-
Notifications
You must be signed in to change notification settings - Fork 390
Initial LES options for MPAS-Atmosphere #1404
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
base: develop
Are you sure you want to change the base?
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.
By ensuring that all variables are explicitly declared in the calculate_n2 routine, the code can be built with compiler flags (e.g., -fimplicit-none) that forbid implicitly declared variables.
…_tend_work The dummy arguments for ustm, hfx, and qfx in the atm_compute_dyn_tend_work routine are not pointers, and so passing unassociated pointers for the actual arguments is invalid and will trigger a runtime error when debugging options are enabled with the GNU compilers. The workaround adopted in this commit is to allocate the ustm, hfx, and qfx array pointers with a trivial size if these fields are not available (due to packages associated with PBL schemes), and to deallocate them after the call to atm_compute_dyn_tend_work. The dummy arguments for ustm, hfx, and qfx in atm_compute_dyn_tend_work (as well as in u_dissipation_3d and scalar_dissipation_3d_les) are now assumed-shape arrays, as the actual arguments may not have (nCells+1) elements.
…dels.F With a macro, when debugging prints are not enabled the compiler will see no executable code.
Rather than comparing strings, set up a local integer variable to indicate which option was chosen at runtime.
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.
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.
| real (kind=RKIND) :: pii | ||
| real (kind=RKIND), dimension(25) :: xp, yp | ||
| real (kind=RKIND) :: xe, ye | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the extra newline needed here?
| end subroutine atm_initialize_deformation_weights | ||
|
|
||
| end module atm_advection | ||
| !----------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line could be removed
| use mpas_stream_manager, only : MPAS_stream_mgr_stream_exists, MPAS_stream_mgr_read | ||
| use mpas_derived_types, only : MPAS_STREAM_MGR_NOERR | ||
| use mpas_vector_operations, only : mpas_initialize_vectors | ||
| subroutine init_atm_case_les(dminfo, mesh, fg, nCells, nVertLevels, state, diag, test_case, configs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This subroutine might need a comment block above to make it consistent with the remaining subroutines in the file
| end function atm_get_sounding | ||
|
|
||
|
|
||
| real (kind=RKIND) function atm_get_sounding_1( variable, height ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if there could be more descriptive names for these three atm_get_sounding functions, or perhaps some comments that briefly describe it.
| if (trim(config_les_model) == 'none') then | ||
| les_model_opt = LES_MODEL_NONE | ||
| else if (trim(config_les_model) == '3d_smagorinsky') then | ||
| les_model_opt = LES_MODEL_3D_SMAGORINSKY | ||
| else if (trim(config_les_model) == 'prognostic_1.5_order') then | ||
| les_model_opt = LES_MODEL_PROGNOSTIC_15_ORDER | ||
| else | ||
| ! Error | ||
| end if | ||
|
|
||
| if (trim(config_les_surface) == 'none') then | ||
| les_surface_opt = LES_SURFACE_NONE | ||
| else if (trim(config_les_surface) == 'specified') then | ||
| les_surface_opt = LES_SURFACE_SPECIFIED | ||
| else if (trim(config_les_surface) == 'varying') then | ||
| les_surface_opt = LES_SURFACE_VARYING | ||
| else | ||
| ! Error | ||
| end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these if clauses seem to be repeated 3-4 times in this file. Wondering if we could move them to a function, and call it once from an appropriate place in mpas_atm_time_integration.F
This PR introduces initial LES options for MPAS-Atmosphere.