diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 854ad1ac5a..e56ca8d4a9 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -199,6 +199,14 @@ + + + + + + + + @@ -1745,6 +1753,15 @@ + + + + + + + + + @@ -1754,6 +1771,15 @@ + + + + + + + + + @@ -2678,6 +2704,15 @@ + + + + + + + + + @@ -2766,6 +2801,14 @@ + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/shell_commands b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/shell_commands new file mode 100644 index 0000000000..106897a2c6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/shell_commands @@ -0,0 +1,3 @@ +./xmlchange --append CAM_CONFIG_OPTS="-rad rrtmgp" +./xmlchange ROF_NCPL=\$ATM_NCPL +./xmlchange GLC_NCPL=\$ATM_NCPL diff --git a/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/user_nl_cam new file mode 100644 index 0000000000..fcbd0d438b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/user_nl_cam @@ -0,0 +1,15 @@ + offline_driver_infile = '$DIN_LOC_ROOT/atm/cam/port/base_cam6_3mode_1deg.doubleCO2.cam.h1.0001-01-01-00000_c170526.nc' + rad_data_fdh = .true. + empty_htapes = .true. + avgflag_pertape = 'A','I' + fincl1 = 'SOLIN', 'QRS', 'FSNS', 'FSNT','FSNSC', 'FSDSC','FSNR','FLNR', + 'FSNTOA', 'FSUTOA', 'FSNTOAC', 'FSNTC', 'FSDSC', 'FSDS', 'SWCF', + 'QRL', 'FLNS', 'FLDS', 'FLNT', 'LWCF', 'FLUT' ,'FLUTC', 'FLNTC', + 'FLNSC', 'FLDSC' + fincl2 = 'SOLIN', 'QRS', 'FSNS', 'FSNT','FSNSC', 'FSDSC','FSNR','FLNR', + 'FSNTOA', 'FSUTOA', 'FSNTOAC', 'FSNTC', 'FSDSC', 'FSDS', 'SWCF', + 'QRL', 'FLNS', 'FLDS', 'FLNT', 'LWCF', 'FLUT' ,'FLUTC', 'FLNTC', + 'FLNSC', 'FLDSC' + rad_data_output = .false. + mfilt=100,100 + nhtfrq=-120,73 diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/shell_commands new file mode 100644 index 0000000000..106897a2c6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/shell_commands @@ -0,0 +1,3 @@ +./xmlchange --append CAM_CONFIG_OPTS="-rad rrtmgp" +./xmlchange ROF_NCPL=\$ATM_NCPL +./xmlchange GLC_NCPL=\$ATM_NCPL diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_cam new file mode 100644 index 0000000000..8482082dce --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_cam @@ -0,0 +1,4 @@ +mfilt=1,1,1,1,1,1 +ndens=1,1,1,1,1,1 +nhtfrq=9,9,9,9,9,9 +inithist='ENDOFRUN' diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_clm new file mode 100644 index 0000000000..0d83b5367b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_clm @@ -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 + diff --git a/cime_config/usermods_dirs/rrtmgp/shell_commands b/cime_config/usermods_dirs/rrtmgp/shell_commands deleted file mode 100755 index 341f65a34e..0000000000 --- a/cime_config/usermods_dirs/rrtmgp/shell_commands +++ /dev/null @@ -1,7 +0,0 @@ -./xmlchange --force STOP_OPTION=ndays - -./xmlchange --force STOP_N=2 - -./xmlchange --append CAM_CONFIG_OPTS="--rad rrtmgp" - -./xmlchange DOUT_S=FALSE diff --git a/cime_config/usermods_dirs/rrtmgp/user_nl_cam b/cime_config/usermods_dirs/rrtmgp/user_nl_cam deleted file mode 100644 index e13d8e4865..0000000000 --- a/cime_config/usermods_dirs/rrtmgp/user_nl_cam +++ /dev/null @@ -1,11 +0,0 @@ -nhtfrq = 0,-3,1 -mfilt = 1,8,1 -ndens = 2,2,2 -history_budget = .true. -history_budget_histfile_num = 1 - -FINCL1 = 'FUS', 'FDS', 'FUL', 'FDL', 'FUSC', 'FDSC', 'FULC', 'FDLC', 'HR', 'QRSC', 'QRLC', 'TOT_CLD_VISTAU', 'TOT_ICLD_VISTAU', 'LIQ_ICLD_VISTAU', 'ICE_ICLD_VISTAU', 'SNOW_ICLD_VISTAU' - -FINCL2 = 'SOLIN','FSNT','FSNTC','FSNTOA','FSNTOAC','SWCF','LWCF','FLUT','FLUTC','PRECT','CLDTOT','CLDLOW','CLDHGH','TMQ','TGCLDLWP','TGCLDIWP','QRS','QRSC','QRL','QRLC' - -FINCL3 = 'T','Q','U','V','QRS','QRSC','QRL','QRLC','DTCOND','PTTEND','DTCORE','PRECT','LHFLX','SHFLX','FLUT','FLUTC','FSNT','FSNTC' diff --git a/cime_config/usermods_dirs/scam_rrtmgp/shell_commands b/cime_config/usermods_dirs/scam_rrtmgp/shell_commands deleted file mode 100755 index ff2497324b..0000000000 --- a/cime_config/usermods_dirs/scam_rrtmgp/shell_commands +++ /dev/null @@ -1,21 +0,0 @@ -./xmlchange --force MPILIB=mpi-serial - -./xmlchange --force REST_OPTION=never - -./xmlchange --force CLM_FORCE_COLDSTART=on - -./xmlchange --force PTS_LON=238.5 - -./xmlchange --force PTS_LAT=31.5 - -./xmlchange --force RUN_STARTDATE=1999-07-11 - -./xmlchange --force START_TOD=0 - -./xmlchange --force STOP_OPTION=nsteps - -./xmlchange --force STOP_N=144 - -./xmlchange --append CAM_CONFIG_OPTS="--rad rrtmgp" - -./xmlchange DOUT_S=FALSE diff --git a/cime_config/usermods_dirs/scam_rrtmgp/user_nl_cam b/cime_config/usermods_dirs/scam_rrtmgp/user_nl_cam deleted file mode 100644 index 57ebe708ed..0000000000 --- a/cime_config/usermods_dirs/scam_rrtmgp/user_nl_cam +++ /dev/null @@ -1,15 +0,0 @@ -iopfile="$DIN_LOC_ROOT/atm/cam/scam/iop/DYCOMSrf02_48hr_4scam.nc" -ncdata="$DIN_LOC_ROOT/atm/cam/scam/iop/CESM2.F2000climo.IOP_SITES.cam.i.0003-07-01-00000.nc" -mfilt=2088 -nhtfrq=1 -scm_use_obs_uv = .true. -scm_use_obs_T =.true. -scm_relaxation = .true. -scm_relax_fincl = 'bc_a1', 'bc_a4', 'dst_a1', 'dst_a2', 'dst_a3', 'ncl_a1', 'ncl_a2', - 'ncl_a3', 'num_a1', 'num_a2', 'num_a3', - 'num_a4', 'pom_a1', 'pom_a4', 'so4_a1', 'so4_a2', 'so4_a3', 'soa_a1', 'soa_a2' -scm_relax_bot_p = 105000. -scm_relax_top_p = 200. -scm_relax_linear = .true. -scm_relax_tau_bot_sec = 864000. -scm_relax_tau_top_sec = 172800. diff --git a/doc/ChangeLog b/doc/ChangeLog index 4a2c43d13f..60c061a614 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,166 @@ =============================================================== +Tag name: +Originator(s): brianpm, courtneyp, eaton +Date: +One-line Summary: Provide RRTMGP as a radiation parameterization +Github PR URL: + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +#255 - Provide RRTMGP as a radiation parameterization +https://github.com/ESCOMP/CAM/issues/255 + +Describe any changes made to build system: +. '-rad' argument to configure accepts the values 'rrtmgp' and 'rrtmgp_gpu' + to build the RRTMGP code for CPUs or for GPUs. + +Describe any changes made to the namelist: +. add variables rrtmgp_coefs_lw_file and rrtmgp_coefs_sw_file to contain + filepaths for the RRTMGP coefficients files. + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: +. performance evaluation of RRTMGP has not yet been done. + +Code reviewed by: + +List all files eliminated: + +src/physics/rrtmg/cloud_rad_props.F90 +src/physics/rrtmg/ebert_curry.F90 +src/physics/rrtmg/oldcloud.F90 +src/physics/rrtmg/slingo.F90 +. these cloud optics files which can be shared by rrtmg and rrtmgp are + moved to src/physics/cam + +List all files added and what they do: + +bld/namelist_files/use_cases/1850_cam5.xml +. use case file for 1850 cam5 physics + +cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/shell_commands +cime_config/testdefs/testmods_dirs/cam/cam6_port_f09_rrtmgp/user_nl_cam +cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/shell_commands +cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_cam +cime_config/testdefs/testmods_dirs/cam/outfrq9s_rrtmgp/user_nl_clm +. for adding RRTMGP to tests + +src/physics/cam/cloud_rad_props.F90 +src/physics/cam/ebert_curry.F90 +src/physics/cam/oldcloud.F90 +src/physics/cam/slingo.F90 +. these 4 files are shared cloud optics code moved here from src/physics/rrtmg/. +. remove unused code, cleanup unused vars + +src/physics/rrtmgp/mcica_subcol_gen.F90 +src/physics/rrtmgp/radconstants.F90 +src/physics/rrtmgp/radiation.F90 +src/physics/rrtmgp/rrtmgp_inputs.F90 +. CAM interface code for RRTMGP. + +List all existing files that have been modified, and describe the changes: + +.gitignore +. add directories src/physics/rrtmgp/{data,ext} + +Externals_CAM.cfg +. add external definition for rte-rrtmgp source +. add external definition for rrtmgp data + +bld/build-namelist +. set the correct filepaths for the coefficient datasets which are checked + out in the source code directory tree. +. generalize logic to include both rrtmgp and rrtmg when appropriate +. add error check for old cloud optics no longer supported + +bld/config_files/definition.xml +. add 'rrtmgp' as valid value for 'rad' configure option + +bld/configure +. add rrtmgp and rrtmgp_gpu as valid values for '-rad' argument. +. '-rad rrtmgp_gpu' sets a flag used to add the filepaths for the GPU code + versions to the Filepath file. The '_gpu' suffix is removed before + setting the parameter value for 'rad' in the config_cache.xml file. + +bld/namelist_files/namelist_defaults_cam.xml +. the aersol and cloud optics datasets for RRTMG are being reused for + RRTMGP for now + +bld/namelist_files/namelist_definition.xml +. add 'rrtmgp' as valid value for 'radiation_scheme' +. add variables rrtmgp_coefs_lw_file and rrtmgp_coefs_sw_file to contain + filepaths for the RRTMGP coefficients files. + +cime_config/testdefs/testlist_cam.xml (aux_cam) +. add aux_cam tests: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.cheyenne_intel.cam-outfrq9s_rrtmgp + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.cheyenne_intel.cam-outfrq9s_rrtmgp + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.cheyenne_intel.cam-outfrq9s_rrtmgp + ERP_D_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_rrtmgp + SMS_Ld5.f09_f09_mg17.PC6.izumi_gnu.cam-cam6_port_f09_rrtmgp + +src/chemistry/utils/solar_data.F90 +. add solar_htng_spctrl_scl to log file output + +src/physics/cam/aer_rad_props.F90 +. nrh, ot_length now accessed from phys_prop + +src/physics/cam/aerosol_optics_cam.F90 +. ot_length now accessed from phys_prop + +src/physics/cam/phys_prop.F90 +. add the public parameter nrh to this module. Was previously in + radconstants. +. turn off old debug output to log file + +src/physics/cam/physpkg.F90 +. reorder initialization of solar_data and radiation modules to allow + reading the spectral band boundaries from the input data rather than + requiring them to be hardcoded. + +src/physics/cam/rad_constituents.F90 +. access ot_length from phys_prop rather than rad_constituents + +src/physics/cam_dev/physpkg.F90 +. reorder initialization of solar_data and radiation modules to allow + reading the wavenumber band boundaries from the input data rather than + requiring them to be hardcoded. + +src/physics/camrt/radconstants.F90 +. parameters ot_length and nrh moved to phys_props + +src/physics/rrtmg/radconstants.F90 +. parameters ot_length and nrh moved to phys_props + +src/physics/simple/radconstants.F90 +. parameters ot_length and nrh moved to phys_props +. add dummy interface for get_sw_spectral_boundaries + +src/physics/spcam/crm/CLUBB/crmx_mt95.f90 +. removed 3 non-ascii characters (in comments) + +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. + +cheyenne/intel/aux_cam: + +izumi/nag/aux_cam: + +izumi/gnu/aux_cam: + +CAM tag used for the baseline comparison tests if different than previous +tag: + +Summarize any changes to answers: None. + New RRTMGP option changes answers only when enabled. + +=============================================================== +=============================================================== + Tag name: cam6_3_133 Originator(s): fvitt Date: 19 Oct 2023 diff --git a/src/physics/cam/phys_prop.F90 b/src/physics/cam/phys_prop.F90 index ecbf6f85e0..6c504e8c78 100644 --- a/src/physics/cam/phys_prop.F90 +++ b/src/physics/cam/phys_prop.F90 @@ -1111,9 +1111,7 @@ subroutine bulk_props_init(physprop, nc_id) type(var_desc_T) :: vid - ! ***N.B.*** RRTMGP hasn't set the value of idx_sw_diag when this routine is - ! called. The debug option will need to be modified for RRTMGP. - logical :: debug = .true. + logical :: debug = .false. character(len=*), parameter :: subname = 'bulk_props_init' !------------------------------------------------------------------------------------ diff --git a/src/physics/spcam/crm/CLUBB/crmx_mt95.f90 b/src/physics/spcam/crm/CLUBB/crmx_mt95.f90 index 14d75bc733..7c2ff7d9db 100644 --- a/src/physics/spcam/crm/CLUBB/crmx_mt95.f90 +++ b/src/physics/spcam/crm/CLUBB/crmx_mt95.f90 @@ -1,10 +1,10 @@ ! A C-program for MT19937, with initialization improved 2002/1/26. ! Coded by Takuji Nishimura and Makoto Matsumoto. -! Code converted to Fortran 95 by José Rui Faustino de Sousa +! Code converted to Fortran 95 by Jose Rui Faustino de Sousa ! Date: 2002-02-01 -! Enhanced version by José Rui Faustino de Sousa +! Enhanced version by Jose Rui Faustino de Sousa ! Date: 2003-04-30 ! Interface: @@ -1310,7 +1310,7 @@ subroutine genrand_res53_7d( r ) end subroutine genrand_res53_7d ! These real versions are due to Isaku Wada, 2002/01/09 added - ! Altered by José Sousa genrand_real[1-3] will not return exactely + ! Altered by Jose Sousa genrand_real[1-3] will not return exactely ! the same values but should have the same properties and are faster end module crmx_mt95