Skip to content

Commit 4c56e8e

Browse files
committed
Merge branch 'cam_development' into vertical-diffusion-refactor
2 parents ec5fe1e + ddacf0f commit 4c56e8e

File tree

4 files changed

+112
-31
lines changed

4 files changed

+112
-31
lines changed

cime

Submodule cime updated 55 files

doc/ChangeLog

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
===============================================================
22

3+
Tag name: cam6_4_042
4+
Originator(s): pel, nusbaume
5+
Date: Oct 9, 2024
6+
One-line Summary: Fix reference pressures in MPAS
7+
Github PR URL: https://github.com/ESCOMP/CAM/pull/1169
8+
9+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
10+
- https://github.com/ESCOMP/CAM/issues/1168
11+
12+
Describe any changes made to build system: N/A
13+
14+
Describe any changes made to the namelist: N/A
15+
16+
List any changes to the defaults for the boundary datasets: N/A
17+
18+
Describe any substantial timing or memory changes: N/A
19+
20+
Code reviewed by: nusbaume
21+
22+
List all files eliminated: N/A
23+
24+
List all files added and what they do: N/A
25+
26+
List all existing files that have been modified, and describe the changes:
27+
28+
M src/dynamics/mpas/dyn_grid.F90
29+
M src/utils/std_atm_profile.F90
30+
- Use CAM reference pressure instead of standard atmosphere surface pressure.
31+
32+
If there were any failures reported from running test_driver.sh on any test
33+
platform, and checkin with these failures has been OK'd by the gatekeeper,
34+
then copy the lines from the td.*.status files for the failed tests to the
35+
appropriate machine below. All failed tests must be justified.
36+
37+
derecho/intel/aux_cam:
38+
39+
ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
40+
SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF)
41+
- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856
42+
43+
ERP_Ln9_P24x3.f45_f45_mg37.QPWmaC6.derecho_intel.cam-outfrq9s_mee_fluxes (Overall: PEND)
44+
ERS_Ld3.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam7 (Overall: PEND)
45+
ERS_Ln9_P36x1.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (Overall: PEND)
46+
SMS_Lm13.f10_f10_mg37.F2000climo.derecho_intel.cam-outfrq1m (Overall: PEND)
47+
- pre-existing failures due to resource limits due to being switched to run in the 'develop' queue rather than 'main'
48+
49+
SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: PEND)
50+
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: PEND)
51+
- pre-existing failures due to build-namelist error requiring CLM/CTSM external update.
52+
53+
ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF)
54+
- Expected answer change due to bug-fix in MPAS surface reference pressure.
55+
56+
derecho/nvhpc/aux_cam: ALL PASS
57+
58+
izumi/nag/aux_cam:
59+
60+
DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL)
61+
- pre-existing failure -- issue #670
62+
63+
ERC_D_Ln9.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF)
64+
- Expected answer change due to bug-fix in MPAS surface reference pressure.
65+
66+
izumi/gnu/aux_cam: ALL PASS
67+
68+
Summarize any changes to answers: all MPAS tests will likely fail against baselines
69+
70+
===============================================================
71+
372
Tag name: cam6_4_041
473
Originator(s): fvitt
574
Date: 16 Oct 2024

src/dynamics/mpas/dyn_grid.F90

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ subroutine dyn_grid_init()
105105
! coupling code requires constructing global fields for the cell center
106106
! grid which is used by the physics parameterizations.
107107

108+
use hycoef, only: ps0
108109
use ref_pres, only: ref_pres_init
109110
use std_atm_profile, only: std_atm_pres
110111
use time_manager, only: get_step_size
@@ -141,7 +142,7 @@ subroutine dyn_grid_init()
141142
ierr = pio_get_att(fh_ini, pio_global, 'sphere_radius', sphere_radius)
142143

143144
! Compute reference pressures from reference heights.
144-
call std_atm_pres(zw, pref_edge)
145+
call std_atm_pres(zw, pref_edge, user_specified_ps=ps0)
145146
pref_mid = (pref_edge(1:plev) + pref_edge(2:plevp)) * 0.5_r8
146147

