source: trunk/libIGCM/AA_job @ 1451

Last change on this file since 1451 was 1448, checked in by jgipsl, 6 years ago

Change in headers at irene : temporary remove option -m and use a workaround given by the TGCC. This change is done to avoid problems with resubmitting from job when submitting the main job from workdir.

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