Skip to content

Commit cd652c3

Browse files
committed
Merge branch 'hotfix-v8.0.1'
This merge corrects several issues in the MPAS-Atmosphere model, specifically: * Fix an OpenMP error in the deallocation of an array (rthdynten) when neither the Grell-Freitas nor the Tiedtke/nTiedtke cumulus schemes are used. * Fix a compilation issue due to a missing include path for the physics_mmm directory when certain Fortran compilers are used. * Fix an issue in reading real-valued global attributes from input files with SMIOL when the input file is of a different precision than the compiled precision of MPAS. * Fix a memory leak for the recloud_p, reice_p, and resnow_p arrays in the deallocate_microphysics routine. * Correct the units and description for the rt_diabatic_tend, pv_vertex, pv_edge, and pv_cell variables in the atmosphere core's Registry.xml file.
2 parents 1d6ec7c + 2bfdc6b commit cd652c3

File tree

13 files changed

+83
-87
lines changed

13 files changed

+83
-87
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v8.0.0
1+
MPAS-v8.0.1
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

src/core_atmosphere/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ clean:
7979
$(RM) $@ $*.mod
8080
ifeq "$(GEN_F90)" "true"
8181
$(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) -I./inc $< > $*.f90
82-
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I../external/esmf_time_f90
82+
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I../external/esmf_time_f90
8383
else
84-
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I../external/esmf_time_f90
84+
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I../external/esmf_time_f90
8585
endif

src/core_atmosphere/Registry.xml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="8.0.0">
2+
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="8.0.1">
33

44
<!-- **************************************************************************************** -->
55
<!-- ************************************** Dimensions ************************************** -->
@@ -1634,20 +1634,20 @@
16341634
<var name="vorticity" type="real" dimensions="nVertLevels nVertices Time" units="s^{-1}"
16351635
description="Relative vorticity at vertices"/>
16361636

1637-
<var name="pv_edge" type="real" dimensions="nVertLevels nEdges Time" units="s^{-1} kg^{-1} m^3"
1638-
description="absolute vorticity/rho_zz averaged to the cell edge from the vertices"/>
1637+
<var name="pv_edge" type="real" dimensions="nVertLevels nEdges Time" units="s^{-1}"
1638+
description="absolute vertical vorticity averaged to the cell edge from the vertices"/>
16391639

16401640
<var name="rho_edge" type="real" dimensions="nVertLevels nEdges Time" units="kg m^{-3}"
16411641
description="rho_zz averaged from cell centers to the cell edge"/>
16421642

16431643
<var name="ke" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-2}"
16441644
description="Kinetic energy at a cell center"/>
16451645

1646-
<var name="pv_vertex" type="real" dimensions="nVertLevels nVertices Time" units="s^{-1} kg^{-1} m^3"
1647-
description="absolute vorticity/rho_zz at a vertex"/>
1646+
<var name="pv_vertex" type="real" dimensions="nVertLevels nVertices Time" units="s^{-1}"
1647+
description="absolute vertical vorticity at a vertex"/>
16481648

1649-
<var name="pv_cell" type="real" dimensions="nVertLevels nCells Time" units="s^{-1} kg^{-1} m^3"
1650-
description="absolute vorticity/rho_zz averaged to the cell center from the vertices"/>
1649+
<var name="pv_cell" type="real" dimensions="nVertLevels nCells Time" units="s^{-1}"
1650+
description="absolute vertical vorticity averaged to the cell center from the vertices"/>
16511651

16521652
<var name="dtheta_dt_mp" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
16531653
description="Potential temperature heating rate from microphysics"/>
@@ -1791,8 +1791,8 @@
17911791
<var name="tend_theta" name_in_code="theta_m" type="real" dimensions="nVertLevels nCells Time" units="kg K m^{-3} s^{-1}"
17921792
description="tendency of coupled potential temperature rho*theta_m/zz from dynamics and physics, updated each RK step"/>
17931793

1794-
<var name="rt_diabatic_tend" type="real" dimensions="nVertLevels nCells Time" units="kg K s^{-1}"
1795-
description="Tendency of coupled potential temperature from physics"/>
1794+
<var name="rt_diabatic_tend" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
1795+
description="Tendency of modified potential temperature due to cloud microphysics"/>
17961796

