Skip to content

Commit c230e5c

Browse files
Update rte-rrtmgp to v1.8 (NOAA-EMC#995)
* Update rte-rrtmgp submodule hash to v1.8 and add any necessary CCPP interface changes. * Changes to use single precision in rte-rrtmgp CCPP interface * Updated GP enabled SDF to v17_p8. Removed unused options in GFS_typedefs.F90 * Fix MPI types in broadcast calls --------- Co-authored-by: Grant Firl <grant.firl@noaa.gov>
1 parent 12be1f2 commit c230e5c

6 files changed

Lines changed: 26 additions & 56 deletions

File tree

ccpp/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ else(CCPP_32BIT)
112112
endif()
113113
endif(CCPP_32BIT)
114114

115+
#------------------------------------------------------------------------------
116+
# Set flags for rte-rrtmgp radiation
117+
if(RRTMGP_32BIT)
118+
message(STATUS "Compile CCPP RTE-RRTMGP with 32-bit precision")
119+
add_definitions(-DRTE_USE_SP)
120+
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
121+
set(CMAKE_Fortran_FLAGS_RTERRTMGP "-real-size 32")
122+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
123+
set(CMAKE_Fortran_FLAGS_RTERRTMGP "-fno-default-real-8 -fdefault-double-8")
124+
endif()
125+
else()
126+
message(STATUS "Compile CCPP RTE-RRTMGP with 64-bit precision")
127+
remove_definitions(-DRTE_USE_SP)
128+
set(CMAKE_Fortran_FLAGS_RTERRTMGP ${CMAKE_Fortran_FLAGS_PHYSICS})
129+
endif()
130+
115131
#------------------------------------------------------------------------------
116132
# Add model-specific flags for C/C++/Fortran preprocessor
117133
if(NOT HYDRO)

ccpp/data/GFS_typedefs.F90

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,8 @@ module GFS_typedefs
901901
integer :: rad_hr_units !< flag to control units of lw/sw heating rate
902902
!< 1: K day-1 - 2: K s-1
903903
logical :: inc_minor_gas !< Include minor trace gases in RRTMG radiation calculation?
904-
integer :: ipsd0 !< initial permutaion seed for mcica radiation
905-
integer :: ipsdlim !< limit initial permutaion seed for mcica radiation
904+
integer :: ipsd0 !< initial permutation seed for mcica radiation
905+
integer :: ipsdlim !< limit initial permutation seed for mcica radiation
906906
logical :: lrseeds !< flag to use host-provided random seeds
907907
integer :: nrstreams !< number of random number streams in host-provided random seed array
908908
logical :: lextop !< flag for using an extra top layer for radiation
@@ -920,9 +920,6 @@ module GFS_typedefs
920920
character(len=128) :: sw_file_clouds !< RRTMGP file containing coefficients used to compute clouds optical properties
921921
integer :: rrtmgp_nBandsSW !< Number of RRTMGP SW bands.
922922
integer :: rrtmgp_nGptsSW !< Number of RRTMGP SW spectral points.
923-
logical :: doG_cldoptics !< Use legacy RRTMG cloud-optics?
924-
logical :: doGP_cldoptics_PADE !< Use RRTMGP cloud-optics: PADE approximation?
925-
logical :: doGP_cldoptics_LUT !< Use RRTMGP cloud-optics: LUTs?
926923
integer :: iovr_convcld !< Cloud-overlap assumption for convective-cloud
927924
integer :: rrtmgp_nrghice !< Number of ice-roughness categories
928925
integer :: rrtmgp_nGauss_ang !< Number of angles used in Gaussian quadrature
@@ -3551,8 +3548,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
35513548
logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc)
35523549
integer :: rad_hr_units = 2 !< heating rate units are K s-1
35533550
logical :: inc_minor_gas = .true. !< Include minor trace gases in RRTMG radiation calculation
3554-
integer :: ipsd0 = 0 !< initial permutaion seed for mcica radiation
3555-
integer :: ipsdlim = 1e8 !< limit initial permutaion seed for mcica radiation
3551+
integer :: ipsd0 = 0 !< initial permutation seed for mcica radiation
3552+
integer :: ipsdlim = 1e8 !< limit initial permutation seed for mcica radiation
35563553
logical :: lrseeds = .false. !< flag to use host-provided random seeds
35573554
integer :: nrstreams = 2 !< number of random number streams in host-provided random seed array
35583555
logical :: lextop = .false. !< flag for using an extra top layer for radiation
@@ -3569,9 +3566,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
35693566
integer :: rrtmgp_nGptsSW = -999 !< Number of RRTMGP SW spectral points. # The RRTMGP spectral dimensions in the files
35703567
integer :: rrtmgp_nBandsLW = -999 !< Number of RRTMGP LW bands. # need to be provided via namelsit.
35713568
integer :: rrtmgp_nGptsLW = -999 !< Number of RRTMGP LW spectral points. #
3572-
logical :: doG_cldoptics = .false. !< Use legacy RRTMG cloud-optics?
3573-
logical :: doGP_cldoptics_PADE = .false. !< Use RRTMGP cloud-optics: PADE approximation?
3574-
logical :: doGP_cldoptics_LUT = .false. !< Use RRTMGP cloud-optics: LUTs?
35753569
integer :: iovr_convcld = 1 !< Cloud-overlap assumption for convective-cloud (defaults to iovr if not set)
35763570
integer :: rrtmgp_nrghice = 3 !< Number of ice-roughness categories
35773571
integer :: rrtmgp_nGauss_ang = 1 !< Number of angles used in Gaussian quadrature
@@ -4151,7 +4145,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
41514145
do_RRTMGP, active_gases, nGases, rrtmgp_root, &
41524146
lw_file_gas, lw_file_clouds, rrtmgp_nBandsLW, rrtmgp_nGptsLW,&
41534147
sw_file_gas, sw_file_clouds, rrtmgp_nBandsSW, rrtmgp_nGptsSW,&
4154-
doG_cldoptics, doGP_cldoptics_PADE, doGP_cldoptics_LUT, &
41554148
rrtmgp_nrghice, rrtmgp_nGauss_ang, do_GPsw_Glw, &
41564149
use_LW_jacobian, doGP_lwscat, damp_LW_fluxadj, lfnc_k, &
41574150
lfnc_p0, iovr_convcld, doGP_sgs_cnv, doGP_sgs_mynn, &
@@ -4765,9 +4758,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
47654758
Model%sw_file_clouds = sw_file_clouds
47664759
Model%rrtmgp_nBandsSW = rrtmgp_nBandsSW
47674760
Model%rrtmgp_nGptsSW = rrtmgp_nGptsSW
4768-
Model%doG_cldoptics = doG_cldoptics
4769-
Model%doGP_cldoptics_PADE = doGP_cldoptics_PADE
4770-
Model%doGP_cldoptics_LUT = doGP_cldoptics_LUT
47714761
Model%iovr_convcld = iovr_convcld
47724762
Model%use_LW_jacobian = use_LW_jacobian
47734763
Model%damp_LW_fluxadj = damp_LW_fluxadj
@@ -4784,11 +4774,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
47844774
write(0,*) "Logic error, RRTMGP only works with levr = levs"
47854775
stop
47864776
end if
4787-
! RRTMGP LW scattering calculation not supported w/ RRTMG cloud-optics
4788-
if (Model%doGP_lwscat .and. Model%doG_cldoptics) then
4789-
write(0,*) "Logic error, RRTMGP Longwave cloud-scattering not supported with RRTMG cloud-optics."
4790-
stop
4791-
end if
47924777
if (Model%doGP_sgs_mynn .and. .not. do_mynnedmf) then
47934778
write(0,*) "Logic error, RRTMGP flag doGP_sgs_mynn only works with do_mynnedmf=.true."
47944779
stop
@@ -4800,14 +4785,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, &
48004785
write(0,*) "RRTMGP implicit cloud scheme being used."
48014786
endif
48024787

