Changeset 207 for trunk/CONFIG/GYRE/EXP00
- Timestamp:
- 2005-01-31T11:29:58+01:00 (19 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.