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

Implement new tendency diagnostics package and significant revisions to PV diagnostics package in MPAS-A #1211

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a6eeeea
Framework for adding tendency diagnostics, updating PV diagnostics
theweathermanda May 24, 2024
47d1203
Check compatability between diagnostic configs and connect configs to…
theweathermanda May 24, 2024
022000f
Implementation of code for tendencies diagnostics
theweathermanda May 30, 2024
571bef9
Cleaned up Registry_tendencies.xml
theweathermanda Jul 2, 2024
7622e5d
Fix order of calls to timers
theweathermanda Jul 9, 2024
ae664a1
Halo framework for PV diags, calcs of PV and DT
theweathermanda Jul 9, 2024
713dfa1
For tendency package: update mpas_atmphys_todynamics.F
theweathermanda Jul 9, 2024
64b09cd
Implemented new PV tendency diagnostics
theweathermanda Jul 9, 2024
6eb006d
Remove tend_u_phys from Registry_pv.xml
theweathermanda Jul 9, 2024
bc2357c
Prevent writing pvbudget stream on restart
theweathermanda Jul 9, 2024
a32423c
Add pvbudget stream to defaults in Registry.xml
theweathermanda Jul 9, 2024
6796b74
Disable PV tend calcs at init; housekeeping items
theweathermanda Jul 9, 2024
522452f
Add theta, PV tendencies for specific Thompson microphysical processes
theweathermanda Jul 10, 2024
c3f55d6
MP var allocation if config_pv_microphys = .false.
theweathermanda Jul 10, 2024
4c8ce89
Bug fix: add missing call to config_pv_microphys
theweathermanda Jul 10, 2024
c3fb0f8
Cleaned up mpas_isobaric_diagnostics.F
theweathermanda Jul 10, 2024
5f53d23
Change diagnostics namelist option to default
theweathermanda Jul 10, 2024
bfddf5e
Added initialization and advection of pv_scalar
theweathermanda Jul 10, 2024
08b417c
Add isobaric interpolation of PV and PV tendencies
theweathermanda Jul 10, 2024
bea55b6
Add missing inStrato variable
theweathermanda Jul 13, 2024
e1157f3
Bug fix: add halo group for wCell;call in calc_epv
theweathermanda Jul 13, 2024
b9c3ec4
Bug fix: halos for intermediate wCell tend vars
theweathermanda Jul 13, 2024
0a252da
Bug fixes for pv_scalars, add depv_dt_scalar_adv
theweathermanda Oct 2, 2024
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
225 changes: 131 additions & 94 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@
<package name="limited_area" description="Limited-area simulations, which have lateral boundaries"/>
<package name="jedi_da" description="Data Assimilation in JEDI framework"/>
<package name="no_invariant_stream" description="No separate invariant I/O stream is active"/>

<package name="isobaric" description="Isobaric interpolation of model variables"/>
<package name="tendencies" description="Diagnostics tendency budget terms for winds, thetam and qv"/>
<package name="pv_diagnostics" description="Basic PV diagnostics calculations activated by config_pv_diag"/>
<package name="pv_tendencies" description="PV tendency calculations activated by config_pv_tend"/>
<package name="pv_scalar" description="PV scalar advection activated by config_pv_scalar"/>
<package name="pv_microphysics" description="PV microphysics process tendency calculations activated by config_pv_microphys"/>
<package name="pv_isobaric" description="Isobaric PV variable interpolation activated by config_pv_isobaric"/>
</packages>


Expand Down Expand Up @@ -911,27 +919,7 @@
<var name="uReconstructZonal"/>
<var name="uReconstructMeridional"/>

