source: trunk/libIGCM/AA_job @ 1440

Last change on this file since 1440 was 1437, checked in by jgipsl, 6 years ago

For Irene:

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