Skip to content

Commit 849b1d8

Browse files
authored
Merge pull request #1338 from kuanchihwang/staging/mpas-dycore-var-output
cam6_4_106: Add "_mpas" suffix and use "ncol" dimension for MPAS-specific output variables
2 parents 634c489 + 2fa9a6c commit 849b1d8

File tree

2 files changed

+128
-41
lines changed

2 files changed

+128
-41
lines changed

doc/ChangeLog

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

3+
Tag name: cam6_4_106
4+
Originator(s): kuanchihwang
5+
Date: July 23, 2025
6+
One-line Summary: Add "_mpas" suffix and use "ncol" dimension for MPAS-specific output variables
7+
Github PR URL: https://github.com/ESCOMP/CAM/pull/1338
8+
9+
Purpose of changes (include the issue number and title text for each relevant GitHub issue):
10+
11+
This PR changes how MPAS-specific output variables are written to history files:
12+
13+
1. Add the "_mpas" suffix, making it clear that these variables are specific to MPAS and
14+
are different from the standard CAM ones.
15+
2. Change the dimension name from "nCells" to "ncol", improving the compatibility with
16+
certain tools like ncremap from NetCDF Operator.
17+
18+
Restart files are not affected.
19+
20+
Closes #1323 (MPAS outputs w, theta, and rho)
21+
22+
Describe any changes made to build system:
23+
24+
None
25+
26+
Describe any changes made to the namelist:
27+
28+
None
29+
30+
List any changes to the defaults for the boundary datasets:
31+
32+
None
33+
34+
Describe any substantial timing or memory changes:
35+
36+
None
37+
38+
Code reviewed by:
39+
40+
PeterHjortLauritzen, cacraigucar
41+
42+
List all files eliminated:
43+
44+
None
45+
46+
List all files added and what they do:
47+
48+
None
49+
50+
List all existing files that have been modified, and describe the changes:
51+
52+
M src/dynamics/mpas/stepon.F90
53+
* Add the "_mpas" suffix to MPAS-specific output variables
54+
* Change the dimension name of MPAS-specific output variables from "nCells" to "ncol"
55+
56+
If there were any failures reported from running test_driver.sh on any test
57+
platform, and checkin with these failures has been OK'd by the gatekeeper,
58+
then copy the lines from the td.*.status files for the failed tests to the
59+
appropriate machine below. All failed tests must be justified.
60+
61+
derecho/intel/aux_cam:
62+
63+
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
64+
FAIL SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s SETUP
65+
* Pre-existing failures due to build-namelist error requiring CLM/CTSM external update
66+
67+
derecho/nvhpc/aux_cam:
68+
69+
All pass
70+
71+
izumi/nag/aux_cam:
72+
73+
All pass
74+
75+
izumi/gnu/aux_cam:
76+
77+
All pass
78+
79+
CAM tag used for the baseline comparison tests if different than previous
80+
tag:
81+
82+
cam6_4_105
83+
84+
Summarize any changes to answers:
85+
86+
None
87+
88+
===============================================================
89+
390
Tag name: cam6_4_105
491
Originator(s): eaton
592
Date: 22 July 2025

src/dynamics/mpas/stepon.F90

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,27 @@ subroutine stepon_init(dyn_in, dyn_out)
5252
!----------------------------------------------------------------------------
5353