<!-- Begin Ertel PV diagnostics defined in diagnostics/Registry_pv.xml -->
<var name="ertel_pv"/>
<var name="u_pv"/>
<var name="v_pv"/>
<var name="theta_pv"/>
<var name="vort_pv"/>
<var name="iLev_DT"/>
#ifdef DO_PHYSICS
<var name="depv_dt_lw"/>
<var name="depv_dt_sw"/>
<var name="depv_dt_bl"/>
<var name="depv_dt_cu"/>
<var name="depv_dt_mix"/>
<var name="dtheta_dt_mp"/>
<var name="depv_dt_mp"/>
<var name="depv_dt_diab"/>
<var name="depv_dt_fric"/>
<var name="depv_dt_diab_pv"/>
<var name="depv_dt_fric_pv"/>
<!-- End Ertel PV diagnostics defined in diagnostics/Registry_pv.xml -->

<var name="i_rainnc"/>
<var name="rainnc"/>
<var name="precipw"/>
Expand Down Expand Up @@ -973,6 +961,66 @@
#endif
</stream>

<stream name="pvbudget"
type="output"
filename_template="pvbudget.$Y-$M-$D_$h.$m.$s.nc"
output_interval="3:00:00"
runtime_format="separate_file">

<var name="initial_time"/>
<var name="xtime"/>
<var name="Time"/>
<!--- For default PV stream. All PV variables defined in Registry_pv.xml -->
<var name="ertel_pv" packages="pv_diagnostics"/>
<var name="pres_pv" packages="pv_diagnostics"/>
<var name="u_pv" packages="pv_diagnostics"/>
<var name="v_pv" packages="pv_diagnostics"/>
<var name="theta_pv" packages="pv_diagnostics"/>
<var name="vort_pv" packages="pv_diagnostics"/>
<var name="height_pv" packages="pv_diagnostics"/>
<!--- Instantaneous PV budget -->
<var name="ertel_pv_prev" packages="pv_tendencies"/>
<var name="depv_dt_diab" packages="pv_tendencies"/>
<var name="depv_dt_fric" packages="pv_tendencies"/>
<var name="depv_dt_dyn" packages="pv_tendencies"/>
<var name="depv_dt_lw" packages="pv_tendencies"/>
<var name="depv_dt_sw" packages="pv_tendencies"/>
<var name="depv_dt_bl" packages="pv_tendencies"/>
<var name="depv_dt_cu" packages="pv_tendencies"/>
<var name="depv_dt_mix" packages="pv_tendencies"/>
<var name="depv_dt_mp" packages="pv_tendencies"/>
<var name="depv_dt_fric_bl" packages="pv_tendencies"/>
<var name="depv_dt_fric_mix" packages="pv_tendencies"/>
<var name="depv_dt_fric_cu" packages="pv_tendencies"/>
<!--- Instantaneous Thompson microphysical PV tendencies -->
<var name="depv_dt_mp_evap_cw" packages="pv_microphysics"/>
<var name="depv_dt_mp_evap_rw" packages="pv_microphysics"/>
<var name="depv_dt_mp_depo_ice" packages="pv_microphysics"/>
<var name="depv_dt_mp_melt_ice" packages="pv_microphysics"/>
<var name="depv_dt_mp_frez_ice" packages="pv_microphysics"/>
<var name="depv_dt_mp_allproc" packages="pv_microphysics"/>
<!--- Accumulated PV budget -->
<var name="acc_depv_dt_diab" packages="pv_tendencies"/>
<var name="acc_depv_dt_fric" packages="pv_tendencies"/>
<var name="acc_depv_dt_dyn" packages="pv_tendencies"/>
<var name="acc_depv_dt_lw" packages="pv_tendencies"/>
<var name="acc_depv_dt_sw" packages="pv_tendencies"/>
<var name="acc_depv_dt_bl" packages="pv_tendencies"/>
<var name="acc_depv_dt_cu" packages="pv_tendencies"/>
<var name="acc_depv_dt_mix" packages="pv_tendencies"/>
<var name="acc_depv_dt_mp" packages="pv_tendencies"/>
<var name="acc_depv_dt_fric_bl" packages="pv_tendencies"/>
<var name="acc_depv_dt_fric_mix" packages="pv_tendencies"/>
<var name="acc_depv_dt_fric_cu" packages="pv_tendencies"/>
<!--- Accumulated Thompson microphysical PV tendencies -->
<var name="acc_depv_dt_mp_evap_cw" packages="pv_microphysics"/>
<var name="acc_depv_dt_mp_evap_rw" packages="pv_microphysics"/>
<var name="acc_depv_dt_mp_depo_ice" packages="pv_microphysics"/>
<var name="acc_depv_dt_mp_melt_ice" packages="pv_microphysics"/>
<var name="acc_depv_dt_mp_frez_ice" packages="pv_microphysics"/>
<var name="acc_depv_dt_mp_allproc" packages="pv_microphysics"/>
</stream>

