-
Notifications
You must be signed in to change notification settings - Fork 3
Build the Ocean LETKF
Ocean-LETKF requires 5 packages of libs:
- one fortran compiler (e.g., ifort or gfortran)
- one MPI implementation with fortran support (e.g., openMPI or MPICH)
- NetCDF lib with Fortran support
- HDF5 lib with Fortran support, which are used to read SMAP L2 data stored in HDF5 files.
- (optional) BUFRLIBS and one C compiler (e.g., gcc or icc) if building Ocean-letkf for the model
hycom
.
If the local lib of BUFRLIBS is not available, ocean-LETKF will download BUFRLIBS and install it under support/bufr_<version>
. Check config/LOCAL_GFORTRAN.bufr.sh for more info.
Ocean-LETKF currently supports the following 8 models:
- MOM6
- MOM4
- HYCOM
- HYCOM_NRL
- ROMS
- NEMO
- SIS
- CICE5
- Create machine configuration files under
config/<machine>.*.sh
(e.g., <machine>=LOCAL_GFORTRAN) - Modify
MACHINE=<machine>
in the fileconfig/machine.sh
- build obsop and letkf under
build/make_obsop.<model>.sh
(e.g., <model>=mom6)
cd build
bash make_obsop.<model>.sh
bash make_letkf.<model>.sh
The main usage of CMAKE is to build the MOM6-LETKF as an application of the model GEOS-ESM. Unless you are using GEOS-ESM, you should always build the ocean-letkf through cmake
with the option SOLO_BUILD=ON
.
Note though libsrc/CMakelists.txt
lists several model names, only mom6
has been supported yet
Most users will probably build MOM6-LETKF with local NetCDF & MPI libs by turning on the option SOLO_BUILD=ON
when running cmake
mkdir cbuild && cd cbuild
cmake .. -DCMAKE_Fortran_COMPILER=<your_fortran_compiler> -DSOLO_BUILD=ON -DMODEL=mom6 -DCMAKE_INSTALL_PREFIX=<your_install_location>
make
make install
If you built the netcdf library under an unusual location or you have multiple netcdf libraries on your current system, you can assign CMAKE_INCLUDE_PATH
or CMAKE_LIBRARY_PATH
,
mkdir cbuild && cd cbuild
cmake .. -DCMAKE_Fortran_COMPILER=<your_fortran_compiler> -DSOLO_BUILD=ON -DMODEL=mom6 \
-DCMAKE_INCLUDE_PATH="<your_netcdf_include>;<your_hdf5_include>" \
-DCMAKE_LIBRARY_PATH="<your_netcdf_lib>;<your_hdf5_lib>" \
-DCMAKE_INSTALL_PREFIX=<your_install_location>
make
make install
On building OCEAN-LETKF with EMSA_baselibs
on Discover, the command will be like:
mkdir cbuild && cd cbuild
cmake .. -DCMAKE_Fortran_COMPILER=ifort -DSOLO_BUILD=on -DMODEL=mom6 \
-DCMAKE_INCLUDE_PATH="$BASEDIR/Linux/include/netcdf;$BASEDIR/Linux/include/hdf5" \
-DCMAKE_LIBRARY_PATH="$BASEDIR/Linux/lib" \
-DCMAKE_INSTALL_PREFIX=<your_install_location>
make
make install
On Mac with gfortran
, the command will be like:
mkdir cbuild && cd cbuild
cmake .. -DCMAKE_Fortran_COMPILER=gfortran -DSOLO_BUILD=on -DMODEL=mom6 \
-DCMAKE_INCLUDE_PATH="$BASEDIR/Darwin/include/netcdf;$BASEDIR/Darwin/include/hdf5" \
-DCMAKE_LIBRARY_PATH="$BASEDIR/Darwin/lib" \
-DCMAKE_INSTALL_PREFIX=<your_install_location>
make
make install
Add -DCMAKE_BUILD_TYPE=Debug
or -DCMAKE_BUILD_TYPE=Release
.
to be tested.
Each push or pull request will trigger the build tests at Github Actions (https://github.com/UMD-AOSC/Ocean-LETKF/actions), to ensure the commit does not break the building process. There are
- 9 tests for building all models supported by Ocean-LETKF through
build/make_*.sh
tools. - 1 test for building MOM6-LETKF with
cmake
.