5454
! dycore state variables on MPAS grids
55-
call addfld ('u', (/ 'lev' /), 'A', 'm/s', 'normal velocity at edges', gridname='mpas_edge')
56-
call addfld ('w', (/ 'ilev' /), 'A', 'm/s', 'vertical velocity', gridname='mpas_cell')
57-
call addfld ('theta', (/ 'lev' /), 'A', 'K', 'potential temperature', gridname='mpas_cell')
58-
call addfld ('rho', (/ 'lev' /), 'A', 'kg/m^3', 'dry air density', gridname='mpas_cell')
59-
call addfld ('qv', (/ 'lev' /), 'A', 'kg/kg', 'water vapor dry mmr', gridname='mpas_cell')
60-
call addfld ('uReconstructZonal', (/ 'lev' /), 'A', 'm/s', &
61-
'zonal velocity at cell centers', gridname='mpas_cell')
62-
call addfld ('uReconstructMeridional', (/ 'lev' /), 'A', 'm/s', &
63-
'meridional velocity at cell centers', gridname='mpas_cell')
64-
call addfld ('divergence', (/ 'lev' /), 'A', '1/s', &
65-
'Horizontal velocity divergence at cell center', gridname='mpas_cell')
66-
call addfld ('vorticity', (/ 'lev' /), 'A', '1/s', &
55+
call addfld ('u_mpas', (/ 'lev' /), 'A', 'm/s', 'normal velocity at edges', gridname='mpas_edge')
56+
call addfld ('w_mpas', (/ 'ilev' /), 'A', 'm/s', 'vertical velocity', gridname='cam_cell')
57+
call addfld ('theta_mpas', (/ 'lev' /), 'A', 'K', 'potential temperature', gridname='cam_cell')
58+
call addfld ('rho_mpas', (/ 'lev' /), 'A', 'kg/m^3', 'dry air density', gridname='cam_cell')
59+
call addfld ('qv_mpas', (/ 'lev' /), 'A', 'kg/kg', 'water vapor dry mmr', gridname='cam_cell')
60+
call addfld ('uReconstructZonal_mpas', (/ 'lev' /), 'A', 'm/s', &
61+
'zonal velocity at cell centers', gridname='cam_cell')
62+
call addfld ('uReconstructMeridional_mpas', (/ 'lev' /), 'A', 'm/s', &
63+
'meridional velocity at cell centers', gridname='cam_cell')
64+
call addfld ('divergence_mpas', (/ 'lev' /), 'A', '1/s', &
65+
'Horizontal velocity divergence at cell center', gridname='cam_cell')
66+
call addfld ('vorticity_mpas', (/ 'lev' /), 'A', '1/s', &
6767
'Relative vorticity at vertices', gridname='mpas_vertex')
6868

6969
! physics forcings on MPAS grids
70-
call addfld ('ru_tend', (/ 'lev' /), 'A', 'kg/m^2/s', &
70+
call addfld ('ru_tend_mpas', (/ 'lev' /), 'A', 'kg/m^2/s', &
7171
'physics tendency of normal horizontal momentum', gridname='mpas_edge')
72-
call addfld ('rtheta_tend', (/ 'lev' /), 'A', 'kg K/m^3/s', &
73-
'physics tendency of rho*theta/zz', gridname='mpas_cell')
74-
call addfld ('rho_tend', (/ 'lev' /), 'A', 'kg/m^3/s', &
75-
'physics tendency of dry air density', gridname='mpas_cell')
72+
call addfld ('rtheta_tend_mpas', (/ 'lev' /), 'A', 'kg K/m^3/s', &
73+
'physics tendency of rho*theta/zz', gridname='cam_cell')
74+
call addfld ('rho_tend_mpas', (/ 'lev' /), 'A', 'kg/m^3/s', &
75+
'physics tendency of dry air density', gridname='cam_cell')
7676

7777
! get aerosol properties
7878
aero_props_obj => aerosol_properties_object()
@@ -235,7 +235,7 @@ subroutine write_dynvar(dyn_out)
235235
nVerticesSolve = dyn_out%nVerticesSolve
236236
qv_idx = dyn_out%index_qv
237237

238-
if (hist_fld_active('u')) then
238+
if (hist_fld_active('u_mpas')) then
239239
allocate(arr2d(nEdgesSolve,plev), stat=ierr)
240240
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
241241
do k = 1, plev
@@ -244,11 +244,11 @@ subroutine write_dynvar(dyn_out)
244244
arr2d(i,k) = dyn_out%uperp(kk,i)
245245
end do
246246
end do
247-
call outfld('u', arr2d, nEdgesSolve, 1)
247+
call outfld('u_mpas', arr2d, nEdgesSolve, 1)
248248
deallocate(arr2d)
249249
end if
250250

251-
if (hist_fld_active('w')) then
251+
if (hist_fld_active('w_mpas')) then
252252
allocate(arr2d(nCellsSolve,plevp), stat=ierr)
253253
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
254254
do k = 1, plevp
@@ -257,76 +257,76 @@ subroutine write_dynvar(dyn_out)
257257
arr2d(i,k) = dyn_out%w(kk,i)
258258
end do
259259
end do
260-
call outfld('w', arr2d, nCellsSolve, 1)
260+
call outfld('w_mpas', arr2d, nCellsSolve, 1)
261261
deallocate(arr2d)
262262
end if
263263

264264
allocate(arr2d(nCellsSolve,plev), stat=ierr)
265265
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
266266

267-
if (hist_fld_active('theta')) then
267+
if (hist_fld_active('theta_mpas')) then
268268
do k = 1, plev
269269
kk = plev - k + 1
270270
do i = 1, nCellsSolve
271271
arr2d(i,k) = dyn_out%theta(kk,i)
272272
end do
273273
end do
274-
call outfld('theta', arr2d, nCellsSolve, 1)
274+
call outfld('theta_mpas', arr2d, nCellsSolve, 1)
275275
end if
276276

277-
if (hist_fld_active('rho')) then
277+
if (hist_fld_active('rho_mpas')) then
278278
do k = 1, plev
279279
kk = plev - k + 1
280280
do i = 1, nCellsSolve
281281
arr2d(i,k) = dyn_out%rho(kk,i)
282282
end do
283283
end do
284-
call outfld('rho', arr2d, nCellsSolve, 1)
284+
call outfld('rho_mpas', arr2d, nCellsSolve, 1)
285285
end if
286286

287-
if (hist_fld_active('qv')) then
287+
if (hist_fld_active('qv_mpas')) then
288288
do k = 1, plev
289289
kk = plev - k + 1
290290
do i = 1, nCellsSolve
291291
arr2d(i,k) = dyn_out%tracers(qv_idx,kk,i)
292292
end do
293293
end do
294-
call outfld('qv', arr2d, nCellsSolve, 1)
294+
call outfld('qv_mpas', arr2d, nCellsSolve, 1)
295295
end if
296296

297-
if (hist_fld_active('uReconstructZonal')) then
297+
if (hist_fld_active('uReconstructZonal_mpas')) then
298298
do k = 1, plev
299299
kk = plev - k + 1
300300
do i = 1, nCellsSolve
301301
arr2d(i,k) = dyn_out%ux(kk,i)
302302
end do
303303
end do
304-
call outfld('uReconstructZonal', arr2d, nCellsSolve, 1)
304+
call outfld('uReconstructZonal_mpas', arr2d, nCellsSolve, 1)
305305
end if
306306

307-
if (hist_fld_active('uReconstructMeridional')) then
307+
if (hist_fld_active('uReconstructMeridional_mpas')) then
308308
do k = 1, plev
309309
kk = plev - k + 1
310310
do i = 1, nCellsSolve
311311
arr2d(i,k) = dyn_out%uy(kk,i)
312312
end do
313313
end do
314-
call outfld('uReconstructMeridional', arr2d, nCellsSolve, 1)
314+
call outfld('uReconstructMeridional_mpas', arr2d, nCellsSolve, 1)
315315
end if
316316

317-
if (hist_fld_active('divergence')) then
317+
if (hist_fld_active('divergence_mpas')) then
318318
do k = 1, plev
319319
kk = plev - k + 1
320320
do i = 1, nCellsSolve
321321
arr2d(i,k) = dyn_out%divergence(kk,i)
322322
end do
323323
end do
324-
call outfld('divergence', arr2d, nCellsSolve, 1)
324+
call outfld('divergence_mpas', arr2d, nCellsSolve, 1)
325325
end if
326326

327327
deallocate(arr2d)
328328

329-
if (hist_fld_active('vorticity')) then
329+
if (hist_fld_active('vorticity_mpas')) then
330330
allocate(arr2d(nVerticesSolve,plev), stat=ierr)
331331
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
332332
do k = 1, plev
@@ -335,7 +335,7 @@ subroutine write_dynvar(dyn_out)
335335
arr2d(i,k) = dyn_out%vorticity(kk,i)
336336
end do
337337
end do
338-
call outfld('vorticity', arr2d, nVerticesSolve, 1)
338+
call outfld('vorticity_mpas', arr2d, nVerticesSolve, 1)
339339
deallocate(arr2d)
340340
end if
341341

@@ -369,7 +369,7 @@ subroutine write_forcings(dyn_in)
369369
nCellsSolve = dyn_in%nCellsSolve
370370
nEdgesSolve = dyn_in%nEdgesSolve
371371

372-
if (hist_fld_active('ru_tend')) then
372+
if (hist_fld_active('ru_tend_mpas')) then
373373
allocate(arr2d(nEdgesSolve,plev), stat=ierr)
374374
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
375375
do k = 1, plev
@@ -378,31 +378,31 @@ subroutine write_forcings(dyn_in)
378378
arr2d(i,k) = dyn_in%ru_tend(kk,i)
379379
end do
380380
end do
381-
call outfld('ru_tend', arr2d, nEdgesSolve, 1)
381+
call outfld('ru_tend_mpas', arr2d, nEdgesSolve, 1)
382382
deallocate(arr2d)
383383
end if
384384

385385
allocate(arr2d(nCellsSolve,plev), stat=ierr)
386386
if( ierr /= 0 ) call endrun(subname//':failed to allocate arr2d array at line:'//int2str(__LINE__))
387387

388-
if (hist_fld_active('rtheta_tend')) then
388+
if (hist_fld_active('rtheta_tend_mpas')) then
389389
do k = 1, plev
390390
kk = plev - k + 1
391391
do i = 1, nCellsSolve
392392
arr2d(i,k) = dyn_in%rtheta_tend(kk,i)
393393
end do
394394
end do
395-
call outfld('rtheta_tend', arr2d, nCellsSolve, 1)
395+
call outfld('rtheta_tend_mpas', arr2d, nCellsSolve, 1)
396396
end if
397397

398-
if (hist_fld_active('rho_tend')) then
398+
if (hist_fld_active('rho_tend_mpas')) then
399399
do k = 1, plev
400400
kk = plev - k + 1
401401
do i = 1, nCellsSolve
402402
arr2d(i,k) = dyn_in%rho_tend(kk,i)
403403
end do
404404
end do
405-
call outfld('rho_tend', arr2d, nCellsSolve, 1)
405+
call outfld('rho_tend_mpas', arr2d, nCellsSolve, 1)
406406
end if
407407

408408
deallocate(arr2d)

0 commit comments

Comments
 (0)