source: trunk/lauching_area/go_ant16.sh @ 334

Last change on this file since 334 was 292, checked in by dumas, 4 years ago

Add ant16km_param_list.dat for ISMIP6 simulation and launching script & update CPTR historical_ISMIP_2015.nc

  • Property svn:executable set to *
File size: 5.9 KB
Line 
1#!/bin/bash
2# script pour lancer un cycle antarctique
3
4# name of the run (7 char + iteration number):
5namerun="noresm1-m_rcp8.5_medium_ISMIP6_Ant16_relax_inv5"   #"noresm1-m_rcp8.5_medium_ISMIP6_Ant16_relax_inv5"
6
7tmodelend="106."         # 105.  305
8tmodelbegin="20."        # 20.   20
9tmodellength="86."       # 85    285
10betacfile="beta-run-12S-inv5.grd"  #"beta-run-12S-inv4.grd" #"beta-run-9-S-inv4.grd" #
11Umagbilfile="vitbil-run-MIP-SBT5.grd"
12parallel="yes" # "yes or no?"
13iteration="1"
14
15
16echo "-------------------------------------"
17echo "    Now launching run: "   $namerun
18echo "      -------------------------      "
19
20#--------------------------------------------------
21# Check if times are ok:
22#--------------------------------------------------
23
24tcheck=`echo "$tmodelbegin + $tmodellength" | bc -l`
25tcheckbis=`echo "$tmodelend + 0" | bc -l`
26if [ $tcheck != $tcheckbis ]; then
27    echo "The times provided are wrong!"
28    echo $tcheck $tcheckbis
29    echo "Tbegin:" $tmodelbegin ", Tend:" $tmodelend ", length:" $tmodellength
30    exit 0
31else
32    echo "The times provided are correct."
33fi
34
35#--------------------------------------------------
36# The different directories:
37#--------------------------------------------------
38#RUNDIR="/home/climold/aquiquet/GRISLI/GRISLI_trunk/RUNS/"$namerun
39#MODELMASTER="/home/climold/aquiquet/GRISLI/GRISLI_trunk/SOURCES"
40#MODEL=$RUNDIR"/SOURCES"
41LAUCHING_DIR=`pwd`
42GRISLI_DIR=${LAUCHING_DIR%%/lauching_area}
43RUNDIR=${GRISLI_DIR}"/RUNS/"${namerun}
44MODELMASTER=${GRISLI_DIR}"/SOURCES"
45MODEL=${RUNDIR}"/SOURCES"
46
47if [ -d $RUNDIR ]; then
48    echo "This run exists, do you really want to overwrite?"
49    echo "You have 7 sec. to do a ctr+c..."
50    sleep 7
51    echo "Ok, your choice."
52else
53    mkdir $RUNDIR
54    echo "      Run will be in:"
55    echo "  " $RUNDIR
56fi
57
58if [ -d $MODEL ]; then
59    echo "model dir already created, cleaning up before copying files"
60    rm -rf $MODEL"/"*
61else
62    mkdir $MODEL
63fi
64 
65cp -R $MODELMASTER"/"* $MODEL"/."
66svn status $MODELMASTER > $MODEL"/svn.status.txt"
67svn diff $MODELMASTER > $MODEL"/svn.diff.txt"
68
69if [ -d $RUNDIR"/bin" ]; then
70    echo "exe in bin/"
71else
72    mkdir $RUNDIR"/bin"
73fi
74
75if [ -d $RUNDIR"/RESULTATS" ]; then
76    echo "exe in RESULTATS/"
77else
78    mkdir $RUNDIR"/RESULTATS"
79fi
80
81if [ -d $RUNDIR"/INPUT" ]; then
82    echo "inputs are linked to model master"
83else
84    echo "inputs will be linked to model master"
85    mkdir $RUNDIR"/INPUT"
86fi
87
88
89   
90echo "Now copying master files to the working directory:"
91echo $RUNDIR
92echo "And to the model directory:"
93echo $MODEL
94
95#cp "../Master-files/Makefile" $MODEL"/Makefile"
96#cp "../Master-files/anteis1_param_list.dat" $RUNDIR"/bin/anteis1_param_list.dat"
97#cp "Master-files/anteis1_TEMPS-NETCDF-cycle.dat" $MODEL"/Fichiers-parametres/anteis1_TEMPS-NETCDF.dat"
98#cp "Master-files/module_choix-antar40-0.4-cycles.f90" $MODEL"/Ant40_files/module_choix-antar40-0.4.f90"
99
100cp "../Param/ant16km_param_list.dat" $RUNDIR"/bin/ant16km_param_list.dat"
101# selection du module choix inversion beta :
102#cp $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90-iterbeta" $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90"
103
104# script gmt de calcul des vitbil et beta_c :
105#cp "Master-files/recup_vitbil_job.sh" $RUNDIR"/recup_vitbil_job.sh"
106
107#cp "../Param/ant16km_param_list.dat.long" $RUNDIR"/bin/ant16km_param_list.dat"
108# selection du module choix run std :
109#cp $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90-std" $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90"
110
111
112if [ $parallel = "yes" ]; then
113  cp "Master-files/grisli.run.openmp_ant16" $RUNDIR"/bin/grisli.run"
114else
115  cp "Master-files/grisli.run_ant16" $RUNDIR"/bin/grisli.run"
116fi
117
118cd $RUNDIR"/INPUT"
119ln -sf ${GRISLI_DIR}"/INPUT/ANT16km" .
120ln -sf ${GRISLI_DIR}"/INPUT/Forcage" .
121ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" .
122
123#--------------------------------------------------
124# Replacing key words:
125#--------------------------------------------------
126
127# run spec.:
128sed -i "s/RUNNAME/${namerun}1/" $RUNDIR"/bin/ant16km_param_list.dat"
129sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/ant16km_param_list.dat"
130sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/ant16km_param_list.dat"
131
132# submission script:
133sed -i "s|SOURCESREP|$MODEL|" $RUNDIR"/bin/grisli.run"
134sed -i "s|EXEREP|$RUNDIR\/bin|" $RUNDIR"/bin/grisli.run"
135sed -i "s|_RUNNAME_|$namerun|" $RUNDIR"/bin/grisli.run"
136sed -i "s|_RUNTBEGIN_|$tmodelbegin|" $RUNDIR"/bin/grisli.run"
137sed -i "s|_RUNTEND_|$tmodelend|" $RUNDIR"/bin/grisli.run"
138sed -i "s|_ITERATION_|$iteration|" $RUNDIR"/bin/grisli.run"
139
140# Makefile:
141if [ $parallel = "yes" ]; then
142    sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-parallel.inc/" $RUNDIR"/SOURCES/Makefile"
143else
144    sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-sequential.inc/" $RUNDIR"/SOURCES/Makefile"
145fi
146
147# param values:
148#sed -i "s/PARAMENHFACT/$enh_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
149#sed -i "s/PARAMCF/$cf_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
150#sed -i "s/PARAMSEUILNEFF/$seuilneff_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
151#sed -i "s/PARAMINFILTR/$infiltr_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
152#sed -i "s/PARAMKOND0/$kond0_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
153#sed -i "s/BETAMAX/$betamax_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
154#sed -i "s/TOSTICK/$tostick_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
155#sed -i "s/EXPOSLOPE/$exposlope_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
156#sed -i "s/PARAMBSLOPE/$bslope_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
157#sed -i "s/PARAMBEXPO/$bexpo_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
158#sed -i "s/PARAMBMELTCOEF/$bmelt_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
159#sed -i "s/PARAMSF/$sf_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
160sed -i "s/NOMBETAC/$betacfile/" $RUNDIR"/bin/ant16km_param_list.dat"
161sed -i "s/NOMVITBIL/$Umagbilfile/" $RUNDIR"/bin/ant16km_param_list.dat"
162
163#--------------------------------------------------
164# Submitting the job:
165#--------------------------------------------------
166
167echo "submitting the job"
168qsub $RUNDIR"/bin/grisli.run"
169echo "-------------------------------------"
170
Note: See TracBrowser for help on using the repository browser.