Initial LES options for MPAS-Atmosphere#1404
Initial LES options for MPAS-Atmosphere#1404mgduda wants to merge 109 commits intoMPAS-Dev:developfrom
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.
abishekg7
left a comment
There was a problem hiding this comment.
Looks good to me. Tested that it's bit identical (with appropriate flags) between CPU and GPU runs for various LES code paths as well as non-LES code path.
In addition, checked that the non-LES code paths don't differ from the hotfix-v8.3.1 branch, provided that the updated initial conditions are used in both runs.
|
My LES test of the current PR code looks fine. |
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
|
@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. |
|
@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. |
| OBJS = mpas_atm_time_integration.o \ | ||
| mpas_atm_boundaries.o | ||
| mpas_atm_boundaries.o \ | ||
| mpas_atm_dissipation_models.o |
There was a problem hiding this comment.
We will need a corresponding change to src/core_atmosphere/CMakelists.txt
Add mpas_atm_dissipation_models.F to ATMOSPHERE_CORE_DYNAMICS_SOURCES
I was able to build mpas-bundle with that change.
There was a problem hiding this comment.
@jim-p-w Thanks for testing out the CMake build! I'll update the CMakeLists.txt in src/core_atmosphere.
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'.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)