Skip to content

Commit

Permalink
Merge branch '5.2-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
chantal-pic committed Aug 28, 2023
2 parents 1d711f7 + 3bb69b5 commit a620567
Show file tree
Hide file tree
Showing 28 changed files with 2,168 additions and 640 deletions.
10 changes: 5 additions & 5 deletions .eccc_setup_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
DOMAIN=`hostname -d`

if [[ ${DOMAIN} = "collab.science.gc.ca" ]]; then
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/SCIENCE/gpscc2/gnu-9.3.0
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/SCIENCE/gpscc2/gnu-9.3.0
elif [[ -z "${DOMAIN}" || ${DOMAIN} = "science.gc.ca" ]]; then
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/SCIENCE/gnu-9.3.0
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/SCIENCE/gnu-9.3.0
else
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/ECCC/gnu-9.3.0
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/ECCC/gnu-9.3.0
fi

# Load latest version of RPN-SI libraries
. r.load.dot rpn/libs/20230516
. r.load.dot rpn/utils/20230414
. r.load.dot rpn/libs/20230531
. r.load.dot rpn/utils/20230531

# We need a more recent version of cmake than the one available by default
. ssmuse-sh -d main/opt/cmake/cmake-3.21.1
Expand Down
10 changes: 5 additions & 5 deletions .eccc_setup_intel
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
DOMAIN=`hostname -d`

if [[ ${DOMAIN} = "collab.science.gc.ca" ]]; then
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/SCIENCE/gpscc2/inteloneapi-2022.1.2
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/SCIENCE/gpscc2/inteloneapi-2022.1.2
elif [[ -z "${DOMAIN}" || ${DOMAIN} = "science.gc.ca" ]]; then
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/SCIENCE/inteloneapi-2022.1.2
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/SCIENCE/inteloneapi-2022.1.2
else
. r.load.dot rpn/code-tools/ENV/cdt-1.6.3/ECCC/inteloneapi-2022.1.2
. r.load.dot rpn/code-tools/ENV/cdt-1.6.4/ECCC/inteloneapi-2022.1.2
fi

# Load latest version of RPN-SI libraries and utilities
. r.load.dot rpn/libs/20230516
. r.load.dot rpn/utils/20230414
. r.load.dot rpn/libs/20230531
. r.load.dot rpn/utils/20230531

