Skip to content

Commit

Permalink
Merge pull request ESCOMP#1100 from brian-eaton/rrtmgp-mt
Browse files Browse the repository at this point in the history
cam6_4_016: Modify RRTMGP interface for MT configurations.
  • Loading branch information
brian-eaton authored Jul 25, 2024
2 parents fe60b8d + e8e7b08 commit 3e9a281
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
[submodule "hemco"]
path = src/hemco
url = https://github.com/ESCOMP/HEMCO_CESM.git
fxtag = hemco-cesm1_2_1_hemco3_6_3_cesm_rme
fxtag = hemco-cesm1_2_1_hemco3_6_3_cesm_rme01
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/HEMCO_CESM.git

Expand Down
89 changes: 89 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,94 @@
===============================================================

Tag name: cam6_4_016
Originator(s): brianpm, eaton
Date: 25 July 2024
One-line Summary: Modify RRTMGP interface for MT configurations.
Github PR URL: https://github.com/ESCOMP/CAM/pull/1100

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

Issue #1063 - Possible modification to RRTMG-P for ~80km top model
. Modify the RRTMGP interface for the special case when the minimum valid
pressure for RRTMGP (1 Pa) falls in the top model layer (as it does in
CAM's 93 level MT configuration). The modification is to use the "extra
layer" code path, and add a very thin extra layer just below 1 Pa. The
algorithm to calculate the midpoint pressure in the "extra layer" has
changed from the original (which assumed a model top at 0 Pa). Hence the
change affects answers for the low top model configurations (cam7-LT and cam6)
as well as the cam7-MT configuration.

Note that this modification is still being tested for scientific validity
in the cam7-MT configuration.

Issue #1097 - HEMCO reference in .gitmodules is a branch not a tag.
. Modify .gitmodules to resolve #1097

Describe any changes made to build system: none

Describe any changes made to the namelist: none

List any changes to the defaults for the boundary datasets: none

Describe any substantial timing or memory changes: none

Code reviewed by: cacraig

List all files eliminated: none

List all files added and what they do: none

List all existing files that have been modified, and describe the changes:

.gitmodules
- hemco-cesm1_2_1_hemco3_6_3_cesm_rme => hemco-cesm1_2_1_hemco3_6_3_cesm_rme01

src/physics/rrtmgp/radiation.F90
src/physics/rrtmgp/rrtmgp_inputs.F90
. Identify special case of 1 Pa pressure level being contained in the top
model layer. Treat that case as though an "extra layer" is needed, and
add a very thin extra layer just below 1 Pa.

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details:
- diffs due to change in RRTMGP interface

ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856

SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: PEND) details:
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: PEND) details:
- pre-existing failures -- need fix in CLM external

SMS_D_Ln9.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failure -- need fix in CICE external

izumi/nag/aux_cam:

DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
- pre-existing failure - issue #670

izumi/gnu/aux_cam:

ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPC6.izumi_gnu.cam-outfrq9s_rrtmgp (Overall: DIFF)
SMS_Ld5.f09_f09_mg17.PC6.izumi_gnu.cam-cam6_port_f09_rrtmgp (Overall: DIFF)
- diffs due to change in RRTMGP interface

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: BFB except answer changes expected for
configurations using cam7MT, cam7LT, and cam6 with RRTMGP

===============================================================
===============================================================

Tag name: cam6_4_015
Originator(s): jedwards, eaton
Date: 23 July 2024
Expand Down
11 changes: 10 additions & 1 deletion src/physics/rrtmgp/radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ subroutine radiation_init(pbuf2d)
! pressure interfaces below 1 Pa. When the entire model atmosphere is
! below 1 Pa then an extra layer is added to the top of the model for
! the purpose of the radiation calculation.

nlay = count( pref_edge(:) > 1._r8 ) ! pascals (0.01 mbar)

if (nlay == pverp) then
Expand All @@ -461,14 +462,22 @@ subroutine radiation_init(pbuf2d)
ktopcam = 1
ktoprad = 2
nlaycam = pver
else if (nlay == (pverp-1)) then
! Special case nlay == (pverp-1) -- topmost interface outside bounds (CAM MT config), treat as if it is ok.
ktopcam = 1
ktoprad = 2
nlaycam = pver
nlay = nlay+1 ! reassign the value so later code understands to treat this case like nlay==pverp
write(iulog,*) 'RADIATION_INIT: Special case of 1 model interface at p < 1Pa. Top layer will be INCLUDED in radiation calculation.'
write(iulog,*) 'RADIATION_INIT: nlay = ',nlay, ' same as pverp: ',nlay==pverp
else
! nlay < pverp. nlay layers are used in radiation calcs, and they are
! all CAM layers.
ktopcam = pver - nlay + 1
ktoprad = 1
nlaycam = nlay
end if

! Create lowercase version of the gaslist for RRTMGP. The ty_gas_concs objects
! work with CAM's uppercase names, but other objects that get input from the gas
! concs objects don't work.
Expand Down
13 changes: 11 additions & 2 deletions src/physics/rrtmgp/rrtmgp_inputs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,20 @@ subroutine rrtmgp_set_state( &

! Add extra layer values if needed.
if (nlay == pverp) then
t_rad(:,1) = state%t(:ncol,1)
pmid_rad(:,1) = 0.5_r8 * state%pint(:ncol,1)
t_rad(:,1) = state%t(:ncol,1)
! The top reference pressure from the RRTMGP coefficients datasets is 1.005183574463 Pa
! Set the top of the extra layer just below that.
pint_rad(:,1) = 1.01_r8

! next interface down in LT will always be > 1Pa
! but in MT we apply adjustment to have it be 1.02 Pa if it was too high
where (pint_rad(:,2) <= pint_rad(:,1)) pint_rad(:,2) = pint_rad(:,1)+0.01_r8

! set the highest pmid (in the "extra layer") to the midpoint (guarantees > 1Pa)
pmid_rad(:,1) = pint_rad(:,1) + 0.5_r8 * (pint_rad(:,2) - pint_rad(:,1))

! For case of CAM MT, also ensure pint_rad(:,2) > pint_rad(:,1) & pmid_rad(:,2) > max(pmid_rad(:,1), min_pressure)
where (pmid_rad(:,2) <= kdist_sw%get_press_min()) pmid_rad(:,2) = pint_rad(:,2) + 0.01_r8
else
! nlay < pverp, thus the 1 Pa level is within a CAM layer. Assuming the top interface of
! this layer is at a pressure < 1 Pa, we need to adjust the top of this layer so that it
Expand Down

0 comments on commit 3e9a281

Please sign in to comment.