Skip to content

Merge NSSL branch v8merge into the MPAS GSL-develop #1

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

Closed

Conversation

tanyasmirnova
Copy link
Collaborator

@tanyasmirnova tanyasmirnova commented Mar 15, 2024

The title above should be a 1 line short summary of the pull request (i.e. what the project the PR represents is intended to do).

Merged NSSL code to the GSL MPAS branch.

Enter a description of this PR. This should include why this PR was created, and what it does.
This merge adds RUC LSM and NSSL microphysics, initial/BC conditions for all hydrometeors, and more diagnostics.

Testing and relations to other Pull Requests should be added as subsequent comments.

See the below examples for more information.
MPAS-Dev/MPAS#930
MPAS-Dev/MPAS#931

mgduda and others added 30 commits September 21, 2020 17:49
This commit adds a copy of the SMIOL library source code in src/external/SMIOL,
and it updates recipes in Makefiles to build the SMIOL library and link it with
MPAS executables. At present, however, the SMIOL library is not actually used.
In order to isolate all code that is specific to the PIO library, this commit
adds pre-processing directives to include PIO-specific code only if
MPAS_PIO_SUPPORT is defined at build time. The top-level Makefile defines
MPAS_PIO_SUPPORT only if the PIO environment variable is defined.

Although it is now possible to compile MPAS without any reference to the PIO
library, doing so does not result in a useful model executable, since, e.g.,
no mesh information can be read during model bootstrapping.

Besides the obvious additions of #idef MPAS_PIO_SUPPORT directives, there are
several other aspects of the changes in this commit worth noting:

1) The optional 'io_system' argument to mpas_framework_init_phase2 and
   mpas_framework_finalize is an integer when MPAS_PIO_SUPPORT is not defined.

2) When MPAS_PIO_SUPPORT is not defined, MPAS_IO_OFFSET_KIND is defined as
   an I8KIND integer in mpas_io_types.inc.

3) The MPAS_*_FILLVAL constants have been provided with alternate defininitions
   when MPAS_PIO_SUPPORT is not defined.
If the PIO environment variable is not defined, the top-level Makefile defines
the pre-processing macro MPAS_SMIOL_SUPPORT; otherwise, MPAS_PIO_SUPPORT is
defined as before.
Still to do:
1) Ensure that all cores compile
2) Remove debugging print statements from mpas_io.F
* framework/smiol-iocomm:
  Update SMIOL to 36e0f0e on io_comm branch
  WIP: Implement SMIOL
  If PIO is not available, define MPAS_SMIOL_SUPPORT in top-level Makefile
  Wrap all PIO-specific code in MPAS_PIO_SUPPORT preprocessing directives
  Add SMIOL library code in src/external/SMIOL, and add Makefile hooks
(Add back the io_comm changes on top of aggregation changes)

This reverts commit 18b7b91.
…icrophysics (adds refl. moment variables for rain, graupel, hail: zrw, zgw, zhw).

 Also added code to compute the composite and 1-km reflectivity for NSSL2M (not actually tested yet)
On case-insensitive filesystems, having the name of a build target the same as
a directory -- specifically, 'smiol' and 'SMIOL', respectively -- leads make
to infer that the target is already up to date. This is problematic in the case
of SMIOL, since the library will never be compiled.
  mpas_io_streams.F : pass ioformat to def_var
  mpas_io.F : add conditional to set deflate on variables if ioformat is netcdf4 (needs netcdf-4.7.4 or later)
MPAS Version 7.3

This minor release addresses one issue in the MPAS-Atmosphere model.

MPAS-Atmosphere:
----------------

* Update the checkout_data_files.sh script to use HTTPS rather than the
  unencrypted Git protocol when obtaining the MPAS-Data repository from GitHub.

