Skip to content

Commit

Permalink
Merge remote-tracking branch 'ESCOMP/development' into constituent-bu…
Browse files Browse the repository at this point in the history
…gfix
  • Loading branch information
Courtney Peverley committed Jul 23, 2024
2 parents 2b3a43f + 40d1804 commit 1838d66
Show file tree
Hide file tree
Showing 18 changed files with 260 additions and 57 deletions.
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "ccpp-framework"]
path = ccpp_framework
url = https://github.com/peverwhee/ccpp-framework
fxtag = CPF_0.2.056
url = https://github.com/NCAR/ccpp-framework
fxtag = 2024-07-11-dev
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/peverwhee/ccpp-framework
fxDONOTUSEurl = https://github.com/NCAR/ccpp-framework
[submodule "mpas"]
path = src/dynamics/mpas/dycore
url = https://github.com/MPAS-Dev/MPAS-Model.git
Expand All @@ -14,7 +14,7 @@
[submodule "ncar-physics"]
path = src/physics/ncar_ccpp
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_02_006
fxtag = atmos_phys0_03_000
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
[submodule "ccs_config"]
Expand Down
2 changes: 1 addition & 1 deletion ccpp_framework
Submodule ccpp_framework updated 101 files
42 changes: 17 additions & 25 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,53 @@
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_kessler_derecho_nooutput/">
<machines>
<machine name="derecho" compiler="intel" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >Intel build test for Kessler physics</option>
</options>
</test>
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_held_suarez_derecho_nooutput/">
<machines>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >GNU build test for Held-Suarez physics</option>
<option name="comment">Intel build test for Kessler physics</option>
</options>
</test>

<!-- Derecho dycore tests -->
<test compset="FKESSLER" grid="mpasa480_mpasa480" name="SMS_Ln2" testmods="cam/outfrq_kessler_mpas_derecho_nooutput/">
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_held_suarez_derecho_nooutput/">
<machines>
<machine name="derecho" compiler="intel" category="aux_sima"/>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >GNU build test for MPAS dycore (with Kessler physics)</option>
<option name="comment">GNU build test for Held-Suarez physics</option>
</options>
</test>
<test compset="FKESSLER" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_kessler_se_cslam_derecho_nooutput/">
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_tj2016_derecho_nooutput/">
<machines>
<machine name="derecho" compiler="intel" category="aux_sima"/>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >GNU build test for SE-CSLAM dycore (with Kessler physics)</option>
<option name="comment">GNU build test for Moist Held-Suarez physics</option>
</options>
</test>
</tests>

<!-- Izumi physics tests -->
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_kessler_izumi_nooutput/">
<!-- Derecho dycore tests -->
<test compset="FKESSLER" grid="mpasa480_mpasa480" name="SMS_Ln2" testmods="cam/outfrq_kessler_mpas_derecho_nooutput/">
<machines>
<machine name="izumi" compiler="gnu" category="aux_sima"/>
<machine name="derecho" compiler="intel" category="aux_sima"/>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >GNU build test for Kessler physics</option>
<option name="comment">GNU build test for MPAS dycore (with Kessler physics)</option>
</options>
</test>
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_held_suarez_izumi_nooutput/">
<test compset="FKESSLER" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_kessler_se_cslam_derecho_nooutput/">
<machines>
<machine name="izumi" compiler="gnu" category="aux_sima"/>
<machine name="derecho" compiler="intel" category="aux_sima"/>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment" >GNU build test for Held-Suarez physics</option>
<option name="comment">GNU build test for SE-CSLAM dycore (with Kessler physics)</option>
</options>
</test>


</testlist>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites tj2016"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ncdata=/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_tj2016_precip_tend_ne3pg3mg37_derecho_gnu_before.nc
ncdata_check=/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_tj2016_precip_tend_ne3pg3mg37_derecho_gnu_after.nc
debug_output=0
pver=30
4 changes: 2 additions & 2 deletions src/control/cam_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ subroutine cam_register_constituents(cam_runtime_opts)

