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

Compile hycom oasis intel #219

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion TP2a0.10/expt_01.0/blkdat.input
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ S-Z(15-11): dp00/f/x/i=3m/1.125/12m/1m; ds=1m/1.125/4m; src_2.2.12;
0 'flxoff' = net flux offset flag (0=F,1=T)
0 'flxsmo' = smooth surface fluxes (0=F,1=T)
1 'relax ' = activate lateral boundary nudging (0=F,1=T)
0 'trcrlx' = activate lat. bound. tracer nudging (0=F,1=T)
1 'priver' = rivers as a precipitation bogas (0=F,1=T)
0 'triver' = total river including Greenland (0=F,1=T)
0 'epmass' = treat evap-precip as a mass exchange (0=F,1=T)
Expand Down
10 changes: 6 additions & 4 deletions TP2a0.10/expt_01.0/srjob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
##(( ncores = SLURM_NNODES * 24 ))
##(( ncores = SLURM_NNODES * 32 )) #on Fram

module load NCL/6.6.2-intel-2018b
module load FFTW/3.3.8-intel-2018b
module load Python/2.7.15-intel-2018b

module restore system
module load FFTW/3.3.10-GCC-11.3.0
module load ESMF/8.3.0-intel-2022a
module load Python/3.10.4-GCCcore-11.3.0
module load UDUNITS/2.2.28-GCCcore-11.3.0
module load intel/2022a

export NMPI=220
export SLURM_SUBMIT_DIR=$(pwd)
Expand Down
1 change: 0 additions & 1 deletion TP5a0.06/expt_01.0/blkdat.input
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ S-Z(15-11): dp00/f/x/i=3m/1.125/12m/1m; ds=1m/1.125/4m; src_2.2.12;
1 'relax ' = activate lateral boundary nudging (0=F,1=T)
0 'trcrlx' = activate lat. bound. tracer nudging (0=F,1=T)
0 'priver' = rivers as a precipitation bogas (0=F,1=T)
0 'triver' = total river including Greenland (0=F,1=T)
0 'epmass' = treat evap-precip as a mass exchange (0=F,1=T)
0 'nmrsti' = 'restart' Restart filename. Dot and date appended. Empty: use old hycom name.
0 'nmrsto' = 'restart' Restart filename. Dot and date appended. Empty: use old hycom name.
Expand Down
48 changes: 22 additions & 26 deletions hycom/RELO/config/Linux.fram.ifort_hycom
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,23 @@
# LDFLAGS: Loader flags.
# EXTRALIBS: Extra local libraries (if any).
#
#INCLUDES = -I/cluster/software/netCDF-Fortran/4.4.4-intel-2017a-HDF5-1.8.18/include -I${ESMF_MOD_DIR} -I${ESMF_DIR}include -I./CICE/rundir/compile

# --- Mostafa: flags required for standalone HYCOM
INCLUDES = -I${ESMF_MOD_DIR} -I${ESMF_DIR}include -I./CICE/rundir/compile
OASIS_DIR = /cluster/projects/nn9878k/guibou/NANUK/oa3-mct_iimpi2022a/
LIBPSMILE = $(OASIS_DIR)/lib/libpsmile.MPI1.a $(OASIS_DIR)/lib/libmct.a $(OASIS_DIR)/lib/libmpeu.a $(OASIS_DIR)/lib/libscrip.
a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems to compile of with the extension "a" of "libscrip" on the next line (line 20) rather than at the end of $(OASIS_DIR)/lib/libscrip. , but it would be best to delete the newline command for clarity

LIBBUILD = $(OASIS_DIR)/build/lib
INCLUDES = -I$(NETCFD_DIR)/include/

FC = mpiifort
#FCFFLAGS = -traceback -g -O2 -fp-model source -warn nogeneral -convert big_endian -assume byterecl -real-size 64 -integer-size 32
FCFFLAGS = -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8
#FCFFLAGS = -traceback -g -O2 -check all -fp-stack-check -fp-model source -warn nogeneral -convert big_endian -assume byterecl -real-size 64 -integer-size 32
#FCFFLAGS = -O2 -fconvert=big-endian -fdefault-real-8 -fdefault-double-8

FCFFLAGS := $(FCFFLAGS) $(INCLUDES)

FCFFLAGS = -g -convert big_endian -assume byterecl -cm -vec_report0 -w -O3 -tpp7 -xW -r8
FCFFLAGS := $(FCFFLAGS) $(INCLUDES) # -I$(LIBBUILD)
FCFFLAGS_OASIS = $(FCFFLAGS) -I$(LIBBUILD) -I$(OASIS_DIR)/build/lib/psmile.MPI1
CC = mpicc
CCFLAGS = -O
CCFLAGS = -O2
CCFLAGS_OASIS = -O2 -I. -cpp -Duse_comm_MPI1 -D__VERBOSE -DTREAT_OVERLAY -DDECOMP_APPLE -DUSE_DOUBLE_PRECISION


CPP = cpp -P
LD = $(FC)
#LDFLAGS = -V $(FCFFLAGS) -shared-intel -mcmodel=medium
LDFLAGS = $(FCFFLAGS) -mcmodel=medium

# ENDIAN_IO not needed due to byteswap compiler flag
Expand All @@ -42,20 +40,15 @@ LDFLAGS = $(FCFFLAGS) -mcmodel=medium
#
# if no STOKES:
# --- Mostafa: flags required for standalone HYCOM
CPPFLAGS = -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DNAN2003 -DTIMER -DRELO -DNERSC_HYCOM_CICE