4803-
if (Model%doGP_cldoptics_PADE .and. Model%doGP_cldoptics_LUT) then
4804-
write(0,*) "Logic error, Both RRTMGP cloud-optics options cannot be selected. "
4805-
stop
4806-
end if
4807-
if (.not. Model%doGP_cldoptics_PADE .and. .not. Model%doGP_cldoptics_LUT .and. .not. Model%doG_cldoptics) then
4808-
write(0,*) "Logic error, No option for cloud-optics scheme provided. Using RRTMG cloud-optics"
4809-
Model%doG_cldoptics = .true.
4810-
end if
48114788
if (Model%rrtmgp_nGptsSW .lt. 0 .or. Model%rrtmgp_nGptsLW .lt. 0 .or. &
48124789
Model%rrtmgp_nBandsSW .lt. 0 .or. Model%rrtmgp_nBandsLW .lt. 0) then
48134790
write(0,*) "Logic error, RRTMGP spectral dimensions (bands/gpts) need to be provided."
@@ -6874,9 +6851,6 @@ subroutine control_print(Model)
68746851
print *, ' sw_file_clouds : ', Model%sw_file_clouds
68756852
print *, ' rrtmgp_nBandsSW : ', Model%rrtmgp_nBandsSW
68766853
print *, ' rrtmgp_nGptsSW : ', Model%rrtmgp_nGptsSW
6877-
print *, ' doG_cldoptics : ', Model%doG_cldoptics
6878-
print *, ' doGP_cldoptics_PADE: ', Model%doGP_cldoptics_PADE
6879-
print *, ' doGP_cldoptics_LUT : ', Model%doGP_cldoptics_LUT
68806854
print *, ' use_LW_jacobian : ', Model%use_LW_jacobian
68816855
print *, ' damp_LW_fluxadj : ', Model%damp_LW_fluxadj
68826856
print *, ' lfnc_k : ', Model%lfnc_k

