#!/bin/csh

#PBS -N  OPA       # nom de la requete NQS
#PBS -S /bin/csh
#PBS -o  OPA.out   # fichier d'output
#PBS -e  OPA.err   # fichier d'erreur
#PBS -q multi
#PBS -l memsz_job=16gb
#PBS -l cputim_job=1:00:00
#PBS -l cpunum_job=5

setenv NB_CPU_CLIENT 4
setenv NB_CPU_SERVER 1

@ NB_CPU = $NB_CPU_CLIENT + $NB_CPU_SERVER
setenv NB_CPU_CLIENT $NB_CPU_CLIENT

setenv BASE_PATH ../../../bin
setenv SERVER_NAME ${BASE_PATH}/ioserver
setenv CLIENT_NAME ${BASE_PATH}/opa
setenv JOB_REQUEST NEMO

setenv MPIPROGINF ALL_DETAIL
setenv F_ERRCNT 0
setenv F_FMTBUF 0
setenv F_SYSLEN 256

cd $PBS_O_WORKDIR

setenv MPISUSPEND OFF

echo "NB_CPU->${NB_CPU}  NB_CPU_SERVER->${NB_CPU_SERVER} NB_CPU_CLIENT->${NB_CPU_CLIENT}"

rm -f OPA.out
rm -f OPA.err
rm -f ORCA2_00000015_restart_ice_*.nc
rm -f ORCA2_00000015_restart_*.nc
rm -f  damping.coeff_*.nc

rcp gaya:/u/rech/eee/reee512/NEMO/ORCA2_LIM_nemo_v3.1.tar .
tar -xvf ORCA2_LIM_nemo_v3.1.tar

mpirun -np $NB_CPU ./launcher_sx
