source: trunk/libIGCM/AA_job @ 675

Last change on this file since 675 was 675, checked in by mafoipsl, 12 years ago

Bugfix on ulam and information added into AA_job.

  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Revision Author Date
File size: 24.1 KB
RevLine 
[314]1#-Q- cesium #!/bin/ksh
2#-Q- cesium ###################################################
3#-Q- cesium ## CESIUM   CEA                                  ##
4#-Q- cesium ## Usefull for postprocessing. AA_job not tested ##
5#-Q- cesium ###################################################
6#-Q- cesium #MSUB -r ::Jobname::    # Nom du job               
7#-Q- cesium #MSUB -N 1              # Reservation du noeud
8#-Q- cesium #MSUB -n 1              # Reservation du processus
9#-Q- cesium #MSUB -T 86400          # Limite de temps elapsed du job
10#-Q- cesium #MSUB -E "-j o"
11#-Q- cesium #MSUB -E "-S /bin/ksh"
[619]12#-Q- curie #!/usr/bin/ksh
13#-Q- curie ######################
14#-Q- curie ## CURIE   TGCC/CEA ##
15#-Q- curie ######################
16#-Q- curie #MSUB -r ::Jobname::       # nom de la requete
17#-Q- curie #MSUB -o Script_Output_::Jobname::.000001    # nom du fichier de sortie
18#-Q- curie #MSUB -e Script_Output_::Jobname::.000001    # nom du fichier de sortie
19#-Q- curie #MSUB -eo
20#-Q- curie #MSUB -n ::JobNumProcTot:: # reservation des processeurs pour le job
21#-Q- curie #MSUB -T 86400             # Limite temps (en secondes)
22#-Q- curie ##MSUB -p XXXXXXX
23#-Q- curie BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
[2]24#-Q- platine #!/usr/bin/ksh
25#-Q- platine ##################
26#-Q- platine ## PLATINE   CEA ##
27#-Q- platine ##################
28#-Q- platine #BSUB -J ::Jobname::       # nom de la requete
29#-Q- platine #BSUB -N                   # message a la fin du job
[57]30#-Q- platine #BSUB -o Script_Output_::Jobname::.000001    # nom du fichier de sortie
[2]31#-Q- platine #BSUB -n ::JobNumProcTot::             # reservation des processeurs pour le job
[445]32#-Q- platine #BSUB -W 1:00              # Limite temps
[426]33#-Q- platine #BSUB -L /bin/ksh
[222]34#-Q- platine BATCH_NUM_PROC_TOT=$SLURM_NPROCS
35#-Q- titane #!/usr/bin/ksh
36#-Q- titane ##################
37#-Q- titane ## TITANE   CEA ##
38#-Q- titane ##################
39#-Q- titane #MSUB -r ::Jobname::       # nom de la requete
40#-Q- titane #MSUB -o Script_Output_::Jobname::.000001    # nom du fichier de sortie
[445]41#-Q- titane #MSUB -e Script_Output_::Jobname::.000001    # nom du fichier de sortie
42#-Q- titane #MSUB -eo
43#-Q- titane #MSUB -n ::JobNumProcTot:: # reservation des processeurs pour le job
44#-Q- titane #MSUB -T 86400             # Limite temps (en secondes)
[222]45#-Q- titane #MSUB -p gen2211
46#-Q- titane BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
[2]47#-Q- sx8brodie #######################
48#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
49#-Q- sx8brodie #######################
50#-Q- sx8brodie #PBS -N ::Jobname::         # nom de la requete
51#-Q- sx8brodie #PBS -m a                   # message a la fin du job
52#-Q- sx8brodie #PBS -j o                   # regroupement des sorties du job : standard error et output
[57]53#-Q- sx8brodie #PBS -o Script_Output_::Jobname::.000001  # nom du fichier de sortie
[2]54#-Q- sx8brodie #PBS -S /usr/bin/ksh        # shell de soumission
55#-Q- sx8brodie #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
56#-Q- sx8brodie #PBS -q ::JobClass::                # classe multi pour BATCH_NUM_PROC_TOT superieur a 2, mono sinon
57#-Q- sx8brodie #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}  # reservation des processeurs pour le job
[212]58#-Q- sx8brodie #PBS -l memsz_job=15.0gb     # Limite memoire
[445]59#-Q- sx8brodie #PBS -l cputim_job=1:00:00   # Limite temps
[68]60#-Q- aix6 #!/usr/bin/ksh
61#-Q- aix6 # ######################
62#-Q- aix6 # ##   VARGAS IDRIS   ##
63#-Q- aix6 # ######################
64#-Q- aix6 # Nom de la requete
65#-Q- aix6 # @ job_name = ::Jobname::
66#-Q- aix6 # Type de travail
67#-Q- aix6 # @ job_type = parallel
68#-Q- aix6 # Fichier de sortie standard
[476]69#-Q- aix6 # @ output = Script_Output_::Jobname::.000001
[68]70#-Q- aix6 # Fichier de sortie erreur (le meme)
[476]71#-Q- aix6 # @ error = Script_Output_::Jobname::.000001
[68]72#-Q- aix6 # Nombre de processus demandes
73#-Q- aix6 # @ total_tasks = ::JobNumProcTot::
[89]74#-Q- aix6 # @ environment = "BATCH_NUM_PROC_TOT=::JobNumProcTot::"
[68]75#-Q- aix6 # Temps CPU max. par processus MPI hh:mm:ss
76#-Q- aix6 # @ wall_clock_limit = 1:00:00
[83]77#-Q- aix6 # Memoire max. utilisee par processus
[68]78#-Q- aix6 # @ data_limit = 3.2gb
[659]79#-Q- aix6 # Memoire stack a etendre si besoin
80#-Q- aix6 ## @ stack_limit = 0.5gb,0.5gb
[68]81#-Q- aix6 # Pas d OpenMP
82#-Q- aix6 # @ resources = ConsumableCpus(1)
83#-Q- aix6 # Fin de l entete
84#-Q- aix6 # @ queue
[386]85#-Q- ulam #!/usr/bin/ksh
86#-Q- ulam # ####################################################
87#-Q- ulam # ##  ULAM IDRIS                                    ##
88#-Q- ulam # ##  Usefull for postprocessing. AA_job not tested ##
89#-Q- ulam # ####################################################
90#-Q- ulam #
[2]91#-Q- sx8mercure #!/bin/ksh
92#-Q- sx8mercure ######################
93#-Q- sx8mercure ## SX8MERCURE   CEA ##
94#-Q- sx8mercure ######################
95#-Q- sx8mercure #PBS -N ::Jobname::           # nom de la requete
96#-Q- sx8mercure #PBS -m a                     # message a la fin du job
97#-Q- sx8mercure #PBS -j o                     # regroupement des sorties du job : standard error et output
[146]98#-Q- sx8mercure ####PBS -A gen6178
[57]99#-Q- sx8mercure #PBS -o Script_Output_::Jobname::.000001   # nom du fichier de sortie
[2]100#-Q- sx8mercure #PBS -S /usr/bin/ksh          # shell de soumission
101#-Q- sx8mercure #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
102#-Q- sx8mercure #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}          # reservation des processeurs pour le job
[445]103#-Q- sx8mercure #PBS -l memsz_job=15.0gb      # limite memoire
[43]104#-Q- sx8mercure #PBS -l elapstim_req=01:00:00 # limite en temps elapsed
[171]105#-Q- sx9mercure #!/bin/ksh
106#-Q- sx9mercure ######################
107#-Q- sx9mercure ## SX9MERCURE   CEA ##
108#-Q- sx9mercure ######################
109#-Q- sx9mercure #PBS -N ::Jobname::           # nom de la requete
110#-Q- sx9mercure #PBS -m a                     # message a la fin du job
111#-Q- sx9mercure #PBS -j o                     # regroupement des sorties du job : standard error et output
112#-Q- sx9mercure #PBS -o Script_Output_::Jobname::.000001   # nom du fichier de sortie
113#-Q- sx9mercure #PBS -S /usr/bin/ksh          # shell de soumission
114#-Q- sx9mercure #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
115#-Q- sx9mercure #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}          # reservation des processeurs pour le job
[445]116#-Q- sx9mercure #PBS -l memsz_job=16.0gb      # limite memoire
[182]117#-Q- sx9mercure #PBS -l elapstim_req=24:00:00 # limite en temps elapsed
[171]118#-Q- sx9mercure #PBS -A gen6178               # groupe obligatoire sur SX9
[358]119#-Q- sx9mercure #PBS -q para-sx9              # para-sx9 or prio-sx9 (for CMIP5 top priorities), bckg-sx9 (run with free slot) and test-sx9 (if elapsed<1h)
[281]120#-Q- lxiv8 ######################
121#-Q- lxiv8 ## OBELIX      LSCE ##
122#-Q- lxiv8 ######################
123#-Q- lxiv8 #PBS -N ::Jobname::
124#-Q- lxiv8 #PBS -m a
125#-Q- lxiv8 #PBS -j oe
126#-Q- lxiv8 #PBS -q medium
127#-Q- lxiv8 #PBS -o Script_Output_::Jobname::.000001
128#-Q- lxiv8 #PBS -S /bin/ksh
129#-Q- lxiv8 #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
130#-Q- lxiv8 #PBS -l nodes=1:ppn=::JobNumProcTot::
[2]131#-Q- default #!/bin/ksh
132#-Q- default ##################
133#-Q- default ## DEFAULT HOST ##
134#-Q- default ##################
135#-Q- default #For MPI use, uncomment next line :
136#-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot::
137
[373]138#**************************************************************
139# Author: Sebastien Denvil
140# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
141# $Revision::                                          $ Revision of last commit
142# $Author::                                            $ Author of last commit
143# $Date::                                              $ Date of last commit
[2]144# IPSL (2006)
145#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
[373]146#
147#**************************************************************
[2]148
149#set -eu
150#set -vx
151
152date
153echo
154echo "#######################################"
155echo "#       ANOTHER GREAT SIMULATION      #"
156echo "#######################################"
157echo
158
159#D--------------------------------------------------------------------==
160#D--------------------------------------------------------------------==
161#D-
162#D-                      Job to launch IGCM models
163#D-
164#D--------------------------------------------------------------------==
165#D--------------------------------------------------------------------==
166#D-
167
168MODIPSL=::modipsl::
169libIGCM=${MODIPSL}/libIGCM
170
171#D--------------------------------------------------------------------==
172#D-                   -1. User modification place
173#D-                      - Job Verbosity
174#D-                      - PeriodNb
[128]175#D-                      - Experience type : DEB(ug), DEV(elopment), RUN
[2]176#D--------------------------------------------------------------------==
177
178#D- Increased verbosity (1, 2, 3)
179Verbosity=3
[475]180#D- Experience type : DEB(ug), DEV(elopment), RUN (default)
181JobType=RUN
[2]182#D- Number of execution in one job
[185]183PeriodNb=1
184#-Q- sx9mercure PeriodNb=60
[2]185
186#D-
[475]187# --------------------------------------------------------------------------------------------------#
188#D-                          ! Optionnal features /!\ Use with care !                               #
189# --------------------------------------------------------------------------------------------------#
[2]190
[475]191
[2]192#D- Low level debug : to bypass lib test checks and stack construction
193#D- Default=true
194DEBUG_debug=false
195
196#D- Set DEBUG_sys to false to disable output calls of function
197#D- Default=true
198#DEBUG_sys=false
199
200#D- Define running directory
201#D- Default=${TMPDIR} ie temporary batch directory
[154]202#RUN_DIR_PATH=/workdir/or/scratchdir/of/this/machine
[2]203
204#D- Define submit directory
[92]205#D- Default= where you launch qsub (variable from scheduler)
206#SUBMIT_DIR=$( pwd )
[2]207
[157]208#D- Define BIG_DIR directory
209#D- Default=(strongly machine dependant/see libIGCM_sys for details)
210#BIG_DIR=/somewhere/with/lot/of/space/scratchdir/may/be
211
[475]212#D- Define input file root directory
213#D- Default=/IGCMG/common/account/of/this/machine
214#R_IN=/u/rech/por/rpor111/DATA
215
[2]216#D- Turn in dry run mode ? (0,1,2,3)
217#D- Default=0
218#DRYRUN=3
[475]219# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE !
[2]220# -------------------------------------------------------------------------------------
221# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
222# |          |  Cp/Exe param files |            |  Chmod  |                           |
223# |          |      Qsub           |            |         |                           |
224# -------------------------------------------------------------------------------------
225# |    0     |       yes           |    yes     |  yes    |      yes                  |
226# -------------------------------------------------------------------------------------
227# |    1     |       yes           |    yes     |  yes    |      no                   |
228# -------------------------------------------------------------------------------------
229# |    2     |       yes           |    yes     |  no     |      no                   |
230# -------------------------------------------------------------------------------------
231# |    3     |       yes           |    no      |  no     |      no                   |
232# -------------------------------------------------------------------------------------
233
[475]234#D-
235# --------------------------------------------------------------------------------------------------#
236#D- ! End of optionnal features /!\ Do not modify anything below unless you know what you are doing #
237# --------------------------------------------------------------------------------------------------#
[2]238
239#D-
240#D--------------------------------------------------------------------==
241#D-                   0. System Environment
242#D-                      - Define variables for Number of processors
243#D-                      - Define MPI variables
244#D-                      - Define batch scheduler variables
245#D-                      - Source IGCM Library
246#D-                      - Get RESOLution in .resol file (temporary)
247#D--------------------------------------------------------------------==
248
249#D--------------------------------------------------------------------==
250
251. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
[83]252       ( ${DEBUG_debug} ) && IGCM_debug_Check
[2]253. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
254       ( ${DEBUG_debug} ) && IGCM_card_Check
255. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
256       ( ${DEBUG_debug} ) && IGCM_date_Check
257#-------
258. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
259. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
260. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
261. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
262
263#D--------------------------------------------------------------------==
264
265#-- Resolution FLAG for oasis input
[511]266#RESOL="ORCA2xLMD9671"
[138]267[ -f ${SUBMIT_DIR}/../.resol ] && RESOL=$(head -1 ${SUBMIT_DIR}/../.resol)
[511]268#-- Chemistrie FLAG to ease chemistries configurations management
269#CHEM="AER"
270[ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie) 
[2]271
272#D-
273#D--------------------------------------------------------------------==
274#D-           1. INITIALIZE CONFIGURATION AND THEN COMPONENTS
275#D--------------------------------------------------------------------==
276
277# --------------------------------------------------------------------==
278#D- Initialize configuration :
279#D-              - Simulation configuration
280#D-              - Simulation parameters
281#D-              - Execution parameter
282#D-              - Define input files directory
283#D-              - Read or initialize CumulPeriod
284#D-              - run.card
285#D-
286# --------------------------------------------------------------------==
287IGCM_config_Initialize
288
289# --------------------------------------------------------------------==
290#D- Define, create and cd RUN_DIR
291#D- 
292# --------------------------------------------------------------------==
[154]293RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_TagName}/${config_UserChoices_JobName}.${$}
[2]294IGCM_sys_MkdirWork ${RUN_DIR}
295IGCM_sys_Cd ${RUN_DIR}
296
[436]297# ------------------------------------------------------------------
298# Test if all was right before proceeding further
299# ------------------------------------------------------------------
[432]300IGCM_debug_Verif_Exit
301
[2]302# --------------------------------------------------------------------==
303#D- Initialize each components taking part
304#D- into simulation configuration :
305#D-         - Define component executable
306#D-         - Define Write Frequency by component "1M" "1D" ...
307#D-         - Source ${comp}.driver
308#D-         - Define Storage Places by component
309#D-         - ${comp}_Initialize :
310#D-         - Patterns to sed
311#D-         - Variables from namelist
312#D-
313# --------------------------------------------------------------------==
314IGCM_comp_Initialize
315
316# --------------------------------------------------------------------==
[92]317#D- Verify compatibility of period length, write frequencies, ...
318#D- Verify compatibility of rebuild choices and post-process choices
319#D- Will stop here if something is wrong
[2]320# --------------------------------------------------------------------==
[380]321IGCM_config_Check
[2]322
[380]323# ------------------------------------------------------------------
324#D- Test if all was right before entering the period loop
325# ------------------------------------------------------------------
326IGCM_debug_Verif_Exit
327
[2]328#D--------------------------------------------------------------------==
329#D-                  2. ENTER THE DEEP EXECUTION LOOP
330#D-                  !!!! FASTEN YOUR SEAT BELTS !!!!
331#D-                  !!!!!      PLEASE.          !!!!
332#D-                  !! WE WILL CROSS TURBULENCES. !!
333#D--------------------------------------------------------------------==
334
335Period=1
336
[120]337PeriodContinue=false
338if [ ${Period} -le ${PeriodNb} ]; then
339    PeriodContinue=true
340fi
341while ( ${PeriodContinue} ) ; do
342
[2]343    echo
344    echo "Starting iteration ${Period} / ${PeriodNb}"
345
346    #D-
347    # ------------------------------------------------------------------
348    #D- COMPUTE AND DEFINE DATE STUFF.
349    # ------------------------------------------------------------------
350    IGCM_config_PeriodStart
351    #D- => ${PeriodDateBegin}
352    #D- => ${PeriodDateEnd}
353    #D- => ${CumulPeriod}
354    #D- => ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd}
355    #D- => ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0
356    #D- => update run.card value
357   
358    #D-
359    # ------------------------------------------------------------------
[335]360    #D- BEGIN COMPUTATION ONLY IF NEEDED
361    # ------------------------------------------------------------------
362    if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then
[675]363        IGCM_debug_Print 1 "break because '${SimulationLengthInDays} -gt ${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}"
[335]364        break ;
365    fi
366   
367    #D-
368    # ------------------------------------------------------------------
[269]369    #D- Optionnal function in driver
370    #D- to set special variables used in forward lists (Param, Init or Bc).
371    # ------------------------------------------------------------------
372    IGCM_comp_PeriodStart
373   
374    #D-
375    # ------------------------------------------------------------------
[2]376    #D- Get parameters text files updated by job (.def, namelist ...)
377    #D- READ AND USE BY GCM AT EACH EXECUTION.
378    # ------------------------------------------------------------------
379    IGCM_comp_GetInputParametersFiles
380
381    #D-
382    # ------------------------------------------------------------------
383    #D- Get initial state (Etat0, carteveg,relief...)
384    #D- NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1
385    #D- AND ???_Restart=NO
386    #D- READ AND USE BY GCM FOR ONLY ONE EXECUTION.
387    # ------------------------------------------------------------------
388    IGCM_comp_GetInputInitialStateFiles
389
390    #D-
391    # ------------------------------------------------------------------
392    #D- Get Boundaries Conditions (SST, WIND[X,Y,Z], LAI ...)
393    #D- READ AND USE BY GCM AT EACH EXECUTION.
394    # ------------------------------------------------------------------
395    IGCM_comp_GetInputBoundaryFiles
396
397    #D-
398    # ------------------------------------------------------------------
[262]399    #D- Get SmoothFiles Conditions (SST, WIND[X,Y,Z], LAI ...)
400    #D- READ AND USE BY GCM AT EACH EXECUTION but varying in time
401    # ------------------------------------------------------------------
[265]402    IGCM_comp_GetInputSmoothFiles
[262]403
404    #D-
405    # ------------------------------------------------------------------
[2]406    #D- Get restart files (restartphy.nc, orca_restart.nc ...)
407    #D- READ AND USE BY GCM AT EACH EXECUTION.
408    #D-
409    #D- IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART
410    #D- ONLY IF CumulPeriod= (=> NUMERO) == 1
411    #D- MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e)
412    #D-
413    #D- IF CumulPeriod == 1
414    #D- AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART
415    #D- MUST BRING THIS RESTART IN ${RUN_DIR_PATH}
416    #D-
417    #D- ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
418    # ------------------------------------------------------------------
419    IGCM_comp_GetInputRestartFiles
420   
421    #D-
422    # ------------------------------------------------------------------
423    #D- Test if all was right before Update
424    # ------------------------------------------------------------------
425    IGCM_debug_Verif_Exit
426
427    # ------------------------------------------------------------------
428    #D- Activate running environnement variables
429    # ------------------------------------------------------------------
430    IGCM_sys_activ_variables
431
432    #D-
433    # ------------------------------------------------------------------
434    #D- UPDATE ParametersFiles (.def, namelist ...) with
435    #D- current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
436    # ------------------------------------------------------------------
437    IGCM_comp_Update
438
439    #D-
440    # ------------------------------------------------------------------
441    #D- Test if all was right before execution
442    # ------------------------------------------------------------------
443    IGCM_debug_Verif_Exit
444
445    #D-
446    #D----------------------------------------------------------------==
447    #D-                          3. Execution
448    #D----------------------------------------------------------------==
449
450    echo
451    echo "#######################################"
452    echo "#      DIR BEFORE RUN EXECUTION       #"
453    echo "#######################################"
454    echo
455    ls -lrt
456
457    echo "========================================================================"
458    if [ ${DRYRUN} -le 1 ] ; then
459        REAL_DATE_INIT=$( date )
[249]460        echo                                                                                   > ${Exe_Output}
461        echo "#######################################"                                        >> ${Exe_Output}
[619]462        echo "EXECUTION of : ${EXECUTION}"
463        echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
[249]464        echo                                                                                  >> ${Exe_Output}
[2]465        typeset RET
[57]466        RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
[619]467        ${EXECUTION}  >> ${Exe_Output} 2>&1
[2]468        RET=$?
[57]469        RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
[2]470        if [ ${RET} -gt 0 ] ; then
471            echo "Return code of executable :" ${RET}
472            IGCM_debug_Exit "EXECUTABLE"
[457]473            IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
474            IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
[433]475            ExecutionFail=true
[2]476        fi
[249]477        echo                                            >> ${Exe_Output}
478        echo "#######################################"  >> ${Exe_Output}
479        echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
480        echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
481        echo                                            >> ${Exe_Output}
[2]482    else
[619]483        echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
484        echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
[36]485        if ( $DEBUG_debug ) ; then
486            echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
487        fi
[2]488    fi
489    echo "========================================================================"
490
491    echo
492    echo "#######################################"
493    echo "#       DIR AFTER RUN EXECUTION       #"
494    echo "#######################################"
495    echo
496    ls -lrt
497
498    #D-
499    # ------------------------------------------------------------------
500    #D- Desactivate running environnement variables
501    # ------------------------------------------------------------------
502    IGCM_sys_desactiv_variables
503
504    #D-
505    #D----------------------------------------------------------------==
506    #D-                    4. Post execution operations
507    #D----------------------------------------------------------------==
508
509    #D-
510    # ------------------------------------------------------------------
511    #D- Save on archive machine netcdf outputs, restarts
512    #D- and text files of models
513    # ------------------------------------------------------------------
514    IGCM_comp_Finalize
515
516    #D-
517    # ------------------------------------------------------------------
518    #D- Test if all was right after Finalize
519    # ------------------------------------------------------------------
520    IGCM_debug_Verif_Exit
521
522    #D-
523    # ------------------------------------------------------------------
[380]524    #D- Configure asynchronous post-treatment (Level 0) when necessary (rebuild)
525    #D- Configure classic post-treatment (Level 1) when necessary (TimeSeries/Seasonal)
[2]526    # ------------------------------------------------------------------
[22]527    IGCM_post_Configure
[2]528
529    #D-
530    # ------------------------------------------------------------------
[380]531    #D- Launch remote rebuild or/and post-treatment process if necessary
532    # ------------------------------------------------------------------
533    IGCM_post_Submit
534
535    #D-
536    # ------------------------------------------------------------------
[2]537    #D- Save job output
538    #D- Manage executable size to save only different binary
539    #D- Write in run.card user, system and elapse time
540    #D- Check that everything went well ! No ? then we stop.
[380]541    #D- Determine next computed period
[2]542    # ------------------------------------------------------------------
543    IGCM_config_PeriodEnd
544
545    echo "Ending iteration ${Period}"
546    (( Period = Period + 1 ))
547
548    # End loop if date end is reached
549    if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
550        break ;
551    fi
552
[120]553    PeriodContinue=false
554    if [ ${Period} -le ${PeriodNb} ]; then
555        PeriodContinue=true
556    fi
[2]557done
558
559#D-
560#D--------------------------------------------------------------------==
561#D-     5. Submit next job or send mail if simulation over.
562#D--------------------------------------------------------------------==
563IGCM_config_Finalize
564
565date
Note: See TracBrowser for help on using the repository browser.