ccpp/data/GFS_typedefs.meta

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4113,13 +4113,13 @@
41134113
type = logical
41144114
[ipsd0]
41154115
standard_name = initial_seed_for_mcica
4116-
long_name = initial permutaion seed for mcica radiation
4116+
long_name = initial permutation seed for mcica radiation
41174117
units = 1
41184118
dimensions = ()
41194119
type = integer
41204120
[ipsdlim]
41214121
standard_name = limit_for_initial_seed_for_mcica
4122-
long_name = limit for initial permutaion seed for mcica radiation
4122+
long_name = limit for initial permutation seed for mcica radiation
41234123
units = 1
41244124
dimensions = ()
41254125
type = integer
@@ -4233,24 +4233,6 @@
42334233
units = count
42344234
dimensions = ()
42354235
type = integer
4236-
[doG_cldoptics]
4237-
standard_name = flag_to_calc_lw_cld_optics_using_RRTMG
4238-
long_name = logical flag to control cloud optics scheme.
4239-
units = flag
4240-
dimensions = ()
4241-
type = logical
4242-
[doGP_cldoptics_PADE]
4243-
standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_PADE
4244-
long_name = logical flag to control cloud optics scheme.
4245-
units = flag
4246-
dimensions = ()
4247-
type = logical
4248-
[doGP_cldoptics_LUT]
4249-
standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_LUT
4250-
long_name = logical flag to control cloud optics scheme.
4251-
units = flag
4252-
dimensions = ()
4253-
type = logical
42544236
[use_LW_jacobian]
42554237
standard_name = flag_to_calc_RRTMGP_LW_jacobian
42564238
long_name = logical flag to control RRTMGP LW calculation

ccpp/suites/suite_FV3_GFS_v17_p8_rrtmgp.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<scheme>sfc_nst</scheme>
4343
<scheme>sfc_nst_post</scheme>
4444
<scheme>noahmpdrv</scheme>
45+
<scheme>sfc_land</scheme>
4546
<scheme>sfc_sice</scheme>
4647
<scheme>GFS_surface_loop_control_part2</scheme>
4748
</subcycle>
@@ -55,8 +56,8 @@
5556
<scheme>satmedmfvdifq</scheme>
5657
<scheme>GFS_PBL_generic_post</scheme>
5758
<scheme>GFS_GWD_generic_pre</scheme>
58-
<scheme>unified_ugwp</scheme>
59-
<scheme>unified_ugwp_post</scheme>
59+
<scheme>ugwpv1_gsldrag</scheme>
60+
<scheme>ugwpv1_gsldrag_post</scheme>
6061
<scheme>GFS_GWD_generic_post</scheme>
6162
<scheme>GFS_suite_stateout_update</scheme>
6263
</subcycle>

io/fv3atm_history_io.F90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,12 @@ subroutine history_type_output(hist, time, diag, atm_block, nx, ny, levs, ntcw,
322322
lcnvfac = lcnvfac*rtime_intfull
323323
! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. full time avg, field=',trim(Diag(idx)%name),' time=',time_intfull
324324
else if ( trim(diag(idx)%time_avg_kind) == 'rad_lw' ) then
325-
!lcnvfac = lcnvfac*min(rtime_radlw,rtime_int)
326325
lcnvfac = lcnvfac*rtime_radlw/int(time_int/dt_atmos)
327326
! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad longwave avg, field=',trim(Diag(idx)%name),' time=',time_radlw
328327
else if ( trim(diag(idx)%time_avg_kind) == 'rad_sw' ) then
329-
!lcnvfac = lcnvfac*min(rtime_radsw,rtime_int)
330328
lcnvfac = lcnvfac*rtime_radsw/int(time_int/dt_atmos)
331329
! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad shortwave avg, field=',trim(Diag(idx)%name),' time=',time_radsw
332330
else if ( trim(diag(idx)%time_avg_kind) == 'rad_swlw_min' ) then
333-
!lcnvfac = lcnvfac*min(max(rtime_radsw,rtime_radlw),rtime_int)
334331
lcnvfac = lcnvfac*max(rtime_radsw,rtime_radlw)/int(time_int/dt_atmos)
335332
! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad swlw min avg, field=',trim(Diag(idx)%name),' time=',time_radlw,time_radsw,time_int
336333
else

0 commit comments

Comments
 (0)