diff --git a/doc/UsersGuide/source/CodeOverview.rst b/doc/UsersGuide/source/CodeOverview.rst index d33e9aa7c3..e01d2e5c91 100644 --- a/doc/UsersGuide/source/CodeOverview.rst +++ b/doc/UsersGuide/source/CodeOverview.rst @@ -1,7 +1,107 @@ .. _CodeOverview: - + ************************* Code Overview ************************* -Description of directories and files from repository +=================================================== +UFS Weather Model Hierarchical Repository Structure +=================================================== + +The ufs-weather-model repository supports the short- and medium-range UFS applications. It contains atmosphere and wave components and some infrastructure components. Each of these components has its own repository. All the repositories are currently located in GitHub with public access to the broad community. :numref:`Table %s ` describes the list of repositories that comprises the ufs-weather-model. + +.. _Repo_Structure: + +.. list-table:: *List of Repositories that comprise the ufs-weather-model* + :widths: 50 50 + :header-rows: 1 + + * - Repository Description + - Authoritative repository URL + * - Umbrella repository for the UFS Weather Model + - https://github.com/ufs-community/ufs-weather-model + * - Infrastructure: Flexible Modeling System + - https://github.com/NOAA-EMC/FMS + * - Infrastructure: NOAA Environmental Modeling System + - https://github.com/NOAA-EMC/NEMS + * - Infrastructure: add description + - https://github.com/NOAA-EMC/NCEPLIBS-pyprodutil + * - Framework to connect the CCPP library to a host model + - https://github.com/NCAR/ccpp-framework + * - CCPP library of physical parameterizations + - https://github.com/NCAR/ccpp-physics + * - Umbrella repository for the physics and dynamics of the atmospheric model + - https://github.com/NOAA-EMC/fv3atm + * - FV3 dynamical core + - https://github.com/NOAA-EMC/GFDL_atmos_cubed_sphere + * - Stochastic physics pattern generator + - https://github.com/noaa-psd/stochastic_physics + * - WAVEWATCH 3 wave model + - https://github.com/NOAA-EMC/WW3 + +In the table, the left column contains a description of each repository, and the right column shows the component repositories which are pointing to (or will point to) the authoritative repositories. The ufs-weather-model currently uses git submodule to manage the sub-components. + +The umbrella repository for the UFS Weather Model is named ufs-weather-model. Under this repository reside a number of submodules that are nested in specific directories under the parent repository’s working directory. When the ufs-weather-model repository is cloned, the *.gitmodules* file creates the following directories: + +.. code-block:: console + + ufs-weather-model/ + ├── FMS https://github.com/NOAA-GFDL/FMS + ├── FV3 https://github.com/NCAR/fv3atm + │ ├── atmos_cubed_sphere https://github.com/NCAR/GFDL_atmos_cubed_sphere + │ ├── ccpp + │ │ ├── framework https://github.com/NCAR/ccpp-framework + │ │ ├── physics https://github.com/NCAR/ccpp-physics + ├── NEMS https://github.com/NCAR/NEMS + │ └── tests/produtil/NCEPLIBS-pyprodutil https://github.com/NOAA-EMC/NCEPLIBS-pyprodutil + ├── stochastic_physics https://github.com/noaa-psd/stochastic_physics + └── WW3 https://github.com/NOAA-EMC/WW3 + +=================== +Directory Structure +=================== + +When the ufs-weather-model is cloned, the basic directory structure will be similar to the example below. Files and some directories have been removed for brevity. + +.. code-block:: console + + ufs-weather-model/ + ├── cmake --------- cmake configuration files + ├── compsets --------- configurations used by some regression tests + ├── conf --------- unused + ├── doc --------- READMEs with build, reg-test hints + ├── FMS --------- The Flexible Modeling System (FMS),a software framework + ├── FV3 --------- FV3 atmosphere model + │ ├── atmos_cubed_sphere ---- FV3 dynamic core + │ │ ├── docs + │ │ ├── driver + │ │ ├── model + │ │ └── tools + │ ├── ccpp -------- Common Community Physics Package + │ │ ├── config + │ │ ├── driver + │ │ ├── framework -------- CCPP framework + │ │ ├── physics -------- CCPP compliant physics schemes + │ │ └── suites -------- CCPP physics suite definition files (SDFs) + │ ├── cpl -------- Coupling field data structures + │ ├── gfsphysics -------- unused - IPD version of physics codes + │ │ ├── CCPP_layer + │ │ ├── GFS_layer + │ │ └── physics + │ ├── io --------- nemsio code + │ ├── ipd --------- unused - IPD driver/interfaces + │ ├── test --------- unused + ├── log --------- log files from NEMS compset regression tests + ├── modulefile --------- system module files for supported HPC systems + ├── NEMS --------- NOAA Earth Modeling System framework + │ ├── exe + │ ├── src + │ └── test + ├── parm --------- regression test configurations + ├── release --------- unused + ├── stochastic_physics -------- stochastic physics pattern generator + ├── tests --------- regression test scripts + └── WW3 --------- WAVEWATCH III (wave component) + +The physics subdirectory in the *gfsphysics* directory is not used or supported as part of this release (all physics is available through the :term:`CCPP`). + diff --git a/doc/UsersGuide/source/CompilingCodeWithoutApp.rst b/doc/UsersGuide/source/CompilingCodeWithoutApp.rst index ddbc92b10e..f1357fc977 100644 --- a/doc/UsersGuide/source/CompilingCodeWithoutApp.rst +++ b/doc/UsersGuide/source/CompilingCodeWithoutApp.rst @@ -1,7 +1,92 @@ .. _CompilingCodeWithoutApp: -********************************* -Compiling the Code without an App -********************************* +***************************************** +Compiling the Code without an Application +***************************************** + +UFS weather model uses the cmake build system. Since UFS weather model requires several external libraries to be available and appropriate environment variables pointing to those libraries to be set, a build script named ``build.sh`` is provided In the top-level directory of the repository to ensure all necessary variables are actually set. + +The required libraries and environment variables can be set as shown in :numref:`Table %s ` and :numref:`Table %s ` for the bash shell. + +1. NCEP libraries: + +.. _ReqLibEnvVar: + +.. list-table:: *List of NCEP libraries that comprise the ufs-weather-model* + :widths: 20 80 + :header-rows: 1 + + * - NCEP Library + - Environment Variables + * - nemsio + - export NEMSIO_INC= + * - + - export NEMSIO_LIB=/libnemsio.a + * - bacio + - export BACIO_LIB4=/libbacio.a + * - splib + - export SP_LIBd=/libsp_d.a + * - w3emc + - export W3EMC_LIBd=/libw3emc_d.a + * - w3nco + - export W3NCO_LIBd=/libw3nco_d.a + +2. Third party libraries: + +.. _ReqLibEnvVar2: + +.. list-table:: *List of External libraries that comprise the ufs-weather-model* + :widths: 20 80 + :header-rows: 1 + + * - Third Party Library + - Environment Variables + * - NetCDF + - export NETCDF= + * - ESMF + - export ESMFMKFILE=/esmf.mk + +You can either manually set those environment variables in your shell, or if you are on one of the supported platforms (Tier 1) the easiest way of setting those variables is by using environment module and load all required modules. Modulefiles for all supported platforms are located in ``modulefiles//fv3``. To load those modules, for example on hera, run: + +.. code-block:: console + + $ cd modulefiles/hera.intel + $ module use $(pwd) + $ module load fv3 + $ cd ../.. + +Currently the build system supports two compiler families: GNU and Intel. The COMPILE environment variable must be set to either ‘gnu’ or ‘intel’ before running build script. For example, to use Intel compilers when using the bash shell, run: + +.. code-block:: console + + $ export COMPILER=intel + +You can further customize compiler MPI wrappers by setting these four environment variables: + +.. code-block:: console + + CMAKE_Platform : if not set the default is linux.${COMPILER} + CMAKE_C_COMPILER : if not set the default is mpicc + CMAKE_CXX_COMPILER : if not set the default is mpicxx + CMAKE_Fortran_COMPILER : if not set the default is mpif90 + +In order to have one or more CCPP physics suites available at runtime, you need to select those suites at build time by setting the ``CCPP_SUITES`` environment variable. Multiple suites can be set, as shown below in an example for the bash shell + +.. code-block:: console + + $ export CCPP_SUITES=’FV3_GFS_2017_gfdlmp,FV3_GFS_v15’ + +If ``CCPP_SUITES`` is not set, the default is ``‘FV3_GFS_2017_gfdlmp’``. + +After setting all the environment variables, you can build the model using + +.. code-block:: console + + $ ./build.sh + +Once ``build.sh`` is finished, you should see the executable, named ufs_weather_model, in the top-level directory. + + + + -How to build the code using compile.sh and not CIME