wiki:access/build-oasis3

Usage

To compile components load the module and add to LDLIBS

-lpsmile.MPI1 -lmpp_io

See the Oasis documentation for how to run.

Install

Source repository at svn://memphis.cerfacs.fr/home/oasis/PRISMSVN/trunk/oasis3

Install path ~saw562/apps/oasis3

Install instructions:

#!/bin/bash

DEST=~saw562/apps/oasis3

# Depends on netcdf and mpi versions
module load openmpi/1.6.3
module load netcdf/3.6.3
svn checkout svn://memphis.cerfacs.fr/home/oasis/PRISMSVN/trunk/oasis3
cd oasis3
REV=$(svn info | sed -n 's/Revision: //p')

# Add local definitions for the makefiles
cat > util/make_dir/make.inc << EOF
ARCHDIR=\$(COUPLE)/build

CHAN=MPI1
FFLAGS=-g -O3 -xHost -r8 -i4 -fpp \$(CPPDEF)
F90FLAGS=\$(FFLAGS)
f90FLAGS=\$(FFLAGS)
fFLAGS=\$(FFLAGS)
CCFLAGS=-g -O3 -xHost \$(CPPDEF)
FLIBS=-lnetcdff -lnetcdf

F90=mpif90
F=\$(F90)
f90=\$(F90)
f=\$(F90)
CC=mpicc
LD=\$(F90)

CPPDEF=-Duse_libMPI -Duse_netCDF -Duse_comm_\$(CHAN) -DDEBUG -D__VERBOSE -DTREAT_OVERLAY
# BINDIR        : directory for executables
BINDIR          = \${ARCHDIR}/bin
# LIBBUILD      : contains a directory for each library
LIBBUILD        = \${ARCHDIR}/build/lib
# INCPSMILE     : includes all *o and *mod for each library
INCPSMILE       = -I\${LIBBUILD}/psmile.${CHAN} -I\${LIBBUILD}/pio  -I\${LIBBUILD}/mct  
EOF

make -C util/make_dir -f TopMakefileOasis3 oasis3_psmile COUPLE=$PWD

# This creates the following files to be put in the install path:
# build/bin/oasis3.MPI1.x: Oasis coupler
# build/lib/libpsmile.MPI1.a,libmpp_io.a: Interface library to be linked with components
# build/build/lib/psmile.MPI1/*.mod: Module files for compiling components

# Copy to version folder
mkdir $DEST/$REV/{bin,lib,include}
cp build/bin/oasis3.MPI1.x $DEST/$REV/bin
cp build/lib/{libpsmile.MPI1.a,libmpp_io.a} $DEST/$REV/lib
cp build/build/lib/psmile.MPI1/*.mod $DEST/$REV/include

The module file then needs to be updated, it should check to make sure MPI and NetCDF are the correct versions. Update the .version file if neccessary

#%Module

set help     "Oasis3 coupler for climate models"
set prefix   "~saw562/apps/oasis3/3548"

conflict     "oasis3"

# May add different dependancy versions in the future
prereq       openmpi/1.4.3
setenv       OASIS3_MPI      "openmpi-1.4.3"

prereq       netcdf/3.6.3
setenv       OASIS3_NETCDF   "netcdf-3.6.3"

source       "~saw562/modules/common"
Last modified 6 years ago Last modified on Oct 10, 2014 2:29:13 PM