* tag 'v7.3': (26 commits)
  Switch from unencrypted Git protocol to HTTPS when obtaining MPAS-Data repo
  Increment version number to 7.3
  Correct units and descriptions for GWDO fields var2d, con, oa[1-4], ol[1-4]
  Halo exchange inTropo in flood fill to find DT.
  Fix parallel reproducibility error in 'smstav' field
  Correct check on availability of dtheta_dt_mix when computing depv_dt_mix
  Fix bug in vertical interp of r.h. and s.h. when levels are given top-to-bottom
  Initialize qvb to zero before its first use in init_atm_case_squall_line
  Remove redundant mpas_pool_get_array calls for dtheta_dt_mp computation
  Use dt_dyn rather than dt_microp when computing dtheta_dt_mp
  Remove trailing whitespace and adjust indentation of dtheta_dt_mp computation
  Obtain 'rvord' from mpas_constants for computation of dtheta_dt_mp
  Increment version number to 7.2
  Calculate dtheta_dt_mp by finite difference around microphysics call.
  Update test for libpio to skip libpio.settings
  When calculating mosit air density, should use virtual T instead of T 	modified:   src/core_init_atmosphere/mpas_init_atm_cases.F
  Enable all runtime checks when DEBUG=true in gfortran build target
  Remove -m64 from all compiler flag sets in gfortran build target
  Change -O3 to -g in CXXFLAGS_DEBUG for gfortran build target
  Fix non-standard BOZ-literal integer constant in module_ra_cam_support
  ...
In order to enable the use of regional first-guess datasets given on
a Lambert conformal conic projection for regional MPAS-A ICs (including
terrain blending), LBCs, surface updates, several places in the init_atmosphere
core have been updated with code to set up Lambert conformal projections.

This commit also adds 'else' cases in the map projection set-up to catch
future uses of unsupported map projections.
…ecast/MPAS-Model into atmosphere/nssl_v7.3_smiol_lcc
end if
if (index_nc > 0) then
scalars_driving(index_nc,1:nVertLevels,1:nCells+1) = mpas_atm_get_bdy_state( clock, block, nVertLevels, nCells, 'nc', dt)
end if
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to Anders: i guess ifa & wfa need to be added here too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to tag @AndersJensen-NOAA

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @joeolson42, I have ifa and nwfa and nc added in my PR.

dzs(6,iCell) = 0.35_RKIND
dzs(7,iCell) = 0.50_RKIND
dzs(8,iCell) = 1.00_RKIND
dzs(9,iCell) = 0.70_RKIND
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanyasmirnova : is this really correct? the 9th layer is thinner than the 8th?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeolson42 Joe, these are the thicknesses between the middles of the layers. The first and last values are actually 0.5 of the thickness.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Thanks.

n_microp = max(nint(dt_dyn/60._RKIND),2)
dt_microp = dt_dyn / n_microp
ENDIF
endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndersJensen-NOAA : do we need anything like this for TEMPO?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeolson42, likely. Though we'll have to look at timestep sensitivity in MPAS first. There already is something defined in the lines above for Thompson, a limit of 90 s.

Copy link
Collaborator

@joeolson42 joeolson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments. I don't know much of anything about the majority of the modules changed, so my review isn't worth much. Under these time constraints, we have no choice but to accept the changes.

Copy link
Collaborator

@AndersJensen-NOAA AndersJensen-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commits from Michael Duda before 2021 are related to the use of SMIOL, which is a built-in I/O layer. If we don't intent on using that, then we can ignore those commits. There are also a lot of commits related to the addition of severe convection diagnostics, that we could ignore for now as well. I added suggestions for files to ignore; here's the caveat: I don't what will or won't break if we ignore files that I suggest we ignore.

packages="mp_thompson_in"/>
packages="mp_thompson_in;mp_nssl2m_in"/>

<var name="nc" array_group="number" units="nb kg^{-1}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this in my PR.
Setting packages="mp_thompson_in;mp_nssl2m_in" will solve the merge conflict for this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ignore this registry for convective diagnostics?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes could be ignored.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes could be ignored.

end if
if (index_nc > 0) then
scalars_driving(index_nc,1:nVertLevels,1:nCells+1) = mpas_atm_get_bdy_state( clock, block, nVertLevels, nCells, 'nc', dt)
end if
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @joeolson42, I have ifa and nwfa and nc added in my PR.

