Initial LES options for MPAS-Atmosphere#1404
Merged
mgduda merged 110 commits intoMPAS-Dev:developfrom Mar 3, 2026
Merged
Conversation
…rinsky scheme on Cartesian planes. This also fixes periodicity on those planes for the coefficients.
Added unit test for deformation coefficients on Cartesian-plane meshes.
The algorithm for the 2D Smagorinsky eddy viscosity coefficients are implemented in this module. Others to follow.
(2) Changes in atm_compute_dyn_tend to call dissipation module subroutine to compute 2D Smagorinsky eddy viscosity.
so that compile time specification of Nvertlevels and maxEdges is enabled.
Made string available in atm_compute_dyn_tend and set up logic to allow for different dissipation options that now include the les models.
subroutine atm_compute_dyn_tend to subroutines in mpas_atm_dissipation.F. The results are no longer bit-for-bit with the modified code because we have re-arranged the order to the processes in the vertical momentum equation to accommodate doing the horizontal and vertical dissipation for w together.
This is config_init_case = 10
…liations. added a new 3D Smagorinsky eddy viscosity computation and vertical mixing for the dynamics variables. All code compiles but not tested.
eddy viscosity array. For use in the LES models.
to always call these LES routines, in this case for the sueprcell test case. Code compiles and runs for the supercell test case.
…del. Fixes are for both configuration and algorithm errors.
…ergence in the 3D mixing routines to conform to convention. no change in results.
dudhia
reviewed
Feb 20, 2026
This commit removes unused variables from the new LES code -- both the test case initialization routine (init_atm_case_les) as well as the new mpas_atm_dissipation_models.F file.
…dels.F With a macro, when debugging prints are not enabled the compiler will see no executable code.
Results with the NVHPC 25.9 compilers are bit-identical between CPU and GPU runs when compiling with the additional flags -Mnofma -gpu=math_uniform .
…es_surface This commit modifies the possible_values attribute for the config_les_model and config_les_surface namelist options in the atmosphere core's Registry.xml file to use LaTeX ` and ' quotes.
…gistry.xml The deformation_coef_* variables now use tabs for indentation rather than spaces to match other variables in the default stream definitions.
…tion.F This commit cleans up whitespace and indentation in the atm_init_test_coefs routine, and it also performs minor cleanup elsewhere in the mpas_atm_advection.F file.
This commit removes commented-out calls to the u_dissipation, w_dissipation, theta_dissipation, and theta_dissipation_3d routines in the atm_compute_dyn_tend_work routine; the implementations of these routines no longer exist, and they had only been used for testing during the migration to new dissipation routines for u, w, and scalars. This commit also removes the local variable test_dissipation_3d, which was used to control whether the aforementioned routines were called.
The value of the Prandtl number had been changed to 1/3 during development of the initial LES capability for MPAS-Atmosphere.
This commit removes the following variables from the definition of the restart stream in the atmosphere core: deriv_two defc_a defc_b deformation_coef_c2 deformation_coef_s2 deformation_coef_cs deformation_coef_c deformation_coef_s coeffs_reconstruct east north These variables are either already indirectly included in the restart stream through the invariant stream or they are not needed in restart files.
The logic to compute time_of_day_seconds was previously in the atm_compute_dyn_tend_work routine, though the time_of_day_seconds variable was only used in the commented-out routine flux_les_sas in the mpas_atm_dissipation_models module. In an attempt to keep the atm_compute_dyn_tend_work routine cleaner, this commit pushes the computation of time_of_day_seconds down to the flux_les_sas routine where it is actually used. In order to do this, the simulation clock and timestep, dt, are now passed as arguments to scalar_dissipation_3d_les and thereafter into flux_les_sas.
The implementation of the "CAM-MPAS" 2nd-order horizontal filter contained code to place a lower-bound on the 'kdiff' variable, which is no longer used, and it also included out-dated code to apply the filter over only the top three layers in the model. This commit updates the filter code (active when config_mpas_cam_coef > 0.0) so that it correctly enforces a lower-bound on 'eddy_visc_horz' over a variable number of layers below the model top. As part of the changes in this commit, the variable 'kdiff' can be removed entirely from the atmosphere core, as it has been supplanted by the 'eddy_visc_horz' variable.
Rather than comparing strings, this commit introduces changes to allow for integer comparisons when checking the LES model option and LES surface option. The mpas_atm_dissipation_models module now contains two new functions, les_model_from_string and les_surface_from_string, that translate character strings from the namelist options config_les_model and config_les_surface, respectively, into integer parameters. These two new functions are used in the atm_compute_dyn_tend routine to obtain integer values representing the runtime selection of LES model option and LES surface option, and these integers are employed thereafter.
This commit reverts all changes to the init_atm_case_squall_line routine since the v8.3.1 tag. These changes are not strictly necessary to the initial LES capability, and for the present, the initialization case 10 (init_atm_case_les) is the only supported test case for use with LES options.
This commit reverts all changes to the init_atm_case_mtn_wave routine since the v8.3.1 tag. These changes are not strictly necessary to the initial LES capability, and they can be re-introduced separately in future.
72c5cce to
e9d81de
Compare
Contributor
Author
|
@dudhia Would you be able to take a look at the PR description, which is an abbreviated version of the draft user's guide material? |
This looks OK. You might mention there should be no PBL option chosen to enable LES. I am not sure whether the code prevents that anyway. In WRF when the PBL option is zero, vertical diffusion is called instead. |
Collaborator
|
@mgduda Could you also add a note to the description about the new fields introduced to the init file, and the need to re-generate the init/input files. |
jim-p-w
reviewed
Feb 27, 2026
…le list
This commit adds the file mpas_atm_dissipation_models.F to the definition of
ATMOSPHERE_CORE_DYNAMICS_SOURCES in src/core_atmosphere/CMakeLists.txt .
Without this change, builds of the MPAS atmosphere core using CMake would fail:
MPAS-Model/src/core_atmosphere/dynamics/mpas_atm_time_integration.F:38:8:
38 | use mpas_atm_dissipation_models
| 1
Fatal Error: Cannot open module file ‘mpas_atm_dissipation_models.mod’ for reading at (1): No such file or directory
compilation terminated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces an initial Large-Eddy Simulation (LES) capability with two sub-grid turbulence models:
The LES capability is controlled by the new namelist option
config_les_model, which may be set to either'none'(default),'3d_smagorinsky', or'prognostic_1.5_order'.Note that if an LES option is enabled, a PBL parameterization scheme should not be used -- that is,
config_pbl_schemeshould be set tooffin the&physicsnamelist group.Other namelist parameter associated with the LES models include:
config_les_surface(default value:none):'specified'uses fixed values fromconfig_surface_*options'varying'uses inputs from physics surface heat flux, moisture flux and friction velocityconfig_surface_heat_flux(K m s-1; default value: 0.0) specifies w'θ' at surfaceconfig_surface_moisture_flux(kg/kg m s-1; default value: 0.0) specifies w'q' at surfaceconfig_surface_drag_coefficient(unitless; default value: 0.0) Cd defined from lowest level V such that surface stress = rhoCdV^2Application of LES mixing,
2d_smagorinskyhorizontal mixing, and the background 4th-order filter can be enabled for scalar variables (qv, etc.) by settingin the
&nhyd_modelnamelist group. Previously, the2d_smagorinskyhorizontal mixing and the background 4th-order filtering were not applied to scalar variables.As of this PR, the default configuration for filtering is unchanged:
config_horiz_mixing = '2d_smagorinsky'and a 4th-order horizontal background filter are active for the dry dynamics variables (u,w,theta_m).Along with the refactoring of the dynamics to more cleanly support the new sub-grid turbulence models, five new static fields have been introduced:
deformation_coef_c2deformation_coef_s2deformation_coef_csdeformation_coef_cdeformation_coef_sThese new fields must be present in "static", "invariant", initial conditions, and restart files. As such, new input files will generally need to be created, regardless of whether any LES options are used in a simulation.