147148
num_pr_lev = 0
@@ -173,7 +174,7 @@ subroutine dyn_grid_init()
173174
! centered grid is used by the physics parameterizations. The physics
174175
! decomposition of the cell centered grid is defined in phys_grid_init.
175176
call define_cam_grids()
176-
177+
177178
end subroutine dyn_grid_init
178179

179180
!=========================================================================================
@@ -380,7 +381,7 @@ integer function get_dyn_grid_parm(name) result(ival)
380381
ival = nCells_g
381382
else if(name == 'plev') then
382383
ival = plev
383-
else
384+
else
384385
ival = -1
385386
end if
386387

@@ -428,7 +429,7 @@ subroutine dyn_grid_get_elem_coords(ie, rlon, rlat, cdex )
428429
! for a field on a dynamics decomposition. The code in hbuf_accum_addlcltime appears
429430
! to also assume that the field is on the physics grid since there is no argument
430431
! passed to specify which dynamics grid the coordinates are for.
431-
432+
432433
call endrun(subname//': not implemented for the MPAS grids')
433434

434435
end subroutine dyn_grid_get_elem_coords
@@ -545,7 +546,7 @@ subroutine define_cam_grids()
545546
use cam_grid_support, only: horiz_coord_t, horiz_coord_create, iMap
546547
use cam_grid_support, only: cam_grid_register, cam_grid_attribute_register
547548
use shr_const_mod, only: PI => SHR_CONST_PI
548-
549+
549550
! Local variables
550551
integer :: i, j
551552

@@ -600,7 +601,7 @@ subroutine define_cam_grids()
600601
'degrees_north', 1, nCellsSolve, latCell(1:nCellsSolve)*rad2deg, map=gidx)
601602
lon_coord => horiz_coord_create('lonCell', 'nCells', nCells_g, 'longitude', &
602603
'degrees_east', 1, nCellsSolve, lonCell(1:nCellsSolve)*rad2deg, map=gidx)
603-
604+
604605
allocate(areaWeight(nCellsSolve), stat=ierr)
605606
if( ierr /= 0 ) call endrun(subname//':failed to allocate area_weight :'//int2str(__LINE__))
606607
call get_dyn_grid_info(hdim1_d, hdim2_d, num_levels, index_model_top_layer, index_surface_layer, unstructured, dyn_cols)
@@ -667,7 +668,7 @@ subroutine define_cam_grids()
667668
'degrees_north', 1, nEdgesSolve, latEdge(1:nEdgesSolve)*rad2deg, map=gidx)
668669
lon_coord => horiz_coord_create('lonEdge', 'nEdges', nEdges_g, 'longitude', &
669670
'degrees_east', 1, nEdgesSolve, lonEdge(1:nEdgesSolve)*rad2deg, map=gidx)
670-
671+
671672
! Map for edge node grid
672673
allocate(grid_map(3, nEdgesSolve), stat=ierr)
673674
if( ierr /= 0 ) call endrun(subname//':failed to allocate grid_map array at line:'//int2str(__LINE__))
@@ -704,7 +705,7 @@ subroutine define_cam_grids()
704705
'degrees_north', 1, nVerticesSolve, latVertex(1:nVerticesSolve)*rad2deg, map=gidx)
705706
lon_coord => horiz_coord_create('lonVertex', 'nVertices', nVertices_g, 'longitude', &
706707
'degrees_east', 1, nVerticesSolve, lonVertex(1:nVerticesSolve)*rad2deg, map=gidx)
707-
708+
708709
! Map for vertex node grid
709710
allocate(grid_map(3, nVerticesSolve), stat=ierr)
710711
if( ierr /= 0 ) call endrun(subname//':failed to allocate grid_map array at line:'//int2str(__LINE__))
@@ -723,7 +724,7 @@ subroutine define_cam_grids()
723724
nullify(grid_map)
724725
nullify(lat_coord)
725726
nullify(lon_coord)
726-
727+
727728
end subroutine define_cam_grids
728729

729730
end module dyn_grid

src/utils/std_atm_profile.F90

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,33 @@ module std_atm_profile
4747
real(r8), parameter :: g0 = 9.80665_r8 ! gravitational acceleration (m/s^2)
4848
real(r8), parameter :: mw = 0.0289644_r8 ! molar mass of dry air (kg/mol)
4949
real(r8), parameter :: c1 = g0*mw/rg
50-
50+
5151
!=========================================================================================
5252
CONTAINS
5353
!=========================================================================================
5454

55-
subroutine std_atm_pres(height, pstd)
56-
55+
subroutine std_atm_pres(height, pstd, user_specified_ps)
56+
5757
! arguments
58-
real(r8), intent(in) :: height(:) ! height above sea level in meters
59-
real(r8), intent(out) :: pstd(:) ! std pressure in Pa
60-
61-
integer :: i, ii, k, nlev
58+
real(r8), intent(in) :: height(:) ! height above sea level in meters
59+
real(r8), intent(out) :: pstd(:) ! std pressure in Pa
60+
real(r8), optional, intent(in) :: user_specified_ps
61+
62+
integer :: i, ii, k, nlev
63+
integer :: ierr
64+
real(r8) :: pb_local(nreg)
65+
6266
character(len=*), parameter :: routine = 'std_atm_pres'
6367
!----------------------------------------------------------------------------
64-
68+
69+
! Initialize local standard pressure values array
70+
pb_local = pb
71+
72+
! Set new surface pressure value if provided by the caller
73+
if (present(user_specified_ps)) then
74+
pb_local(1) = user_specified_ps
75+
end if
76+
6577
nlev = size(height)
6678
do k = 1, nlev
6779
if (height(k) < 0.0_r8) then
@@ -76,33 +88,32 @@ subroutine std_atm_pres(height, pstd)
7688
end if
7789
end do find_region
7890
end if
79-
91+
8092
if (lb(ii) /= 0._r8) then
81-
pstd(k) = pb(ii) * ( tb(ii) / (tb(ii) + lb(ii)*(height(k) - hb(ii)) ) )**(c1/lb(ii))
93+
pstd(k) = pb_local(ii) * ( tb(ii) / (tb(ii) + lb(ii)*(height(k) - hb(ii)) ) )**(c1/lb(ii))
8294
else
83-
pstd(k) = pb(ii) * exp( -c1*(height(k) - hb(ii))/tb(ii) )
95+
pstd(k) = pb_local(ii) * exp( -c1*(height(k) - hb(ii))/tb(ii) )
8496
end if
85-
86-
end do
8797

98+
end do
8899
end subroutine std_atm_pres
89100

90101
!=========================================================================================
91102

92103
subroutine std_atm_height(pstd, height)
93-
104+
94105
! arguments
95106
real(r8), intent(in) :: pstd(:) ! std pressure in Pa
96107
real(r8), intent(out) :: height(:) ! height above sea level in meters
97-
108+
98109
integer :: i, ii, k, nlev
99110
logical :: found_region
100111
character(len=*), parameter :: routine = 'std_atm_height'
101112
!----------------------------------------------------------------------------
102-
113+
103114
nlev = size(height)
104115
do k = 1, nlev
105-
116+
106117
if (pstd(k) <= pb(nreg)) then
107118
ii = nreg
108119
else if (pstd(k) > pb(1)) then
@@ -129,16 +140,16 @@ end subroutine std_atm_height
129140
!=========================================================================================
130141

131142
subroutine std_atm_temp(height, temp)
132-
143+
133144
! arguments
134145
real(r8), intent(in) :: height(:) ! std pressure in Pa
135146
real(r8), intent(out) :: temp(:) ! temperature
136-
147+
137148
! local vars
138149
integer :: i, ii, k, nlev
139150
character(len=*), parameter :: routine = 'std_atm_temp'
140151
!----------------------------------------------------------------------------
141-
152+
142153
nlev = size(height)
143154
do k = 1, nlev
144155
if (height(k) < 0.0_r8) then
@@ -158,7 +169,7 @@ subroutine std_atm_temp(height, temp)
158169
else
159170
temp(k) = tb(ii)
160171
end if
161-
172+
162173
end do
163174

164175
end subroutine std_atm_temp

0 commit comments

Comments
 (0)