17971797
<var name="euler_tend_u" name_in_code="u_euler" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-2}"
17981798
description="Tendency of u from dynamics"/>
@@ -2962,6 +2962,9 @@
29622962
description="Total dry air tendency from physics"
29632963
persistence="scratch" />
29642964

2965+
<var name="rthdynten" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
2966+
description="tendency of temperature due to horizontal and vertical advections"/>
2967+
29652968
<!-- Scratch variables used when propagating cell-centered winds to edges -->
29662969
<var name="tend_uzonal" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1} s^{-1}"
29672970
description="Total cell-centered zonal wind tendency from physics"
@@ -3007,10 +3010,6 @@
30073010
description="tendency of water vapor due to horizontal and vertical advections"
30083011
packages="cu_grell_freitas_in;cu_tiedtke_in"/>
30093012

3010-
<var name="rthdynten" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
3011-
description="tendency of temperature due to horizontal and vertical advections"
3012-
packages="cu_grell_freitas_in;cu_tiedtke_in"/>
3013-
30143013
<var name="rucuten" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1} s^{-1}"
30153014
description="tendency of zonal wind due to cumulus convection"
30163015
packages="cu_grell_freitas_in;cu_tiedtke_in"/>

src/core_atmosphere/dynamics/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ clean:
2020
$(RM) $@ $*.mod
2121
ifeq "$(GEN_F90)" "true"
2222
$(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) $< > $*.f90
23-
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../../external/esmf_time_f90
23+
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90
2424
else
25-
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../../external/esmf_time_f90
25+
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I.. -I../../framework -I../../operators -I../physics -I../physics/physics_wrf -I../physics/physics_mmm -I../../external/esmf_time_f90
2626
endif

src/core_atmosphere/dynamics/mpas_atm_time_integration.F

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group)
11421142
call mpas_pool_get_array(tend_physics, 'rqvdynten', rqvdynten)
11431143
call mpas_pool_get_array(state, 'theta_m', theta_m, 2)
11441144

1145-
if (associated(tend_physics)) then
1146-
call mpas_pool_get_array(tend_physics, 'rthdynten', rthdynten)
1147-
end if
1145+
call mpas_pool_get_array(tend_physics, 'rthdynten', rthdynten)
11481146

