source: BOL/LMDZ_Setup/setup.sh

Last change on this file was 4942, checked in by asima, 3 weeks ago

Allowing job submission from "jean-zay-pp" (which was not possible until some time ago) :

removing the "exit" and the associates warning message.

File size: 40.3 KB
Line 
1#!/bin/bash
2
3#set -vx
4
5#####################################################################
6# This script sets up and launches a (series of) simulation(s).
7#
8# RECOMMENDATION: use main.sh to drive it (do not run it directly)
9#
10#####################################################################
11#
12# EXPERT-LEVEL CHOICES, only available in setup.sh, not in main.sh :
13#####################################################################
14
15#NOTE : $optim  is part of $LMDZname (see definition of LMDZname below),
16#   so that running with "-debug" needs to (re)install the model (install=-install in main.sh)
17#   If you have already installed the model, and only want to recompile the gcm in debug mode,
18#   add "-debug" to the compilation options in the compile.sh script created in the present folder, and run it (./compile.sh gcm)
19#   ALTERNATIVELY : you can remove $optim in the definition of "LMDZname" below
20optim=""
21#optim="-debug"
22
23#NOTE : "testmode=y" is for running in test mode :
24# the simulation job "tmp_$SIM" (created on $SCRATCHDIR) is automatically changed for a short run,
25# and submitted to the Jean-Zay "test" queue :
26#  a/ time=00:10:00  (run time limit = 10 min ; for test queue, it must be 30 min maximum)
27#  b/ nday=1 (this line, forcing nday to 1 day, is "hidden" in script_SIMU, by default it is commented out)
28#  c/ #SBATCH --qos=qos_cpu-dev (this line is in script_SIMU, by default it is commented out)
29#If you want to change "time", or "nday", but still run in "test" mode, modify the "if [ $debug = 1 ]...; fi" further below.
30testmode=n
31
32# --->>> Radiative code : run with "oldrad" or "rrtm" or "ecrad" (default : rrtm)
33# NOTE : For LMDZ rev before 4185 included, if you change this choice and you want to recompile,
34#        modify compile.sh and run it in the present folder ($local) : ./compile.sh gcm
35#       with the appropriate compiling option (see $opt_rrtm below)
36rad=rrtm
37
38# --->>> AEROSOLS : n (=no) / clim (=average 1995-2014) / spla (interactive dust and sea salt)
39# (ATTENTION : if you first run the scripts with aerosols=n, then you want to change to =clim ,
40#   you'll need to remove the INIT and LIMIT folders that have been created, then run main.sh with init=1
41#   in order to re-run the initialisation job, which downloads the aerosol files and interpolates them)
42aerosols=clim
43
44# --->>> SURFACE/VEGETATION SCHEME (as in install_lmdz.sh ; LF)
45# It is controlled by the single variable "veget" which can have the following values
46# - NONE: bucket scheme (default)
47# - CMIP6: orchidee version used in CMIP exercise, rev 5661
48# - number: orchidee version number : only rev 7983 on branch _2_2, and 7994 on trunk, are available
49        # !!! ATTENTION : both ORCHIDEE branch 2_2 and recent TRUNK REQUIRE XIOS !!!!
50veget=CMIP6
51#AS : If you have installed the model with a given "veget" option, and you want to change it :
52#   --> RECOMMENDED : re-install the model from scratch, using main.sh with "-install" option in it
53#    (even better : start in a new TEST_PROD folder)
54#   --> EXPERT : If you want to keep your previous installation, and not go through the install_lmdz.sh routine,
55#    you will need to (a) install the proper version of ORCHIDEE in the modipsl/modeles directory, and
56#                     (b) set the "veget" options (opt_veget, orchidee_rev, suforch) to their proper values
57#                        in the file $LMDZD/modipsl/modeles/surface_env
58# (NB : no need to initialise these vars here:
59#     surface_env is either (re)created when (re)installing the model (run with install=-install),
60#     or it already exists (install="").
61
62# --->>> New snow scheme INLANDSIS (y/n)
63# (this flag activates INLANDSIS compilation ;
64# not yet done : treatment of specific restart and def file)
65inlandsis=n
66
67## --->>> Isotopes : compile and run with/without (y/n) : is now dependent on phylmd (=lmd_phys from  main.sh), see below
68##isotopes=n
69
70# --->>> COMPILATION options : fcm, debug
71fcm=-nofcm
72fcm=""
73
74# --->>> ALSO PAY ATTENTION TO OUTPUT files, frequency, level -------------
75#   With IOIPSL : Choose your config.def among the versions available in DEF,
76#     copy it as config.def (the copy is done automatically for "iso"),
77#     edit it and set up output files, frequencies and levels.
78#     NB : For aerosols=spla, output level minimum 4 is required to output the specific variables.
79#          For aerosols=n, the corresponding flags will automatically be set to "n".
80#   With XIOS : adjust DEF/XMLfiles*/file*xml
81#
82#### END EXPERT-LEVEL CHOICES #########################################
83
84# Set up the appropriate environment
85#------------------------------------
86sed -i -e 's/hostname=.*.$/hostname='`hostname`'/' lmdz_env.sh
87. lmdz_env.sh
88module list
89
90# Pour les post-traitements
91sed -i'' -e 's/groupe@cpu/'$groupe'@cpu/' seasonal.sh
92local=`pwd`
93
94##############################################################
95
96# A function to fetch files either locally or on the internet
97function myget { #1st and only argument should be file name
98   # Path on local computer where to look for the datafile
99   if [ -f /u/lmdz/WWW/LMDZ/pub/$1 ] ; then
100     \cp -f -p /u/lmdz/WWW/LMDZ/pub/$1 .
101   elif [ -f ~/LMDZ/pub/$1 ] ; then
102     \cp -f -p ~/LMDZ/pub/$1 .
103   else
104     wget -nv https://lmdz.lmd.jussieu.fr/pub/$1
105     #dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir ; cp -r `basename $1` $dir
106   fi
107}
108
109##############################################################
110# Choices : name, nudging, calendar ...
111##############################################################
112SIM=`basename \`pwd\``CTL
113phylmd=lmd #option -p $phylmd for makelmdz
114
115# COSP
116cosp=n
117
118#XIOS
119xios=n
120
121# Nudging :
122ok_guide=n
123# With nudging, use real calendar (climato=0) and monthly integrations
124climato=1
125freq=mo  # frequence mensuelle mo ou annuelle yr
126
127# NB : the run stops in the BEGINNING of mthend (test "next=stopsim")
128mthini=200001
129mthend=200501
130resol=144x142x79
131
132version=20230412.trunk
133svn=""
134
135install=0
136init=1
137
138LIMIT=LIMIT
139
140
141##############################################################
142# options
143##############################################################
144
145while (($# > 0))
146   do
147   case $1 in
148     "-h") cat <<........fin
149           setup.sh can be launched/driven by main.sh; some options can only be specified in setup.sh (ex: veget, aerosols).
150           setup.sh [-v version] [-r svn_release] [-init INIT] [-d 96x95x79] [-f mo] [-nudging]
151           "version" like 20150828.trunk ; see https://lmdz.lmd.jussieu.fr/Distrib/LISMOI.trunk
152           "svn_release"      either the svn release number or "last"
153           -d IMxJMxLM        to run in resolution IM x JM x LM
154           -install           pour installer et compiler le modele
155           -f mo/yr           pour tourner en mensuel ou annuel
156           "INIT"             1: creates INIT and LIMIT
157                              0: reads from INIT and LIMIT
158                              SIMU: reads from preexisting simulation SIMU and LIMIT
159           -nudging           to run with nudging. Nudging files must be created independently
160           Other options available (see "options" section in the script)
161........fin
162     exit ;;
163     "-v") version="$2" ; shift ; shift ;;
164     "-r") svn=$2 ; shift ; shift ;;
165     "-d") resol=$2 ; shift ; shift ;;
166     "-f") freq=$2 ; shift ; shift ;;
167     "-p") phylmd=$2 ; shift ; shift ;;
168     "-install") install=1 ; shift ;;
169     "-name") SIM=$2 ; shift ; shift ;;
170     "-cosp") cosp=y ; shift ;;
171     "-xios") xios=y ; shift ;;
172     "-init") init=$2 ; shift ; shift ;;
173     "-nudging") ok_guide=y ; shift ;;
174     "-climato") climato=$2 ; shift ; shift ;;
175     "-mthini") mthini=$2 ; shift ; shift ;;
176     "-mthend") mthend=$2 ; shift ; shift ;;
177     *) $0 -h ; exit
178   esac
179done
180
181# --->>> Isotopes : ompile and run with isotopes if lmdz_phys="lmdiso" in main.sh
182if [ $phylmd = "lmdiso" ] ; then isotopes=y ; else isotopes=n ; fi
183
184# Three options for initialisation
185# 1: Create INIT
186# 0: Take from INIT
187# DIR : Take from DIR
188if [ $init = 1 -o $init = 0 ] ; then
189   INIT=INIT
190else
191   INIT=$init
192fi
193
194yearini=`echo $mthini | cut -c-4`
195if [ $freq = yr ] ; then stopsim=`echo $mthend | cut -c-4` ; else stopsim=$mthend ; fi
196
197if [ "$svn" = "" ] ; then svnopt="" ; else svnopt="-r $svn" ; fi
198
199if [ -d $SIM ] ; then
200   echo La simulation $SIM existe deja
201   echo Il est preferable d arreter et de verifier.
202   echo Si vous etes sur de vous, vous pouvez la prolonger
203   echo Voulez vous la prolonger '? (y/o)' 
204   read ans
205   if [ $ans != y -a $ans != o ] ; then
206      exit
207   fi
208fi
209
210# AVOID COMBINATIONS OF OPTIONS THAT DON'T WORK in user choices
211#-------------------------------------------------------
212
213if [ $ok_guide = y -a $climato = 1 ] ; then
214   echo "================================================================"
215   echo Running nudged simulations with climatological SSTs
216   echo is not planned. Change climato to 0 or modify the setup \(experts\)
217   echo "================================================================"
218   exit
219fi
220
221if [ $climato = 0 -a $freq = yr ] ; then
222   echo "================================================================"
223   echo running simulations with interannual SSTs is possible only
224   echo month by month and a true calendar.
225   echo Change climato to 1 or freq to mo or modify setup.sh \(experts\)
226   echo "================================================================"
227   exit
228fi
229
230# STOP if trying to use ORCHIDEE_2_2 or ORCHIDEE trunk post-CMIP6 without XIOS :
231if [ $veget != "NONE" -a $veget != "CMIP6" -a $xios = "n"  ] ; then echo "STOP : For this ORCHIDEE rev you need XIOS : change "xios" option in main.sh" ; exit ; fi
232
233# STOP if trying to use both ORCHIDEE and Isotopes :
234if [ $isotopes = "y" -a $veget != "NONE" ] ; then echo "STOP : You cannot run LMDZ with ORCHIDEE and ISOtopes at the same time ; either change "veget" option to NONE, or isotopes to "n" in setup.sh" ; exit ; fi
235
236# STOP if trying to use both SPLA and Isotopes :
237if [ $isotopes = "y" -a $aerosols = "spla" ] ; then echo "STOP : You cannot run LMDZ with Isotopes and aerosols=spla at the same time ; change "aerosols" option to "n" or "clim" in setup.sh " ; exit ; fi
238
239# (Temporary) STOP if trying to use Isotopes with XIOS :
240if [ $isotopes = "y" -a $xios = "y" ] ; then echo "STOP : Isotopes cannont yet be run with XIOS ; change xios option in main.sh" ; exit ; fi 
241
242# (Temporary) Constraints for aerosols=spla :
243# --> resolution 128x88x79 and rad=rrtm
244if [ $aerosols = spla -a $resol != 128x88x79 ] ; then
245  echo 'For now, aerosols=spla requiers resol=128x88x79, and uses the zoomed grid from gcm.def_zNAfrica_BiJe, for which forcing & initial files are available'
246  echo Actual aerosols and resol is $aerosols, $resol
247  exit
248fi
249if [ ${aerosols} = "spla" -a ${rad} != "rrtm" ] ; then echo "STOP : For the time being, aerosols=spla requires rad=rrtm" ; exit ; fi
250
251
252# INSTALLATION OPTIONS depending on the user choices
253#-------------------------------------------------------
254
255if [ $cosp = y ] ; then  ins_cosp="-cosp v1" ; else ins_cosp="" ; fi
256
257if [ $xios = y ] ; then  ins_xios="-xios" ; else ins_xios="" ; fi
258
259########################################################################
260# Recuperation ou compilation du GCM
261########################################################################
262
263if [ ! -d $LMDZD ] ; then mkdir -p $LMDZD ; fi
264version_name=LMDZ`echo $version | sed -e 's/-v//g' -e 's/-unstable//' -e 's/-r/r/' -e 's/ //g'`
265LMDZname=${version_name}${svn}${optim}OR${veget}${ins_xios}
266MODEL=$LMDZD/$LMDZname/modipsl/modeles/LMDZ
267
268if [ $install = 1 ] ; then
269   if [ -d $MODEL ] ; then
270           echo $MODEL
271      echo "Vous essayez d installer une version deja presente"
272      exit
273   else
274      echo On installe le modele
275      cd $LMDZD
276      echo wget https://lmdz.lmd.jussieu.fr/pub/install_lmdz.sh
277      \rm -f install_lmdz.sh
278      wget --no-cache https://lmdz.lmd.jussieu.fr/pub/install_lmdz.sh
279      # Si la ligne ci-dessus "wget https://lmdz.lmd..." ne marche pas pour "certificat expired", utiliser : 
280      #wget https://web.lmd.jussieu.fr/~lmdz/pub/install_lmdz.sh
281      chmod +x install_lmdz.sh
282      echo "./install_lmdz.sh $fcm $optim -v $version $svnopt -d $resol -rad $rad -bench 0 -parallel mpi_omp $ins_cosp $ins_xios -name $LMDZname -env_file $local/lmdz_env.sh -veget $veget" >> $local/install_lmdz_options.$$
283      ./install_lmdz.sh $fcm $optim -v $version $svnopt -d $resol -rad $rad -bench 0 -parallel mpi_omp $ins_cosp $ins_xios -name $LMDZname -env_file $local/lmdz_env.sh -veget $veget
284      mv install_lmdz.sh install_lmdz.$$
285      if grep "Not Found" $LMDZname/get.log >/dev/null ; then echo "version=$version is NOT A TESTING VERSION, Ask LMDZ Team" ; exit ; fi
286      cd $local
287   fi
288else
289   if [ ! -d $MODEL ] ; then
290      echo Le model $MODEL n est pas installe
291      echo relancer avec install=1 si vous voulez l installer automatiquement
292      exit
293   fi
294fi
295
296# Determine svn revision number, which will determine compilation options, executable names etc
297# If svn not available, will use the svn writen in $MODEL/Readm*md
298# For old version it assumes that it is before 4185 (the version
299# for which the test was introduced
300mysvn=`svnversion $MODEL | egrep -o "[0-9]+" 2>/dev/null` 
301if [ "$mysvn" = "" ] ; then mysvn=`grep 'Revision: [0-9]' $LMDZD/$LMDZname/Read*.md | awk ' { print $2 } ' 2>/dev/null` ; fi
302if [ "$mysvn" = "" ] ; then mysvn=4190 ; fi
303echo mysvn $mysvn
304
305# For mysvn >= 4532, "module load netcdf95" must be added in lmdz_env.sh for Jean-Zay if it's not there;
306# lmdz_env.sh must be sourced again, and copied again as $MODEL/arch/arch-X64_JEANZAY.env
307# (first copy is done by install_lmdz.sh launched with option "-env lmdz_env.sh" )
308if [ ${hostname:0:5} = "jean-" -a $mysvn -ge 4532 -a ! "`grep netcdf95 lmdz_env.sh`" ] ; then
309   cp -p lmdz_env.sh lmdz_env.orig
310   sed -i'' -e 's/module load nco/module load netcdf95\n                module load nco/' lmdz_env.sh
311   cp -p lmdz_env.sh $MODEL/arch/arch-X64_JEANZAY.env
312   . lmdz_env.sh
313fi
314
315# COMPILATION OPTIONS depending on the user choices and LMDZ revision number $mysvn
316#-------------------------------------------------------
317if [ "$ARCH" = "" ] ; then arch= ; else arch="-arch $ARCH" ; fi
318
319if [ $cosp = y ] ; then opt_cosp="-cosp true" ; else opt_cosp="" ; fi
320   # makelmdz* uses "opt_cosp", and for v1 (default) needs "-cosp true/false" 
321   # When cosp v2 will be validated, we'll have opt_cosp=ins_cosp="-cosp v2"
322   # (option cosp2 in makelmdz* to be ignored ; it is a transitory version from v1 to v2)
323
324if [ $xios = y ] ; then opt_xios="-io xios" ; else opt_xios="" ; fi
325
326case $rad in
327    oldrad) iflag_rrtm=0 ; NSW=2 ; opt_rad="" ;;
328    rrtm)   iflag_rrtm=1 ; NSW=6 ; if [ $mysvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;;
329    ecrad)  iflag_rrtm=2 ; NSW=6 ; opt_rad="-rad ecrad" ;;
330    *) echo Only oldrad rrtm ecrad for rad option ; exit 
331esac
332if [ "$rad" = "ecrad" -a ! -d ecrad_data ] ; then
333    cd $local ; wget https://lmdz.lmd.jussieu.fr/pub/3DInputData/ecrad/ecrad_data.tar ; tar xvf ecrad_data.tar ; cd -
334fi
335if [ "$rad" = "ecrad" -a "$aerosols" != "n" -a "$mysvn" -lt 4489 ]  ; then echo Les aerosols tropospheriques ne sont pas pris en charge par ecrad avant LMDZ rev 4489, ici rev est $mysvn ; exit ; fi
336
337
338# Aerosols : also define the associated suffix in gcm name
339if [ $aerosols = spla ] ; then
340  opt_aer=' -dust true ' ;  sufaer='_spla'
341else
342  opt_aer=""             ;  sufaer=''
343fi
344
345if [ $inlandsis = y ] ; then
346   opt_inlandsis="-inlandsis true"
347else
348   opt_inlandsis=""
349fi
350
351# Isotopes : also define the associated suffix in gcm name
352if [ $isotopes = y ] ; then
353  opt_isotopes="-isotopes true" ; sufiso="_iso"
354else
355  opt_isotopes=""               ; sufiso=""
356fi
357
358# Source the surface_env file created by install_lmdz.sh, to get the "veget"-related variables
359#--------------------------------------------------------------------------------------
360# surface_env is produced by install_lmdz in $MODEL=$LMDZD/$LMDZname/modipsl/modeles
361# Every model installation will have an unique orchidee_rev,
362#   to be changed by hand if a new Orchidee rev is installed by hand in modipsl/models
363. $LMDZD/$LMDZname/modipsl/modeles/surface_env
364echo LMDZname $LMDZD/$LMDZname/modipsl/modeles/surface_env
365echo veget=$veget
366echo opt_veget=$opt_veget
367echo orchidee_rev=$orchidee_rev
368echo suforch=$suforch
369
370
371#######################################################################
372# Compilation du modele
373#######################################################################
374# The gcm name defined below is used to check if the executable exists
375# It is also used when compiling without fcm : the output of makelmdz is gcm.e, and is renamed as $gcm
376#
377# NOTE : Some compilation options do not appear in the gcm name (xios, cosp, ...).
378#   (Also : LMDZ rev before 4185 included, did not contain radiative-code suffix; starting r4186, it includes oldrad/rrtm/ecrad )
379#   So if you change those options and you want to recompile,
380#   setup.sh will not detect the change when testing if [ ! -f $gcm ],
381#   You'll need to modify and run the compile.sh script created in the present folder, and run it (./compile.sh gcm)
382
383# compile_opt_iso is used for gcm only ; ce0l cannot be compiled with isotopes yet (phylmd instead of phylmdiso is required)
384if [ $isotopes = y ] ; then
385    compile_opt_iso="$optim -p $phylmd $opt_cosp $opt_xios $opt_rad $arch -d $resol $opt_veget $opt_aer $opt_inlandsis $opt_isotopes -mem -parallel mpi_omp" 
386    if [ $mysvn -le 4185 ] ; then 
387      suffix_iso=_${resol}_phy${phylmd}_para_mem${suforch}${sufaer}${sufiso}
388    else
389      suffix_iso=_${resol}_phy${phylmd}_${rad}_para_mem${suforch}${sufaer}${sufiso}
390    fi
391    phylmd="lmd"
392fi
393
394# compile_opt is used for gcm if isotopes=n, and for ce0l always
395compile_opt="$optim -p $phylmd $opt_cosp $opt_xios $opt_rad $arch -d $resol $opt_veget $opt_aer $opt_inlandsis -mem -parallel mpi_omp"
396
397if [ $mysvn -le 4185 ] ; then suffix=_${resol}_phy${phylmd}_para_mem${suforch}${sufaer} ;
398                         else suffix=_${resol}_phy${phylmd}_${rad}_para_mem${suforch}${sufaer} ; fi
399
400# use an intermediate variable to use either suffix or suffix_iso
401strsuffix=suffix${sufiso}
402gcm=$MODEL/bin/gcm${!strsuffix}.e
403
404echo $mysvn
405echo $gcm
406
407if [ ! -f $gcm ] ; then
408   echo Le model $gcm n existe pas
409   echo il va se compiler automatiquement sur $MODEL
410   sleep 10
411
412   if [ "$fcm" = "-nofcm" ] ; then
413       compile="./makelmdz $compile_opt \$1 ; mkdir -p bin ; \mv -f \${prog}.e $gcm"
414       compile_iso="./makelmdz $compile_opt_iso \$1 ; mkdir -p bin ; \mv -f \${prog}.e $gcm"
415   else
416      # makelmdz_fcm directly produces executable named $gcm, depending on the compilation options
417       compile="./makelmdz_fcm $compile_opt -j 2 \$1"
418       compile_iso="./makelmdz_fcm $compile_opt_iso -j 2 \$1"
419   fi
420
421   #NB on est dans $local, qui est $STORE/$MAINDIR
422   echo $compile${sufiso}
423
424   #create compile.sh ;
425   # if isotopes = y , it will still be used for compiling ce0l
426   cat <<...eod>| compile.sh
427   cd $MODEL
428   prog=\$1
429   ${compile}
430...eod
431   pwd
432   ls -l compile.sh
433   chmod +x compile.sh
434
435   #create compile_iso.sh for compiling gcm_ _iso.e
436   if [ $isotopes = y ] ; then
437   cat <<...eod>| compile_iso.sh
438   cd $MODEL
439   prog=\$1
440   ${compile_iso}
441...eod
442   pwd
443   ls -l compile_iso.sh
444   chmod +x compile_iso.sh
445   fi
446
447   echo Compilation de LMDZ, suivre avancement dans lmdz.log
448   ./compile${sufiso}.sh gcm > lmdz.log 2>&1
449
450   if [ ! -f $gcm ] ; then echo la compilation a echoue ; exit ; fi
451   cd $local
452fi
453
454
455######################################################################
456# Choix du nombre de processeurs
457# NOTES :
458# omp=8 by default (for Jean-Zay must be a divisor of 40 procs/node), but we need
459#   omp=1 for SPLA (only MPI parallelisation)
460#   omp=2 for veget=CMIP6 beacause of a bug in ORCHIDEE/src_xml/xios_orchidee.f90
461######################################################################
462jm=`echo $resol | cut -dx -f2`
463(( mpi = ( $jm + 1 ) / 2 ))
464omp=8
465if [ $aerosols = spla ] ; then omp=1 ; fi
466if [ $veget = CMIP6 -a $xios = y ] ; then omp=2 ; fi
467if [ $mpi -gt $nb_mpi_max ] ; then mpi=$nb_mpi_max ; fi
468if [ $omp -gt $nb_omp_max ] ; then omp=$nb_omp_max ; fi
469
470######################################################################
471# Utilisation des .def_iso pour LMDZ-ISOtopes
472######################################################################
473if [ $isotopes = y ] ; then
474  for file_iso in $( ls DEF | grep _iso)
475  do
476    cp DEF/$file_iso DEF/${file_iso%%_iso}
477  done
478fi
479
480######################################################################
481# Choix de la grille verticale
482######################################################################
483if [ ! -d DEF ] ; then echo Recuperer un repertoire DEF ; exit ; fi
484lm=`echo $resol | cut -dx -f3`
485if [ ! -f DEF/L$lm.def ] ; then echo resolution verticale non prevue
486                                 echo creer un fichier DEF/L$lm.def
487   exit
488else
489   sed -i -e 's/INCLUDEDEF=L.*.def/INCLUDEDEF=L'$lm'.def/' DEF/run.def
490fi
491
492######################################################################
493# Changements dans les fichiers DEF/*def
494# (ils vont se repercuter dans les repertoires de simulation $local/$SIM et de run $WRK)
495######################################################################
496
497# Choix du fichier traceur.def coherent avec l'option "aerosols"
498#  NOTE : Le nouveau tracer.def_nospla par defaut n'inclut pas Rn-Pb ;
499#               si on les veut, il faut utiliser ci-dessous; a la place, tracer_RN_PB.def
500#---------------------------------------------------------------------
501# NB: Si on change de traceur.def (entre spla et nospla), il faut refaire l'etape "initialisation" (ce0l)?
502# Normalement les traceurs absents de start* files sont initialises=0 dans le code ; verifier pour spla ! 
503if [ $aerosols = spla ] ; then 
504   # ancien traceur pour l instant
505   cp DEF/traceur.def_spla   DEF/traceur.def 
506elif [ $isotopes = n ] ; then
507   # nouveau traceur
508   # déjà copié si 'y'
509   cp DEF/tracer.def_nospla DEF/tracer.def 
510fi
511
512# TEMPORAIREMENT pour spla on force l'utilisation de gcm.def_zNAfrica_BiJe (avec resolution 128x88x79)
513#----------------------------------------------------------------------
514if [ $aerosols = spla ] ; then cp DEF/gcm.def_zNAfrica_BiJe DEF/gcm.def ; fi
515
516# Inscription du choix ok_guide dans DEF/guide.def
517#---------------------------------------------------------------------
518sed -i -e 's/ok_guide=.*.$/ok_guide='$ok_guide'/' DEF/guide.def
519
520# Inscription du type de calendrier (qui est fonction de $climato) dans DEF/run.def
521#---------------------------------------------------------------------
522# NB Contrairement a ce qui est ecrit dans les fichiers run.def standard,
523# dans ce tutorial le choix earth_365d n'est pas disponible, et earth_366d s'appelle gregorian
524if [ $climato = 0 ] ; then calend=gregorian ; else calend=earth_360d ; fi
525sed -i -e 's/calend=.*.$/calend='$calend'/' DEF/run.def
526
527# Changements dans config.def (pre-choisi, et regle pour output si utilisation avec IOIPSL)
528#   cf options veget, aerosols, cosp, xios
529#---------------------------------------------------------------------
530if [ $veget = NONE ] ; then  VEGET=n ; else VEGET=y ; fi
531sed -i -e 's/VEGET=.*.$/VEGET='$VEGET'/' DEF/config.def
532
533if [ $aerosols = n ] ; then
534  # set flag_aerosols=0 and flags ok_ade&co=n
535  sed -i'' -e 's/^ok_cdnc=.*.$/ok_cdnc=n/' -e 's/^ok_ade=.*.$/ok_ade=n/' -e 's/^ok_aie=.*.$/ok_aie=n/' -e 's/^ok_alw=.*.$/ok_alw=n/' -e 's/^flag_aerosol=.*.$/flag_aerosol=0/' DEF/config.def
536fi
537
538# COSP : ok_cosp desactive COSP si on a compile avec; il ne l'active pas si on a compile sans
539sed -i -e 's/ok_cosp.*.$/ok_cosp='$cosp'/' DEF/config.def
540if [ $cosp = y ] ; then \cp -f $MODEL/DefLists/cosp*.txt $local/DEF/ ; fi
541
542# Sorties LMDZ en fonction de l'option "xios"
543sed -i'' -e 's/ok_all_xml=.*.$/ok_all_xml='$xios'/' DEF/config.def
544
545# Ajuster physiq.def en fonction de radiative code (default: values for rad=rrtm)
546#   Pour isotopes=y , mettre iflag_ice_thermo=0 au lieu de 1
547#---------------------------------------------------------------------
548sed -i'' -e 's/iflag_rrtm=.*.$/iflag_rrtm='$iflag_rrtm'/' -e 's/NSW=.*.$/NSW='$NSW'/' DEF/physiq.def
549pwd
550sed -i'' -e 's:directory_name.*$:directory_name="'$local'/ecrad_data",:' DEF/namelist_ecrad
551
552if [ $isotopes = y ] ; then iflag_ice_thermo=0 ; else iflag_ice_thermo=1 ; fi
553sed -i -e 's/iflag_ice_thermo=.*.$/iflag_ice_thermo='$iflag_ice_thermo'/' DEF/physiq.def
554
555# Choix de orchidee.def en fonction de orchidee_rev ; modification pour xios
556#  NOTE separate orchidee_pft.def file for ORCHIDEE trunk post-CMIP6 
557#---------------------------------------------------------------------
558orchidee_def=orchidee.def_6.1
559orchidee_pft_def=""
560if [ $veget = "7983" ] ; then 
561  orchidee_def=orchidee.def_6.2work
562elif [ $veget = "7994" ] ; then 
563  orchidee_def=orchidee.def_6.4work
564  orchidee_pft_def=orchidee_pft.def_6.4work
565  if [ ! grep "INCLUDEDEF=orchidee_pft.def" DEF/run.def ] ; then
566    sed -i'' -e 's/INCLUDEDEF=orchidee.def/INCLUDEDEF=orchidee.def\nINCLUDEDEF=orchidee_pft.def/' DEF/run.def ; fi
567fi
568\cp -f DEF/$orchidee_def DEF/orchidee.def
569if [ "$orchidee_pft_def" != "" ] ; then \cp -f DEF/$orchidee_pft_def DEF/orchidee_pft.def ; fi
570
571# Only for veget=CMIP6 it is still possible to use IOIPSL ; newer versions of orchidee.def have XIOS_ORCHIDEE_OK = y
572sed -i'' -e 's/XIOS_ORCHIDEE_OK =.*.$/XIOS_ORCHIDEE_OK = '$xios'/' DEF/orchidee.def
573
574
575######################################################################
576# Si on tourne avec XIOS, mise a jour des fichiers context et field* dans XMLfilesLMDZ
577# (ils vont se repercuter dans les repertoires de simulation $local/$SIM et de run $WRK)
578######################################################################
579if [ $xios = y ] ; then
580  \cp -f $MODEL/DefLists/context_lmdz.xml $local/DEF/XMLfilesLMDZ/.
581  \cp -f $MODEL/DefLists/field_def_lmdz.xml $local/DEF/XMLfilesLMDZ/.
582  if [ $cosp = y ] ; then \cp -f $MODEL/DefLists/field_def_cosp1.xml $local/DEF/XMLfilesLMDZ/. ; fi
583fi
584
585
586######################################################################
587# Verification de l'existance de l'etat initial et compilation eventuelle
588# pour sa creation
589######################################################################
590if [ ! -d $INIT ] ; then 
591   if [ $init = 0 ] ; then
592      echo  Recuperer les repertoires $INIT ou lancer avec option -init ; exit
593   else
594      ce0l=$MODEL/bin/ce0l${suffix}.e
595      echo $ce0l
596
597      # Test if $ce0l exists (it may be the case if you use a model configuration already installed and compiled)
598      if [ ! -f $ce0l ] ; then
599       echo L executable $ce0l n existe pas
600       echo il va se compiler automatiquement sur $MODEL
601       sleep 10
602
603       $local/compile.sh ce0l
604     fi
605
606     if [ ! -f $ce0l ] ; then echo la compilation de $ce0l a echoue ; exit ; fi
607
608      cd $local
609   fi
610elif [ $init = 1 ] ; then
611   echo Vous essayez d initialiser le modele mais $INIT existe deja
612   exit
613fi
614
615MAINDIR=`basename \`pwd\``
616
617######################################################################
618# On cree sur le SCRATCHD un repertoire de travail avec le meme
619# nom que le repertoire local
620######################################################################
621. ./lmdz_env.sh
622WRK=$SCRATCHD/$MAINDIR
623mkdir -p $WRK
624cd $WRK
625echo La simulation s executera sur $SCRATCHD/$MAINDIR
626
627#####################################################################
628# Creation du repertoire $SIM s'il n'existe pas deja
629#####################################################################
630
631if [ ! -d $local/$SIM ] ; then
632mkdir $local/$SIM
633cd $local
634sed -e 's:^rebuild=.*.$:rebuild='$LMDZD/$LMDZname/modipsl/bin/rebuild':' -e 's/groupe@cpu/'$groupe'@cpu/' reb.sh  >| $local/$SIM/reb.sh ; chmod +x $local/$SIM/reb.sh
635cp lmdz_env.sh $local/$SIM/
636mkdir $local/$SIM/DEF ; cp DEF/*def DEF/namelis* $local/$SIM/DEF/
637#Pour XIOS, respectivement COSP, copier aussi les fichiers *xml / *txt
638if [ $cosp = y ] ; then cp DEF/cosp*txt $local/$SIM/DEF/ ; fi
639if [ $xios = y ] ; then
640   cp DEF/XMLfilesLMDZ/*xml $local/$SIM/DEF/
641   if [ $veget != 'NONE' ] ; then cp DEF/XMLfilesOR$veget/*xml $local/$SIM/DEF/ ; fi
642fi
643chmod u+w $local/$SIM/DEF/*
644
645# Gestion du calendrier
646#######################
647sed -e 's/anneeref=.*.$/anneeref='$yearini'/' \
648    DEF/run.def >| $local/$SIM/DEF/run.def
649cd $SIM
650if [ "$freq" = "yr" ] ; then date=$yearini ; else date=$mthini ; fi
651echo $date a faire >| etat
652
653# Recuperation des fichiers : executable initiaux et forcages
654#############################################################
655echo $date 
656for f in start startphy ; do inf=../$INIT/$f.$date.nc ; if [ -f $inf -o $init = 1 ] ; then ln -s $inf ./ ; else echo $inf inexistant ; exit ; fi ; done
657for f in sechiba stomate ; do if [ -f ../$INIT/start_$f.$date.nc ] ; then ln -sf  ../$INIT/start_$f.$date.nc . ; fi ; done
658cp $gcm gcm.e
659fi  # fin de " if [ ! -d $local/$SIM ]"
660cd $local/..
661
662# Choix du "time limit" pour le job
663###################################
664if [ "$freq" = "yr" ] ; then cput=04:00:00 ; else cput=01:00:00 ; fi
665
666#####################################################################
667echo Modification du script de lancement
668###################################################################/$S
669sed -e 's/stopsim=.*.$/stopsim='$stopsim'/' -e 's/^veget=.*.$/veget='$veget'/' -e 's/orchidee_rev=.*.$/orchidee_rev='$orchidee_rev'/' -e 's/^aerosols=.*.$/aerosols='$aerosols'/' -e 's/^isotopes=.*.$/isotopes='$isotopes'/' -e 's/NOM_SIMU/'$SIM'/' -e 's/time=.*.$/time='$cput'/' -e 's/MAINDIR=.*.$/MAINDIR='$MAINDIR'/' -e 's:STORED=.*.*:STORED='$STORED':'  -e 's:SCRATCHD=.*.*:SCRATCHD='$SCRATCHD':' -e 's/ntasks=.*.$/ntasks='$mpi'/' -e 's/cpus-per-task=.*.$/cpus-per-task='$omp'/' -e 's/nthreads=.*./nthreads='$omp'/' -e 's/^climato=.*.$/climato='$climato'/' -e 's/^ok_guide=.*.$/ok_guide='$ok_guide'/' -e 's/groupe@cpu/'$groupe'@cpu/' $local/script_SIMU >| $WRK/tmp_$SIM
670
671if [ "$testmode" = "y" ] ; then
672  sed -i -e 's/time=.*.$/time=00:30:00/' -e 's/#nday=1/nday=1/' -e 's/#[[:space:]]#SBATCH[[:space:]]--qos=qos_cpu-dev/#SBATCH --qos=qos_cpu-dev/' $WRK/tmp_$SIM
673fi
674
675if [ $climato = 0 ] ; then
676# calend est choisi plus haut dans "Changements dans les fichiers DEF/*def" et ecrit dans $MAINDIR/DEF/run.def
677yrini=`echo $mthini | cut -c-4`
678yrend=`echo $mthend | cut -c-4`
679yrs="" ; yr=$yrini ; while [ $yr -le $yrend ] ; do yrs="$yrs $yr" ; (( yr = $yr + 1 )) ; done
680suf=360x180_
681else
682yrs=2000
683suf=1x1_clim
684fi
685
686
687#####################################################################
688   echo Recuperation eventuelle de certains fichiers sur LMDZ_Init
689#####################################################################
690
691if [ ! -d $LMDZ_Init ] ; then mkdir $LMDZ_Init ; fi
692
693#-------------------------------------------------------------------
694# Fichiers ORCHIDEE
695#-------------------------------------------------------------------
696get="myget 3DInputData/Orchidee/"
697liste_get="PFTmap_IPCC_2000.nc cartepente2d_15min.nc "
698liste_get+="routing.nc routing_simple.nc lai2D.nc soils_param.nc "
699liste_get+="woodharvest_2000.nc PFTmap_15PFT.v1_2000.nc"
700for file in $liste_get ; do 
701  if [ ! -f $LMDZ_Init/$file ] ; then cd $LMDZ_Init ; ${get}$file ; cd - ; fi 
702done
703# Additionnal files needed for ORCHIDEE trunk post-CMIP6
704if [ $veget = 7994 -a ! -f $LMDZ_Init/soil_bulk_and_ph.nc ] ; then
705  cd $LMDZ_Init 
706  ${get}soil_bulk_and_ph.nc ; ${get}NITROGEN_for_ORtrunk.tar
707  tar -xvf NITROGEN_for_ORtrunk.tar ; cd -
708fi
709#-------------------------------------------------------------------
710# Fichiers aerosols/chimie
711#-------------------------------------------------------------------
712if [ $aerosols = clim ] ; then
713  get="myget 3DInputData/AerChem/"
714  #liste_get="aerosols1850_from_inca.nc aerosols2000_from_inca.nc"
715  #aerosols9999_from_inca.nc est un lien vers aerosols1995_2014_ensavg_from_inca.nc
716  liste_get="aerosols1850_from_inca.nc aerosols9999_from_inca.nc"
717  for file in $liste_get ; do 
718    if [ ! -f $LMDZ_Init/$file ] ; then cd $LMDZ_Init ; ${get}$file ; cd - ; fi
719  done
720fi
721
722# For SPLA
723#-------------------
724# Dans ${LMDZ_Init} on cree folder SPLA_Init et dedans le INITIAL
725# Pour l'instant on copie là-dedans de chez Binta les fichiers a la res zoomNaf;
726# plus tard on y recupererea des fichiers a haute resolution reguliere depuis http:/LMDZ,
727# a regrider ensuite par un script interp_fichiers_spla.sh (comme pour aerosols="clim")
728# Les fichiers (regrides, sauf SOILSPEC.data utilise tel quel) seront mis dans $MAINDIR/INPUT_SPLA (equivalent de INPUT_DUST)
729if [ $aerosols = spla ] ; then
730  if [ ! -d ${LMDZ_Init}/SPLA_Init ] ; then mkdir ${LMDZ_Init}/SPLA_Init ; mkdir $LMDZ_Init/SPLA_Init/INITIAL ; fi
731  get="cp -p /gpfsstore/rech/gzi/rgzi027/ergon/BIBIAERO/INPUTS_DUST/INITIAL/"
732  liste_get="wth.dat cly.dat donnees_lisa.nc SOILSPEC.data \
733               carbon_emissions.nc sulphur_emissions_antro.nc  \
734               sulphur_emissions_nat.nc  sulphur_emissions_volc.nc" 
735
736  for file in $liste_get ; do
737    if [ ! -f $LMDZ_Init/SPLA_Init/INITIAL/$file ] ; then cd $LMDZ_Init/SPLA_Init/INITIAL ; ${get}$file . ; cd - ; fi
738  done
739###
740  #Cas particulier des fichiers mensuels dust.nc :A DECIDER :
741  #C'est entre le cas des aerosols.clim= 1 seul fichier, annuel,
742  # et le cas des vents guidage, pré-interpolés avec era2gcm pour toute la periode, dans MAINDIR/GUIDE.
743  # On pourrait (a)demander de precalculer dust.nc aussi, dans MAINDIR/INPUT_SPLA - avec un script à adapter de Jeronimo. Rien a mettre dans SPLA_Init alors.
744  # Ou (b) fournir dans SPLA_Init les 12 mois d'un dust.nc climato (an 2006 pour nous ici) à la res EC, et faire juste le regrid vers MAINDIR/INPUT_SPLA
745  #ICI pour l'instant je copie les fichiers de chez Binta (repositoire==http...) dans LMDZ_Init/SPLA_Init, avec test sur mois 01
746
747  if [ ! -d ${LMDZ_Init}/SPLA_Init/PERIOD0001 ] ; then cp -pr /gpfsstore/rech/gzi/rgzi027/ergon/BIBIAERO/INPUTS_DUST/PERIOD* $LMDZ_Init/SPLA_Init/. ; fi
748
749 #A la fin on doit avoir dans SPLA_Init les fichiers initiaux dans INITIAL plus les repertoires PERIOD00MM contenant dust.nc
750 #Cela doit se retrouver dans script_SIMU qui les copie dans le repertoire de run sur $SCRATCH
751
752fi #$aerosols = spla
753
754
755#-------------------------------------------------------------------
756# Fichiers Init
757#-------------------------------------------------------------------
758get="myget 3DInputData/Init/"
759liste_get="alb_bg_modisopt_2D_ESA_v2.nc reftemp.nc"
760for file in $liste_get ; do 
761  if [ ! -f $LMDZ_Init/$file ] ; then cd $LMDZ_Init ; ${get}$file ; cd - ; fi
762done
763
764cd $local
765
766
767
768if [ $init = 1 ] ; then
769   #####################################################################
770      echo Creation de l etat initial
771   #####################################################################
772
773   # Creation du repertoire INIT et mise en place de liens logiques vers les starts
774   # en anticipation de leur création :
775   mkdir $local/$INIT ; cd $local/$INIT
776   for an in $mthini $yearini ; do for f in start startphy ; do ln -s $f.nc $f.$an.nc ; done ; done
777
778   # Creation du repertoire INIT temporaire et rapatriement des fichiers necessaires
779   if [ -d $WRK/$INIT ] ; then mv $WRK/$INIT $WRK/$INIT$$ ; fi
780   mkdir $WRK/$INIT ;  cp -r $local/DEF $WRK/$INIT/
781   cd $WRK/$INIT ; cp DEF/*.def . ; cp $local/lmdz_env.sh .
782   if [ $xios = y ] ; then 
783       cp DEF/XMLfilesLMDZ/*xml . 
784       if [ $veget != 'NONE' ] ; then cp DEF/XMLfilesOR$veget/*xml . ; fi 
785   fi 
786   sed -e 's/anneeref=.*.$/anneeref='$yearini'/' DEF/run.def >| run.def
787
788#-------------------------------------------------------------------
789# Fichiers Limit
790#-------------------------------------------------------------------
791   get="myget 3DInputData/Limit/"
792   liste_get="Albedo.nc Relief.nc Rugos.nc landiceref.nc"
793   for yr in $yrs ; do
794       if [ $climato = 0 ] ; then sufyr=$suf$yr ; else sufyr=$suf ; fi
795       liste_get="$liste_get  amipbc_sic_$sufyr.nc amipbc_sst_$sufyr.nc"
796   done
797   echo LISTEGET $liste_get
798   for file in $liste_get ; do
799     if [ ! -f $LMDZ_Init/$file ] ; then cd $LMDZ_Init ; ${get}$file ; cd - ; fi
800     ln -s $LMDZ_Init/$file
801   done
802#-------------------------------------------------------------------
803# ECDYN
804#-------------------------------------------------------------------
805   get="myget 3DInputData/Init/"
806   if [ ! -f $LMDZ_Init/ECDYN.nc ] ; then cd $LMDZ_Init ; ${get}ECDYN.nc ; cd - ; fi
807   ln -s $LMDZ_Init/ECDYN.nc
808   ln -sf ECDYN.nc ECPHY.nc
809
810
811   # Creation du script d'initialisation
812   cat <<...eod>| tmp
813#!/bin/bash
814
815#SBATCH --job-name=Init         # nom du job
816#SBATCH -A "$groupe"@cpu
817#SBATCH --ntasks=1             # Nombre de processus MPI
818#SBATCH --cpus-per-task=16     # nombre de threads OpenMP
819# /!\ Attention, la ligne suivante est trompeuse mais dans le vocabulaire
820# de Slurm "multithread" fait bien référence à l'hyperthreading.
821#SBATCH --hint=nomultithread   # 1 thread par coeur physique (pas d'hyperthreading)
822#SBATCH --time=00:10:00            # Temps d’exécution maximum demandé (HH:MM:SS)
823#SBATCH --output=Init%j.out     # Nom du fichier de sortie
824#SBATCH --error=Init%j.out      # Nom du fichier d'erreur (ici commun avec la sortie)
825# To submit to dev queue ; "time" (above) must be max 2h
826# #SBATCH --qos=qos_cpu-dev
827
828# ANCIEN MULTI STEP  case \${LOADL_STEP_NAME} in
829
830# ANCIEN MULTI STEP   init )
831
832   if [ ! -f lmdz_env.sh ] ; then echo manque fichier lmdz_env.sh ; ls ; exit ; fi
833   . lmdz_env.sh
834   ulimit -s unlimited
835   export OMP_STACKSIZE=800M
836   export OMP_NUM_THREADS=1
837   cd $WRK/$INIT
838   echo Executable : $ce0l
839   for yr in $yrs ; do 
840      if [ $climato = 0 ] ; then sufyr=$suf\$yr ; else sufyr=$suf ; fi
841      ln -sf amipbc_sic_\$sufyr.nc amipbc_sic_1x1.nc
842      ln -sf amipbc_sst_\$sufyr.nc amipbc_sst_1x1.nc
843      sed -e 's/anneeref=.*.$/anneeref='\$yr'/' DEF/run.def >| run.def
844      echo Starting initialisation
845      $run 1 $ce0l
846      if [ $climato = 0 ] ; then mv limit.nc limit.\$yr.nc ; fi
847   done
848# ANCIEN MULTI STEP    ;;
849
850# ANCIEN MULTI STEP   interp )
851   if [ $aerosols = clim ] ; then
852    cp $local/interp_aerosols.sh . ; chmod +x interp_aerosols.sh
853    # Les aerosols de l'annee 2000 ont ete remplaces par "9999" qui pointe vers un fichier moyen sur 1995-2014
854    #for year in 2000 1850 ; do  ./interp_aerosols.sh \$year ; done
855    #mv aerosols.2000.nc aerosols.clim.nc ; mv aerosols.1850.nc aerosols.nat.nc
856    for year in 9999 1850 ; do ./interp_aerosols.sh \$year ; done
857    mv aerosols.9999.nc aerosols.clim.nc ; mv aerosols.1850.nc aerosols.nat.nc
858   fi
859
860   # AS : S'il etait possible d'automatiser l'interpolation de l'input SPLA, ce serait a lancer ici
861   #en attendant, on passe au paragraphe suivant où on copie les fichiers à la res ZoomNaf depuis $LMDZ_Init/SPLA_Init
862   #if [ $aerosols = spla ] ; then
863    #cp $local/futur script interp_aerosols_SPLA.sh . ; chmod +x interp_aerosols_SPLA.sh
864    #for file in... ; do  ./interp_aerosols_SPLA.sh \$year ; done
865    #etc etc etc ...
866   #fi
867
868# Copy initial and forcing files in $local/$INIT and $local/$LIMIT; also in $local/INPUT_SPLA if $aerosols=spla
869   for f in sta* limit.nc gri*nc ; do cp \$f $local/$INIT/\$f ; done
870   mkdir -p $local/$LIMIT
871   for f in limit*.nc  ; do cp \$f $local/$LIMIT/\$f ; done
872   if [ $aerosols = clim ] ; then  for f in aerosols[.0-9]*nc ; do cp \$f $local/$LIMIT/\$f ; done ; fi
873   #
874   if [ $aerosols = spla ] ; then 
875     #mkdir -p $local/INPUT_SPLA ; pour l'instant on copie $LMDZ_Init/SPLA_Init en block
876     if [ ! -d $local/INPUT_SPLA ] ; then cp -pr $LMDZ_Init/SPLA_Init $local/INPUT_SPLA ; fi
877   fi
878   cd $WRK
879...eod
880   if [ $ok_guide != y ] ; then # Running first simulation automatically except for nudging
881      cat <<...eod>> tmp
882         $submit tmp_$SIM
883...eod
884   fi
885   cat <<...eod>> tmp
886# ANCIEN MULTI STEP   esac
887...eod
888
889   echo '###############################################################################'
890   echo Submitting initialisation job
891pwd
892   $submit tmp
893   echo '###############################################################################'
894
895else
896#case [ $init != 1 ]
897
898   cd $WRK
899   echo '###############################################################################'
900   echo Submitting job tmp_$SIM
901   echo $submit tmp_$SIM
902   $submit tmp_$SIM
903   echo '###############################################################################'
904fi
905
906
907if [ $ok_guide = y -a $init = 1 ] ; then
908   echo Once initialisation is finished, you have to create nudging files
909   echo Edit era2gcm.sh and set the desired parameters in section "User choices"
910   echo Make sure you have acces to the chosen ERA files, and the required modules are load
911   echo Then run : ./era2gcm.sh
912   if [ "$aerosols" = "spla" ] ; then
913     echo Your aerosol choice is "spla", so you need ERA 10m-winds interpolated on LMDZ grid
914     echo Use script era2gcm_uv10m.sh 
915   fi
916else
917   echo Si tout se passe bien, vous avez initialise et lance automatiquement
918   echo la simulation.
919   echo Si vous voulez modifier les caracteristiques du job, comme le temps
920   echo max ou le nombre de proc, il se trouve sur
921   echo $SCRATCHD/$MAINDIR/tmp_$SIM
922fi
923
924###############################################################################
925# At the end, print on screen the compilation command, and also in a "compile.sh" script
926
927echo "To recompile the model :"
928echo "run the compile${sufiso}.sh script created in the present folder: ./compile${sufiso}.sh gcm " 
Note: See TracBrowser for help on using the repository browser.