Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

switch of radiation scheme in the code

Yuan Wang

New Member
In CESM 1.0 and later versions, the default radiation code is RRTMG, as specified in the namelist. However, in the source code, I couldn't find where to choose the radiation scheme between RRTMG and CAMRT under /models/atm/cam/src/physics (I expected to see a "IF" statement somewhere in the code). The interfaces of the two schemes have the same routine names and file names, which makes it difficult to track the scheme. Can anyone help elaborate how RRTMG is chosen in the code? Thanks a lot in advance,Yuan
 

eaton

CSEG and Liaisons
Using either CAMRT or RRTMG is a build time decision, not run time.  That's why you won't find conditional logic in the Fortran code to implement the switch.  Instead you'll find in CAM's configure script a conditional which includes the source paths for RRTMG in the Filepath file in front of the path .../models/atm/cam/src/physics/cam/ in the configurations that use RRTMG.  The Filepath is used in the Makefile to compile the correct code for the chosen radiation scheme.  The RRTMG source has a further confusing aspect in that there are duplicated filenames in multiple directories.  Again the Filepath is the mechanism used to choose the correct file.  The directory rrtmg_mcica is listed before rrtmg_lw and rrtmg_sw in the Filepath file, so in the case of duplicate filenames it's the version in rrtmg_mcica which is used. 
 

eaton

CSEG and Liaisons
Using either CAMRT or RRTMG is a build time decision, not run time.  That's why you won't find conditional logic in the Fortran code to implement the switch.  Instead you'll find in CAM's configure script a conditional which includes the source paths for RRTMG in the Filepath file in front of the path .../models/atm/cam/src/physics/cam/ in the configurations that use RRTMG.  The Filepath is used in the Makefile to compile the correct code for the chosen radiation scheme.  The RRTMG source has a further confusing aspect in that there are duplicated filenames in multiple directories.  Again the Filepath is the mechanism used to choose the correct file.  The directory rrtmg_mcica is listed before rrtmg_lw and rrtmg_sw in the Filepath file, so in the case of duplicate filenames it's the version in rrtmg_mcica which is used. 
 

eaton

CSEG and Liaisons
Using either CAMRT or RRTMG is a build time decision, not run time.  That's why you won't find conditional logic in the Fortran code to implement the switch.  Instead you'll find in CAM's configure script a conditional which includes the source paths for RRTMG in the Filepath file in front of the path .../models/atm/cam/src/physics/cam/ in the configurations that use RRTMG.  The Filepath is used in the Makefile to compile the correct code for the chosen radiation scheme.  The RRTMG source has a further confusing aspect in that there are duplicated filenames in multiple directories.  Again the Filepath is the mechanism used to choose the correct file.  The directory rrtmg_mcica is listed before rrtmg_lw and rrtmg_sw in the Filepath file, so in the case of duplicate filenames it's the version in rrtmg_mcica which is used. 
 

Yuan Wang

New Member
Thanks a lot Eaton for your detailed explanations.Does that mean if I want to switch back to CAMRT, only changing the namelist is not enough. I also have to modify the .../Buildconf/camconf/Filepath, right?
Yuan 
 

Yuan Wang

New Member
Thanks a lot Eaton for your detailed explanations.Does that mean if I want to switch back to CAMRT, only changing the namelist is not enough. I also have to modify the .../Buildconf/camconf/Filepath, right?
Yuan 
 

Yuan Wang

New Member
Thanks a lot Eaton for your detailed explanations.Does that mean if I want to switch back to CAMRT, only changing the namelist is not enough. I also have to modify the .../Buildconf/camconf/Filepath, right?
Yuan 
 

eaton

CSEG and Liaisons
Correct, only run time options can be changed with the namelist, not build time options.  If you want to run with camrt the way to do that is with appropriate arguments to configure which then produces the correct Filepath file.  The arguments '-phys cam3' or '-phys cam4' both produce configurations that use camrt.  '-phys cam5' uses rrtmg. 
 

eaton

CSEG and Liaisons
Correct, only run time options can be changed with the namelist, not build time options.  If you want to run with camrt the way to do that is with appropriate arguments to configure which then produces the correct Filepath file.  The arguments '-phys cam3' or '-phys cam4' both produce configurations that use camrt.  '-phys cam5' uses rrtmg. 
 

eaton

CSEG and Liaisons
Correct, only run time options can be changed with the namelist, not build time options.  If you want to run with camrt the way to do that is with appropriate arguments to configure which then produces the correct Filepath file.  The arguments '-phys cam3' or '-phys cam4' both produce configurations that use camrt.  '-phys cam5' uses rrtmg. 
 
Hi Eaton,     Can we change the radiation_scheme and macrop_scheme that are used by CAM5 by setting them in the user_nl_cam ? i.e. radiation_scheme= camrt  macrop_scheme= 'RK' . The default values for CAM5 are 'rrtmg' and 'park'  respectively.      Thanks.
 
Hi Eaton,     Can we change the radiation_scheme and macrop_scheme that are used by CAM5 by setting them in the user_nl_cam ? i.e. radiation_scheme= camrt  macrop_scheme= 'RK' . The default values for CAM5 are 'rrtmg' and 'park'  respectively.      Thanks.
 
Hi Eaton,     Can we change the radiation_scheme and macrop_scheme that are used by CAM5 by setting them in the user_nl_cam ? i.e. radiation_scheme= camrt  macrop_scheme= 'RK' . The default values for CAM5 are 'rrtmg' and 'park'  respectively.      Thanks.
 
Top