<stream name="diagnostics"
type="output"
filename_template="diag.$Y-$M-$D_$h.$m.$s.nc"
Expand All @@ -984,76 +1032,19 @@
<var name="Time"/>

<!-- Begin isobaric diagnostics defined in diagnostics/Registry_isobaric.xml -->
<var name="mslp"/>
<var name="relhum_50hPa"/>
<var name="relhum_100hPa"/>
<var name="relhum_200hPa"/>
<var name="relhum_250hPa"/>
<var name="relhum_500hPa"/>
<var name="relhum_700hPa"/>
<var name="relhum_850hPa"/>
<var name="relhum_925hPa"/>
<var name="dewpoint_50hPa"/>
<var name="dewpoint_100hPa"/>
<var name="dewpoint_200hPa"/>
<var name="dewpoint_250hPa"/>
<var name="dewpoint_500hPa"/>
<var name="dewpoint_700hPa"/>
<var name="dewpoint_850hPa"/>
<var name="dewpoint_925hPa"/>
<var name="temperature_50hPa"/>
<var name="temperature_100hPa"/>
<var name="temperature_200hPa"/>
<var name="temperature_250hPa"/>
<var name="temperature_500hPa"/>
<var name="temperature_700hPa"/>
<var name="temperature_850hPa"/>
<var name="temperature_925hPa"/>
<var name="height_50hPa"/>
<var name="height_100hPa"/>
<var name="height_200hPa"/>
<var name="height_250hPa"/>
<var name="height_500hPa"/>
<var name="height_700hPa"/>
<var name="height_850hPa"/>
<var name="height_925hPa"/>
<var name="uzonal_50hPa"/>
<var name="uzonal_100hPa"/>
<var name="uzonal_200hPa"/>
<var name="uzonal_250hPa"/>
<var name="uzonal_500hPa"/>
<var name="uzonal_700hPa"/>
<var name="uzonal_850hPa"/>
<var name="uzonal_925hPa"/>
<var name="umeridional_50hPa"/>
<var name="umeridional_100hPa"/>
<var name="umeridional_200hPa"/>
<var name="umeridional_250hPa"/>
<var name="umeridional_500hPa"/>
<var name="umeridional_700hPa"/>
<var name="umeridional_850hPa"/>
<var name="umeridional_925hPa"/>
<var name="w_50hPa"/>
<var name="w_100hPa"/>
<var name="w_200hPa"/>
<var name="w_250hPa"/>
<var name="w_500hPa"/>
<var name="w_700hPa"/>
<var name="w_850hPa"/>
<var name="w_925hPa"/>
<var name="vorticity_50hPa"/>
<var name="vorticity_100hPa"/>
<var name="vorticity_200hPa"/>
<var name="vorticity_250hPa"/>
<var name="vorticity_500hPa"/>
<var name="vorticity_700hPa"/>
<var name="vorticity_850hPa"/>
<var name="vorticity_925hPa"/>
<var name="t_isobaric"/>
<var name="t_iso_levels"/>
<var name="z_isobaric"/>
<var name="z_iso_levels"/>
<var name="meanT_500_300"/>
<var name="mslp" packages="isobaric"/>
<var name="iso_levels" packages="isobaric"/>
<var name="temperature_isobaric" packages="isobaric"/>
<var name="theta_isobaric" packages="isobaric"/>
<var name="dewpoint_isobaric" packages="isobaric"/>
<var name="relhum_isobaric" packages="isobaric"/>
<var name="qvapor_isobaric" packages="isobaric"/>
<var name="uzonal_isobaric" packages="isobaric"/>
<var name="umeridional_isobaric" packages="isobaric"/>
<var name="height_isobaric" packages="isobaric"/>
<var name="geoheight_isobaric" packages="isobaric"/>
<var name="w_isobaric" packages="isobaric"/>
<var name="vorticity_isobaric" packages="isobaric"/>
<!-- End isobaric diagnostics defined in diagnostics/Registry_isobaric.xml -->

