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