#CPPFLAGS = -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DNAN2003 -DTIMER -DRELO -DUSE_ESMF -DUSE_ESMF_5 -DNERSC_HYCOM_CICE
CPPFLAGS = -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DNAN2003 -DTIMER -DRELO -DNERSC_HYCOM_CICE -DCPL_OASIS_HYCOM -DOFFICEField
# for STOKES flag use
#CPPFLAGS = -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DNAN2003 -DTIMER -DRELO -DUSE_ESMF -DUSE_ESMF_5 -DNERSC_HYCOM_CICE -DSTOKES
#EXTRALIBS = -L${ESMF_LIB_DIR}/ -lesmf -pgcpplibs
#EXTRALIBS = -L${ESMF_LIB_DIR}/ -lesmf -lfftw3 -lmkl -lnetcdff -lnetcdf -lmpi -lmpifort
# --- Mostafa: flags required for standalone HYCOM
EXTRALIBS = -lfftw3 -lmkl -lnetcdff -lnetcdf -lmpi -lmpifort


# from fabm
#CPPFLAGS += -D_FABM_ -I${HOME}/local/fabm/hycom/include
#EXTRALIBS += -L${HOME}/local/fabm/hycom/lib -lfabm
EXTRALIBS = $(LIBPSMILE) -lfftw3 -lnetcdf -lnetcdff
# from fabm
CPPFLAGS += -D_FABM_ -I${HOME}/local/fabm/hycom/include

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 50 should be commented out, so that the default does not require fabm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the fix, was tested on an different setup, it works but please have a look

EXTRALIBS += -L${HOME}/local/fabm/hycom/lib -lfabm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 51 should be commented out, so that the default does not require fabm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the fix, was tested on an different setup, it works but please have a look


#
# --- generic make definitions
Expand All @@ -67,19 +60,22 @@ RM = \rm -f
# rules.
#

#mod_cpl_oasis:

.c.o:
$(CC) $(CPPFLAGS) $(CCFLAGS) -c $*.c

.f.o:
$(FC) $(FCFFLAGS) -c $*.f

.F.o:
$(FC) $(CPPFLAGS) $(FCFFLAGS) -c $*.F
.F.o:
$(FC) $(CPPFLAGS) $(FCFFLAGS) -c $*.F


#======= for Fabm use these

.f90.o:
$(FC) $(FCFFLAGS) -c $*.f90
$(FC) $(CCFLAGS_OASIS) $(FCFFLAGS_OASIS) -c $*.f90

.F90.o:
$(FC) $(CPPFLAGS) $(FCFFLAGS) -c $*.F90
Expand Down
25 changes: 5 additions & 20 deletions hycom/RELO/config/nextsim_configuration.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,18 @@
# must be sourced before compiling and running
export MACHINE_FRAM=1 # compile of core is slightly different on fram

# Load the right modules
module restore system
module load GCC/6.3.0-2.27
module load Boost/1.63.0-foss-2017a-Python-2.7.13
module load netCDF-C++4/4.3.0-foss-2017a-HDF5-1.8.18
module load CMake/3.9.1
module load netCDF-Fortran/4.4.4-foss-2017a-HDF5-1.8.18
#AS
module load PETSc/3.8.0-foss-2017a-Python-2.7.13
#AS


# Linking module and neXtSIM envinronment variables
CLUSTER_ROOT_DIR=/cluster/projects/nn2993k/sim
export PETSC_DIR=$EBROOTPETSC #AS#$CLUSTER_ROOT_DIR/packages/petsc/
export EBROOTBOOST=/opt/nextsim_intel/boost-1.67/
export BOOST_INCDIR=$EBROOTBOOST/include
export BOOST_LIBDIR=$EBROOTBOOST/lib
export NETCDF_DIR=$EBROOTNETCDFMINCPLUSPLUS4
export NETCDF_FOR_DIR=$EBROOTNETCDF
export OPENMPI_DIR=$EBROOTOPENMPI
export NETCDF_DIR=/cluster/software/netCDF/4.9.0-iimpi-2022a

# User or use-case specific directories
export NEXTSIMDIR=$HOME/Progs/NeXtSIM/nextsim
export NEXTSIMTOOLS_ROOT_DIR=$HOME/Progs/NeXtSIM/nextsim-tools
export NEXTSIMF_ROOT_DIR=$HOME/Progs/NeXtSIM/nextsimf
export NEXTSIM_ENV_ROOT_DIR=$HOME/Progs/NeXtSIM/nextsim-env
export SWARP_ROUTINES=$HOME/Progs/NeXtSIM/SWARP-routines
export INPUT_DATA_DIR=$CLUSTER_ROOT_DIR/data
export XSIM_COMP_VERBOSE=no

Expand All @@ -38,7 +23,7 @@ export NEXTSIM_MESH_DIR=$CLUSTER_ROOT_DIR/mesh
export NEXTSIM_DATA_DIR=$CLUSTER_ROOT_DIR/data_links

# GMSH related variables
export GMSH_DIR=$CLUSTER_ROOT_DIR/packages/gmsh/
export GMSH_DIR=/opt/nextsim_intel/gmsh-3.0.6/
export PATH=$PATH:$GMSH_DIR/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GMSH_DIR/lib

Expand All @@ -48,7 +33,7 @@ export AEROBULK_DIR=$CLUSTER_ROOT_DIR/packages/aerobulk/

# Oasis related variables
export USE_OASIS=true
export OASIS_DIR=/cluster/projects/nn9481k/oasis3-mct/oa3-mct_gfortran/
export OASIS_DIR=/cluster/projects/nn9878k/guibou/NANUK/oa3-mct_iimpi2022a/

# email for slurm jobs
export MY_EMAIL="[email protected]"
export MY_EMAIL=""