source: branches/GRISLIv3/launching_area/Master-files/speed-10-master_ant40-nolin.sh @ 491

Last change on this file since 491 was 491, checked in by dumas, 5 months ago

update go files to write output file in bin directory

  • Property svn:executable set to *
File size: 5.9 KB
RevLine 
[489]1#!/bin/bash
2
3# LHS experiment number (corresponds to the line number in the matrix of experiments)
4#runnum="100"       # should be a 3 digit number.
5runnum="XIXIXIXIXIX"
6
7# name of the run:
8namerun="AN40T"$runnum
9
10tmodelend="100000."
11tmodelbegin="0."
12tmodellength="100000."
13
14
15parallel="no" # "yes or no?"
16proc_number="4" # number of processor used
17ppn_number=$proc_number # number of cpus (ppn)
18exename="Ant-40"
19
20queue="long"  # specify queue used : short, medium, long, xlong...
21
22# Files used
23grisli_run_file="Master-files/grisli.run.lsce"
24param_file="Master-files/Param/anteis1_param_list_lhs-nolin.dat"     # param file
25TEMPS_NETCDF_file="Master-files/Param/lhs_TEMPS-NETCDF.dat"          # TEMPS-NETCDF.dat
26module_choix_file="Master-files/module_choix-antar40-0.4-nolin.f90"  # module choix
27
28#Revision number :
29rev=`svn info | grep "vision" | awk '{print $2}'`
30echo "Code revision svn "$rev
31
32
33echo "-------------------------------------"
34echo "    Now launching run: "   $namerun
35echo "      -------------------------      "
36
37#--------------------------------------------------
38# Check if times are ok:
39#--------------------------------------------------
40
41tcheck=`echo "$tmodelbegin + $tmodellength" | bc -l`
42tcheckbis=`echo "$tmodelend + 0" | bc -l`
43if [ $tcheck != $tcheckbis ]; then
44    echo "The times provided are wrong!"
45    echo $tcheck $tcheckbis
46    echo "Tbegin:" $tmodelbegin ", Tend:" $tmodelend ", length:" $tmodellength
47    exit 0
48else
49    echo "The times provided are correct."
50fi
51
52#--------------------------------------------------
53# The different directories:
54#--------------------------------------------------
55
56LAUNCHING_DIR=`pwd`
57GRISLI_DIR=${LAUNCHING_DIR%%/launching_area}
58RUNDIR=${GRISLI_DIR}"/RUNS/"${namerun}
59MODELMASTER=${GRISLI_DIR}"/SOURCES"
60MODEL=${RUNDIR}"/SOURCES"
61
62
63if [ -d $RUNDIR ]; then
64    echo "This run exists, do you really want to overwrite?"
65    echo "You have 3 sec. to do a ctr+c..."
66    sleep 3
67    echo "Ok, your choice."
68else
69    mkdir $RUNDIR
70    echo "      Run will be in:"
71    echo "  " $RUNDIR
72fi
73
74if [ -d $MODEL ]; then
75    echo "model dir already created, cleaning up before copying files"
76    rm -rf $MODEL"/"*
77else
78    mkdir $MODEL
79fi
80 
81cp -R $MODELMASTER"/"* $MODEL"/."
82svn status $MODELMASTER > $MODEL"/svn.status.txt"
83svn diff $MODELMASTER > $MODEL"/svn.diff.txt"
84
85
86if [ -d $RUNDIR"/bin" ]; then
87    echo "exe in bin/"
88else
89    mkdir $RUNDIR"/bin"
90fi
91
92if [ -d $RUNDIR"/RESULTATS" ]; then
93    echo "exe in RESULTATS/"
94else
95    mkdir $RUNDIR"/RESULTATS"
96fi
97
98if [ -d $RUNDIR"/INPUT" ]; then
99    echo "inputs are linked to model master"
100else
101    echo "inputs will be linked to model master"
102    mkdir $RUNDIR"/INPUT"
103fi
104
105
106   
107echo "Now copying master files to the working directory:"
108echo $RUNDIR
109echo "And to the model directory:"
110echo $MODEL
111
112
113cp $TEMPS_NETCDF_file $MODEL"/Fichiers-parametres/TEMPS-NETCDF.dat"
114cp $module_choix_file $MODEL"/Ant40_files/module_choix-antar40-0.4.f90"
115cp $param_file $RUNDIR"/bin/anteis1_param_list.dat"
116cp $grisli_run_file $RUNDIR"/bin/grisli.run"
117
118
119cd $RUNDIR"/INPUT"
120ln -sf $MODELMASTER"/../INPUT/ANTEIS1" .
121ln -sf $MODELMASTER"/../INPUT/Forcage" .
122ln -sf $MODELMASTER"/../INPUT/tracer.dat" .
123
124
125#--------------------------------------------------
126# parameter values:
127#--------------------------------------------------
128
129mnolin_fact="3."
130nbiternolin_fact="5"
131
132fichlhs=$LAUNCHING_DIR"/Master-files/LHS/LHS_values_4-params.dat"
133expnum=`echo $runnum "* 1." | bc`
134echo "LHS exp. number: " $expnum
135head -$expnum $fichlhs | tail -1 > prov
136# Keep a record of the values:
137cp prov  $RUNDIR"/bin/LHS_values_4-params_run-"$expnum".dat"
138
139enh_fact=`awk '{print $2}' prov`
140bslope_fact=`awk '{print $3*100}' prov` 
141ob_fact=`awk '{print (((($3*1000-2.75))/2.25)*0.5)+1.}' prov` # pour le Ob du beta de PISM (simple hydro) (ici entre 0.5 et 1.5)
142kond0_fact=`awk '{print $4}' prov`
143kt_fact=`awk '{print $5*25}' prov`
144
145bexpo_fact="1."
146
147infiltr_fact="1.e-3" #"1.e-3"
148
149
150
151#--------------------------------------------------
152# Replacing key words:
153#--------------------------------------------------
154
155# run spec.:
156sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/anteis1_param_list.dat"
157sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/anteis1_param_list.dat"
158sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/anteis1_param_list.dat"
159
160# submission script:
161sed -i "s|SOURCESREP|$MODEL|" $RUNDIR"/bin/grisli.run"
162sed -i "s|EXEREP|$RUNDIR\/bin|" $RUNDIR"/bin/grisli.run"
163sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/grisli.run"
164sed -i "s/EXE_NAME/$exename/g" $RUNDIR"/bin/grisli.run"
165
166if [ $parallel = "yes" ]; then
167    sed -i "s/QUEUE/${queue}p/" $RUNDIR"/bin/grisli.run"
168    sed -i "s/PROC_NUMBER/$proc_number/" $RUNDIR"/bin/grisli.run"
169    sed -i "s/PPN_NUMBER/$ppn_number/" $RUNDIR"/bin/grisli.run"
170else
171    sed -i "s/QUEUE/$queue/" $RUNDIR"/bin/grisli.run"
172    sed -i "s/PROC_NUMBER/1/" $RUNDIR"/bin/grisli.run"
173    sed -i "s/PPN_NUMBER/1/" $RUNDIR"/bin/grisli.run"
174    sed -i "/export\ MKL_NUM_THREADS/d" $RUNDIR"/bin/grisli.run"
175    sed -i "/export\ OMP_NUM_THREADS/d" $RUNDIR"/bin/grisli.run"
176    sed -i "/export\ KMP_STACKSIZE/d" $RUNDIR"/bin/grisli.run"
177fi
178
179# param values:
180sed -i "s/PARAMMNOLIN/$mnolin_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
181sed -i "s/PARAMNBITERNOLIN/$nbiternolin_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
182sed -i "s/PARAMENHFACT/$enh_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
183sed -i "s/PARAMINFILTR/$infiltr_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
184sed -i "s/PARAMKOND0/$kond0_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
185sed -i "s/PARAMBSLOPE/$bslope_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
186sed -i "s/PARAMBEXPO/$bexpo_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
187sed -i "s/PARAMOB/$ob_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
188sed -i "s/PARAMKT/$kt_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
189
190#--------------------------------------------------
191# Submitting the job:
192#--------------------------------------------------
[491]193cd $RUNDIR"/bin"
[489]194echo "submitting the job"
[491]195qsub grisli.run
[489]196echo "-------------------------------------"
197
198
199
200
201
202
203
204
Note: See TracBrowser for help on using the repository browser.