Skip to content
Open
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
2 changes: 2 additions & 0 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,8 @@ sub write_filepath
print $fh "$camsrcdir/src/physics/cam\n";
print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized\n";
print $fh "$camsrcdir/src/atmos_phys/phys_utils\n";
print $fh "$camsrcdir/src/physics/nlte_extco2/src\n";
print $fh "$camsrcdir/src/physics/nlte_extco2\n";

# Add the CCPP'ized subdirectories
print $fh "$camsrcdir/src/atmos_phys/schemes/tropopause_find\n";
Expand Down
7 changes: 7 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7992,6 +7992,13 @@ If TRUE, then use the ALI-ARMS scheme (an alternative method of computing non-LT
Default: FALSE
</entry>

<entry id="nlte_use_extco2" type="logical" category="waccm_phys"
group="radheat_nl" valid_values="" >
If TRUE, then use the extended CO2 scheme of Lopez-Puertas et al. 2024 as an alternative method of computing non-LTE
CO2 cooling rates in the upper atmosphere.
Comment on lines +7997 to +7998
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the DOI be included here as well?

Default: FALSE
</entry>

<entry id="nlte_aliarms_every_x" type="integer" category="waccm_phys"
group="radheat_nl" valid_values="" >
Call ALI-ARMS every X timesteps
Expand Down
2 changes: 1 addition & 1 deletion cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@
</options>
</test>
<!-- 471 -->
<test compset="QPWmaC6" grid="f10_f10_mg37" name="ERC_D_Ln9" testmods="cam/outfrq3s" supported="false">
<test compset="QPWmaC6" grid="f10_f10_mg37" name="ERC_D_Ln9" testmods="cam/outfrq9s_extco2_nonlte" supported="false">
<machines>
<machine name="izumi" compiler="nag" category="aux_cam"/>
<machine name="izumi" compiler="nag" category="waccm"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24
write_nstep0 = .true.
nlte_use_extco2 = .true.
fincl2 = 'QCO2ext', 'TCO2ext','PCO2ext','CO2_ext','N2_ext','O_ext'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mfilt=1,1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'

fincl2 = 'QRLNLTE','QCO2', 'QCO2ext', 'TCO2ext','PCO2ext','CO2_ext','N2_ext','O_ext','O2_ext',
nlte_use_extco2 = .true.
27 changes: 27 additions & 0 deletions cime_config/testdefs/testmods_dirs/cam/outfrq9s_co2ext/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
!
! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options
! are set in the CLM_NAMELIST_OPTS env variable.
!
! EXCEPTIONS:
! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
! Set dtime with L_NCPL option
! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
! (includes $inst_string for multi-ensemble cases)
! Set glc_grid with CISM_GRID option
! Set glc_smb with GLC_SMB option
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
write_nstep0=.true.
inithist='ENDOFRUN'

nlte_use_extco2 = .true.
fincl2 = 'QCO2ext', 'TCO2ext','PCO2ext','CO2_ext','N2_ext','O_ext'
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
!
! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options
! are set in the CLM_NAMELIST_OPTS env variable.
!
! EXCEPTIONS:
! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
! Set dtime with L_NCPL option
! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
! (includes $inst_string for multi-ensemble cases)
! Set glc_grid with CISM_GRID option
! Set glc_smb with GLC_SMB option
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1

83 changes: 69 additions & 14 deletions src/physics/cam/radheat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ module radheat
use physics_types, only: physics_state, physics_ptend, physics_ptend_init
use physconst, only: cpair,mwco2
use air_composition, only: cpairv
use perf_mod
use cam_logfile, only: iulog
use cam_abortutils, only: endrun
use nlte_extco2, only: nlte_extco2_init, nlte_extco2_hrate

implicit none
private
Expand Down Expand Up @@ -56,17 +57,62 @@ module radheat
real(r8) :: max_pressure_lw=50._r8

integer :: ntop_qrs_cam ! top level for pure cam solar heating
logical :: nlte_use_extco2 = .false. ! If true, use the extended CO2 scheme of Lopez-Puertas et al. 2024

!===============================================================================
contains
!===============================================================================
subroutine radheat_readnl(nlfile)

character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input

! No options for this version of radheat; this is just a stub.

end subroutine radheat_readnl
subroutine radheat_readnl(nlfile)
use namelist_utils, only : find_group_name
use spmd_utils, only : mpicom, masterprocid, mpi_logical,&
& mpi_success

character(len=*), intent(in) :: nlfile ! filepath for file
! containing namelist input

integer :: unitn, ierr
character(len=*), parameter :: subname = 'radheat_readnl'

! ===================
! Namelist definition
! ===================
namelist /radheat_nl/ nlte_use_extco2

! =============
! Read namelist
! =============
if (masterproc) then
! read namelist
open( newunit=unitn, file=trim(nlfile), status='old' )
call find_group_name(unitn, 'radheat_nl', status=ierr)
if (ierr == 0) then
read(unitn, radheat_nl, iostat=ierr)
if (ierr /= 0) then
call endrun(subname//': radheat_nl: ERROR reading&
& namelist')
end if
end if
close(unitn)

end if

! ============================
! Broadcast namelist variables
! ============================
call mpi_bcast(nlte_use_extco2, 1, mpi_logical, masterprocid, mpicom, ierr)
if (ierr/=mpi_success) then
call endrun(subname//': MPI_BCAST ERROR: nlte_use_extco2')
end if

! =============================
! Write setting to cam.log file
! =============================
if (masterproc) then
write(iulog,*) subname,': nlte_use_extco2: ',nlte_use_extco2
end if

end subroutine radheat_readnl

!================================================================================================

Expand All @@ -82,7 +128,7 @@ end subroutine radheat_register

subroutine radheat_init(pref_mid)


use nlte_fomichev, only: nlte_fomichev_init
use phys_control, only: phys_getopts

Expand Down Expand Up @@ -169,7 +215,7 @@ subroutine radheat_init(pref_mid)
endif

end do

co2_mw = mwco2
o1_mw = 16._r8
o2_mw = 32._r8
Expand All @@ -179,7 +225,9 @@ subroutine radheat_init(pref_mid)
nlte_limit_co2 = .true.
! Initialize Fomichev parameterization
call nlte_fomichev_init (co2_mw, n2_mw, o1_mw, o2_mw, o3_mw, no_mw, nlte_limit_co2)

if (nlte_use_extco2) then
call nlte_extco2_init(co2_mw, n2_mw, o1_mw, o2_mw)
end if

! determine upppermost level that is purely solar heating (no MLT chem heating)
ntop_qrs_cam = 0
Expand Down Expand Up @@ -244,22 +292,23 @@ subroutine radheat_tend(state, pbuf, ptend, qrl, qrs, fsns, &
real(r8), intent(out) :: net_flx(pcols)

! Local variables
integer :: k
integer :: k
integer :: ncol ! number of atmospheric columns
integer :: lchnk ! chunk identifier
real(r8) :: qrl_mrg(pcols,pver) ! merged LW heating
real(r8) :: qrl_mlt(pcols,pver) ! M/LT longwave heating rates
real(r8) :: qrs_mrg(pcols,pver) ! merged SW heating

real(r8) :: qrlfomichev(pcols,pver) ! Fomichev cooling rate ! (K/s)
real(r8) :: o3cool(pcols,pver) ! Fomichev cooling rate ! (K/s)
real(r8) :: o3cool(pcols,pver) ! Fomichev cooling rate ! (K/s)
real(r8) :: co2cool(pcols,pver) ! Fomichev cooling rate ! (K/s)
real(r8) :: c2scool(pcols,pver) ! Fomichev cooling rate ! (K/s)
real(r8) :: xco2mmr(pcols,pver) ! CO2
real(r8) :: xo2mmr(pcols,pver) ! O2
real(r8) :: xo3mmr(pcols,pver) ! O3
real(r8) :: xommr(pcols,pver) ! O
real(r8) :: xn2mmr(pcols,pver) ! N2
real(r8) :: co2cooling(pcols,pver)

real(r8), parameter :: N2_VMR = 0.78084 ! From US standard atmosphere
real(r8), parameter :: N2_mass = 28.0134 ! g/mol
Expand All @@ -275,7 +324,7 @@ subroutine radheat_tend(state, pbuf, ptend, qrl, qrs, fsns, &
ncol = state%ncol
lchnk = state%lchnk
call physics_ptend_init(ptend, state%psetcols, 'radheat', ls=.true.)

! Shortwave heating is RRTMG solar heating only
qrs_mrg(:,:) = qrs(:,:)

Expand All @@ -300,7 +349,13 @@ subroutine radheat_tend(state, pbuf, ptend, qrl, qrs, fsns, &

call nlte_fomichev_calc (lchnk,ncol,state%pmid,state%pint,state%t, &
xo2mmr,xommr,xo3mmr,xn2mmr,xco2mmr,qrlfomichev,co2cool,o3cool,c2scool)
qrl_mlt = qrlfomichev

if (nlte_use_extco2) then
call nlte_extco2_hrate(lchnk, ncol, state%t, state%pmid, xco2mmr, xn2mmr, xommr, xo2mmr, co2cooling)
qrl_mlt(:ncol,:) = o3cool(:ncol,:) + co2cooling(:ncol,:) * cpairv(:ncol,:,lchnk)
else
qrl_mlt(:ncol,:) = qrlfomichev(:ncol,:)
end if

! Merge cam long wave heating for lower atmosphere with M/LT (nlte) heating
call merge_qrl (ncol, qrl, qrl_mlt, qrl_mrg)
Expand Down
Loading