Add MPAS_ESMF for external ESMF linking#1405
Conversation
|
@scrasmussen @uturuncoglu |
|
@mgduda |
mgduda
left a comment
There was a problem hiding this comment.
In addition to the comment about the error message, I'd suggest a couple of other changes:
- Somewhere around this point in the top-level
Makefile, should we include a message in the build summary to indicate which ESMF timekeeping library was used? - Around this point in the top-level
Makefile, we could include a description of the newMPAS_ESMFbuild option that's been introduced in this PR. - In the commit message (not the GitHub PR description), could you include a bit more detail regarding the changes in the commit?
|
Hi @mgduda Note, I also did some build timing tests to see if linking to an external ESMF library makes a difference and it does. I think the external ESMF library is much larger and has a few downstream 3rd party libraries that get linked in too. There may be a way to speed this up using dynamic linking. But I think the increased build time is to be expected. Before change MPAS_ESMF=embedded MPAS_ESMF=external |
|
@mgduda |
- MPAS_ESMF=embedded (default), uses internal ESMF timekeeping lib - MPAS_ESMF=external, uses external ESMF lib defined by ESMFMKFILE - Replaces hardcoded esmf_time_f90 include with MPAS_ESMF_INC - Replaces hardcoded esmf_time lib with MPAS_ESMF_LIBS
With the introduction of the deformation_coef_* fields in merge commit 63f2d44 (PR MPAS-Dev#1405), the defc_a and defc_b fields are no longer needed in either the init_atmosphere or the atmosphere core. Accordingly, this commit removes the defc_a and defc_b fields from the Registry.xml files as well as source code in both of these cores.
This merge removes the defc_a and defc_b fields from the init_atmosphere and atmosphere cores. With the introduction of the deformation_coef_* fields in merge commit 63f2d44 (PR #1405), the defc_a and defc_b fields are no longer needed in either the init_atmosphere core or the atmosphere core. Accordingly, this merge removes the defc_a and defc_b fields from the Registry.xml files as well as from the source code of both of these cores. * atmosphere/remove_defc_ab: Remove defc_a and defc_b from the init_atmosphere and atmosphere cores
MPAS Version 8.4.0 This release of MPAS introduces new capabilities and improvements in the MPAS-Atmosphere model and its supporting software infrastructure, and it is the first release to provide the foundation for CheMPAS-A, a chemistry capability for MPAS-Atmosphere. Notable changes are listed below. MPAS-Atmosphere Initialization: * Fix an issue in snow initialization over areas covered by seaice. (PR #1438) * Introduce namelist control over the vertical coordinate configuration for real-data case initialization. Two new namelist options may now be specified in the &vertical_grid namelist group in the namelist.init_atmosphere file: - config_hybrid_coordinate (default: true) Whether to employ a hybrid vertical coordinate - config_hybrid_top_z (default: 30000 m) Height at which coordinate surfaces become constant height surfaces Additionally, the smoothing coefficient formula for the hybrid coordinate now uses the transition height instead of the model top height. (PR #1382) * Add computation of the edgeNormalVectors, cellTangentPlane, and localVerticalUnitVectors fields for MPAS-A initialization case 13 (CAM-MPAS 3-d grid) to better support alternative initialization workflows for CAM-MPAS. (PR #1351) MPAS-Atmosphere Dynamics: * Implement an initial Large-Eddy Simulation (LES) capability. Similar to WRF, it contains two subgrid turbulence models -- a diagnostic Turbulent Kinetic Energy (TKE) formulation based on a 3-d Smagorinsky formulation, and a 1.5-order prognostic TKE formulation. These formulations generally follow the implementation in WRF (see the WRF Technical Note Version 4, sections 4.2.3 and 4.2.4 for a description of the formulations). (PR #1404) * Generalize the epssm parameter, allowing level-dependent values to be specified through four new namelist options: - config_epssm_minimum (default value: 0.1) - config_epssm_maximum (default value: 0.5) - config_epssm_transition_bottom_z (default value: 30000.0) - config_epssm_transition_top_z (default value: 50000.0) The epssm parameter is an off-centering coefficient for the vertically semi-implicit acoustic / gravity-wave integration, and it was previously specified as a single, constant value using the config_epssm namelist option. (PR #1381) * Add the capability to turn off microphysics tendencies above a specified height with a new namelist option, config_microphysics_top, in the &physics namelist group. Ignoring tendencies from the microphysics at upper levels has been found to alleviate some instabilities in deep-domain (i.e., model tops above the stratopause) MPAS-Atmosphere simulations. (PR #1380) * Optimize OpenACC data movement throughout the MPAS-A dycore, so that the majority of fields are transferred to the device at the start of a dynamics step and from the device at the end of a dynamics step. (PR #1315) * Remove the scaling of the gravity-wave absorbing layer coefficient (dss) by the local mesh size. Previously, the absorbing layer coefficient was scaled by dx/dx_fine, and for large values of dx/dx_fine, instabilities have been encountered associated with this scaling of the absorbing layer coefficient. (PR #1379) MPAS-Atmosphere Physics: * Correct an issue with high q2 values over urban cells in Noah-MP. (PR #1383) * Fix crashes when using the CAM SW radiation scheme. (PR #1391) * Fix an indexing typo in mpas_atmphys_interface.F, where evapprod(k,k) was used instead of evapprod(k,i). The fix corrects diagnostic output, but should not affect the model state or simulation results. (PR #1396) * Correct the units designations of the gravity wave drag diagnostics variables dusfcg, dvsfcg, dtaux3d and dtauy3d in the atmosphere core's Registry.xml file. (PR #1378) MPAS-Atmosphere Misc.: * Remove PV diagnostic fields from the default "output" stream for MPAS-Atmosphere, reducing the size of the default "history" netCDF files by ~20%. (PR #1428) * Modify the MPAS-Atmosphere CMake build system to use manage_externals to obtain specific tags from the https://github.com/NCAR/MMM-physics.git and https://github.com/NOAA-GSL/UGWP.git repositories, rather than simply obtaining the HEAD of the default branch. This modification corrects build failures when using CMake. (PR #1421) CheMPAS-A: * Enable linking with the MUSICA-Fortran library to support development of chemistry capabilities based on MICM and TUV-x. (PR #1309) * Add a new namelist group, &musica, with a single option, config_micm_file, to control the MICM configuration in MPAS-Atmosphere. The new namelist group is only included in the namelist.atmosphere file (and therefore, only recognized) when MPAS is compiled with support for the MUSICA library. (PR #1376) * Introduce directory structure and stub modules for MUSICA, and more broadly, for chemistry options in the atmosphere core. (PR #1360) New directories and modules include: src/ core_atmosphere/ chemistry/ <--| mpas_atm_chemistry.F <--| musica/ <--| new in this release mpas_musica.F <--| Infrastructure: * Introduce the ability to partition meshes "online" at model startup using the PT-Scotch library. (PR #1364) * Enable execution of halo exchanges directly on GPU-resident fields when MPAS is linked with an MPI library that is GPU-aware. To enable GPU-aware halo exchanges, a new namelist option, config_gpu_aware_mpi, in the &development namelist group must be set to true at runtime. (PR #1355) * Improve support for using an external ESMF library through a new build option, MPAS_ESMF. (PR #1405) * Set the default PnetCDF header alignment to 128 KiB when creating new output files with SMIOL. This has been found to fix I/O issues when overwriting existing model output files under certain conditions. (PR #1386) * Fix an issue with macro expansion with newer Intel oneAPI compilers by adding a flag for the 'intel' build target to change the order of macro expansion in the Fortran pre-processor. This change in macro expansion order fixes an issue with some nested macro use in MPAS. (PR #1392) * Fix a buffer overflow in the streaminfo_query function in the mpas_stream_inquiry module , where the local array c_attname was allocated without space for a C null character. (PR #1352)
This commit replaces hardcoded links to
external/esmf_time_f90in Makefiles withMPAS_ESMF_INCandMPAS_ESMF_LIBS.MPAS_ESMF_INCandMPAS_ESMF_LIBSare calculated in the rootMakefiledepending onMPAS_ESMF=embedded(default) orMPAS_ESMF=external.MPAS_ESMF=embeddedwill use theexternal/esmf_time_f90folder andMPAS_ESMF=externalwill read INC and LIBS variables in aESMFMKFILEfile. These variables are then exported for all other Makefiles.I first tried adding include paths and libraries to
FCINCLUDESandLIBSbut this failed while checking PIO when executingMPAS_ESMF=embeddedbecauseexternal/esmf_time_f90isn't build until after the PIO check.As I'm new to MPAS and the MPAS build system please let me know if I'm on the right track.
Testing
Testing within a Docker container that includes mpich, netcdf-c, netcdf-fortran, parallel-netcdf, parallelio, and esmf (libraries installed using spack).
make clean gnu CORE="atmosphere"make clean gnu CORE="atmosphere" MPAS_ESMF=embeddedmake clean gnu CORE="atmosphere" MPAS_ESMF=externalESMFMKFILEenvironment variableBefore change
clean build ~2m24s
rebuild. ~0m18s
MPAS_ESMF=embedded
clean build ~2m25s
rebuild ~0m18s
MPAS_ESMF=external
clean build ~3m38s
rebuild ~0m35s