Skip to content

Commit

Permalink
Merge pull request ESCOMP#227 from cacraigucar/misc_for_cam_cesm2_1_r…
Browse files Browse the repository at this point in the history
…el_46

 Misc bugs ESCOMP#1: rrtmg_state pointer, SCAM namelist, izumi compiler and TGIT test
  • Loading branch information
cacraigucar authored Sep 28, 2020
2 parents 9adf506 + feedc2e commit caf0c8f
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ required = True
local_path = components/cice

[cime]
tag = cime5.6.27
tag = cime5.6.33
protocol = git
repo_url = https://github.com/ESMCI/cime
required = True
Expand Down
12 changes: 9 additions & 3 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4421,6 +4421,12 @@ Column bfb match with cam generated IOP.
Default: FALSE
</entry>

<entry id="scm_backfill_iop_w_init" type="logical" category="scam"
group="scam_nl" valid_values="">
Backfill missing IOP values for omega/T/q/Ps from initial data file.
Default: FALSE
</entry>

<entry id="scm_crm_mode" type="logical" category="scam"
group="scam_nl" valid_values="">
Column radiation mode.
Expand Down Expand Up @@ -4522,19 +4528,19 @@ Default: 'slt'
</entry>

<entry id="scm_iop_lhflxshflxTg" type="logical" category="scam"
group="scam_nl" valid_values="iop,eulc,slt,off">
group="scam_nl" valid_values="">
Use the SCAM-IOP specified surface LHFLX/SHFLX/ustar/Tg instead of using internally-computed values
Default: FALSE
</entry>

<entry id="scm_use_obs_qv" type="logical" category="scam"
group="scam_nl" valid_values="iop,eulc,slt,off">
group="scam_nl" valid_values="">
Use the SCAM-IOP specified observed water vapor at each time step instead of forecast value
Default: FALSE
</entry>

<entry id="scm_force_latlon" type="logical" category="scam"
group="scam_nl" valid_values="iop,eulc,slt,off">
group="scam_nl" valid_values="">
Force scam to use the lat lon fields specified in the scam namelist not what is closest to IOP avail lat lon
Default: FALSE
</entry>
Expand Down
104 changes: 104 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,110 @@

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

Tag name: cam_cesm2_1_rel_46
Originator(s): cacraig, fvitt, jet
Date: Sept 28, 2020
One-line Summary: Fix rrtmg_state pointer bug, correct SCAM6 namelist inconsistencies and update izumi compilers and TGIT test
Github PR URL: https://github.com/ESCOMP/CAM/pull/227

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
cheyenne jobs randomly failing with deallocation [rrtmg_state pointer bug] (issue #86)
SCAM6 namelist definitions inconsistent (issue #130)
Updates to handle izumi compiler updates (issue #145)
Update ChangeLog template (issue #228)

Update the TGIT CAM regression test
Update cheyenne compiler


Describe any changes made to build system:

Describe any changes made to the namelist:

List any changes to the defaults for the boundary datasets:

Describe any substantial timing or memory changes:

Code reviewed by: nusbaume, goldy, eaton, jet, fvitt

List all files eliminated:

List all files added and what they do:

List all existing files that have been modified, and describe the changes:
modified: src/physics/rrtmg/radiation.F90
modified: src/physics/rrtmg/rrtmg_state.F90
- Mods for issue #86:
cheyenne jobs randomly failing with deallocation [rrtmg_state pointer bug]

modified: bld/namelist_files/namelist_definition.xml
modified: src/control/scamMod.F90
modified: src/dynamics/eul/iop.F90
modified: src/physics/cam/physpkg.F90
- Mods for issue #130:
SCAM6 namelist definitions inconsistent

modified: Externals.cfg
modified: test/system/CAM_compare.sh
modified: test/system/test_driver.sh
- Mods for issue #145:
Updates to handle izumi compiler updates
Also needed to update cheyenne compiler

modified: TGIT.sh
- Update the TGIT CAM regression test


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: all BFB

cheyenne/intel/aux_cam: all PASS

hobart/nag: all BFB

hobart/pgi:
004 bl112 TBL.sh e8c3aqdm outfrq3s+aquaplanet_cam3 9s .........................................FAIL! rc= 7 at Fri Sep 25 18:04:01 MDT
008 bl114 TBL.sh e8c4aqdm co2rmp 9s ...........................................................FAIL! rc= 7 at Fri Sep 25 18:10:27 MDT 2020
011 bl222 TBL.sh f10spmaqdm outfrq3s 9s .......................................................FAIL! rc= 7 at Fri Sep 25 18:54:01 MDT 2020
014 bl314 TBL.sh f10c4aqwscdm outfrq3s_diags 9s ...............................................FAIL! rc= 7 at Fri Sep 25 19:01:54 MDT 2020
017 bl320 TBL.sh f10c5aqpbadm rad_diag 9s .....................................................FAIL! rc= 7 at Fri Sep 25 19:09:31 MDT 2020
020 bl334 TBL.sh f10c5aqudm outfrq3s 9s .......................................................FAIL! rc= 7 at Fri Sep 25 19:18:03 MDT 2020
023 bl339 TBL.sh f10adhterm terminator 9s .....................................................FAIL! rc= 7 at Fri Sep 25 19:24:29 MDT 2020
026 bl712 TBL.sh h5c5aqbamdm outfrq3s+aquaplanet_cam5 9s ......................................FAIL! rc= 7 at Fri Sep 25 19:33:04 MDT 2020
All PGI baselines expected to fail, due to changes with updated PGI compiler (this was seen in the cam_development branch previously)


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

Summarize any changes to answers, i.e.,
- what code configurations:
- what platforms/compilers:
- nature of change (roundoff; larger than roundoff but same climate; new
climate):

If bitwise differences were observed, how did you show they were no worse
than roundoff?

If this tag changes climate describe the run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced, i.e.,
- source tag (all code used must be in the repository):
- platform/compilers:
- configure commandline:
- build-namelist command (or complete namelist):
- MSS location of output:

MSS location of control simulations used to validate new climate:

URL for AMWG diagnostics output used to validate new climate:

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

Tag name: cam_cesm2_1_rel_45
Originator(s): cacraig, jedwards
Date: April 24, 2020
Expand Down
5 changes: 2 additions & 3 deletions doc/ChangeLog_template
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ Tag name:
Originator(s):
Date:
One-line Summary:
Github PR URL:

Purpose of changes:

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

Describe any changes made to build system:

Expand Down
71 changes: 62 additions & 9 deletions src/control/scamMod.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
module scamMod
!----------------------------------------------------------------------
!
! This module provides control variables and namelist functionality
! for SCAM.
!
! As with global CAM, SCAM is initialized with state information
! from the initial and boundary files. For each succeeding timestep
! SCAM calculates the physics tendencies and combines these with
! the advective tendencies provided by the IOP file to produce
! a forcast. Generally, the control variables in this module
! determine what data and parameterizations will be used to make
! the forecast. For instance, many of the control variables in
! this module provide flexibility to affect the forecast by overriding
! parameterization prognosed tendencies with observed tendencies
! of a particular field program recorded on the IOP file.
!
! Public functions/subroutines:
! scam_readnl
!-----------------------------------------------------------------------

use shr_kind_mod, only: r8 => shr_kind_r8
use pmgrid, only: plon, plat, plev, plevp
Expand Down Expand Up @@ -27,8 +46,6 @@ module scamMod

logical, public :: single_column ! Using IOP file or not
logical, public :: use_iop ! Using IOP file or not
logical, public :: use_analysis
logical, public :: use_saveinit
logical, public :: use_pert_init ! perturb initial values
logical, public :: use_pert_frc ! perturb forcing
logical, public :: switch(num_switches) ! Logical flag settings from GUI
Expand Down Expand Up @@ -164,11 +181,11 @@ module scamMod
logical, public :: have_asdif = .false. ! dataset contains asdif
logical, public :: use_camiop = .false. ! use cam generated forcing
logical, public :: use_3dfrc = .false. ! use 3d forcing
logical, public :: use_userdata = .false.
logical, public :: isrestart = .false. ! If this is a restart step or not

! SCAM namelist defaults

logical, public :: scm_backfill_iop_w_init = .false. ! Backfill missing IOP data from initial file
logical, public :: scm_relaxation = .false. ! Use relaxation
logical, public :: scm_crm_mode = .false. ! Use column radiation mode
logical, public :: scm_cambfb_mode = .false. ! Use extra CAM IOP fields to assure bit for bit match with CAM run
Expand Down Expand Up @@ -220,14 +237,11 @@ subroutine scam_readnl(nlfile,single_column_in,scmlat_in,scmlon_in)

! Local variables
character(len=*), parameter :: sub = 'scam_readnl'
integer :: unitn, ierr
integer :: unitn, ierr, i
integer :: ncid
integer :: latdimid, londimid
integer :: latsiz, lonsiz
integer :: latid, lonid
integer :: iatt
integer :: ret
integer :: latidx, lonidx
logical :: adv
real(r8) :: ioplat,ioplon

! this list should include any variable that you might want to include in the namelist
Expand All @@ -236,7 +250,7 @@ subroutine scam_readnl(nlfile,single_column_in,scmlat_in,scmlon_in)
scm_cambfb_mode,scm_crm_mode,scm_zadv_uv,scm_zadv_T,scm_zadv_q,&
scm_use_obs_T, scm_use_obs_uv, scm_use_obs_qv, &
scm_relax_linear, scm_relax_tau_top_sec, &
scm_relax_tau_bot_sec, scm_force_latlon, scm_relax_fincl
scm_relax_tau_bot_sec, scm_force_latlon, scm_relax_fincl, scm_backfill_iop_w_init

single_column=single_column_in

Expand Down Expand Up @@ -303,6 +317,45 @@ subroutine scam_readnl(nlfile,single_column_in,scmlat_in,scmlon_in)
scmlon = ioplon
end if

if (masterproc) then
write (iulog,*) 'Single Column Model Options: '
write (iulog,*) '============================='
write (iulog,*) ' iopfile = ',trim(iopfile)
write (iulog,*) ' scm_backfill_iop_w_init = ',scm_backfill_iop_w_init
write (iulog,*) ' scm_cambfb_mode = ',scm_cambfb_mode
write (iulog,*) ' scm_crm_mode = ',scm_crm_mode
write (iulog,*) ' scm_force_latlon = ',scm_force_latlon
write (iulog,*) ' scm_iop_Tg = ',scm_iop_Tg
write (iulog,*) ' scm_iop_lhflxshflxTg = ',scm_iop_lhflxshflxTg
write (iulog,*) ' scm_relaxation = ',scm_relaxation
write (iulog,*) ' scm_relax_bot_p = ',scm_relax_bot_p
write (iulog,*) ' scm_relax_linear = ',scm_relax_linear
write (iulog,*) ' scm_relax_tau_bot_sec = ',scm_relax_tau_bot_sec
write (iulog,*) ' scm_relax_tau_sec = ',scm_relax_tau_sec
write (iulog,*) ' scm_relax_tau_top_sec = ',scm_relax_tau_top_sec
write (iulog,*) ' scm_relax_top_p = ',scm_relax_top_p
write (iulog,*) ' scm_use_obs_T = ',scm_use_obs_T
write (iulog,*) ' scm_use_obs_qv = ',scm_use_obs_qv
write (iulog,*) ' scm_use_obs_uv = ',scm_use_obs_uv
write (iulog,*) ' scm_zadv_T = ',trim(scm_zadv_T)
write (iulog,*) ' scm_zadv_q = ',trim(scm_zadv_q)
write (iulog,*) ' scm_zadv_uv = ',trim(scm_zadv_uv)
write (iulog,*) ' scm_relax_finc: '
! output scm_relax_fincl character array
do i=1,pcnst
if (scm_relax_fincl(i) .ne. '') then
adv = mod(i,4)==0
if (adv) then
write (iulog, "(A18)") "'"//trim(scm_relax_fincl(i))//"',"
else
write (iulog, "(A18)", ADVANCE="NO") "'"//trim(scm_relax_fincl(i))//"',"
end if
else
exit
end if
end do
end if

end if

end subroutine scam_readnl
Expand Down
16 changes: 8 additions & 8 deletions src/dynamics/eul/iop.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ module iop
use phys_control, only: phys_getopts
use pmgrid, only: beglat,endlat,plon,plev,plevp
use prognostics, only: n3,t3,q3,u3,v3,ps
use scamMod, only: use_camiop, ioptimeidx, have_ps, use_userdata, have_tsair, &
use scamMod, only: use_camiop, ioptimeidx, have_ps, scm_backfill_iop_w_init, have_tsair, &
tobs, have_t, tground, have_tg, qobs, have_q, have_cld, &
have_clwp, divq, have_divq, vertdivq, have_vertdivq, divq3d, &
have_divq3d, dqfxcam, have_numliq, have_cldliq, have_cldice, &
have_numice, have_divu, have_divv, divt, have_divt, vertdivt, &
have_vertdivt, divt3d, have_divt3d, have_divu3d, have_divv3d, &
have_ptend, ptend, wfld, uobs, have_u, uobs, vobs, have_v, &
vobs, have_prec, have_q1, have_q2, have_lhflx, have_shflx, &
use_3dfrc, betacam, fixmascam, alphacam, ioptimeidx,doiopupdate, &
use_userdata, cldiceobs, cldliqobs, cldobs, clwpobs, divu, &
use_3dfrc, betacam, fixmascam, alphacam, doiopupdate, &
cldiceobs, cldliqobs, cldobs, clwpobs, divu, &
divu3d, divv, divv3d, iopfile, lhflxobs, numiceobs, numliqobs, &
precobs, q1obs, scmlat, scmlon, shflxobs, tsair, have_omega, wfldh,qinitobs
use shr_kind_mod, only: r8 => shr_kind_r8, max_chars=>shr_kind_cl
Expand Down Expand Up @@ -325,7 +325,7 @@ subroutine readiopdata(timelevel)
if ( status .ne. nf90_noerr ) then
have_ps = .false.
if (masterproc) write(iulog,*) sub//':Could not find variable Ps'
if ( .not. use_userdata ) then
if ( .not. scm_backfill_iop_w_init ) then
status = NF90_CLOSE( ncid )
return
else
Expand Down Expand Up @@ -398,7 +398,7 @@ subroutine readiopdata(timelevel)
if ( status .ne. nf90_noerr ) then
have_t = .false.
if (masterproc) write(iulog,*) sub//':Could not find variable T'
if ( .not. use_userdata ) then
if ( .not. scm_backfill_iop_w_init ) then
status = NF90_CLOSE( ncid )
return
else
Expand Down Expand Up @@ -447,7 +447,7 @@ subroutine readiopdata(timelevel)
if ( status .ne. nf90_noerr ) then
have_q = .false.
if (masterproc) write(iulog,*) sub//':Could not find variable q'
if ( .not. use_userdata ) then
if ( .not. scm_backfill_iop_w_init ) then
status = nf90_close( ncid )
return
else
Expand Down Expand Up @@ -794,7 +794,7 @@ subroutine readiopdata(timelevel)
if ( status .ne. nf90_noerr ) then
have_omega = .false.
if (masterproc) write(iulog,*) sub//':Could not find variable omega'
if ( .not. use_userdata ) then
if ( .not. scm_backfill_iop_w_init ) then
status = nf90_close( ncid )
return
else
Expand Down Expand Up @@ -1134,7 +1134,7 @@ subroutine setiopupdate
!
if ( ncdate > last_date .or. (ncdate == last_date &
.and. ncsec > last_sec)) then
if ( .not. use_userdata ) then
if ( .not. scm_backfill_iop_w_init ) then
call endrun(sub//':ERROR - setiopupdate.c:Reached the end of the time varient dataset')
else
doiopupdate = .false.
Expand Down
5 changes: 5 additions & 0 deletions src/physics/cam/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
use physconst, only: stebol, latvap
use carma_intr, only: carma_accumulate_stats
use spmd_utils, only: mpicom
use iop_forcing, only: scam_use_iop_srf
#if ( defined OFFLINE_DYN )
use metdata, only: get_met_srf2
#endif
Expand Down Expand Up @@ -1116,6 +1117,10 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, &
!

if(single_column.and.scm_crm_mode) return
!-----------------------------------------------------------------------
! if using IOP values for surface fluxes overwrite here after surface components run
!-----------------------------------------------------------------------
if (single_column) call scam_use_iop_srf(cam_in)

!-----------------------------------------------------------------------
! Tendency physics after coupler
Expand Down
4 changes: 2 additions & 2 deletions src/physics/rrtmg/radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ subroutine radiation_tend( &
integer :: troplev(pcols)
real(r8) :: p_trop(pcols)

type(rrtmg_state_t), pointer :: r_state ! contains the atm concentrations in layers needed for RRTMG
type(rrtmg_state_t) :: r_state ! contains the atm concentrations in layers needed for RRTMG

! cloud radiative parameters are "in cloud" not "in cell"
real(r8) :: ice_tau (nswbands,pcols,pver) ! ice extinction optical depth
Expand Down Expand Up @@ -921,7 +921,7 @@ subroutine radiation_tend( &
if (dosw .or. dolw) then

! construct an RRTMG state object
r_state => rrtmg_state_create( state, cam_in )
r_state = rrtmg_state_create( state, cam_in )

call t_startf('cldoptics')

Expand Down
Loading

0 comments on commit caf0c8f

Please sign in to comment.