#ifdef DO_PHYSICS
Expand Down Expand Up @@ -1628,8 +1619,22 @@

</var_array>
#endif
</var_struct>
<!-- MW: adding a PV scalar ARRAY for optional PV scalar diagnostic variable because the scalar advection subroutine expects a scalar array input !-->
<var_array name="pv_scalars" type="real" dimensions="nVertLevels nCells Time" streams="restart">
<var name="pv_scalar" array_group="passive" units="PVU"
description="Ertel's potential vorticity scalar initialized as diagnostic PV field at t=0 and passively advected by the model"
packages="pv_scalar"
streams="restart"/>

<var name="pv_scalar_dt" array_group="passive" units="PVU"
description="Ertel's PV scalar passively advected by the model but reset to updated diagnostic PV field at end of each time step"
packages="pv_scalar"
streams="restart"/>

</var_array>

</var_struct>

<var_struct name="diag" time_levs="1">

<!-- coefficients for the vertical tridiagonal solve -->
Expand Down Expand Up @@ -1715,9 +1720,6 @@
<var name="pv_cell" type="real" dimensions="nVertLevels nCells Time" units="s^{-1}"
description="absolute vertical vorticity averaged to the cell center from the vertices"/>

<var name="dtheta_dt_mp" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from microphysics"/>

<!-- reconstructed horizontal velocity vectors at cell centers -->
<var name="uReconstructX" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
description="Cartesian x-component of reconstructed horizontal velocity at cell centers"/>
Expand Down Expand Up @@ -1929,6 +1931,19 @@
packages="mp_thompson_aers_in"/>
</var_array>
#endif
<!-- MW: Tendency variable array for optional pv_scalar diagnostic variable. -->
<!-- pv_scalars_tend only contains one variable but we need the array because the scalar transport code expects it -->
<var_array name="pv_scalars_tend" type="real" dimensions="nVertLevels nCells Time">
<var name="tend_pv_scalar" array_group="passive" units="PVU kg m^{-3} s^{-1}"
description="Tendency of pv_scalar variable from scalar advection multiplied by dry air density divided by d(zeta)/dz"
packages="pv_scalar" />

<var name="tend_pv_scalar_dt" array_group="passive" units="PVU kg m^{-3} s^{-1}"
description="Tendency of pv_scalar_dt variable from scalar advection multiplied by dry air density divided by d(zeta)/dz"
packages="pv_scalar" />

</var_array>

</var_struct>

<!-- ===================================================================================== -->
Expand Down Expand Up @@ -2446,6 +2461,28 @@
description="precipitable water"/>


<!-- Variables for microphysics process theta tendencies in Thompson scheme used in PV microphysics tendencies -->
<var name="tend_theta_mp_evap_cw" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Net potential temperature heating rate from cloud water condensation and evaporation"
packages="mp_thompson_in;mp_thompson_aers_in;pv_microphysics"/>

<var name="tend_theta_mp_evap_rw" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from rain water evaporation"
packages="mp_thompson_in;mp_thompson_aers_in;pv_microphysics"/>

