Skip to content
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

Updating modulefiles to work with latest spack-stack #501

Merged
merged 9 commits into from
Aug 19, 2024
30 changes: 19 additions & 11 deletions scm/doc/TechGuide/chap_quick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,9 @@ However, we have provided an example procedure in
The main downside to spack-stack is that it contains a large number of libraries and utilities used by the whole
Unified Forecast System and related applications, only a minority of which are required for the SCM. Users may
install libraries manually if they wish, but they will need to make sure the appropriate environment variables
are set to the correct values so that the build system can find them, as described in the following chapter.
are set to the correct values so that the build system can find them, as described in the following paragraphs.


Setting up compilation environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For users on a pre-configured platform, you can load the spack-stack environment via one of the provided modules in ``scm/etc/modules/``.
For example, users on the NSF NCAR machine Derecho who wish to use Intel compilers can do the following:

Expand All @@ -244,6 +241,19 @@ compilers (``CC``, ``CXX``, ``FC``), as well as the root directories for the lib
provided Dockerfile in ``ccpp-scm/docker/``, so users can reference that file for guidance on how to install this software
and set these variables.

If libraries were installed via spack-stack, users can load modules similarly to those available on pre-configured platforms.
For a user on MacOS, who has installed spack-stack with ``clang``/``gfortran`` compilers, they can set up the build environment
by setting the SPACK_STACK_DIR variable to the appropriate path, and loading the module as on pre-configured platforms described above.

::

export SPACK_STACK_DIR=[/path/to/spack-stack]
cd [path/to/ccpp-scm/]
module use scm/etc/modules/
module load macos_clang

A module file is also provided for a generic linux platform with gnu compilers. For other platforms/combinations, you may be able
to modify the provided modulefiles to work with your spack-stack install, otherwise reference the above procedure for manually installed libraries.