# Load Intel FFTW if on rhel
if [[ ${ORDENV_DIST} = "rhel" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "cmake_rpn"]
path = cmake_rpn
url = ../cmake_rpn.git
branch = dev
branch = master
[submodule "src/rpn-si/vgrid"]
path = src/rpn-si/vgrid
url = ../vgrid.git
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME : gem
VERSION : 5.2.0-rc1
VERSION : 5.2.0-rc3
BUILD : RelWithDebInfo
DESCRIPTION: ECCC-MRD Global Environmental Multi-scale model - GEM
SUMMARY : The Global Environmental Multiscale Model (GEM) is an integrated forecasting and data assimilation system developed by the Atmospheric Numerical Prediction Research Section, Meteorological Research Division, of Environment and Climate Change Canada.
Expand All @@ -15,5 +15,5 @@ tdpack >= 1.6.2
vgrid >= 6.9.2
rpncomm >= 4.6.3
modelutils = 1.7.0-rc1
rpnphy = 6.2.0-rc1
gemdyn = 5.2.0-rc1
rpnphy = 6.2.0-rc3
gemdyn = 5.2.0-rc2
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ MAKEFLAGS += --no-print-directory
cmake:
( cd build-${GEM_ARCH} && cd `/bin/pwd` && cmake ${gem_DIR} )

# Outside CMC: COMPILER_SUITE must be specified for Intel
# Using static Intel libraries
cmake-static:
( cd build-${GEM_ARCH} && cd `/bin/pwd` && cmake -DSTATIC_INTEL=ON ${gem_DIR} )

# Outside CMC: COMPILER_SUITE may need to be specified for Intel
cmake-intel:
( cd build-${GEM_ARCH} && cd `/bin/pwd` && cmake -DCOMPILER_SUITE=intel ${gem_DIR} )

Expand Down
46 changes: 27 additions & 19 deletions README-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Before the first build:
. ./.initial_setup
# building and installing GEM
# please see other options with cado -h
# please see other options with cado -h or by using tab completion
cado cmake
cado -j work
Expand All @@ -39,7 +39,7 @@ To compile and run GEM, you will need:
- OpenMP support (optional)
- (BLAS,LAPACK) or equivalent mathematical/scientific library (ie: MKL), with development package,
- fftw3 library (with development package),
- basic Unix utilities such as cmake (version 3.16 minimum), bash, sed, etc.
- basic Unix utilities such as cmake (version 3.20 minimum), bash, sed, etc.

```
# clone everything, including libraries and tools included as git submodules
Expand Down Expand Up @@ -67,8 +67,6 @@ mkdir -p build
cd build
# default compiler is gnu
cmake ..
# or, for Intel:
cmake .. -DCOMPILER_SUITE=intel
# Create an execution environment for GEM
make -j work
Expand Down Expand Up @@ -100,7 +98,7 @@ voir -iment RUNMOD/output/cfg0000/ ...
fststat -fst RUNMOD/output/cfg0000/ ...
```

[SPI](https://github.com/ECCC-ASTD-MRD/SPI) can be used to view the output
[SPI](https://github.com/ECCC-ASTD-MRD/SPI-Bundle) can be used to view the output
files.

2D fields can also be displayed with
Expand All @@ -117,7 +115,7 @@ To compile and run GEM, you will need:
- OpenMP support (optional)
- (BLAS,LAPACK) or equivalent mathematical/scientific library (ie: MKL), with development package,
- fftw3 library (with development package),
- basic Unix utilities such as cmake (version 3.16 minimum), bash, sed, etc.
- basic Unix utilities such as cmake (version 3.20 minimum), bash, sed, etc.

## Data for examples

Expand All @@ -133,7 +131,7 @@ link:
- By default GEM is configured to use gfortran and gcc compilers, and OpenMPI
- Changes to the C and Fortran flags can be done in the **CMakeLists.txt**
file, under the section **# Adding specific flags for GEM**.
- You can also check the C and Fortran flags in **cmake_rpn/ec_compiler_presets/default/Linux-x86_64/gnu.cmake**
- You can also check the C and Fortran flags in **cmake_rpn/modules/ec_compiler_presets/default/Linux-x86_64/gnu.cmake**
- Make sure the compilers and libraries paths are set in the appropriate
environment variables (PATH and LD_LIBRARY_PATH). Here are some examples
of commands, which you will need to adapt for your setup:
Expand All @@ -156,13 +154,13 @@ link:

- Changes to the C and Fortran flags can be done in the **CMakeLists.txt**
file, under the section **# Adding specific flags for GEM**.
- You can also check the C and Fortran flags in **cmake_rpn/ec_compiler_presets/default/Linux-x86_64/intel.cmake**
- You can also check the C and Fortran flags in **cmake_rpn/modules/ec_compiler_presets/default/Linux-x86_64/intel.cmake**
- You may need to modify ```-march``` to generate code that can run on your
system
- Make sure the compilers and libraries are in the appropriate
environment variables (```PATH``` and ```LD_LIBRARY_PATH```)
- As gnu is the default compiler suite, use the following command to compile
with Intel: ```cmake .. -DCOMPILER_SUITE=intel```
- As gnu is the default compiler suite, you may have to use the following
command to compile with Intel: ```cmake .. -DCOMPILER_SUITE=intel```

## Compiling and installing GEM

Expand All @@ -181,12 +179,12 @@ command line.
This release has been tested with GNU and Intel compilers on Linux x86_64.
Other compilers have also been used in the past, but have not been tested
with the current release. You will likely have to modify the *.cmake files
in the **cmake_rpn/ec_compiler_presets/default/** folder.
in the **cmake_rpn/modules/ec_compiler_presets/default/** folder.

If you get error messages (for example, compiler, OpenMP or MPI/OpenMPI not
found), make sure that the ```PATH``` and ```LD_LIBRARY_PATH``` environment
variables contain the appropriate paths. You can also add
```-DCMAKE_VERBOSE_MAKEFILE=ON``` to you **cmake** command line to generate
```-DCMAKE_VERBOSE_MAKEFILE=ON``` to your **cmake** command line to generate
verbose makefiles which will print the exact compiler command lines issued.

If the compiler or compile options are not right:
Expand All @@ -199,7 +197,7 @@ If the compiler or compile options are not right:
The installation process will create a directory named after the operating system
on which the compilation was executed, and the compiler you used
(work-[OS_NAME]-[COMPILER_NAME]). For example
*work-Fedora-34-x86_64-gnu-11.2.1* would be created in the main directory,
*work-FedoraLinux-37-x86_64-gnu-12.3.1* would be created in the main directory,
and the following executables installed in the *bin* sub-folder:

- cclargs_lite
Expand All @@ -221,13 +219,23 @@ and the following executables installed in the *bin* sub-folder:
- voir
- yy2global

A script named GEM-config is also installed. It displays a summary of the
A script named gem-config is also installed. It displays a summary of the
architecture, compiler, and flags used.

## Structure of the working environment

The following environment variables are created:
- gem_DIR = directory where the git clone was created
- GEM_WORK = work directory
- GEM_ARCH = architecture, for example FedoraLinux-37-x86_64-gnu-12.3.1
- ATM_MODEL_DFILES = gem database directory
- COMPILER_SUITE = compiler suite, for example gnu
- COMPILER_VERSION = compiler version, for example 12.3.1

## Running GEM

Go to the working directory, named *work-[OS_NAME]-[COMPILER_NAME]*, for
example *work-Fedora-34-x86_64-gnu-11.2.1*
example *work-FedoraLinux-37-x86_64-gnu-12.3.1*

```
cd work-[OS_NAME]-[COMPILER_NAME]
Expand All @@ -238,7 +246,7 @@ runprep.sh -dircfg configurations/GEM_cfgs_GY_FISL_P
runmod.sh -dircfg configurations/GEM_cfgs_GY_FISL_P
```

*runmod.sh*'s ```-ptopo``` argument can be used to specify the number of CPU to
*runmod.sh* ```-ptopo``` argument can be used to specify the number of CPU to
use. For example, ```-ptopo 2x2x1``` will use 4 cpus for a LAM, and
8 cpus for global Yin-Yang.

Expand Down Expand Up @@ -291,7 +299,7 @@ various tasks on the output files:
editfst -s <input FST> -d <output FST> -i <editfst.directives>
```

[SPI](https://github.com/ECCC-ASTD-MRD/SPI) is a scientific and
[SPI](https://github.com/ECCC-ASTD-MRD/SPI-Bundle) is a scientific and
meteorological virtual globe offering processing, analysis and visualization
capabilities, with a user interface similar to Google Earth and NASA World
Wind, developed by Environment Canada.
Expand All @@ -306,8 +314,8 @@ Research Division, Environment and Climate Change Canada.
The execution of all three components of GEM is configurable through the use
of three configuration files called:
- gem_settings.nml: file containing some namelists to configure the model execution
- outcfg.out: file use to configure the model output
- configexp.cfg: file use to configure the execution shell environment
- outcfg.out: file used to configure the model output
- configexp.cfg: file used to configure the execution shell environment

Examples of these files can be found in the test cases in the configurations
directory.
Expand Down
6 changes: 6 additions & 0 deletions _cado
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ cado_commands=(
cmake-all
cmake-debug
cmake-debug-extra
cmake-mach
cmake-mach-static
cmake-all-mach
cmake-mach-debug
build
work
install
package
help
)
Expand All @@ -21,6 +26,7 @@ favorite_makefile_targets=(
rpnphy
rmn
modelutils
install
# ...
)

Expand Down
14 changes: 14 additions & 0 deletions cado
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ this_project=GEM
cmake_all_command='WITH_SYSTEM_RPN=FALSE cmake -S . -B ${build_dir} "$@"'
cmake_debug_command='cmake -S . -B ${build_dir} -DCMAKE_BUILD_TYPE=Debug" $@"'
cmake_debug_extra_command='cmake -S . -B ${build_dir} -DCMAKE_BUILD_TYPE=Debug" -DEXTRA_CHECKS_ON $@"'
cmake_mach_command='cmake -S . -B ${build_dir} -DWITH_MACH=TRUE "$@"'
cmake_mach_static_command='cmake -S . -B ${build_dir} -DWITH_MACH=TRUE -DSTATIC_INTEL=ON "$@"'
cmake_all_mach_command='WITH_SYSTEM_RPN=FALSE cmake -S . -B ${build_dir} -DWITH_MACH=TRUE "$@"'
cmake_mach_debug_command='cmake -S . -B ${build_dir} -DWITH_MACH=TRUE -DCMAKE_BUILD_TYPE=Debug" $@"'

build_command='cmake --build ${build_dir} -- "$@"'
work_command='cmake --build ${build_dir} --target work -- "$@"'
install_command='cmake --build ${build_dir} --target install -- "$@"'
package_command='cmake --build ${build_dir} --target package -- "$@"'
clean_command='cmake --build ${build_dir} --target clean -- "$@"'

Expand Down Expand Up @@ -105,6 +110,10 @@ COMMANDS:
cmake-all: configure using sources of RPN libraries (WITH_SYSTEM_RPN is set to FALSE)
cmake-debug: configure with debug flags (-DCMAKE_BUILD_TYPE=Debug)
cmake-debug-extra: configure with debug flags and extra compile-time checks (-DCMAKE_BUILD_TYPE=Debug -DEXTRA_CHECKS=ON)
cmake-mach: configure using installed RPN libraries (-DWITH_MACH=TRUE)
cmake-mach-static: configure using installed RPN libraries and static Intel libraries (-DSTATIC_INTEL=ON -DWITH_MACH=TRUE)
cmake-all-mach: configure using sources of RPN libraries (WITH_SYSTEM_RPN is set to FALSE -DWITH_MACH=TRUE)
cmake-mach-debug: configure with debug flags (-DCMAKE_BUILD_TYPE=Debug -DWITH_MACH=TRUE)
building: (Additional arguments forwarded to make (like -j))
build: Build entire project
Expand Down Expand Up @@ -155,8 +164,13 @@ case "${name}" in
cmake-all) cmd=${cmake_all_command} ;;
cmake-debug) cmd=${cmake_debug_command} ;;
cmake-debug-extra) cmd=${cmake_debug_extra_command} ;;
cmake-mach) cmd=${cmake_mach_command} ;;
cmake-mach-static) cmd=${cmake_mach_static_command} ;;
cmake-all-mach) cmd=${cmake_all_mach_command} ;;
cmake-mach-debug) cmd=${cmake_mach_debug_command} ;;
build) cmd=${build_command} ;;
work) cmd=${work_command} ;;
install) cmd=${install_command} ;;
package) cmd=${package_command} ;;
clean) cmd=${clean_command} ;;
help|--help) print_cado_help ; exit 0 ;;
Expand Down
4 changes: 2 additions & 2 deletions scripts/gem_nml_mkref
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# @Author: S.Chamberland
# @Date: Feb 2016

set -x
DESC='Create a reference nml for gem'

eval $(rpy.cclargparse \
Expand Down Expand Up @@ -33,6 +32,8 @@ EOF
exit 1
fi

export gemdyn_version=${gemdyn_version:-${ATM_MODEL_VERSION}}
export rpnphy_version=${rpnphy_version:-${ATM_MODEL_VERSION}}
a=$(which gemdyn_nml_mkref)
b=$(which rpnphy_nml_mkref)
if [[ x"${a}" == x"" || x"${b}" == x"" ]] ; then
Expand Down Expand Up @@ -60,4 +61,3 @@ mv ${nmlfilename} ${myfile}
cd ${here}
rm -rf ${localtmp}
exit 0
set +x
Loading

0 comments on commit a620567

Please sign in to comment.