Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap MPAS longitude values to [0,2pi) range #23

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
===============================================================

Tag name:
Originator(s): gdicker
Date: Jul 18, 2024
One-line Summary: Address run failures due to MPAS-A longitudes
Github PR URL: https://github.com/ESCOMP/CAM/pull/1095

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- Wrap MPAS-A longitudes to [0,2pi) range: https://github.com/ESCOMP/CAM/issues/1094

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

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

Describe any substantial timing or memory changes: N/A

Code reviewed by:

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
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,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

izumi/nag/aux_cam:

izumi/gnu/aux_cam:

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

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: cam6_3_148
Originator(s): brianpm, courtneyp, eaton
Date: Wed 21 Feb 2024
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