real(kind=RKIND),parameter :: epsq2=0.2 ! initial TKE for camuw PBL scheme [m2 s^-2]
real(kind=RKIND),parameter :: a2=17.2693882
real(kind=RKIND),parameter :: a3=273.16
real(kind=RKIND),parameter :: a4=35.86
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a2, a3, and a4 replace a2s, a3s, and a4s defined as parameters in the scheme itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge changes to this file: module_mp_thompson.F

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since some of these commit are old, I'd ignore changes to the Makefile.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore

@tanyasmirnova
Copy link
Collaborator Author

I left a few comments. I don't know much of anything about the majority of the modules changed, so my review isn't worth much. Under these time constraints, we have no choice but to accept the changes.

@joeolson42 Joe, I think we could make a separate branch: NCAR_NSSLv8_merge. And another option isto add our physics to NCAR MPAS one at a time as you suggested. I am working now on separating RUC LSM changes from the rest of NSSL changes. Hopefully it will not take too long, maybe by next week it will be ready. The NCAR_NSSLv8_merge branch could be used untill we are ready with the NCAR_GSL/develop.

@jderrico-noaa
Copy link
Collaborator

@joeolson42 Joe, I think we could make a separate branch: NCAR_NSSLv8_merge. And another option isto add our physics to NCAR MPAS one at a time as you suggested. I am working now on separating RUC LSM changes from the rest of NSSL changes. Hopefully it will not take too long, maybe by next week it will be ready. The NCAR_NSSLv8_merge branch could be used until we are ready with the NCAR_GSL/develop.

I think this makes sense, I can add @tanyasmirnova 's branch from this PR as a separate branch to our repo for now and then work on pulling out what @AndersJensen-NOAA flagged and we can see how (if) it compiles and runs. In the mean time we can start with Anders's PR #2, I need one more approval and then I'll merge it

jderrico-noaa pushed a commit that referenced this pull request Mar 29, 2024
… microphysics features (#2)

* Add microphysics submodule and updated graupel lookup table support (#1)

* microphysics Makefiles for submodule

* Add submodule support for microphysics

* Fix bug in Makefile directory path

* Thompson table updates for two-moment graupel

* Add aerosol aware microphysics capability (#2)

* Add microphysics aerosol information to initialization

* Link microphysics aerosol tables for runtime

* Update submodule

* Fix link to microphysics aerosol tables

* Add water- and ice-friendly aerosols to model for transport (#3)

* Update pointer for microphysics

* Update pointer to microphysics submodule

* Add microphysics aerosol information to LBCs

* Add aerosol-aware microphysics to LBCs (#4)

* Add microphysics aerosol information to LBCs

* Support for water- and ice-friendly aerosols in LBCs

* Add documentation to subroutine init_microphysics_aerosols_lbc

* Time interpolation for microphysics aerosols ICs

* Add time interpolation for microphysics aerosols to LBCs

* Aerosol time interpolation (#5)

* Add microphysics aerosol information to LBCs

* Time interpolation for microphysics aerosols ICs

* Add time interpolation for microphysics aerosols to LBCs

* Nc microphysics (#6)

* Updates for aerosol aware

* Add support for nc microphysics

* Add nc to interface

* point to develop branch of Thompson submodule

* Import nwfa and nifa into microphysics (#7)

* Add microphysics submodule makefile (#8)

* Import nwfa and nifa into microphysics

* Add makefile support for microphysics submodule

* Update location for microphysics submodule

* remove GSL_cloud_physics directory

* Point to microphysics submodule

* Point to microphysics submodule

* Remove old submodule

* Bug fix in Makefile to deal with old version of microphysics
@jderrico-noaa jderrico-noaa marked this pull request as draft March 29, 2024 18:29
@tanyasmirnova
Copy link
Collaborator Author

@jderrico-noaa @joeolson42 @AndersJensen-NOAA This merged with NSSL version of MPAS code has been tested on the 13-km CONUS test case from Anders Jensen. Although the versions of MYNN, Thompson and RUC LSM are old, the results appear to be reasonable. Below is the 2-m T verification produced by @AndersJensen-NOAA:
image (1)
This code could be used in HFIP as a backup until the gsl/develp is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants