Skip to content

Commit

Permalink
Merge pull request #2990 from ESMCI/bogensch/SCM_SE_test
Browse files Browse the repository at this point in the history
Modifications to allow for E3SM developer tests for the SE SCM

This PR includes modifications to allow for E3SM developer tests for the Spectral Element (SE) version of the Single Column Model (SCM), which will be the default version of the SCM for E3SMv2. This PR 1) adds the SE SCM test in config/e3sm/tests.py , 2) removes the restriction that the SCM be compiled with mpi-serial mode (will not compile with the SE SCM and no longer a requirement for the Eulerian SCM), and 3) add a single_column logical check in src/drivers/mct/main/seq_io_mod.F90. In the E3SM SE SCM since the full dynamics grid is initialized but only one physics column is initialized, a shr_sys_abort is called when coupler diagnostics would otherwise be successfully written to history file. Added a logical check to avoid this abort call when SCM is used.

Note that required modifications to run the SE SCM test have also be made in a companion E3SM PR.

Test suite: scripts/test/scripts_regression_tests.py
Along with modifications in the E3SM PR, my e3sm_developer tests for both SE SCM and Eulerian SCM pass (in addition to the full testing suite). SCM runs using the official E3SM SCM scripts also pass for both dynamical cores.
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes [CIME Github issue #]

User interface changes?:

Update gh-pages html (Y/N)?:

Code review:
  • Loading branch information
jgfouca authored Jan 30, 2019
2 parents 2368fcf + 26ff75e commit 7013825
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
14 changes: 10 additions & 4 deletions driver-mct/main/seq_hist_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module seq_hist_mod
logical :: histavg_wav ! .true. => write wav fields to average history file
logical :: histavg_xao ! .true. => write flux xao fields to average history file

logical :: single_column

!--- domain equivalent 2d grid size ---
integer(IN) :: atm_nx, atm_ny ! nx,ny of 2d grid, if known
Expand Down Expand Up @@ -201,6 +202,7 @@ subroutine seq_hist_write(infodata, EClock_d, &
glc_nx=glc_nx, glc_ny=glc_ny, &
wav_nx=wav_nx, wav_ny=wav_ny, &
ocn_nx=ocn_nx, ocn_ny=ocn_ny, &
single_column=single_column, &
case_name=case_name, &
model_doi_url=model_doi_url)

Expand Down Expand Up @@ -252,13 +254,17 @@ subroutine seq_hist_write(infodata, EClock_d, &
gsmap => component_get_gsmap_cx(atm(1))
dom => component_get_dom_cx(atm(1))
call seq_io_write(hist_file, gsmap, dom%data, 'dom_ax', &
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='doma')
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='doma', &
scolumn=single_column)
call seq_io_write(hist_file, gsmap, fractions_ax, 'fractions_ax', &
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='fraca')
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='fraca', &
scolumn=single_column)
call seq_io_write(hist_file, atm, 'x2c', 'x2a_ax', &
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='x2a')
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='x2a', &
scolumn=single_column)
call seq_io_write(hist_file, atm, 'c2x', 'a2x_ax', &
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='a2x')
nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='a2x', &
scolumn=single_column)
!call seq_io_write(hist_file, gsmap, l2x_ax, 'l2x_ax', &
! nx=atm_nx, ny=atm_ny, nt=1, whead=whead, wdata=wdata, pre='l2x_ax')
!call seq_io_write(hist_file, gsmap, o2x_ax, 'o2x_ax', &
Expand Down
24 changes: 18 additions & 6 deletions driver-mct/main/seq_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ end function seq_io_sec2hms
! !INTERFACE: ------------------------------------------------------------------

subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval,pre,tavg,&
use_float, file_ind)
use_float, file_ind, scolumn)

! !INPUT/OUTPUT PARAMETERS:
implicit none
Expand All @@ -394,6 +394,7 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval,
logical,optional,intent(in) :: tavg ! is this a tavg
logical,optional,intent(in) :: use_float ! write output as float rather than double
integer,optional,intent(in) :: file_ind
logical,optional,intent(in) :: scolumn ! single column model flag

!EOP

Expand Down Expand Up @@ -421,6 +422,7 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval,
character(*),parameter :: subName = '(seq_io_write_av) '
integer, pointer :: Dof(:)
integer :: lfile_ind
logical :: lcolumn

