Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scm_zero_non_iop_tracers option. #5182

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/eam/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4095,6 +4095,13 @@ Default: FALSE
group="cam_inparm" valid_values="">
Turn off microphysics computation.
Default: FALSE
</entry> |
|
<entry id="scm_zero_non_iop_tracers" type="logical" category="scam"
group="cam_inparm" valid_values="">
Ignore all tracers from initial conditions file, and default all tracers not
specified in IOP to minimum value (usually zero).
Default: FALSE
</entry>

<!-- Solar Parameters -->
Expand Down
10 changes: 7 additions & 3 deletions components/eam/src/control/runtime_opts.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ module runtime_opts
logical :: scm_crm_mode
logical :: scm_observed_aero
logical :: precip_off
logical :: scm_zero_non_iop_tracers

contains

Expand Down Expand Up @@ -324,7 +325,8 @@ subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, nlfilename_in )
namelist /cam_inparm/ iopfile,scm_iop_srf_prop,scm_relaxation, &
scm_relaxation_low, scm_relaxation_high, &
scm_diurnal_avg,scm_crm_mode,scm_clubb_iop_name, &
scm_observed_aero, precip_off
scm_observed_aero, precip_off, &
scm_zero_non_iop_tracers

!-----------------------------------------------------------------------

Expand Down Expand Up @@ -369,7 +371,8 @@ subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, nlfilename_in )
scm_crm_mode_out=scm_crm_mode, &
scm_observed_aero_out=scm_observed_aero, &
precip_off_out=precip_off, &
scm_clubb_iop_name_out=scm_clubb_iop_name)
scm_clubb_iop_name_out=scm_clubb_iop_name, &
scm_zero_non_iop_tracers_out=scm_zero_non_iop_tracers)
end if

! Read in the cam_inparm namelist from input filename
Expand Down Expand Up @@ -446,7 +449,8 @@ subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, nlfilename_in )
scm_crm_mode_in=scm_crm_mode, &
scm_observed_aero_in=scm_observed_aero, &
precip_off_in=precip_off, &
scm_clubb_iop_name_in=scm_clubb_iop_name)
scm_clubb_iop_name_in=scm_clubb_iop_name, &
scm_zero_non_iop_tracers_in=scm_zero_non_iop_tracers)
end if
endif

