Skip to content

Commit

Permalink
Merge branch 'gdicker1/mpas_loncell_wrapto2pi' into add_v8mpasfiles (PR
Browse files Browse the repository at this point in the history
ESCOMP#1095)

These changes address run-time failures that were seen when using MPAS
ncdata with longitudes in the [-pi, pi] range in cases with non-simple
physics. The atmospheric state would become unphysical and fail.
  • Loading branch information
gdicker1 committed Sep 10, 2024
2 parents 1fcdd78 + 1325911 commit 87a4b80
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 20 deletions.
59 changes: 39 additions & 20 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
===============================================================

Tag name:
Tag name: cam6_4_033
Originator(s): gdicker1 ([email protected])
Date: Thu 05 Sep 2024
Date: Tue 10 Sep 2024
One-line Summary: Add updated meshes and topo for v8 MPAS-A dycore
Github PR URL: https://github.com/ESCOMP/CAM/pull/1029

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

#995 - Runs with MPAS-A dycore and CAM7 physics fail - missing variables in inic files
https://github.com/ESCOMP/CAM/issues/995
Add files created by v8 MPAS init_atmosphere model for frontogenesis fields
#995 - Runs with MPAS-A dycore and CAM7 physics fail - missing variables in inic files: https://github.com/ESCOMP/CAM/issues/995
#1094 - Wrap MPAS-A longitudes to [0,2pi) range: https://github.com/ESCOMP/CAM/issues/1094

Miscellaneous:

Describe any changes made to build system:
Describe any changes made to build system: N/A

Describe any changes made to the namelist:
Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: none
List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes:
Describe any substantial timing or memory changes: N/A

Code reviewed by:
Code reviewed by: adamrher, jtruesdal, cacraigucar, mgduda

List all files eliminated:
- mpasa120_L32_topo_coords_c201022.nc

Replaced by newer versions
Eliminated, replaced by newer versions:
- mpasa480_L32_notopo_coords_c201125.nc
- mpasa120_L32_notopo_coords_c201216.nc
- mpasa60_L32_notopo_coords_c230707.nc
Expand All @@ -39,7 +38,7 @@ Replaced by newer versions

List all files added and what they do:

New input 32, 58, and 93L without real-data (analytic-ICs only)
New input 32, 58, and 93L without real-data (analytic-ICs only):
- mpasa480_L32_notopo_coords_c240508.nc
- mpasa120_L32_notopo_coords_c240507.nc
- mpasa60_L32_notopo_coords_c240507.nc
Expand All @@ -53,25 +52,26 @@ New input 32, 58, and 93L without real-data (analytic-ICs only)
- mpasa60_L93_notopo_coords_c240814.nc
- mpasa30_L93_notopo_coords_c240814.nc

New input L70 file for waccm cases, simple chemistry
New input L70 file for waccm cases:
- mpasa120_L70.waccm_topography_SC_c240904.nc

New input data with topology and real-data ICs
New input data with topology and real-data ICs:
- cami_01-01-2000_00Z_mpasa480_L32_CFSR_c240508.nc
- cami_01-01-2000_00Z_mpasa120_L32_CFSR_c240508.nc
- cami_01-01-2000_00Z_mpasa480_L58_CFSR_c240814.nc
- cami_01-01-2000_00Z_mpasa120_L58_CFSR_c240814.nc
- cami_01-01-2000_00Z_mpasa480_L93_CFSR_c240814.nc
- cami_01-01-2000_00Z_mpasa120_L93_CFSR_c240814.nc

New bnd_topo files
New bnd_topo files:
- mpasa480_gmted2010_modis_bedmachine_nc3000_Laplace0400_noleak_20240507.nc
- mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240507.nc

List all existing files that have been modified, and describe the changes:

Add new ncdata and bnd_topo files above so they can be used
- bld/namelist_files/namelist_defaults_cam.xml
M bld/namelist_files/namelist_defaults_cam.xml
- Add new ncdata and bnd_topo files above so they can be used
M src/dynamics/mpas/dyn_grid.F90
- Modifies setup_time_invariant to ensure lonCell values are in [0,2pi) range

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,
Expand All @@ -87,7 +87,26 @@ izumi/gnu/aux_cam:
CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: None.
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:

===============================================================
===============================================================
Expand Down
14 changes: 14 additions & 0 deletions src/dynamics/mpas/dyn_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ subroutine setup_time_invariant(fh_ini)
type(mpas_pool_type), pointer :: meshPool
real(r8), pointer :: rdzw(:)
real(r8), allocatable :: dzw(:)
integer, pointer :: nCells
real(r8), dimension(:), pointer :: lonCell

integer :: k, kk
integer :: ierr
Expand All @@ -473,6 +475,7 @@ subroutine setup_time_invariant(fh_ini)
call mpas_pool_get_dimension(meshPool, 'nEdgesSolve', nEdgesSolve)
call mpas_pool_get_dimension(meshPool, 'nVerticesSolve', nVerticesSolve)
call mpas_pool_get_dimension(meshPool, 'nVertLevels', nVertLevelsSolve) ! MPAS always solves over the full column
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)

! check that number of vertical layers matches MPAS grid data
if (plev /= nVertLevelsSolve) then
Expand All @@ -482,6 +485,17 @@ subroutine setup_time_invariant(fh_ini)
') does not match plev ('//int2str(nVertLevelsSolve)//').')
end if

! Ensure longitudes are within the [0,2*pi) range, and only remap values that
! are outside the range. Some non-simple physics in CAM require this
! longitude range, the MPAS-A dycore does not require any specific range for
! lonCell
call mpas_pool_get_array(meshPool, 'lonCell', lonCell)
do k=1,nCells
if (lonCell(k) < 0._r8 .or. lonCell(k) >= (2._r8 * pi)) then
lonCell(k) = lonCell(k) - (2._r8 * pi) * floor(lonCell(k) / (2._r8 * pi))
end if
end do

! Initialize fields needed for reconstruction of cell-centered winds from edge-normal winds
! Note: This same pair of calls happens a second time later in the initialization of
! the MPAS-A dycore (in atm_mpas_init_block), but the redundant calls do no harm
Expand Down

0 comments on commit 87a4b80

Please sign in to comment.