LCOV - code coverage report
Current view: | top level - chemistry/mozart - gas_wetdep_opts.F90 (source / functions) |  |  | Hit | Total | Coverage
Test: | coverage.info |  | Lines: | 0 | 20 | 0.0 %
Date: | 2024-12-17 17:57:11 |  | Functions: | 0 | 1 | 0.0 %

              Line data    Source code
           1             : !-----------------------------------------------------------------------
           2             : ! Reads namelist options for gas-phase wet deposition
           3             : !
           4             : ! Created by Francis Vitt -- 22 Apr 2011
           5             : !-----------------------------------------------------------------------
           6             : module gas_wetdep_opts
           7             :
           8             :   use constituents,     only : pcnst
           9             :   use cam_logfile,      only : iulog
          10             :   use constituents,     only : pcnst
          11             :   use spmd_utils,       only : masterproc
          12             :   use cam_abortutils,   only : endrun
          13             :
          14             :   implicit none
          15             :
          16             :   character(len=16), protected :: gas_wetdep_list(pcnst) = ' '
          17             :   character(len=3), protected :: gas_wetdep_method = 'MOZ'
          18             :   integer,          protected :: gas_wetdep_cnt = 0
          19             :
          20             : contains
          21             :
          22             :   !-----------------------------------------------------------------------
          23             :   !-----------------------------------------------------------------------
          24             :
          25           0 :   subroutine gas_wetdep_readnl(nlfile)
          26             :
          27             :     use cam_abortutils,  only: endrun
          28             :     use namelist_utils,  only: find_group_name
          29             :     use units,           only: getunit, freeunit
          30             : #ifdef SPMD
          31             :     use mpishorthand,    only: mpichar, mpicom
          32             : #endif
          33             :
          34             :     implicit none
          35             :
          36             :     character(len=*), intent(in) :: nlfile  ! filepath for file containing namelist input
          37             :
          38             :     integer :: unitn, i, ierr
          39             :
          40             :     namelist /wetdep_inparm/ gas_wetdep_list
          41             :     namelist /wetdep_inparm/ gas_wetdep_method
          42             :
          43           0 :     if (masterproc) then
          44           0 :        unitn = getunit()
          45           0 :        open( unitn, file=trim(nlfile), status='old' )
          46           0 :        call find_group_name(unitn, 'wetdep_inparm', status=ierr)
          47           0 :        if (ierr == 0) then
          48           0 :           read(unitn, wetdep_inparm, iostat=ierr)
          49           0 :           if (ierr /= 0) then
          50           0 :              call endrun('mo_neu_wetdep->wetdep_readnl: ERROR reading wetdep_inparm namelist')
          51             :           end if
          52             :        end if
          53           0 :        close(unitn)
          54           0 :        call freeunit(unitn)
          55             :     end if
          56             :
          57             : #ifdef SPMD
          58           0 :     call mpibcast (gas_wetdep_list, len(gas_wetdep_list(1))*pcnst, mpichar, 0, mpicom)
          59           0 :     call mpibcast (gas_wetdep_method, len(gas_wetdep_method), mpichar, 0, mpicom)
          60             : #endif
          61             :
          62           0 :     gas_wetdep_cnt = 0
          63           0 :     do i = 1,pcnst
          64           0 :        if ( len_trim(gas_wetdep_list(i)) > 0 ) then
          65           0 :           gas_wetdep_cnt = gas_wetdep_cnt + 1
          66             :        endif
          67             :     enddo
          68             :
          69           0 :     if (( gas_wetdep_cnt>0 ).and.( .not.(gas_wetdep_method=='MOZ' .or. gas_wetdep_method=='NEU' &
          70             :          .or. gas_wetdep_method=='OFF') )) then
          71           0 :        call endrun('gas_wetdep_readnl; gas_wetdep_method must be set to either MOZ or NEU')
          72             :     endif
          73             :
          74           0 :   end subroutine gas_wetdep_readnl
          75             :
          76             : end module gas_wetdep_opts

Generated by: LCOV version 1.14