source: trunk/libIGCM/AA_job @ 1429

Last change on this file since 1429 was 1427, checked in by mafoipsl, 6 years ago

On curie, reintroduce the parameter -U in job's header.
Set -U medium as default. Use -U high for highest priority
and -U low for lowest priority.

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