!Combine host and physics constituents into a single
!constituents object:
call cam_ccpp_register_constituents(cam_runtime_opts%suite_as_list(), &
host_constituents, dynamic_constituents, errcode=errflg, errmsg=errmsg)
call cam_ccpp_register_constituents( &
host_constituents, errcode=errflg, errmsg=errmsg)

if (errflg /= 0) then
call endrun(subname//trim(errmsg), file=__FILE__, line=__LINE__)
Expand Down
4 changes: 2 additions & 2 deletions src/data/physconst.meta
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
dimensions = ()
protected = True
[ gravit ]
standard_name = gravitational_acceleration
standard_name = standard_gravitational_acceleration
units = m s-2
type = real | kind = kind_phys
dimensions = ()
Expand Down Expand Up @@ -268,7 +268,7 @@
dimensions = ()
protected = True
[ epsilo ]
standard_name = ratio_of_h2o_to_dry_air_molecular_weights
standard_name = ratio_of_water_vapor_to_dry_air_molecular_weights
units = 1
type = real | kind = kind_phys
dimensions = ()
Expand Down
1 change: 1 addition & 0 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<metadata_file>$SRCROOT/src/data/cam_thermo.meta</metadata_file>
<metadata_file>$SRCROOT/src/data/ref_pres.meta</metadata_file>
<metadata_file>$SRCROOT/src/dynamics/utils/vert_coord.meta</metadata_file>
<metadata_file>$SRCROOT/src/dynamics/utils/hycoef.meta</metadata_file>
<!-- Variables registered to physics_types -->
<file name="physics_types" type="module">
<use module="ccpp_kinds" reference="kind_phys"/>
Expand Down
80 changes: 74 additions & 6 deletions src/dynamics/utils/hycoef.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module hycoef

use shr_kind_mod, only: r8 => shr_kind_r8
use ccpp_kinds, only: kind_phys
use spmd_utils, only: masterproc
use vert_coord, only: pver, pverp
use cam_logfile, only: iulog
Expand Down Expand Up @@ -28,8 +29,6 @@ module hycoef
real(r8), public, allocatable, target :: hybi(:) ! ps component of hybrid coordinate - interfaces
real(r8), public, allocatable, target :: hybm(:) ! ps component of hybrid coordinate - midpoints

real(r8), public, allocatable :: etamid(:) ! hybrid coordinate - midpoints

real(r8), public, allocatable :: hybd(:) ! difference in b (hybi) across layers
real(r8), public, allocatable :: hypi(:) ! reference pressures at interfaces
real(r8), public, allocatable :: hypm(:) ! reference pressures at midpoints
Expand All @@ -47,6 +46,10 @@ module hycoef
type(var_desc_t) :: hyam_desc, hyai_desc, hybm_desc, hybi_desc, p0_desc
public init_restart_hycoef, write_restart_hycoef

!> \section arg_table_hycoef Argument Table
!! \htmlinclude hycoef.html
real(kind_phys), allocatable, public :: etamid(:) ! hybrid coordinate - midpoints

!=======================================================================
contains
!=======================================================================
Expand All @@ -56,6 +59,7 @@ subroutine hycoef_init(file, psdry)
! use cam_history_support, only: add_hist_coord, add_vert_coord, formula_terms_t
use physconst, only: pref
use string_utils, only: to_str
use phys_vars_init_check, only: mark_as_initialized

!-----------------------------------------------------------------------
!
Expand Down Expand Up @@ -326,6 +330,11 @@ subroutine hycoef_init(file, psdry)
write(iulog,9830) pverp, hypi(pverp)
end if

! Mark etamid (input name) as initialized (by standard name sum_of_sigma_...)
call mark_as_initialized( &
'sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient')


9800 format( 1x, i3, 3p, 3(f10.4,10x) )
9810 format( 1x, 3x, 3p, 3(10x,f10.4) )
9820 format(1x,'reference pressures (Pa)')
Expand Down Expand Up @@ -394,42 +403,101 @@ subroutine hycoef_read(File)
character(len=*), parameter :: routine = 'hycoef_read'
!----------------------------------------------------------------------------

! Set PIO to return error codes.
call pio_seterrorhandling(file, PIO_BCAST_ERROR, pio_errtype)

! PIO traps errors internally, no need to check ierr

ierr = PIO_Inq_DimID(File, 'lev', lev_dimid)
if (ierr /= PIO_NOERR) then
ierr = PIO_Inq_DimID(File, 'reference_pressure_in_atmosphere_layer', lev_dimid)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find lev dimension in ncdata or restart file.')
end if
end if
ierr = PIO_Inq_dimlen(File, lev_dimid, flev)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Failed to inquire dimension length of flev in ncdata or restart file.')
end if
if (pver /= flev) then
write(iulog,*) routine//': ERROR: file lev does not match model. lev (file, model):',flev, pver
call endrun(routine//': ERROR: file lev does not match model.')
end if

ierr = PIO_Inq_DimID(File, 'ilev', lev_dimid)
if (ierr /= PIO_NOERR) then
ierr = PIO_Inq_DimID(File, 'reference_pressure_in_atmosphere_layer_at_interfaces', lev_dimid)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find ilev dimension in ncdata or restart file')
end if
end if
ierr = PIO_Inq_dimlen(File, lev_dimid, filev)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Failed to inquire dimension length of filev in ncdata or restart file.')
end if
if (pverp /= filev) then
write(iulog,*) routine//':ERROR: file ilev does not match model ilev (file, model):',filev, pverp
call endrun(routine//':ERROR: file ilev does not match model.')
end if

ierr = pio_inq_varid(File, 'hyai', hyai_desc)
if (ierr /= PIO_NOERR) then
ierr = pio_inq_varid(File, 'sigma_pressure_hybrid_coordinate_a_coefficient_at_interfaces', hyai_desc)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find hyai variable in ncdata or restart file')
end if
end if

ierr = pio_inq_varid(File, 'hyam', hyam_desc)
if (ierr /= PIO_NOERR) then
ierr = pio_inq_varid(File, 'sigma_pressure_hybrid_coordinate_a_coefficient', hyam_desc)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find hyam variable in ncdata or restart file')
end if
end if

ierr = pio_inq_varid(File, 'hybi', hybi_desc)
if (ierr /= PIO_NOERR) then
ierr = pio_inq_varid(File, 'sigma_pressure_hybrid_coordinate_b_coefficient_at_interfaces', hybi_desc)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find hybi variable in ncdata or restart file')
end if
end if

ierr = pio_inq_varid(File, 'hybm', hybm_desc)
if (ierr /= PIO_NOERR) then
ierr = pio_inq_varid(File, 'sigma_pressure_hybrid_coordinate_b_coefficient', hybm_desc)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: unable to find hybm variable in ncdata or restart file')
end if
end if

ierr = pio_get_var(File, hyai_desc, hyai)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Unable to get hyai variable in ncdata or restart file.')
end if
ierr = pio_get_var(File, hybi_desc, hybi)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Unable to get hybi variable in ncdata or restart file.')
end if
ierr = pio_get_var(File, hyam_desc, hyam)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Unable to get hyam variable in ncdata or restart file.')
end if
ierr = pio_get_var(File, hybm_desc, hybm)
if (ierr /= PIO_NOERR) then
call endrun(routine//': ERROR: Unable to get hybm variable in ncdata or restart file.')
end if

if (masterproc) then
write(iulog,*) routine//': read hyai, hybi, hyam, hybm'
end if

! Check whether file contains value for P0. If it does then use it

! Set PIO to return error codes.
call pio_seterrorhandling(file, PIO_BCAST_ERROR, pio_errtype)

ierr = pio_inq_varid(file, 'P0', p0_desc)
if (ierr /= PIO_NOERR) then
ierr = pio_inq_varid(File, 'surface_reference_pressure', p0_desc)
end if
if (ierr == PIO_NOERR) then
ierr = pio_get_var(file, p0_desc, ps0)
if (ierr /= PIO_NOERR) then
Expand Down
13 changes: 13 additions & 0 deletions src/dynamics/utils/hycoef.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ccpp-table-properties]
name = hycoef
type = module
[ccpp-arg-table]
name = hycoef
type = module

[ etamid ]
standard_name = sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient
type = real | kind = kind_phys
units = 1
dimensions = (vertical_layer_dimension)

Loading

0 comments on commit 1838d66

Please sign in to comment.