11491147
!NOTE: The calculation of the tendency due to horizontal and vertical advection for the water vapor mixing ratio
11501148
!requires that the subroutine atm_advance_scalars_mono was called on the third Runge Kutta step, so that a halo
@@ -3888,7 +3886,7 @@ subroutine atm_compute_dyn_tend(tend, tend_physics, state, diag, mesh, configs,
38883886
38893887
real (kind=RKIND), dimension(:,:), pointer :: rr_save
38903888
3891-
real (kind=RKIND), dimension(:,:), pointer :: rthdynten => null()
3889+
real (kind=RKIND), dimension(:,:), pointer :: rthdynten
38923890
38933891
real (kind=RKIND), dimension(:,:,:), pointer :: scalars
38943892
@@ -3931,8 +3929,6 @@ subroutine atm_compute_dyn_tend(tend, tend_physics, state, diag, mesh, configs,
39313929
real (kind=RKIND), pointer :: config_rayleigh_damp_u_timescale_days
39323930
integer, pointer :: config_number_rayleigh_damp_u_levels, config_number_cam_damping_levels
39333931
3934-
logical :: inactive_rthdynten
3935-
39363932
39373933
call mpas_pool_get_config(mesh, 'sphere_radius', r_earth)
39383934
call mpas_pool_get_config(configs, 'config_coef_3rd_order', coef_3rd_order)
@@ -3982,9 +3978,7 @@ subroutine atm_compute_dyn_tend(tend, tend_physics, state, diag, mesh, configs,
39823978
call mpas_pool_get_array(diag, 'h_divergence', h_divergence)
39833979
call mpas_pool_get_array(diag, 'exner', exner)
39843980
3985-
if (associated(tend_physics)) then
3986-
call mpas_pool_get_array(tend_physics, 'rthdynten', rthdynten)
3987-
end if
3981+
call mpas_pool_get_array(tend_physics, 'rthdynten', rthdynten)
39883982
39893983
call mpas_pool_get_array(mesh, 'weightsOnEdge', weightsOnEdge)
39903984
call mpas_pool_get_array(mesh, 'cellsOnEdge', cellsOnEdge)
@@ -4061,18 +4055,6 @@ subroutine atm_compute_dyn_tend(tend, tend_physics, state, diag, mesh, configs,
40614055
call mpas_pool_get_array(mesh, 'cf2', cf2)
40624056
call mpas_pool_get_array(mesh, 'cf3', cf3)
40634057
4064-
!
4065-
! rthdynten is currently associated with packages, and if those packages
4066-
! are not active at run-time, we need to produce an rthdynten array for
4067-
! use in the atm_compute_dyn_tend_work routine
4068-
!
4069-
inactive_rthdynten = .false.
4070-
if (.not. associated(rthdynten)) then
4071-
allocate(rthdynten(nVertLevels,nCells+1))
4072-
rthdynten(:,nCells+1) = 0.0_RKIND
4073-
inactive_rthdynten = .true.
4074-
end if
4075-
40764058
call atm_compute_dyn_tend_work(nCells, nEdges, nVertices, nVertLevels, &
40774059
nCellsSolve, nEdgesSolve, vertexDegree, maxEdges, maxEdges2, num_scalars, moist_start, moist_end, &
40784060
fEdge, dvEdge, dcEdge, invDcEdge, invDvEdge, invAreaCell, invAreaTriangle, meshScalingDel2, meshScalingDel4, &
@@ -4094,10 +4076,6 @@ subroutine atm_compute_dyn_tend(tend, tend_physics, state, diag, mesh, configs,
40944076
cellStart, cellEnd, vertexStart, vertexEnd, edgeStart, edgeEnd, &
40954077
cellSolveStart, cellSolveEnd, vertexSolveStart, vertexSolveEnd, edgeSolveStart, edgeSolveEnd)
40964078
4097-
if (inactive_rthdynten) then
4098-
deallocate(rthdynten)
4099-
end if
4100-
41014079
end subroutine atm_compute_dyn_tend
41024080
41034081

src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ subroutine deallocate_microphysics(configs)
216216
if(allocated(graupelncv_p) ) deallocate(graupelncv_p )
217217

218218
!cloud water,cloud ice,and snow effective radii:
219-
if(.not.allocated(recloud_p) ) allocate(recloud_p(ims:ime,kms:kme,jms:jme) )
220-
if(.not.allocated(reice_p) ) allocate(reice_p(ims:ime,kms:kme,jms:jme) )
221-
if(.not.allocated(resnow_p) ) allocate(resnow_p(ims:ime,kms:kme,jms:jme) )
219+
if(allocated(recloud_p) ) deallocate(recloud_p )
220+
if(allocated(reice_p) ) deallocate(reice_p )
221+
if(allocated(resnow_p) ) deallocate(resnow_p )
222222

223223
microp2_select: select case(microp_scheme)
224224

src/core_init_atmosphere/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="8.0.0">
2+
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="8.0.1">
33

44
<!-- **************************************************************************************** -->
55
<!-- ************************************** Dimensions ************************************** -->

src/core_landice/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="landice" core_abbrev="li" version="8.0.0">
2+
<registry model="mpas" core="landice" core_abbrev="li" version="8.0.1">
33

44

55
<!-- ======================================================================= -->

src/core_ocean/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="ocean" core_abbrev="ocn" version="8.0.0">
2+
<registry model="mpas" core="ocean" core_abbrev="ocn" version="8.0.1">
33

44
<dims>
55
<dim name="nCells" units="unitless"

src/core_seaice/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<registry model="mpas" core="seaice" core_abbrev="seaice" version="8.0.0">
2+
<registry model="mpas" core="seaice" core_abbrev="seaice" version="8.0.1">
33

44
<dims>
55
<dim name="nCells"

0 commit comments

Comments
 (0)