Expand Down
13 changes: 11 additions & 2 deletions components/eam/src/control/scamMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ module scamMod
logical*4, public :: scm_relaxation! use relaxation
logical*4, public :: scm_observed_aero ! use observed aerosols in SCM file
logical*4, public :: precip_off ! turn off precipitation processes
logical*4, public :: scm_zero_non_iop_tracers ! initialize non-IOP-specified tracers to zero
logical*4, public :: use_replay ! use e3sm generated forcing
logical*4, public :: use_3dfrc ! use 3d forcing
logical*4, public :: have_heat_glob ! dataset contains global energy fixer
Expand All @@ -203,7 +204,7 @@ subroutine scam_default_opts( scmlat_out,scmlon_out,iopfile_out, &
single_column_out,scm_iop_srf_prop_out, scm_relaxation_out, &
scm_relaxation_low_out, scm_relaxation_high_out, &
scm_diurnal_avg_out, scm_crm_mode_out, scm_observed_aero_out, &
precip_off_out, scm_clubb_iop_name_out)
precip_off_out, scm_clubb_iop_name_out, scm_zero_non_iop_tracers_out)
!-----------------------------------------------------------------------
real(r8), intent(out), optional :: scmlat_out,scmlon_out
character*(max_path_len), intent(out), optional :: iopfile_out
Expand All @@ -217,6 +218,7 @@ subroutine scam_default_opts( scmlat_out,scmlon_out,iopfile_out, &
real(r8), intent(out), optional :: scm_relaxation_low_out
real(r8), intent(out), optional :: scm_relaxation_high_out
character(len=*), intent(out), optional :: scm_clubb_iop_name_out
logical, intent(out), optional :: scm_zero_non_iop_tracers_out

if ( present(scmlat_out) ) scmlat_out = -999._r8
if ( present(scmlon_out) ) scmlon_out = -999._r8
Expand All @@ -231,14 +233,16 @@ subroutine scam_default_opts( scmlat_out,scmlon_out,iopfile_out, &
if ( present(scm_observed_aero_out)) scm_observed_aero_out = .false.
if ( present(precip_off_out)) precip_off_out = .false.
if ( present(scm_clubb_iop_name_out) ) scm_clubb_iop_name_out = ' '
if ( present(scm_zero_non_iop_tracers_out) ) scm_zero_non_iop_tracers_out = .false.

end subroutine scam_default_opts

subroutine scam_setopts( scmlat_in, scmlon_in,iopfile_in,single_column_in, &
scm_iop_srf_prop_in, scm_relaxation_in, &
scm_relaxation_low_in, scm_relaxation_high_in, &
scm_diurnal_avg_in, scm_crm_mode_in, scm_observed_aero_in, &
precip_off_in, scm_clubb_iop_name_in)
precip_off_in, scm_clubb_iop_name_in, &
scm_zero_non_iop_tracers_in)
!-----------------------------------------------------------------------
real(r8), intent(in), optional :: scmlon_in, scmlat_in
character*(max_path_len), intent(in), optional :: iopfile_in
Expand All @@ -252,6 +256,7 @@ subroutine scam_setopts( scmlat_in, scmlon_in,iopfile_in,single_column_in, &
character(len=*), intent(in), optional :: scm_clubb_iop_name_in
real(r8), intent(in), optional :: scm_relaxation_low_in
real(r8), intent(in), optional :: scm_relaxation_high_in
logical, intent(in), optional :: scm_zero_non_iop_tracers_in
integer ncid,latdimid,londimid,latsiz,lonsiz,latid,lonid,ret,i
integer latidx,lonidx
real(r8) ioplat,ioplon
Expand Down Expand Up @@ -296,6 +301,10 @@ subroutine scam_setopts( scmlat_in, scmlon_in,iopfile_in,single_column_in, &
scm_clubb_iop_name=scm_clubb_iop_name_in
endif

if (present (scm_zero_non_iop_tracers_in)) then
scm_zero_non_iop_tracers=scm_zero_non_iop_tracers_in
endif

if (present (iopfile_in)) then
iopfile=trim(iopfile_in)
endif
Expand Down
5 changes: 5 additions & 0 deletions components/eam/src/dynamics/eul/eul_single_column_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module eul_single_column_mod

subroutine scm_setinitial

use constituents, only: pcnst, qmin

implicit none

integer i, j, k, thelev
Expand Down Expand Up @@ -51,6 +53,9 @@ subroutine scm_setinitial
endif

if (get_nstep() .eq. 0) then
do i = 1, pcnst
if (scm_zero_non_iop_tracers) q3(1,:,i,1,n3) = qmin(i)
end do
do k=thelev,PLEV
if (have_t) t3(1,k,1,n3)=tobs(k)
if (have_q) q3(1,k,1,1,n3)=qobs(k)
Expand Down
10 changes: 7 additions & 3 deletions components/eam/src/dynamics/se/se_single_column_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module se_single_column_mod

use element_mod, only: element_t
use scamMod
use constituents, only: cnst_get_ind
use constituents, only: cnst_get_ind, pcnst
use dimensions_mod, only: nelemd, np
use time_manager, only: get_nstep, dtime, is_first_step
use ppgrid, only: begchunk
Expand All @@ -27,11 +27,13 @@ module se_single_column_mod

subroutine scm_setinitial(elem)

use constituents, only: qmin

implicit none

type(element_t), intent(inout) :: elem(:)

integer i, j, k, ie, thelev
integer i, j, k, cix, ie, thelev
integer inumliq, inumice, icldliq, icldice

if (.not. use_replay .and. get_nstep() .eq. 0) then
Expand Down Expand Up @@ -74,6 +76,9 @@ subroutine scm_setinitial(elem)
endif

if (get_nstep() .eq. 0) then
do cix = 1, pcnst
if (scm_zero_non_iop_tracers) elem(ie)%state%Q(i,j,:,cix) = qmin(cix)
end do
do k=thelev, PLEV
#ifdef MODEL_THETA_L
if (have_t) elem(ie)%derived%FT(i,j,k)=tobs(k)
Expand Down Expand Up @@ -132,7 +137,6 @@ subroutine apply_SC_forcing(elem,hvcoord,tl,n,t_before_advance,nets,nete)
use element_mod, only : element_t
use physical_constants, only : Cp, Rgas, cpwater_vapor
use time_mod
use constituents, only: pcnst
use time_manager, only: get_nstep
use shr_const_mod, only: SHR_CONST_PI

Expand Down