Nemo example runscript

From SourceWiki
Jump to navigation Jump to search
##################
## SX6NEC   CEA ##
##################
#PBS -N EXP.1
#PBS -o output_EXP.1
#PBS -j oe
#PBS -S /usr/bin/ksh
##PBS -l mem=3.6gb
##PBS -l cput=1:01:00
#PBS -q long_ib
##PBS -l cpunum_prc=4
##PBS -q parallel
########################################################################
##
##      Script to run a short experiment when installing the
##      ORCA2_LIM configuration 
##
##            Rachid Benshila, OPA System Team
##
##
#########################################################################
##-- print echo of commands before and after shell interpretation
date
set -vx
cd ${HOME}/modipsl/config/ORCA2_LIM/EXP00
#################################
# Beginning of user modification
#################################
export LD_LIBRARY_PATH="/usr/local/Cluster-Apps/ofed/1.2.5/lib:/usr/local/Cluster-Apps/ofed/1.2.5/lib64:/usr/loca
l/Cluster-Apps/torque/2.1.7//lib/:/usr/local/Cluster-Apps/maui/3.2.6p19//lib/:/usr/local/Cluster-Apps/pgi/6.2.5/l
inux86-64/6.2/libso:/usr/local/Cluster-Apps/ofed/1.2.5/mpi/pgi/mvapich-0.9.9/lib:/usr/local/Cluster-Apps/ofed/1.2
.5/mpi/pgi/mvapich-0.9.9/lib/shared:/usr/local/netcdf/3.6.2/pgi-251/lib"
##-- define some directories : 
export DUMP2HOLD="/exports/gpfsbig/work/bristol/${USER}/"
#- Input file storing 
R_FORCING="${HOME}/NEMO_forcing"
#- Launching run repository
R_EXPER=${PWD}
#- modipsl repository
R_EXEDIR=${HOME}/modipsl     
#- execution repository
R_TMP="$DUMP2HOLD/NEMO/$$/"         
#- output files storing 
R_SORTIE_OCE=${R_TMP}/output/

##-- define processus number : to change when running in mpp
NB_PROC=1

#################################
# End of user modification
#################################

#--  define a fonction to get the input tarfile
Rapatrie () { [ -f $1/$2 ] || ( cp ${R_FORCING}/$2 $1 ; cd $1; tar xvf $2 ;) }

[ -d ${R_TMP} ] || mkdir -p ${R_TMP}
cd ${R_TMP}

#--  get the executable
cp ${R_EXEDIR}/bin/opa opa.xx
chmod 777 opa.xx

## --  Copy ancillary files
#
#- Namelist for ocean and ice
cp ${R_EXPER}/namelist_ice namelist_ice 
cp ${R_EXPER}/namelist namelist

#- Namelist for ocean and ice (agrif fine grid)
cp ${R_EXPER}/1_namelist_ice 1_namelist_ice 
cp ${R_EXPER}/1_namelist 1_namelist
cp ${R_EXPER}/AGRIF_FixedGrids.in AGRIF_FixedGrids.in

#- Files for the configuration and ocean dynamics
Rapatrie ${R_TMP} ORCA2_LIM_nemo_v2.tar

ls -alF

export F_PROGINF=yes
export F_ERRCNT=5

#- To be use for a mpp run
#mpirun -np ${NB_PROC} ./opa.xx
set

echo $HOSTNAME
ldd opa.xx
ls /usr/local/netcdf/3.6.2/pgi-251/lib/libnetcdff.so.4 

./opa.xx

## -- Save output files
ls -alF
##- to copy on a storage machine
#DPUT=putfer 
#[ -d ${R_SORTIE_OCE} ] || mkdir -p ${R_SORTIE_OCE}
#
##- Save ocean output files
#$DPUT *ocean.output ${R_SORTIE_OCE}/.
#$DPUT *solver.stat ${R_SORTIE_OCE}/.
#[ -f *mpp.output* ] && $DPUT *mpp.output* ${R_SORTIE_OCE}/.
#for file_netcdf in *_grid_*.nc
#do
#$DPUT ${file_netcdf} ${R_SORTIE_OCE}/${file_netcdf}
#done
##
##- Save ice output files
#for file_netcdf in *icemod*
#do
#$DPUT ${file_netcdf} ${R_SORTIE_OCE}/${file_netcdf} 
#done
#$DPUT ice.evolu ${R_SORTIE_OCE}/ice.evolu 
##
##- Save restart files
#for restart in *restart*
#do
#$DPUT ${restart} ${R_SORTIE_OCE}/${restart} 
#done
##
##- Save ftrace file
#[ -f ftrace.out* ] && $DPUT ftrace.out* ${R_SORTIE_OCE}/.