Closed cecilehannay closed 8 years ago
Wasn't this brought into ACME with commit c40047604afd3fccee432083d6c1aacfdc0ca012 ?
Yes, I agree it looks like it was brought into ACME. We are trying to find a way to easily find track the bugs found in CAM. Here we decided to use the label "PotentialBug".
@rljacob : since this is in ACME, should we add the "Bug" label? Or add "Bug" and remove "PotentialBug"?
Right this is a "Bug", not a "PotentialBug".
@cecilehannay we're using "PotentialBug" for "In CAM but NOT in ACME".
Also changed the title which should describe the bug.
This issue is the same as: https://github.com/ACME-Climate/ACME/issues/139
This was fixed in: https://github.com/ACME-Climate/ACME/pull/222
Reported in cam5_3_80. I expect this bug to be in ACME too.
Bug was reported in Minghua Zhang's email: A new routine (shr_orb_avg_cosz) has been introduced "that eliminates the spurious zonal oscillation of daily insolation caused by discrete time sampling. The algorithm uses the mean of cosz in a time step. The module shr_orb_mod.F90 calls this subroutine" Added a shr_orb_init routine which is used to set the dt to use in the above calculation. This dt is the size of the radiation time step. If shr_orb_init is not called, the original shr_orb_cosz calculation is used. It is important to note that ALL CESM components will use this modified cosz calculation with the specified dt value if it is turned on. This new shr functionality is controlled via the new CAM namelist logical: use_rad_dt_cosz
Index: components/cam/bld/namelist_files/namelist_definition.xml
--- components/cam/bld/namelist_files/namelist_definition.xml (.../cam5_3_79) (revision 75667) +++ components/cam/bld/namelist_files/namelist_definition.xml (.../cam5_3_80) (revision 75667) @@ -3131,6 +3131,12 @@ Default: FALSE
+<entry id="use_rad_dt_cosz" type="logical" category="radiation"
Index: components/cam/src/control/runtime_opts.F90
--- components/cam/src/control/runtime_opts.F90 (.../cam5_3_79) (revision 75667) +++ components/cam/src/control/runtime_opts.F90 (.../cam5_3_80) (revision 75667) @@ -266,6 +266,7 @@ ! or hours (negative) SW/LW radiation will be run continuously ! from the start of an initial run. Default: 0 logical :: spectralflux ! calculate fluxes (up and down) per band. Default: FALSE +logical :: use_rad_dt_cosz ! if true, uses the radiation dt for all cosz calculations
! SCM Options logical :: single_column @@ -443,7 +444,6 @@ character(len=fieldname_lenp2) fwrtpr9(pflds) character(len=fieldname_lenp2) fwrtpr10(pflds)
-! ! Define the cam_inparm namelist ! _NOTE_ If a namelist option is not described in the CAM Users Guide, ! it is not supported.
@@ -479,7 +479,7 @@ namelist /cam_inparm/ print_energy_errors
! radiative heating calculation options
namelist /cam_inparm/ iradsw, iradlw, iradae, irad_always, spectralflux, use_rad_dt_cosz
! scam namelist /cam_inparm/ iopfile,scm_iop_srf_prop,scm_relaxation, & @@ -520,7 +520,8 @@ iradlw_out = iradlw, & iradae_out = iradae, & irad_always_out = irad_always, &
if (present(single_column_in)) then call scam_default_opts(scmlat_out=scmlat,scmlon_out=scmlon, & @@ -741,7 +742,8 @@ iradlw_in = iradlw, & iradae_in = iradae, & irad_always_in = irad_always, &
! ! Set runtime options for single column mode @@ -1003,6 +1005,7 @@ call mpibcast (iradae, 1, mpiint, 0, mpicom) call mpibcast (irad_always,1, mpiint, 0, mpicom) call mpibcast (spectralflux,1, mpilog, 0, mpicom)
Index: components/cam/src/physics/rrtmg/radiation.F90
--- components/cam/src/physics/rrtmg/radiation.F90 (.../cam5_3_79) (revision 75667) +++ components/cam/src/physics/rrtmg/radiation.F90 (.../cam5_3_80) (revision 75667) @@ -70,6 +70,7 @@ ! run continuously from the start of an ! initial or restart run logical :: spectralflux = .false. ! calculate fluxes (up and down) per band. +logical :: use_rad_dt_cosz = .false. ! if true, use radiation dt for all cosz calculations
-subroutine radiation_defaultopts(iradsw_out, iradlw_out, iradae_out, irad_always_out, spectralflux_out) +subroutine radiation_defaultopts(iradsw_out, iradlw_out, iradae_out, irad_always_out, spectralflux_out, use_rad_dt_cosz_out) !----------------------------------------------------------------------- ! Purpose: Return default runtime options !----------------------------------------------------------------------- @@ -121,6 +122,7 @@ integer, intent(out), optional :: iradae_out integer, intent(out), optional :: irad_always_out logical, intent(out), optional :: spectralflux_out
logical, intent(out), optional :: use_rad_dt_cosz_out !-----------------------------------------------------------------------
if ( present(iradsw_out) ) iradsw_out = iradsw @@ -128,13 +130,14 @@ if ( present(iradae_out) ) iradae_out = -999 if ( present(irad_always_out) ) irad_always_out = irad_always if ( present(spectralflux_out) ) spectralflux_out = spectralflux
if ( present(use_rad_dt_cosz_out) ) use_rad_dt_cosz_out = use_rad_dt_cosz
!================================================================================================
subroutine radiation_setopts(dtime, nhtfrq, iradsw_in, iradlw_in, iradae_in, &
irad_always_in, spectralflux_in)
irad_always_in, spectralflux_in, use_rad_dt_cosz_in) !----------------------------------------------------------------------- ! Purpose: Set runtime options ! * NOTE * This routine needs information about dtime (init by dycore) @@ -150,6 +153,7 @@ integer, intent(in), optional :: iradae_in integer, intent(in), optional :: irad_always_in logical, intent(in), optional :: spectralflux_in
logical, intent(in), optional :: use_rad_dt_cosz_in
! Local integer :: ntspdy ! no. timesteps per day @@ -162,6 +166,7 @@ if ( present(iradae_in) ) iradae = iradae_in if ( present(irad_always_in) ) irad_always = irad_always_in if ( present(spectralflux_in) ) spectralflux = spectralflux_in
if ( present(use_rad_dt_cosz_in) ) use_rad_dt_cosz = use_rad_dt_cosz_in
! Convert iradsw, iradlw and irad_always from hours to timesteps if necessary if (iradsw < 0) iradsw = nint((-iradsw *3600._r8)/dtime) @@ -317,7 +322,11 @@ use modal_aer_opt, only: modal_aer_opt_init use rrtmg_state, only: rrtmg_state_init use physics_buffer, only: physics_buffer_desc
use time_manager, only: get_step_size
use shr_orb_mod, only: shr_orb_init
! args type(physics_buffer_desc), pointer :: pbuf2d(:,:)
@@ -331,6 +340,9 @@ ! liquid budgets. integer :: history_budget_histfile_num ! output history file number for budget fields integer :: err +
integer :: dtime !-----------------------------------------------------------------------
call rrtmg_state_init() @@ -340,6 +352,13 @@ call radsw_init() call radlw_init()