<var name="tend_theta_mp_depo_ice" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Net potential temperature heating rate from deposition and sublimation of all ice hydrometeors"
packages="mp_thompson_in;mp_thompson_aers_in;pv_microphysics"/>

<var name="tend_theta_mp_melt_ice" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from melting of all ice hydrometeors"
packages="mp_thompson_in;mp_thompson_aers_in;pv_microphysics"/>

<var name="tend_theta_mp_frez_ice" type="real" dimensions="nVertLevels nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from freezing/riming of all ice hydrometeors"
packages="mp_thompson_in;mp_thompson_aers_in;pv_microphysics"/>


<!-- ================================================================================================== -->
<!-- ... PARAMETERIZATION OF CONVECTION: -->
<!-- ================================================================================================== -->
Expand Down
3 changes: 2 additions & 1 deletion src/core_atmosphere/diagnostics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ mpas_soundings.o:
################### Generally no need to modify below here ###################


OBJS = mpas_atm_diagnostics_manager.o mpas_atm_diagnostics_utils.o
OBJS = mpas_atm_diagnostics_manager.o mpas_atm_diagnostics_utils.o mpas_atm_diagnostics_packages.o

all: $(DIAGNOSTIC_MODULES) $(OBJS)

mpas_atm_diagnostics_manager.o: mpas_atm_diagnostics_utils.o $(DIAGNOSTIC_MODULES)

mpas_atm_diagnostics_packages.o: mpas_atm_diagnostics_utils.o

clean:
$(RM) *.o *.mod *.f90
Expand Down
53 changes: 53 additions & 0 deletions src/core_atmosphere/diagnostics/Registry_diagnostics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,59 @@
<!-- soundings -->
#include "Registry_soundings.xml"

<!-- tendencies -->
#include "Registry_tendencies.xml"


<!-- ........................................................................ -->
<!-- Declare namelist config options for tendency and PV diagnostics packages -->
<!-- ........................................................................ -->
<nml_record name="diagnostics" in_defaults="true">

<!-- Namelist option for isobaric interpolation of model variables -->
<nml_option name="config_isobaric" type="logical" default_value="false" in_defaults="true"
units="-"
description="Logical for outputting model variables interpolated to isobaric levels"
possible_values=".true. for isobaric interpolation; .false. otherwise"/>


<!-- NAMELIST VARIABLES ADDED FOR INITIALIZATION OF INITIAL TENDENCY DIAGNOSTICS: -->
<nml_option name="config_tend" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for outputting tendency budget terms for thetam, water-vapor mixing ratio, and reconstructed winds"
possible_values=".true. for accumulating tendency terms; .false. otherwise"/>


<!-- NAMELIST VARIABLES ADDED FOR INITIALIZATION OF PV DIAGNOSTICS: -->
<nml_option name="config_pv_diag" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for calculation of potential vorticity and variables interpolated to dynamic tropopause"
possible_values=".true. for PV diagnostics calculation; .false. otherwise"/>

<!-- The following are only active when config_pv_diag = True -->
<!-- config_pv_tend requires config_tend = True -->
<nml_option name="config_pv_tend" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for calculation of potential vorticity tendency diagnostics"
possible_values=".true. for PV tendency diagnostics calculation; .false. otherwise"/>

<nml_option name="config_pv_isobaric" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for interpolation of PV diagnostics onto isobaric levels"
possible_values=".true. for PV diagnostics interpolation; .false. otherwise"/>

<nml_option name="config_pv_microphys" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for calculation of specific process tendencies from Thompson microphysics"
possible_values=".true. for PV tendencies from specific mp processes; .false. otherwise"/>

<nml_option name="config_pv_scalar" type="logical" default_value="false" in_defaults="false"
units="-"
description="Logical for treating the initial PV field as a passive scalar and transporting it throughout the simulation"
possible_values=".true. for calculating scalar PV transport; .false. otherwise"/>

</nml_record>

<!-- ******************************* -->
<!-- End includes from diagnostics -->
<!-- ******************************* -->
Loading