Python requirements
"""""""""""""""""""""
Expand Down Expand Up @@ -494,7 +504,7 @@ If using the main branch, you should run the above command to ensure you have th

- ``--case [-c]``

- **This is the only required argument.** The provided argument should correspond to the name of a case in
- The provided argument should correspond to the name of a case in
``../etc/case_config`` (without the ``.nml`` extension).

- ``--suite [-s]``
Expand Down Expand Up @@ -596,17 +606,15 @@ configuration files located in ``../etc/case_config`` (*without the .nml extensi
specifying a suite other than the default, the suite name used must
match the value of the suite name in one of the suite definition files
located in ``../../ccpp/suites`` (Note: not the filename of the suite definition file). As
part of the sixth CCPP release, the following suite names are supported:
part of the seventh CCPP release, the following suite names are supported:

#. SCM_GFS_v16

#. SCM_GFS_v17p8

#. SCM_RAP
#. SCM_GFS_v16_RRTMGP

#. SCM_HRRR
#. SCM_GFS_v17_p8_ugwpv1

#. SCM_RRFS_v1beta
#. SCM_HRRR_gf

#. SCM_WoFS_v0

Expand Down
20 changes: 0 additions & 20 deletions scm/etc/CENTOS_docker_setup.sh

This file was deleted.

25 changes: 12 additions & 13 deletions scm/etc/modules/derecho_gnu.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
help([[
This module loads libraries for building the CCPP Single-Column Model on
the CISL machine Derecho (Cray) using Intel-classic-2023.0.0
the CISL machine Derecho (Cray) using GNU 12.2.0
]])

whatis([===[Loads spack-stack libraries needed for building the CCPP SCM on Derecho with GNU compilers]===])

setenv("LMOD_TMOD_FIND_FIRST","yes")
load("ncarenv/23.09")
load("cmake/3.26.3")

prepend_path("MODULEPATH","/glade/work/epicufsrt/contrib/spack-stack/derecho/modulefiles")
prepend_path("MODULEPATH","/glade/work/epicufsrt/contrib/spack-stack/derecho/spack-stack-1.5.1/envs/unified-env/install/modulefiles/Core")
prepend_path("MODULEPATH","/lustre/desc1/scratch/epicufsrt/contrib/modulefiles_extra")
prepend_path("MODULEPATH","/glade/work/epicufsrt/contrib/spack-stack/derecho/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core")

load("stack-gcc/12.2.0")
load("stack-cray-mpich/8.1.25")
load("stack-python/3.10.8")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("stack-python/3.10.13")
load("cmake/3.23.1")

load("hdf5/1.14.0")
load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")
load("sp/2.5.0")
load("w3emc/2.10.0")

load("py-f90nml")
load("py-netcdf4/1.5.8")

setenv("CMAKE_C_COMPILER","mpicc")
setenv("CMAKE_CXX_COMPILER","mpicxx")
Expand Down
16 changes: 8 additions & 8 deletions scm/etc/modules/derecho_intel.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
help([[
This module loads libraries for building the CCPP Single-Column Model on
the CISL machine Derecho (Cray) using Intel-classic-2023.0.0
the CISL machine Derecho (Cray) using Intel-classic-2021.10.0
]])

whatis([===[Loads spack-stack libraries needed for building the CCPP SCM on Derecho with Intel compilers]===])

setenv("LMOD_TMOD_FIND_FIRST","yes")
load("ncarenv/23.09")
load("cmake/3.26.3")

prepend_path("MODULEPATH","/glade/work/epicufsrt/contrib/spack-stack/derecho/modulefiles")
prepend_path("MODULEPATH","/glade/work/epicufsrt/contrib/spack-stack/derecho/spack-stack-1.5.1/envs/unified-env/install/modulefiles/Core")
prepend_path("MODULEPATH","/lustre/desc1/scratch/epicufsrt/contrib/modulefiles_extra")
prepend_path("MODULEPATH", "/glade/work/epicufsrt/contrib/spack-stack/derecho/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core")

load("stack-intel/2021.10.0")
load("stack-cray-mpich/8.1.25")
load("stack-python/3.10.8")
load("stack-python/3.10.13")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("cmake/3.23.1")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")
load("sp/2.5.0")
load("w3emc/2.10.0")

setenv("CMAKE_C_COMPILER","cc")
setenv("CMAKE_CXX_COMPILER","CC")
Expand Down
2 changes: 1 addition & 1 deletion scm/etc/modules/hera_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ prepend_path("MODULEPATH", "/scratch2/NCEPDEV/stmp1/role.epic/spack-stack/spack-

load("stack-gcc/13.3.0")
load("stack-openmpi/4.1.6")
load("cmake/3.23.1")
load("stack-python/3.10.13")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("cmake/3.23.1")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")
Expand Down
2 changes: 1 addition & 1 deletion scm/etc/modules/hera_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-s

load("stack-intel/2021.5.0")
load("stack-intel-oneapi-mpi/2021.5.1")
load("cmake/3.23.1")
load("stack-python/3.10.13")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("cmake/3.23.1")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")
Expand Down
31 changes: 0 additions & 31 deletions scm/etc/modules/jet_gnu.lua

This file was deleted.

17 changes: 6 additions & 11 deletions scm/etc/modules/jet_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@ the NOAA RDHPC machine Jet using Intel-2021.5.0

whatis([===[Loads libraries needed for building the CCPP SCM on Jet with Intel compilers ]===])

prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/spack-stack/modulefiles")

load("cmake/3.26.4")
load("miniconda/3.9.12")

prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/role.epic/modulefiles")
prepend_path("MODULEPATH", "/mnt/lfs4/HFIP/hfv3gfs/role.epic/spack-stack/spack-stack-1.5.1/envs/unified-env/install/modulefiles/Core")
prepend_path("MODULEPATH","/mnt/lfs4/HFIP/hfv3gfs/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core")

load("stack-intel/2021.5.0")
load("stack-intel-oneapi-mpi/2021.5.1")
load("stack-python/3.10.8")
load("stack-python/3.10.13")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("cmake/3.23.1")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")
load("sp/2.5.0")
load("w3emc/2.10.0")

setenv("CMAKE_C_COMPILER","mpiicc")
setenv("CMAKE_CXX_COMPILER","mpiicpc")
Expand Down
6 changes: 2 additions & 4 deletions scm/etc/modules/linux_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ load("stack-openmpi/4.1.6")

load("cmake/3.28.3")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")

load("py-f90nml/1.4.3")
load("py-netcdf4/1.5.8")


load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.5.0")
load("w3emc/2.10.0")
Expand Down
6 changes: 2 additions & 4 deletions scm/etc/modules/macos_clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ load("stack-openmpi/4.1.6")

load("cmake/3.28.3")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")

load("py-f90nml/1.4.3")
load("py-netcdf4/1.5.8")


load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.5.0")
load("w3emc/2.10.0")
Expand Down
30 changes: 0 additions & 30 deletions scm/etc/modules/orion_gnu.lua

This file was deleted.

21 changes: 9 additions & 12 deletions scm/etc/modules/orion_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@ the NOAA RDHPC machine Orion using Intel-2021.5.0

whatis([===[Loads libraries needed for building the CCPP SCM on Orion with Intel compilers ]===])

prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/modulefiles")
prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/unified-env-rocky9/install/modulefiles/Core")

load("cmake/3.22.1")
load("python/3.9.2")

prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.5.1/envs/unified-env/install/modulefiles/Core")

load("stack-intel/2022.0.2")
load("stack-intel-oneapi-mpi/2021.5.1")
load("stack-python/3.10.8")
load("stack-intel/2021.9.0")
load("stack-intel-oneapi-mpi/2021.9.0")
load("stack-python/3.10.13")
load("py-f90nml")
load("py-netcdf4/1.5.8")
load("cmake/3.23.1")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("netcdf-fortran/4.6.1")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")
load("sp/2.5.0")
load("w3emc/2.10.0")


setenv("CMAKE_C_COMPILER","mpiicc")
setenv("CMAKE_CXX_COMPILER","mpiicpc")
Expand Down
3 changes: 3 additions & 0 deletions scm/src/run_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def parse_arguments():
mpi_command = args.mpi_command
stop_on_error = args.stop_on_error

if not case and not file:
parser.error('Either "--case" or "--file" must be specified. Use "--help" for more information.')

if not sdf:
sdf = DEFAULT_SUITE

Expand Down
2 changes: 1 addition & 1 deletion scm/src/supported_suites.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
suites = ["SCM_GFS_v16","SCM_GFS_v16_RRTMGP","SCM_GFS_v17_p8_ugwpv1","SCM_RAP","SCM_HRRR_gf","SCM_WoFS_v0"]
suites = ["SCM_GFS_v16","SCM_GFS_v16_RRTMGP","SCM_GFS_v17_p8_ugwpv1","SCM_HRRR_gf","SCM_WoFS_v0"]

Loading