source: trunk/libIGCM/AA_job @ 1459

Last change on this file since 1459 was 1454, checked in by sdipsl, 6 years ago

Dont let the scheduler try to rerun our job when strange things happen inside TGCC

  • 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: 23.5 KB
Line 
1#-Q- curie #!/bin/ksh
2#-Q- curie ######################
3#-Q- curie ## CURIE   TGCC/CEA ##
4#-Q- curie ######################
5#-Q- curie #MSUB -r ::Jobname::        # Job Name
6#-Q- curie #MSUB -o Script_Output_::Jobname::.000001    # standard output
7#-Q- curie #MSUB -e Script_Output_::Jobname::.000001    # error output
8#-Q- curie #MSUB -eo
9#-Q- curie #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case)
10#-Q- curie #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD
11#-Q- curie #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
12#-Q- curie #MSUB -E '--cpu_bind=none'
13#-Q- curie ##MSUB -E '--distribution cyclic'
14#-Q- curie #MSUB -T 86400              # Wall clock limit (seconds)
15#-Q- curie #MSUB -q standard           # thin nodes
16#-Q- curie ##MSUB -U high
17#-Q- curie #MSUB -U medium
18#-Q- curie ##MSUB -U low
19#-Q- curie #MSUB -A ::default_project::
20#-Q- curie #MSUB -E --no-requeue
21#-Q- curie # Below specific options that can be activated
22#-Q- curie ##MSUB -q ivybridge         # Option for Airain
23#-Q- curie
24#-Q- curie BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
25#-Q- curie set +x
26#-Q- irene #!/bin/ksh
27#-Q- irene ######################
28#-Q- irene ## IRENE   TGCC/CEA ##
29#-Q- irene ######################
30#-Q- irene #MSUB -r ::Jobname::        # Job Name
31#-Q- irene #MSUB -o Script_Output_::Jobname::.000001    # standard output
32#-Q- irene #MSUB -e Script_Output_::Jobname::.000001    # error output
33#-Q- irene #MSUB -eo
34#-Q- irene #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case)
35#-Q- irene #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD
36#-Q- irene #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
37#-Q- irene #MSUB -E '--cpu_bind=none'
38#-Q- irene #MSUB -T 86400              # Wall clock limit (seconds)
39#-Q- irene #MSUB -A ::default_project::
40#-Q- irene #MSUB -q skylake
41#-Q- irene ###MSUB -m store,work,scratch
42#-Q- irene #MSUB -E '--licenses=fs_unshare,fs_work,fs_store,fs_scratch'
43#-Q- irene
44#-Q- irene BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
45#-Q- irene set +x
46#-Q- ada #!/bin/ksh
47#-Q- ada # ######################
48#-Q- ada # ##  ADA       IDRIS ##
49#-Q- ada # ######################
50#-Q- ada # Job name
51#-Q- ada # @ job_name = ::Jobname::
52#-Q- ada # Standard output file name
53#-Q- ada # @ output = Script_Output_::Jobname::.000001
54#-Q- ada # Error output file name
55#-Q- ada # @ error = Script_Output_::Jobname::.000001
56#-Q- ada # Job type
57#-Q- ada # @ job_type = parallel
58#-Q- ada # Total number of tasks
59#-Q- ada # @ total_tasks = ::JobNumProcTot::
60#-Q- ada # Specific option for OpenMP parallelization: Number of OpenMP threads per MPI task
61#-Q- ada # @ parallel_threads = ::openMPthreads::
62#-Q- ada # Memory : as_limit=3.5gb max per process per core. With 4 threads per process use max as_limit=14gb
63#-Q- ada # @ as_limit = 3.5gb
64#-Q- ada # Maximum CPU time per task hh:mm:ss
65#-Q- ada # @ wall_clock_limit = 1:00:00
66#-Q- ada # @ environment = "BATCH_NUM_PROC_TOT=::JobNumProcTot::" ; wall_clock_limit=$(wall_clock_limit)
67#-Q- ada # End of the header options
68#-Q- ada # @ queue
69#-Q- lxiv8 ######################
70#-Q- lxiv8 ## OBELIX      LSCE ##
71#-Q- lxiv8 ######################
72#-Q- lxiv8 #PBS -N ::Jobname::
73#-Q- lxiv8 #PBS -m a
74#-Q- lxiv8 #PBS -j oe
75#-Q- lxiv8 #PBS -q mediump
76#-Q- lxiv8 #PBS -o Script_Output_::Jobname::.000001
77#-Q- lxiv8 #PBS -S /bin/ksh
78#-Q- lxiv8 #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
79#-Q- lxiv8 #PBS -l nodes=1:ppn=::JobNumProcTot::
80#-Q- ifort_CICLAD ######################
81#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
82#-Q- ifort_CICLAD ######################
83#-Q- ifort_CICLAD #PBS -N ::Jobname::
84#-Q- ifort_CICLAD #PBS -m a
85#-Q- ifort_CICLAD #PBS -j oe
86#-Q- ifort_CICLAD ###PBS -q h12   # Queue for 12 hours at ciclad only
87#-Q- ifort_CICLAD #PBS -o Script_Output_::Jobname::.000001
88#-Q- ifort_CICLAD #PBS -S /bin/ksh
89#-Q- ifort_CICLAD #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
90#-Q- ifort_CICLAD #PBS -l nodes=1:ppn=::JobNumProcTot::
91#-Q- ifort_CICLAD #PBS -l mem=6gb
92#-Q- ifort_CICLAD #PBS -l vmem=30gb
93#-Q- default #!/bin/ksh
94#-Q- default ##################
95#-Q- default ## DEFAULT HOST ##
96#-Q- default ##################
97#-Q- default #For MPI use, uncomment next line :
98#-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot::
99
100#**************************************************************
101# Author: Sebastien Denvil
102# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
103# $Revision::                                          $ Revision of last commit
104# $Author::                                            $ Author of last commit
105# $Date::                                              $ Date of last commit
106# IPSL (2006)
107#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
108#
109#**************************************************************
110
111#set -eu
112#set -vx
113
114date
115echo
116echo "#######################################"
117echo "#       ANOTHER GREAT SIMULATION      #"
118echo "#######################################"
119echo
120
121#D--------------------------------------------------------------------==
122#D-
123#D-                      Job to launch IGCM models
124#D-
125#D--------------------------------------------------------------------==
126#D-
127
128MODIPSL=::modipsl::
129libIGCM=${MODIPSL}/libIGCM
130
131#D--------------------------------------------------------------------==
132#D- -1. PLACE FOR USER MODIFICATION
133#D-     - Job Verbosity
134#D-     - PeriodNb
135#D-     - Experience type : DEB(ug), DEV(elopment), RUN
136#D--------------------------------------------------------------------==
137
138#D- Task type DO NOT CHANGE (computing, post-processing or checking)
139TaskType=computing
140
141#D- Increased verbosity (1, 2, 3)
142Verbosity=3
143
144#D- postProcessingStopLevel (0,1,2,3)
145#D- 3 stop the main job if any post-processing went wrong (atlas, monitoring, metrics, create_ts, create_se, rebuild or pack_*)
146#D- 2 stop only if create_ts, create_se or pack_* failed  (dont stop if atlas, monitoring or metrics failed)
147#D- 1 stop only if pack_* failed (dont stop if atlas, monitoring, metrics, create_ts or create_se failed)
148#D- 0 never stop the main job for post-processing that went wrong
149postProcessingStopLevel=1
150
151#D- Experience type : DEB(ug), DEV(elopment), RUN (default)
152#D- DEB : set -vx mode + output files are NOT read only
153#D- DEV : output files are NOT read only
154#D- RUN : output files ARE read only
155JobType=RUN
156
157#D- Number of execution in one job
158PeriodNb=1
159
160#D-
161#D- --------------------------------------------------------------------------------------------------#
162#D-                          ! OPTIONNAL FEATURES /!\ USE WITH CARE !                                 #
163#D- --------------------------------------------------------------------------------------------------#
164
165
166#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
167#D- Default=true
168#D-
169DEBUG_debug=true
170
171#D- Messaging : all activities and call stacks will be sent to ipsl servers
172#D- If true will imply DEBUG_debug=true
173#D- Default=false
174#D-
175BigBrother=true
176
177#D- Set DEBUG_sys to false to disable output calls of function
178#D- true when JobType=DEB # means DEB(ug)
179#D-
180#DEBUG_sys=false
181
182#D- Define running directory
183#D- Default=${TMPDIR} ie temporary batch directory
184#D-
185#RUN_DIR_PATH=/workdir/or/scratchdir/of/this/machine
186
187#D- Define submit directory
188#D- Default= where you launch qsub (variable from scheduler)
189#D-
190#SUBMIT_DIR=$( pwd )
191
192#D- Define input file root directory
193#D- Default=/IGCMG/common/account/of/this/machine
194#D- IPSL:   /prodigfs/ipslfs/igcmg/IGCM
195#D- TGCC:   /ccc/work/cont003/igcmg/igcmg/IGCM
196#D- IDRIS:  /workgpfs/rech/psl/rpsl035/IGCM
197#D- OBELIX: /home/orchideeshare/igcmg/IGCM
198#D- OTHER:  /home/${LOGIN}/IGCM
199
200#D- Change below to override the default
201#R_IN=/u/rech/por/rpor111/DATA
202
203#D- Turn in dry run mode ? (0,1,2,3)
204#D- Default=0
205#D-
206#DRYRUN=3
207#D-# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE !
208#D-# -------------------------------------------------------------------------------------
209#D-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
210#D-# |          |  Cp/Exe/param/files |            |         |                           |
211#D-# |          |  Chmod Qsub         |            |         |                           |
212#D-# -------------------------------------------------------------------------------------
213#D-# |    0     |       yes           |    yes     |  yes    |      yes                  |
214#D-# -------------------------------------------------------------------------------------
215#D-# |    1     |       yes           |    yes     |  yes    |      no                   |
216#D-# -------------------------------------------------------------------------------------
217#D-# |    2     |       yes           |    yes     |  no     |      no                   |
218#D-# -------------------------------------------------------------------------------------
219#D-# |    3     |       yes           |    no      |  no     |      no                   |
220#D-# -------------------------------------------------------------------------------------
221
222#D-
223# --------------------------------------------------------------------------------------------------#
224#D- ! END OF OPTIONNAL FEATURES /!\ DO NOT MODIFY ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING #
225# --------------------------------------------------------------------------------------------------#
226
227#D-
228#D--------------------------------------------------------------------==
229#D- 0.0 SYSTEM ENVIRONMENT
230#D-     - Define variables for Number of processors
231#D-     - Define MPI variables
232#D-     - Define batch scheduler variables
233#D-     - Source IGCM Library
234#D-     - Get RESOLution in .resol file (temporary)
235#D--------------------------------------------------------------------==
236
237#---------------------------------------------------------------------==
238
239. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
240. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
241. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
242#-------
243. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
244. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
245. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
246. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
247#-------
248( ${DEBUG_debug} ) && IGCM_debug_Check
249( ${DEBUG_debug} ) && IGCM_card_Check
250( ${DEBUG_debug} ) && IGCM_date_Check
251
252#--------------------------------------------------------------------==
253
254#-- Resolution FLAG for oasis input
255#RESOL="ORCA2xLMD9671"
256[ -f ${SUBMIT_DIR}/../.resol ] && RESOL=$(head -1 ${SUBMIT_DIR}/../.resol)
257#-- Chemistrie FLAG to ease chemistries configurations management
258#CHEM="AER"
259[ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie)
260
261#D-
262#D--------------------------------------------------------------------==
263#D- 0.1 COMMON ENVIRONMENT
264#D-     - Read libIGCM compatibility version in config.card
265#D-     - Read UserChoices section
266#D-     - Read Ensemble section
267#D-     - Read Post section
268#D-     - Define all netcdf output directories
269#D--------------------------------------------------------------------==
270IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
271
272if [ ! -r ${SUBMIT_DIR}/run.card ] ; then
273  #================================================#
274  #         The file run.card doesn't exist        #
275  #================================================#
276  FirstInitialize=true
277  #copy initial run.card
278  IGCM_sys_Cp ${SUBMIT_DIR}/run.card.init ${SUBMIT_DIR}/run.card
279  IGCM_debug_Print 2 "run.card copied from run.card.init"
280else
281  FirstInitialize=false
282  IGCM_debug_Print 2 "run.card exists"
283fi
284
285# ------------------------------------------------------------------
286# Activate BigBrother so as to supervise this simulation
287# ------------------------------------------------------------------
288IGCM_debug_BigBro_Initialize
289
290#D-
291#D--------------------------------------------------------------------==
292#D- 1. INITIALIZE CONFIGURATION
293#D-    - Simulation configuration
294#D-    - Simulation parameters
295#D-    - Execution parameter
296#D-    - Define input files directory
297#D-    - Read or initialize CumulPeriod
298#D-    - run.card
299#D--------------------------------------------------------------------==
300IGCM_config_Initialize
301
302# --------------------------------------------------------------------==
303# Define, create and cd RUN_DIR
304# --------------------------------------------------------------------==
305RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$}
306IGCM_sys_MkdirWork ${RUN_DIR}
307IGCM_sys_Cd ${RUN_DIR}
308
309# ------------------------------------------------------------------
310# Test if all was right before proceeding further
311# ------------------------------------------------------------------
312IGCM_debug_Verif_Exit
313
314#D-
315#D---------------------------------------------------------------------==
316#D- 2. INITIALIZE ALL COMPONENT OF THE CONFIGURATION
317#D-    - Define component executable
318#D-    - Define Write Frequency by component "1M" "1D" ...
319#D-    - Source ${comp}.driver
320#D-    - Define Storage Places by component
321#D-    - ${comp}_Initialize :
322#D-    - Patterns to sed
323#D-    - Variables from namelist
324#D---------------------------------------------------------------------==
325IGCM_comp_Initialize
326
327#D-
328#D---------------------------------------------------------------------==
329#D- 3. PERFORM GENERAL VERIFICATION
330#D-    - Verify compatibility of period length, write frequencies, ...
331#D-    - Verify compatibility of rebuild choices and post-process choices
332#D-    - Will stop here if something is wrong
333#D---------------------------------------------------------------------==
334IGCM_config_Check
335
336# ------------------------------------------------------------------
337# Test if all was right before entering the period loop
338# ------------------------------------------------------------------
339IGCM_debug_Verif_Exit
340
341#D-
342#D---------------------------------------------------------------------==
343#D- 4. ENTER THE DEEP EXECUTION LOOP
344#D-    ! FASTEN YOUR SEAT BELTS PLEASE. !
345#D-    !   WE WILL CROSS TURBULENCES.   !
346#D---------------------------------------------------------------------==
347
348Period=1
349
350PeriodContinue=false
351if [ ${Period} -le ${PeriodNb} ]; then
352  PeriodContinue=true
353fi
354while ( ${PeriodContinue} ) ; do
355
356  echo
357  echo "Starting iteration ${Period} / ${PeriodNb}"
358
359  #D-
360  # ------------------------------------------------------------------
361  #D-   4.1 COMPUTE AND DEFINE DATE INFORMATION.
362  #D-       - ${PeriodDateBegin}
363  #D-       - ${PeriodDateEnd}
364  #D-       - ${CumulPeriod}
365  #D-       - ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd}
366  #D-       - ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0
367  #D-       - update run.card value
368  # ------------------------------------------------------------------
369  IGCM_config_PeriodStart
370
371  #D-
372  # ------------------------------------------------------------------
373  #D-   4.2 BEGIN COMPUTATION ONLY IF NEEDED
374  # ------------------------------------------------------------------
375  if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then
376    IGCM_debug_Print 1 "break because '\${SimulationLengthInDays} -gt \${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}"
377    break ;
378  fi
379
380  #D-
381  # ------------------------------------------------------------------
382  #D-   4.3 CALL OPTIONNAL FUNCTION WITHIN DRIVER
383  #D-       - to set special variables used in lists (Param, Init or Bc).
384  # ------------------------------------------------------------------
385  IGCM_comp_PeriodStart
386
387  #D-
388  # ------------------------------------------------------------------
389  #D-   4.4 GET PARAMETERS TEXT FILES UPDATED BY JOB
390  #D-       - (.def, namelist ...)
391  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
392  # ------------------------------------------------------------------
393  IGCM_comp_GetInputParametersFiles
394
395  #D-
396  # ------------------------------------------------------------------
397  #D-   4.5 GET INITIAL STATE
398  #D-       - (Etat0, carteveg,relief...)
399  #D-       - NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1
400  #D-       - AND ???_Restart=NO
401  #D-       - READ AND USE BY GCM FOR ONLY ONE EXECUTION.
402  # ------------------------------------------------------------------
403  IGCM_comp_GetInputInitialStateFiles
404
405  #D-
406  # ------------------------------------------------------------------
407  #D-   4.6 GET BOUNDARIES CONDITIONS
408  #D-       - (SST, WIND[X,Y,Z], LAI ...)
409  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
410  # ------------------------------------------------------------------
411  IGCM_comp_GetInputBoundaryFiles
412
413  #D-
414  # ------------------------------------------------------------------
415  #D-   4.7 GET SmoothFiles CONDITIONS
416  #D-       - (SST, WIND[X,Y,Z], LAI ...)
417  #D-       - READ AND USE BY GCM AT EACH EXECUTION
418  #D-       - Do not change at each ${Period}
419  # ------------------------------------------------------------------
420  IGCM_comp_GetInputSmoothFiles
421
422  #D-
423  # ------------------------------------------------------------------
424  #D-   4.8 GET RESTART FILES
425  #D-       - (restartphy.nc, orca_restart.nc ...)
426  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
427  #D-
428  #D-       - IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART
429  #D-       - ONLY IF CumulPeriod= (=> NUMERO) == 1
430  #D-       - MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e)
431  #D-
432  #D-       - IF CumulPeriod == 1
433  #D-       - AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART
434  #D-       - MUST BRING THIS RESTART IN ${RUN_DIR_PATH}
435  #D-
436  #D-       - ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
437  # ------------------------------------------------------------------
438  IGCM_comp_GetInputRestartFiles
439
440  # ------------------------------------------------------------------
441  #D-   4.9 GET BINARY FILES
442  #D-       - USED BY AT EACH EXECUTION.
443  #D-       - CHECK BINARIES HAS BEEN COMPILED WITH THE SAME COMPILER
444  #D-       - RELOAD THE APPROPRIATE ENVIRONMENT THE FIRST TIME IF NEEDED
445  # ------------------------------------------------------------------
446  IGCM_comp_GetInputBinaryFiles
447
448  # ------------------------------------------------------------------
449  # Test if all was right before Update
450  # ------------------------------------------------------------------
451  IGCM_debug_Verif_Exit
452
453  #D-
454  # ------------------------------------------------------------------
455  #D-   4.10 ACTIVATE RUNNING ENVIRONNEMENT VARIABLES
456  #D-       - including module load associated to compiler & tools
457  #D-       - .env_intel17.0.2_curie
458  #D-       - .env_netcdf4.3.3.1_curie
459  # ------------------------------------------------------------------
460  IGCM_sys_activ_variables
461
462  #D-
463  # ------------------------------------------------------------------
464  #D-   4.11 UPDATE ParametersFiles
465  #D-        - (.def, namelist ...)
466  #D-        - with current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
467  # ------------------------------------------------------------------
468  IGCM_comp_Update
469
470  # ------------------------------------------------------------------
471  # Test if all was right before execution
472  # ------------------------------------------------------------------
473  IGCM_debug_Verif_Exit
474
475  #D-
476  #D---------------------------------------------------------------------==
477  #D- 5. EXECUTION
478  #D---------------------------------------------------------------------==
479
480  echo
481  echo "#######################################"
482  echo "#      DIR BEFORE RUN EXECUTION       #"
483  echo "#######################################"
484  echo
485  ls -lrt
486
487  echo "========================================================================"
488  if [ ${DRYRUN} -le 1 ] ; then
489    REAL_DATE_INIT=$( date )
490    echo                                                                                   > ${Exe_Output}
491    echo "#######################################"                                        >> ${Exe_Output}
492    echo "EXECUTION of : ${EXECUTION}"
493    echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
494    echo                                                                                  >> ${Exe_Output}
495    typeset RET
496    RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
497    ${EXECUTION}  >> ${Exe_Output} 2>&1
498    RET=$?
499    RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
500    if [ ${RET} -gt 0 ] ; then
501      echo "Return code of executable :" ${RET}
502      IGCM_debug_Exit "EXECUTABLE"
503      IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
504      IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
505      ExecutionFail=true
506    fi
507    echo                                            >> ${Exe_Output}
508    echo "#######################################"  >> ${Exe_Output}
509    echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
510    echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
511    echo                                            >> ${Exe_Output}
512  else
513    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
514    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
515    if ( $DEBUG_debug ) ; then
516      echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
517    fi
518  fi
519  echo "========================================================================"
520
521  echo
522  echo "#######################################"
523  echo "#       DIR AFTER RUN EXECUTION       #"
524  echo "#######################################"
525  echo
526  ls -lrt
527
528  #D-
529  #D---------------------------------------------------------------------==
530  #D- 6. POST EXECUTION OPERATIONS
531  #D---------------------------------------------------------------------==
532
533  #D-
534  # ------------------------------------------------------------------
535  #D-   6.1. DESACTIVATE RUNNING ENVIRONNEMENT VARIABLES
536  # ------------------------------------------------------------------
537  IGCM_sys_desactiv_variables
538
539  #D-
540  # ------------------------------------------------------------------
541  #D-   6.2. SAVE OUTPUTS
542  #D-        - On archive/storage machine
543  #D-        - netcdf outputs, restarts and text files of models
544  # ------------------------------------------------------------------
545  IGCM_comp_Finalize
546
547  # ------------------------------------------------------------------
548  # Test if all was right after Finalize
549  # ------------------------------------------------------------------
550  IGCM_debug_Verif_Exit
551
552  #D-
553  # ------------------------------------------------------------------
554  #D-   6.3. CONFIGURE POST-PROCESSING
555  #D-        - asynchronous post-treatment (Level 0) when necessary (rebuild/pack)
556  #D-        - classic post-treatment      (Level 1) when necessary (TimeSeries/Seasonal)
557  # ------------------------------------------------------------------
558  IGCM_post_Configure
559
560  #D-
561  # ------------------------------------------------------------------
562  #D-   6.4. SUBMIT POST-PROCESSING
563  #D-        - remote rebuild or/and post-treatment process if necessary
564  # ------------------------------------------------------------------
565  IGCM_post_Submit
566
567  #D-
568  # ------------------------------------------------------------------
569  #D-   6.5. FINALYZE CURRENT LOOP AND PREPARE NEXT ONE
570  #D-        - Manage executable size to save only different binary
571  #D-        - Write in run.card user, system and elapse time
572  #D-        - Check that everything went well ! No ? then we stop.
573  #D-        - Determine next computed period
574  # ------------------------------------------------------------------
575  IGCM_config_PeriodEnd
576
577  echo "Ending iteration ${Period}"
578  (( Period = Period + 1 ))
579
580  # End loop if date end is reached
581  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
582    break ;
583  fi
584
585  PeriodContinue=false
586  if [ ${Period} -le ${PeriodNb} ]; then
587    PeriodContinue=true
588  fi
589done
590
591#D-
592#D---------------------------------------------------------------------==
593#D- 7. SUBMIT NEXT JOB OR SEND MAIL IF SIMULATION IS OVER.
594#D---------------------------------------------------------------------==
595IGCM_config_Finalize
596
597date
Note: See TracBrowser for help on using the repository browser.