real(r8), allocatable :: tmpdata(:)

Expand All @@ -440,8 +442,10 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval,

lwhead = .true.
lwdata = .true.
lcolumn = .false.
if (present(whead)) lwhead = whead
if (present(wdata)) lwdata = wdata
if (present(scolumn)) lcolumn = scolumn

if (.not.lwhead .and. .not.lwdata) then
! should we write a warning?
Expand Down Expand Up @@ -475,7 +479,7 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval,
if (present(ny)) then
if (ny /= 0) lny = ny
endif
if (lnx*lny /= ng) then
if (lnx*lny /= ng .and. .not. lcolumn) then
if(iam==0) write(logunit,*) subname,' ERROR: grid2d size not consistent ',ng,lnx,lny,trim(dname)
call shr_sys_abort(subname//'ERROR: grid2d size not consistent ')
endif
Expand Down Expand Up @@ -562,7 +566,7 @@ end subroutine seq_io_write_av
! !INTERFACE: ------------------------------------------------------------------

subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillval,pre,tavg,&
use_float,file_ind)
use_float,file_ind,scolumn)

! !INPUT/OUTPUT PARAMETERS:
implicit none
Expand All @@ -580,6 +584,7 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva
logical,optional,intent(in) :: tavg ! is this a tavg
logical,optional,intent(in) :: use_float ! write output as float rather than double
integer,optional,intent(in) :: file_ind
logical,optional,intent(in) :: scolumn ! single column model flag

!EOP

Expand Down Expand Up @@ -610,6 +615,7 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva
integer, pointer :: Dof(:)
integer, pointer :: Dofn(:)
integer :: lfile_ind
logical :: lcolumn

!-------------------------------------------------------------------------------
!
Expand All @@ -627,8 +633,10 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva

lwhead = .true.
lwdata = .true.
lcolumn = .false.
if (present(whead)) lwhead = whead
if (present(wdata)) lwdata = wdata
if (present(scolumn)) lcolumn = scolumn

if (.not.lwhead .and. .not.lwdata) then
! should we write a warning?
Expand Down Expand Up @@ -666,7 +674,7 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva
if (present(ny)) then
if (ny /= 0) lny = ny
endif
if (lnx*lny /= ng) then
if (lnx*lny /= ng .and. .not. lcolumn) then
if(iam==0) write(logunit,*) subname,' ERROR: grid2d size not consistent ',ng,lnx,lny,trim(dname)
call shr_sys_abort(subname//' ERROR: grid2d size not consistent ')
endif
Expand Down Expand Up @@ -784,7 +792,7 @@ end subroutine seq_io_write_avs
! !INTERFACE: ------------------------------------------------------------------

subroutine seq_io_write_avscomp(filename, comp, flow, dname, &
whead, wdata, nx, ny, nt, fillval, pre, tavg, use_float, file_ind)
whead, wdata, nx, ny, nt, fillval, pre, tavg, use_float, file_ind, scolumn)

! !INPUT/OUTPUT PARAMETERS:
implicit none
Expand All @@ -802,6 +810,7 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, &
logical ,optional,intent(in) :: tavg ! is this a tavg
logical ,optional,intent(in) :: use_float ! write output as float rather than double
integer ,optional,intent(in) :: file_ind
logical ,optional,intent(in) :: scolumn ! single column model flag

!EOP

Expand Down Expand Up @@ -835,6 +844,7 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, &
integer, pointer :: Dof(:)
integer, pointer :: Dofn(:)
integer :: lfile_ind
logical :: lcolumn

!-------------------------------------------------------------------------------
!
Expand All @@ -852,8 +862,10 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, &

lwhead = .true.
lwdata = .true.
lcolumn = .false.
if (present(whead)) lwhead = whead
if (present(wdata)) lwdata = wdata
if (present(scolumn)) lcolumn = scolumn
frame = -1
if (present(nt)) then
frame = nt
Expand Down Expand Up @@ -893,7 +905,7 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, &
if (present(ny)) then
if (ny /= 0) lny = ny
endif
if (lnx*lny /= ng) then
if (lnx*lny /= ng .and. .not. lcolumn) then
if(iam==0) then
write(logunit,*) subname,' ERROR: grid2d size not consistent ',&
ng,lnx,lny,trim(dname)
Expand Down

0 comments on commit 7013825

Please sign in to comment.