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

Commits on Jul 2, 2024

  1. Framework for adding tendency diagnostics, updating PV diagnostics

    - Add tendency and PV packages declarations to Registry.xml
    - Add Registry_tendencies.xml file with tendency package variables
    - Update Registry_diagnostics.xml with Registry_tendencies.xml and namelist config option declarations
    - Update Registry_pv.xml with all variables required to make modifications to PV diagnostics package
    theweathermanda committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    a6eeeea View commit details
    Browse the repository at this point in the history
  2. Check compatability between diagnostic configs and connect configs to…

    … variable packages
    
    - Added mpas_atm_diagnostics_packages.F in /src/core_atmosphere/diagnostics to setup the tendency and PV diagnostics packages based on config options and ensure comptability between the config options selected in the namelist
    - Modified Makefile in /src/core_atmosphere/diagnostics to reflect this new script
    - Modified mpas_atm_core_interface.F to call mpas_atm_diagnostics_packages.F to setup these packages
    theweathermanda committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    47d1203 View commit details
    Browse the repository at this point in the history
  3. Implementation of code for tendencies diagnostics

    - Updated mpas_atm_halos.F with new halo groups for GWDO tendencies and horizontal momentum tendencies
    - Updated mpas_atmphys_todynamics.F to include physics tendency diagnostic calculations
    - Updated mpas_atmphys_interface.F to include microphysics tendency diagnostic calculations
    - Updated mpas_atm_time_integration.F to include calculations and subroutines for tendency diagnostics
    theweathermanda committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    022000f View commit details
    Browse the repository at this point in the history
  4. Cleaned up Registry_tendencies.xml

    - Removed extraneous variables
    - Changed descriptions to specify tendencies of moist potential temperature
    theweathermanda committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    571bef9 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Configuration menu
    Copy the full SHA
    7622e5d View commit details
    Browse the repository at this point in the history
  2. Halo framework for PV diags, calcs of PV and DT

    - Modified mpas_atm_halos.F to include halo groups for variables used in PV calculations:
    
      For ertel_pv:
      -- diagnostics:pv_diag
    
      For DT identification:
      -- diagnostics:inStrato (integer fields currently unsupported for mpas_halo_exch_group)
      -- diagnostics:inTropo (integer fields currently unsupported for mpas_halo_exch_group)
      -- diagnostics:iLev_DT (integer fields currently unsupported for mpas_halo_exch_group)
    
      For PV tendencies:
      -- diagnostics:dpv_prev
      -- diagnostics:dpv_th_tend
      -- diagnostics:dpv_mom_tend
      -- diagnostics:dpv_mom_curl
    
      For microphysics PV tendencies:
      -- diagnostics:dpv_mp_tend
    
    - Starting from scratch, recreated mpas_pv_diagnostics.F and implemented subroutines to calculate
      ertel_pv, identify the dynamic tropopause, and interpolate static fields to the DT
    
    - Adapted relevant subroutines in mpas_pv_diagnostics.F to use new halo communication groups. The
      approach I took was modeled after the few scripts in core_atmosphere that had already done this
      is and is possibly an overly complicated way of calling the needed arguments (like domain), which
      are ultimately passed down to the PV code from mpas_atm_core.F. Thus, code changes propagate up
      to that script and include modifications to the following:
    
      -- atm_compute_pv_diagnostics in mpas_pv_diagnostics.F
      -- pv_diagnostics_update and pv_diagnostics_compute in mpas_pv_diagnostics.F, called by
         mpas_atm_diagnostics_manager.F
      -- mpas_atm_diagnostics_manager.F to support changes to the PV subroutine calls and
         include input arguments to mpas_atm_diag_update and mpas_atm_diag_compute
      -- mpas_atm_core.F to support the new arguments called in mpas_atm_diag_update and
         mpas_atm_diag_compute
    
      Note that the DT identification routines in mpas_pv_diagnositcs.F require halo communication,
      but the communicated fields are integers and are thus currently incompatable with the new
      MPAS halo groups. I left these as-is.
    theweathermanda committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    ae664a1 View commit details
    Browse the repository at this point in the history
  3. For tendency package: update mpas_atmphys_todynamics.F

    Added calculation of rucuten_tend for tendency diagnostics package, which was missing.
    theweathermanda authored Jul 9, 2024
    Configuration menu
    Copy the full SHA
    713dfa1 View commit details
    Browse the repository at this point in the history
  4. Implemented new PV tendency diagnostics

    - Added relevant subroutines to mpas_pv_diagnostics.F to store variables from the
      beginning of the time step and compute PV tendencies for all fundamental diabatic,
      dynamic, and frictional processes. Added subroutine to interpolate PV tendencies
      to DT identified at the beginning of the time step. Added subroutine to accumulate
      tendencies over successive time steps.
    
    - Added call to pv_diagnostics_reset in mpas_atm_diagnostics_manager.F
    
    - Modified mpas_atmphys_interface.F to add calculations of thmmpten and qvmppten and
      remove calculations of dtheta_dt_mp, which is now calculated in the PV script.
    
      Note: v8.2.0 now contains calculations of rthmpten and rqvmpten for some microphysics schemes.
      rqvmpten is equal to qvmmpten, but rthmpten (theta tendency, not theta-m tendency) will
      not exactly equal the theta tendency derived from thmmpten and qvmppten that results in a
      closed theta budget (dtheta_dt_mp).
    
    - Added outstanding tendency calculations used for PV tendencies to mpas_atm_time_integration.F
      and initialized du_dt_dyn as 0. Also added missing calculation for ru_tend_diff that is
      needed for the ITM package but was omitted in a prior commit.
    
    - Modified mpas_atm_todynamics.F to remove calculations of tend_u_phys, which is no
      longer used in the PV tendency calculations.
    
    - Modified mpas_atm_core.F to add a config_pv_tend flag for calculation of diagnostic
      variables, rho and theta. Previously these were only calculated prior to writing an
      output file. If config_pv_tend is set to true, these will now be calculated at
      each time step.
    theweathermanda committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    64b09cd View commit details
    Browse the repository at this point in the history
  5. Remove tend_u_phys from Registry_pv.xml

    - This commit removes tend_u_phys from Registry_pv.xml. This variable is
      no longer used to compute the frictional PV tendency.
    theweathermanda committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    6eb006d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bc2357c View commit details
    Browse the repository at this point in the history
  7. Add pvbudget stream to defaults in Registry.xml

    - Removed PV diagnostics variables from preexisting history output stream and
      created default pvbudget stream containing relevant variables
    theweathermanda committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    a32423c View commit details
    Browse the repository at this point in the history
  8. Disable PV tend calcs at init; housekeeping items

    - Added pv_callCounter to Registry_pv.xml
    
    - Added pv_callCounter tracking in mpas_pv_diagnostics.F to activate calculations
      of PV tendencies during runtime, not at model initialization. This is really only
      relevant for when the model is restarted and the derived parent tendencies used in the
      PV tendency calculations are inaccurate because (1) they are not included in restart
      streams and (2) mpas_atm_time_integration.F hasn't been called. This prevents the
      inaccurate tendencies from being included in the accumulated PV tendency variables
    
    - Removed declaration of _dyn variables from mpas_atm_time_integration.F
    theweathermanda committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    6796b74 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. Add theta, PV tendencies for specific Thompson microphysical processes

    - Added mpas_halo_exch_group_complete for microphysics process tendencies (was previously missing)
    
    - Added tend_theta_mp_* variables to Registry.xml that track potential temperature tendencies for the following processes
      in the Thompson microphysics scheme: net condensation/evaporation of cloud water, evaporation of rain water,
      net deposition/sublimation, melting, and freezing. These variables are only computed for config_pv_microphys = .true.
      and are used in the calculation of PV tendencies for each respective process
    
    - Added variable declarations to mpas_atmphys_vars.F for calculations of temperature tendencies from the Thompson scheme
    
    - Added calculations of temperature and potential temperature tendencies to module_mp_thompson.F, mpas_atmphys_driver_microphys.F,
      and mpas_atmphys_interface.F
    
    - Added calculations of PV tendencies associated with these specific microphysical processes to mpas_pv_diagnostics.F
    
    - Added compatability with 'mp_thompson_aerosols' in Registry.xml and mpas_atm_diagnostics_packages.F
    theweathermanda committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    522452f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c3f55d6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4c8ce89 View commit details
    Browse the repository at this point in the history
  4. Cleaned up mpas_isobaric_diagnostics.F

      This commit pertains to a series of modifications that clean up
      to currently existing isobaric diagnostics interpolation. The
      existing diagnostics comprise a number of variables at individual
      pressure levels (e.g., temperature_200hPa) and thus require a significant
      amount of hard-coding.
    
      This modified version reduces (but does not eliminate) the need for
      hard-coding by prescribing a list of isobaric levels to which the
      variables are commonly interpolated, leading to variables of the form
      e.g., temperature_isobaric. These variables are also connected to a
      diagnostic package and namelist config option (config_isobaric = .true.)
      to make it easier for users to toggle on their calculation at runtime.
    
      The specific changes include:
    
      - Adding an isobaric package to Registry.xml
    
      - Adding the config_isobaric namelist option to Registry_diagnostics.xml
    
      - Connecting the package variables to the namelist option in mpas_atm_diagnostics_packages.F
    
      - Updating Registry_isobaric.xml to remove the highly specific variables and
        replace them with more generalizable variables, such as temperature_isobaric
    
      - Updating Registry.xml to change the default diagnostics stream variables
    
      - Updating mpas_isobaric_diagnostics.F with the interpolation of the new
        generalizable variables and removal of the old variables. Subroutines are
        also added to clean up the code.
    
      - Adding halo groups 'isobaric:pressure_p' and 'isobaric:vorticity' to
        mpas_atm_halos.F and removing the previous halo field exchanges from
        mpas_isobaric_diagnostics.F
    
      - Updating mpas_atm_diagnostics_manager.F to include the halo exchange
        and config input arguments to the isobaric subroutine calls
    theweathermanda committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    c3fb0f8 View commit details
    Browse the repository at this point in the history
  5. Change diagnostics namelist option to default

    - Changed diagnostics option and config_isobaric to be in the default
      namelist configuration.
    theweathermanda committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    5f53d23 View commit details
    Browse the repository at this point in the history
  6. Added initialization and advection of pv_scalar

    - Added intialization of pv_scalar field as ertel_pv to mpas_pv_diagnostics.F
    - Added calls to initialize pv_scalar field to mpas_atm_diagnostics_manager.F and
      mpas_atm_core.F
    - Added call to advect_scalars subroutine for pv_scalars in mpas_atm_time_integration.F
      if config_pv_scalar = True
    theweathermanda committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    bfddf5e View commit details
    Browse the repository at this point in the history
  7. Add isobaric interpolation of PV and PV tendencies

    - Add isobaric PV variables to Registry_isobaric.xml
    
    - Add isobaric interpolation of PV and PV tendencies to mpas_isobaric_diagnostics.F
    
    - Add calls to isobaric interpolation subroutines and accumulation of isobaric PV tendencies to mpas_pv_diagnostics.F
    
    - Add config_pv_isobaric flag dependence on halo group for 'isobaric:pressure_p'
    theweathermanda committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    08b417c View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2024

  1. Configuration menu
    Copy the full SHA
    bea55b6 View commit details
    Browse the repository at this point in the history
  2. Bug fix: add halo group for wCell;call in calc_epv

    - Code previously did halo exchange of wCell before it was calculated,
      leading to erroneous values of ertel_pv along halo region boundaries
      when nCellsSolve is used in mpas_pv_diagnostics.F subroutines rather
      than nCells.
    
    - Commit adds a separate halo group for wCell and calls this group
      in the calc_epv subroutine in mpas_pv_diagnostics.F
    theweathermanda committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    e1157f3 View commit details
    Browse the repository at this point in the history
  3. Bug fix: halos for intermediate wCell tend vars

    - Code previously did halo exchanges of intermediate wCell tendency variables
      before they were calculated, leading to erroneous values of depv_dt_fric and
      depv_dt_dyn along halo region boundaries when nCellsSolve is used in
      mpas_pv_diagnostics.F subroutines rather than nCells.
    
    - Commit adds separate halo groups for the wCell tendencies and calls these groups
      in the calc_pvBudget subroutine in mpas_pv_diagnostics.F
    theweathermanda committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    b9c3ec4 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2024

  1. Bug fixes for pv_scalars, add depv_dt_scalar_adv

    Additions:
    - Add pv_scalar_dt variable to Registry.xml, which will be reset to the updated ertel_pv
      field at the end of each time step
    - Add depv_dt_scalar_adv, acc_depv_dt_scalar_adv to track the PV tendencies from
      advecting PV as a scalar variable through pv_scalar_dt
    
    Bug fixes:
    - Add halo groups for pv_scalars at time levels 1 and 2 to mpas_atm_halos.F
    - Add halo exchanges for pv_scalars to mpas_atm_time_integration.F
    - Add advance_scalars option for pv_scalars when split scalar transport isn't selected
    - Removed rk_step == 3 dependence on advance_scalars for pv_scalars
    - Modified the dqv_dt_dyn, acc_dqv_dt_dyn calculations to be consistent with qv
      dynamics tendency for both monotonic and non-monotonic scalar transport
    theweathermanda committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    0a252da View commit details
    Browse the repository at this point in the history