New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
AA_job in trunk/CONFIG/ORCA2_LIM/EXP00 – NEMO

source: trunk/CONFIG/ORCA2_LIM/EXP00/AA_job @ 8

Last change on this file since 8 was 8, checked in by opalod, 20 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 11.2 KB
Line 
1#@$-r F01.1                   # name of job
2#@$-me                        # sends a mail at the end of execution
3#@$-eo                        # merge standard error and output
4                              # in one file
5#@$-o sortie_F01.1            # name of the output file (listing)
6#@$-lT 2:00:00                # Max total CPU time
7#@$-lt 1:59:00                # Max CPU time per process
8#@$-lM 2Gb                    # Max memory
9#-Q- sxnec ## NEC
10#-Q- sxnec #@$-jo             # print a short performance analysis
11#-Q- sxnec                    # at the end of the listing
12## Temporary comments
13###-Q- sxnec #@$-c 4            # Max number of simultaneous procs used (here=4)
14###-Q- sxnec #@$-q multi        # Use more than 1 proc
15## End of Temporary comments
16#-Q- fjvpp ## VPP
17#-Q- fjvpp #@$-ko             # Keep the output listing on disk
18#-Q- fjvpp #@$-s /bin/ksh     # Name of the shell used for this script
19#-Q- fjvpp #@$-lP 3           # Number of procs (here=3)
20#
21#
22#
23########################################################################
24##
25##      Script to run a validation experiment when installing the
26##      ORCA model
27##
28##            Claire Levy
29##
30##      Original Script:
31##           Coupled IPSL experiment Eric MAISONNAVE / Marie-Alice FOUJOLS
32##
33#########################################################################
34##-- print echo of commands before and after shell interpretation
35date
36set -vx
37##
38##
39##-- Name of the experiment
40##--
41CEXPER=F01
42# -  Directory for executables
43#
44# ! Attention ! The executables are to be copied from the modipsl/bin
45#               directory
46#
47R_EXE=$WORKDIR/${CEXPER}/Exe
48#
49#
50
51JOB=${CEXPER}
52##-- First day of the experiment
53JOUR_DEBUT_EXP=1  ; MOIS_DEBUT_EXP=1  ; AN_DEBUT_EXP=1
54##--
55##-- Last day of the experiment
56JOUR_FINAL_EXP=31  ; MOIS_FINAL_EXP=12 ; AN_FINAL_EXP=1
57##--
58##-- Duration of the experiment
59JOURS=0; MOIS=0 ; ANS=1
60##
61#########################################################################
62##
63##    1. Unix Variables definition
64##
65#########################################################################
66##
67##-- Get the submisson directory
68echo $QSUB_WORKDIR
69##-- Get the directory controlling the chaining of the jobs
70R_EXPER=${QSUB_WORKDIR}
71##
72##
73MKDIR="mkdir"
74#-Q- fjvpp MKDIR="/usr/X11R6/bin/mkdirhier"
75#
76##--- Variables used by the ocean model
77# ----------------- ORCA --------------
78#
79JOB=$( echo ${CEXPER} | tr '[a-z]' '[A-Z]' )
80#
81#
82#
83#########################################################################
84##
85##    2. Directories definition
86##
87#########################################################################
88# -  Data directory for input/output of the model
89#
90#-Q- sxnec R_DONNEES=${WORKDIR}/EXPER/${CEXPER}
91#-Q- fjvpp R_DONNEES=${WORKDIR}/EXPER/${CEXPER}
92#
93#
94# ----------------- ORCA --------------------
95#
96R_ENTREE_OCE=${R_DONNEES}/Entree/Oce
97R_SORTIE_OCE=${R_DONNEES}/Sortie/Oce
98#
99#
100if [ ! -d ${R_DONNEES} ]; then
101  mkdir -p ${R_ENTREE_OCE}
102  mkdir -p ${R_SORTIE_OCE}
103  mkdir -p ${R_DONNEES}/SortieTest/Oce
104fi
105#
106# -  Get the tarfile containing all the usefull files
107#
108#
109#-- Directory definition for the data storage computer (where the tarfile is)
110#-Q- sxnec R_STOCKAGE="gaya:/u/DODS/pub/reee055/ORCA2_LIM"
111#-Q- fjvpp R_STOCKAGE="/G/nymphea0/dmnfs/"
112#--
113#-- Test if the tarfile is already there before geting it from the data storage
114#--
115#-Q- sxnec Rapatrie () { [ -f $1/$3 ] || ( rcp ${R_STOCKAGE}/$2/$3 $1 ; cd $1; tar xvf $3 ;) }
116#-Q- fjvpp Rapatrie () { [ -f $1/$3 ] || ( cp ${R_STOCKAGE}/$2/$3 $1 ; cd $1; tar xvf $3 ;) }
117
118#
119Rapatrie ${R_ENTREE_OCE} ENTREE Entree_Oce.tar
120Rapatrie ${R_DONNEES}/SortieTest/Oce VERIF SortieTest_Oce.tar
121
122#
123# -  Temporary working directory
124#
125#-Q- sxnec TMP=${TMPDIR}/${CEXPER}
126#-Q- fjvpp TMP=${SCRATCHDIR}/${CEXPER}
127#
128#-- Create this directory if needed
129[ -d ${TMP} ] || ${MKDIR} ${TMP}
130#
131#
132#########################################################################
133##
134##    3. Pre-processing
135##
136#########################################################################
137#
138# =============================================================================
139# Time control
140# =============================================================================
141cd ${R_EXPER}
142##
143##- Create ${JOB}.suivi containing the date of the run going on or the date
144##- of the first waiting job, and ${JOB}.log containing execution log
145##
146if [ ! -f "${JOB}.suivi" ]
147then
148    JOUR_DEB_JOB=${JOUR_DEBUT_EXP} ; MOIS_DEB_JOB=${MOIS_DEBUT_EXP} ; AN_DEB_JOB=${AN_DEBUT_EXP}
149    NUMERO=1
150cat <<EOF >${JOB}.suivi
151$AN_DEB_JOB $MOIS_DEB_JOB $JOUR_DEB_JOB $NUMERO
152EOF
153echo `date` " Begining of Experience : " ${JOB} " in directory :" ${R_EXPER} > ${JOB}.log
154fi
155
156cat ${JOB}.suivi | read AN_DEB_JOB MOIS_DEB_JOB JOUR_DEB_JOB NUMERO
157echo $AN_DEB_JOB $MOIS_DEB_JOB $JOUR_DEB_JOB
158echo "`date` $AN_DEB_JOB $MOIS_DEB_JOB $JOUR_DEB_JOB begin" >> ${JOB}.log
159
160
161
162# ==============================================================================
163# Copy executables
164# ==============================================================================
165if [ -z ${TMP} ]; then
166  echo " The TMP variable is empty !!!"
167  exit
168fi
169cd ${TMP} || exit
170#- Clear working directory
171rm -f *
172
173#- Get executables
174# ----------------- ORCA -----------------------
175cp ${R_EXE}/opa opa.xx
176#
177#
178#-Q- sxnec # ----------------- ORCA -----------------------
179#-Q- sxnec # Reminder for the cpp keys used
180#-Q- sxnec #
181#-Q- sxnec OPT_COMPIL_ORCA=` mcs -p opa.xx | grep key_orca | head -1 `
182#-Q- sxnec #
183#-Q- sxnec echo ${OPT_COMPIL_ORCA}
184#-Q- sxnec #
185#-Q- sxnec #-- Check ocean model resolution
186#-Q- sxnec RESOL_ORCA=` echo ${OPT_COMPIL_ORCA} | sed s/.*key_orca_r// | sed s/-Wp.*// `
187#-Q- sxnec if [ ${RESOL_ORCA} -ne "2" ] ; then
188#-Q- sxnec   echo " Resolution of the executable for the ocean model is not correct : " ${RESOL_ORCA}
189#-Q- sxnec fi
190#
191#-Q- sxnec #-- Ckeck for real and integer size
192#-Q- sxnec #-- in the ocean executable
193#-Q- sxnec IR_ORCA=` echo ${OPT_COMPIL_ORCA} | grep "-ew" `
194#-Q- sxnec if [ -n ${IR_ORCA} ]; then
195#-Q- sxnec   echo 'Taille des reels :   8 '
196#-Q- sxnec   echo 'Taille des entiers : 8 '
197#-Q- sxnec else
198#-Q- sxnec   echo ' ATTENTION: ocean executable has not been compiled in I8R8 '
199#-Q- sxnec   exit
200#-Q- sxnec fi
201
202# ==============================================================================
203# Update the namelist
204# ==============================================================================
205#
206# ----------------- ORCA ---------------------
207#
208#
209# change namelist from fortran 77 to fortran 90
210sed -e /:/d -e s/" \&END"/"\/"/ -e s/" \&"/"\&"/ ${R_ENTREE_OCE}/namelist > namelist
211#
212PAT_NO=$( grep 'no' namelist | grep -v off )
213PAT_CEXPER=$( grep 'cexper' namelist )
214PAT_RESTAR=$( grep 'lrstar' namelist )
215PAT_NRSTAR=$( grep 'nrstdt' namelist )
216PAT_NMSH=$( grep 'nmsh' namelist )
217PAT_NDATE0=$( grep 'ndate0' namelist )
218
219
220if [ ${NUMERO} -eq 1 ]
221then
222#- At the beginning of the experiment:
223#- No check of the date of restart (since there is no restart)
224#- Create the meshmask file (usefull for graphics)
225sed    -e "s/$PAT_CEXPER/       cexper=\"$CEXPER\"/" \
226    -e "s/$PAT_NMSH/         nmsh=1/" \
227    namelist > nam.tmp
228else
229#- Check the date of restart for all the following job submission
230sed    -e "s/$PAT_CEXPER/       cexper=\"$CEXPER\"/" \
231    -e "s/$PAT_RESTAR/       lrstar=.TRUE./" \
232    -e "s/$PAT_NMSH/         nmsh=0/" \
233    -e "s/$PAT_NRSTAR/       nrstdt=1/" \
234    -e "s/$PAT_NDATE0/       ndate0=$DATE_DEB_JOB/" \
235    namelist > nam.tmp
236fi
237
238mv nam.tmp namelist
239
240
241#
242# ==============================================================================
243# Copy input files
244# ==============================================================================
245#
246# ----------------- ORCA ---------------------
247#
248# -  Copy auxilliary files
249#
250# - Files for the ice
251#
252cp ${R_ENTREE_OCE}/dynami.param  .
253cp ${R_ENTREE_OCE}/geogra.param .
254cp ${R_ENTREE_OCE}/inice.param  .
255cp ${R_ENTREE_OCE}/output.param .
256cp ${R_ENTREE_OCE}/run.param.li .
257cp ${R_ENTREE_OCE}/thermo.param .
258cp ${R_ENTREE_OCE}/cpointj.dat .
259
260
261
262cp ${R_ENTREE_OCE}/coordinates.nc .
263cp ${R_ENTREE_OCE}/bathymetry .
264cp ${R_ENTREE_OCE}/LEVITUS_1m_Salinity_Ice_nomask.nc .
265cp ${R_ENTREE_OCE}/LEVITUS_1m_Temperature_Pot_Ice_nomask.nc .
266cp ${R_ENTREE_OCE}/runoff_1m_nomask.nc .
267cp ${R_ENTREE_OCE}/ahmcoef ahmcoef
268cp ${R_ENTREE_OCE}/MIX.Y93-98.STRESSX.GLOBAL.MON.nc .
269cp ${R_ENTREE_OCE}/MIX.Y93-98.STRESSY.GLOBAL.MON.nc .
270cp ${R_ENTREE_OCE}/CLIO_1m_0101_0112_flx.nc .
271cp ${R_ENTREE_OCE}/EMPave_old.dat .
272#
273# -  Copy of the restart file
274#
275
276if [ ${NUMERO} -ne 1 ]
277then
278  cp ${R_SORTIE_OCE}/${CEXPER}_${DATE_RESTART}_restart.nc orcaini.nc
279  cp ${R_SORTIE_OCE}/${CEXPER}_${DATE_RESTART}_res0.om rest.om
280  cp ${R_SORTIE_OCE}/${CEXPER}_${DATE_RESTART}_run.param.li .
281  cp ${R_SORTIE_OCE}/${CEXPER}_${DATE_RESTART}_EMPave_old.dat EMPave_old.dat
282fi
283
284#
285#
286ls -alF
287#
288#########################################################################
289##
290##    4. Launching the experiment
291##
292#########################################################################
293#
294##-Q- sxnec export F_PROGINF=detail F_FTRACE=yes F_ERRCNT=500
295##-Q- sxnec   mpirun -np 1 -max_np 3 opa.xx
296#-Q- sxnec  opa.xx
297
298#-Q- fjvpp opa.xx -np 1
299
300#-Q- fjvpp ##-- Accounting
301#-Q- fjvpp ja
302
303
304ls -alF
305
306NIT_FINAL=$( cat time.step )
307#
308#########################################################################
309##
310##    5. Post-processing
311##
312#########################################################################
313#
314# ==============================================================================
315# Save output files
316# ==============================================================================#
317i_ERR_SAUV=0
318#
319#
320#
321# ----------------- ORCA ---------------------
322#
323if [ -f date.file ]
324then
325    DATE=$(cat date.file | sed 's/ //g' | sed 's/_output//g' )
326fi
327##  Print the last time step:
328cat time.step
329#
330##-Q- sxnec cp ftrace.out ${R_SORTIE_OCE}/${DATE}.ftrace.out
331##-Q- sxnec cp mon.out ${R_SORTIE_OCE}/${DATE}.mon.out
332#
333# Save ocean output files
334#
335if [ ${NUMERO} -eq 1 ]
336then
337  mv meshmask* ${R_SORTIE_OCE}
338fi
339mv ocean.output ${R_SORTIE_OCE}/${DATE}.oceout
340mv solver.stat ${R_SORTIE_OCE}/${DATE}.solver.stat
341#
342for file_netcdf in *_grid_[TUVW].nc
343   do
344     mv $file_netcdf ${R_SORTIE_OCE}/ || i_ERR_SAUV=1
345   done
346#
347# Save ocean restart file
348mv ${CEXPER}_*_restart.nc ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}_restart.nc
349if [ ! -f ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}_restart.nc ]; then
350  echo " Attention: The backup of the restart file was UNSUCCESSFULL"
351  i_ERR_SAUV=1
352fi
353
354#
355# Save ice output files
356for file_netcdf in *icemod.nc
357   do
358     mv $file_netcdf ${R_SORTIE_OCE}/${file_netcdf} || i_ERR_SAUV=1
359   done
360#
361mv ice_forcing ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}.ice_forcing || i_ERR_SAUV=1
362mv ice_mouchard ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}.ice_mouchard || i_ERR_SAUV=1
363mv ice_evolu ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}.ice_evolu || i_ERR_SAUV=1
364#
365for restart_ice in res*om
366   do
367     cp $restart_ice  ${R_SORTIE_OCE}/${CEXPER}_${DATE_FIN_JOB}.${restart_ice} || i_ERR_SAUV=1
368   done
369#
370#-
371#- Test on backups
372#-
373if [ ${i_ERR_SAUV} -ne "0" ] ; then
374   echo "Error in at least one of the restarts backups!"
375   exit
376fi
377#
378# Tar all outputs in one tarfile
379cd ${R_SORTIE_OCE}
380 if [ ! -f ${R_DONNEES}/SortieTest/Oce/SortieTest_Oce.tar ]
381then
382    tar cvf ${R_DONNEES}/SortieTest/Oce/SortieTest_Oce.tar .
383else
384    tar rvf ${R_DONNEES}/SortieTest/Oce/SortieTest_Oce.tar .
385fi
386rcp ${R_DONNEES}/SortieTest/Oce/SortieTest_Oce.tar ${R_STOCKAGE}/VERIF/SortieTest_Oce.tar
387cd ${TMP}
Note: See TracBrowser for help on using the repository browser.