Changeset 1005 for trunk/LMDZ.MARS/deftank
- Timestamp:
- Jul 18, 2013, 8:33:04 AM (11 years ago)
- Location:
- trunk/LMDZ.MARS/deftank
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/deftank/run0
r758 r1005 1 #!/bin/ csh1 #!/bin/bash 2 2 ########################################################################### 3 3 # Script to perform several chained LMD Mars GCM simulations 4 4 # SET HERE the maximum total number of simulations 5 5 6 setnummax=16 nummax=1 7 7 8 8 ########################################################################### … … 12 12 echo "starting run0" 13 13 14 setdir=`pwd`15 setmachine=`hostname`16 setaddress=`whoami`14 dir=`pwd` 15 machine=`hostname` 16 address=`whoami` 17 17 18 18 # Look for file "num_run" which should contain 19 19 # the value of the previously computed season 20 20 # (defaults to 0 if file "num_run" does not exist) 21 if ( -f num_run )then22 echo "found file num_run"23 setnumold=`cat num_run`21 if [[ -r num_run ]] ; then 22 echo "found file num_run" 23 numold=`cat num_run` 24 24 else 25 setnumold=026 endif 25 numold=0 26 fi 27 27 echo "numold is set to" ${numold} 28 28 29 29 30 30 # Set value of current season 31 set numnew=${numold} 32 @ numnew = ${numnew} + 1 31 (( numnew = ${numold} + 1 )) 33 32 echo "numnew is set to" ${numnew} 34 33 35 34 # Look for initialization data files (exit if none found) 36 if ( ( -f start${numold}.nc ) && ( -f startfi${numold}.nc ) )then35 if [[ ( -r start${numold}.nc && -r startfi${numold}.nc ) ]] ; then 37 36 \cp -f start${numold}.nc start.nc 38 37 \cp -f startfi${numold}.nc startfi.nc 39 else if ( ${numold} == 99999 ) then 38 else 39 if (( ${numold} == 99999 )) ; then 40 40 echo "No run because previous run crashed ! (99999 in num_run)" 41 41 exit 42 else42 else 43 43 echo "Where is file start"${numold}".nc??" 44 44 exit 45 endif 45 fi 46 fi 46 47 47 48 48 49 # Run GCM 49 gcm.e > !lrun${numnew}50 gcm.e > lrun${numnew} 50 51 51 52 52 53 # Check if run ended normaly and copy datafiles 53 if ( ( -f restartfi.nc ) && ( -f restart.nc ) )then54 if [[ ( -r restartfi.nc && -r restart.nc ) ]] ; then 54 55 echo "Run seems to have ended normaly" 55 56 \mv -f restartfi.nc startfi${numnew}.nc 56 57 \mv -f restart.nc start${numnew}.nc 57 58 else 58 if ( -f num_run )then59 if [[ -r num_run ]] ; then 59 60 \mv -f num_run num_run.crash 60 61 else 61 62 echo "No file num_run to build num_run.crash from !!" 62 63 # Impose a default value of 0 for num_run 63 echo 0 > !num_run.crash64 endif65 echo 99999 > !num_run64 echo 0 > num_run.crash 65 fi 66 echo 99999 > num_run 66 67 ############## To receive an Email message if the run crashes ######## 67 68 mail -s "crash run GCM" $address <<ENDMAIL … … 70 71 ############################################"" 71 72 exit 72 endif 73 fi 73 74 74 75 # Copy other datafiles that may have been generated 75 if ( -f diagfi.nc )then76 if [[ -r diagfi.nc ]] ; then 76 77 \mv -f diagfi.nc diagfi${numnew}.nc 77 endif 78 if ( -f diagsoil.nc )then78 fi 79 if [[ -r diagsoil.nc ]] ; then 79 80 \mv -f diagsoil.nc diagsoil${numnew}.nc 80 endif 81 if ( -f stats.nc )then81 fi 82 if [[ -r stats.nc ]] ; then 82 83 \mv -f stats.nc stats${numnew}.nc 83 endif 84 if ( -f profiles.dat )then84 fi 85 if [[ -f profiles.dat ]] ; then 85 86 \mv -f profiles.dat profiles${numnew}.dat 86 87 \mv -f profiles.hdr profiles${numnew}.hdr 87 endif 88 fi 88 89 89 90 # Prepare things for upcoming runs by writing 90 91 # value of computed season in file num_run 91 echo ${numnew} > !num_run92 echo ${numnew} > num_run 92 93 93 94 # If we are over nummax : stop 94 if ( `expr $numnew + 1 \> $nummax ` == 1)then95 if (( $numnew + 1 > $nummax )) ; then 95 96 exit 96 97 else 97 98 \cp -f run0 exe_mars 98 exe_mars99 endif99 ./exe_mars 100 fi 100 101 101 102 -
trunk/LMDZ.MARS/deftank/run_mcd
r38 r1005 1 #!/bin/ csh1 #!/bin/bash 2 2 ############################################################################## 3 3 # Script to run successive monthly (a month spans 30 deg. in Ls) … … 26 26 27 27 # 12 martian months (=30°deg Ls) of unequal length (excentric orbit) 28 sed s/9999/61/ run.def.ref > ! run.def ; run0 >>&error #129 sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #230 sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #331 sed s/9999/65/ run.def.ref > ! run.def ; run0 >>&error #432 sed s/9999/60/ run.def.ref > ! run.def ; run0 >>&error #533 sed s/9999/54/ run.def.ref > ! run.def ; run0 >>&error #634 sed s/9999/50/ run.def.ref > ! run.def ; run0 >>&error #735 sed s/9999/46/ run.def.ref > ! run.def ; run0 >>&error #836 sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #937 sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #1038 sed s/9999/51/ run.def.ref > ! run.def ; run0 >>&error #1139 sed s/9999/56/ run.def.ref > ! run.def ; run0 >>&error #1228 sed s/9999/61/ run.def.ref > run.def ; run0 >> error #1 29 sed s/9999/66/ run.def.ref > run.def ; run0 >> error #2 30 sed s/9999/66/ run.def.ref > run.def ; run0 >> error #3 31 sed s/9999/65/ run.def.ref > run.def ; run0 >> error #4 32 sed s/9999/60/ run.def.ref > run.def ; run0 >> error #5 33 sed s/9999/54/ run.def.ref > run.def ; run0 >> error #6 34 sed s/9999/50/ run.def.ref > run.def ; run0 >> error #7 35 sed s/9999/46/ run.def.ref > run.def ; run0 >> error #8 36 sed s/9999/47/ run.def.ref > run.def ; run0 >> error #9 37 sed s/9999/47/ run.def.ref > run.def ; run0 >> error #10 38 sed s/9999/51/ run.def.ref > run.def ; run0 >> error #11 39 sed s/9999/56/ run.def.ref > run.def ; run0 >> error #12 40 40 # 41 41 # 12 martian months (=30°deg Ls) of unequal length (excentric orbit) 42 # sed s/9999/61/ run.def.ref > ! run.def ; run0 >>&error #1343 # sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #1444 # sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #1545 # sed s/9999/65/ run.def.ref > ! run.def ; run0 >>&error #1646 # sed s/9999/60/ run.def.ref > ! run.def ; run0 >>&error #1747 # sed s/9999/54/ run.def.ref > ! run.def ; run0 >>&error #1848 # sed s/9999/50/ run.def.ref > ! run.def ; run0 >>&error #1949 # sed s/9999/46/ run.def.ref > ! run.def ; run0 >>&error #2050 # sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #2151 # sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #2252 # sed s/9999/51/ run.def.ref > ! run.def ; run0 >>&error #2353 # sed s/9999/56/ run.def.ref > ! run.def ; run0 >>&error #2442 # sed s/9999/61/ run.def.ref > run.def ; run0 >> error #13 43 # sed s/9999/66/ run.def.ref > run.def ; run0 >> error #14 44 # sed s/9999/66/ run.def.ref > run.def ; run0 >> error #15 45 # sed s/9999/65/ run.def.ref > run.def ; run0 >> error #16 46 # sed s/9999/60/ run.def.ref > run.def ; run0 >> error #17 47 # sed s/9999/54/ run.def.ref > run.def ; run0 >> error #18 48 # sed s/9999/50/ run.def.ref > run.def ; run0 >> error #19 49 # sed s/9999/46/ run.def.ref > run.def ; run0 >> error #20 50 # sed s/9999/47/ run.def.ref > run.def ; run0 >> error #21 51 # sed s/9999/47/ run.def.ref > run.def ; run0 >> error #22 52 # sed s/9999/51/ run.def.ref > run.def ; run0 >> error #23 53 # sed s/9999/56/ run.def.ref > run.def ; run0 >> error #24 54 54 # 55 55 # 12 martian months (=30°deg Ls) of unequal length (excentric orbit) 56 # sed s/9999/61/ run.def.ref > ! run.def ; run0 >>&error #2557 # sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #2658 # sed s/9999/66/ run.def.ref > ! run.def ; run0 >>&error #2759 # sed s/9999/65/ run.def.ref > ! run.def ; run0 >>&error #2860 # sed s/9999/60/ run.def.ref > ! run.def ; run0 >>&error #2961 # sed s/9999/54/ run.def.ref > ! run.def ; run0 >>&error #3062 # sed s/9999/50/ run.def.ref > ! run.def ; run0 >>&error #3163 # sed s/9999/46/ run.def.ref > ! run.def ; run0 >>&error #3264 # sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #3365 # sed s/9999/47/ run.def.ref > ! run.def ; run0 >>&error #3466 # sed s/9999/51/ run.def.ref > ! run.def ; run0 >>&error #3567 # sed s/9999/56/ run.def.ref > ! run.def ; run0 >>&error #3656 # sed s/9999/61/ run.def.ref > run.def ; run0 >> error #25 57 # sed s/9999/66/ run.def.ref > run.def ; run0 >> error #26 58 # sed s/9999/66/ run.def.ref > run.def ; run0 >> error #27 59 # sed s/9999/65/ run.def.ref > run.def ; run0 >> error #28 60 # sed s/9999/60/ run.def.ref > run.def ; run0 >> error #29 61 # sed s/9999/54/ run.def.ref > run.def ; run0 >> error #30 62 # sed s/9999/50/ run.def.ref > run.def ; run0 >> error #31 63 # sed s/9999/46/ run.def.ref > run.def ; run0 >> error #32 64 # sed s/9999/47/ run.def.ref > run.def ; run0 >> error #33 65 # sed s/9999/47/ run.def.ref > run.def ; run0 >> error #34 66 # sed s/9999/51/ run.def.ref > run.def ; run0 >> error #35 67 # sed s/9999/56/ run.def.ref > run.def ; run0 >> error #36 68 68 69 69 # These last lines allow to reconstruct the last num_run after a model crash 70 70 # (because after crash, num_run was set to 9999 so that no further simulation 71 71 # Could be performed 72 setnumber=`cat num_run`73 if ( $number == 99999)then72 number=`cat num_run` 73 if (( $number == 99999)) ; then 74 74 set numold=`cat num_run.crash` 75 echo '-----' >> &error76 echo 'Seasonal simulation aborted after starting from start'$numold >> &error75 echo '-----' >> error 76 echo 'Seasonal simulation aborted after starting from start'$numold >> error 77 77 \mv -f num_run.crash num_run 78 endif78 fi
Note: See TracChangeset
for help on using the changeset viewer.