source: trunk/libIGCM/AA_job @ 1438

Last change on this file since 1438 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
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
[1432]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)
[1437]38#-Q- irene #MSUB -A ::default_project::
[1432]39#-Q- irene #MSUB -q skylake
[1433]40#-Q- irene #MSUB -m store,work,scratch
[1432]41#-Q- irene
42#-Q- irene BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
43#-Q- irene set +x
[770]44#-Q- ada #!/bin/ksh
45#-Q- ada # ######################
[929]46#-Q- ada # ##  ADA       IDRIS ##
[770]47#-Q- ada # ######################
[1108]48#-Q- ada # Job name
[770]49#-Q- ada # @ job_name = ::Jobname::
[1108]50#-Q- ada # Standard output file name
[770]51#-Q- ada # @ output = Script_Output_::Jobname::.000001
[1108]52#-Q- ada # Error output file name
[770]53#-Q- ada # @ error = Script_Output_::Jobname::.000001
[1240]54#-Q- ada # Job type
55#-Q- ada # @ job_type = parallel
[1108]56#-Q- ada # Total number of tasks
[770]57#-Q- ada # @ total_tasks = ::JobNumProcTot::
[1240]58#-Q- ada # Specific option for OpenMP parallelization: Number of OpenMP threads per MPI task
59#-Q- ada # @ parallel_threads = ::openMPthreads::
[1247]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
[1108]62#-Q- ada # Maximum CPU time per task hh:mm:ss
[770]63#-Q- ada # @ wall_clock_limit = 1:00:00
[1240]64#-Q- ada # @ environment = "BATCH_NUM_PROC_TOT=::JobNumProcTot::" ; wall_clock_limit=$(wall_clock_limit)
[1108]65#-Q- ada # End of the header options
[770]66#-Q- ada # @ queue
[281]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
[1126]73#-Q- lxiv8 #PBS -q mediump
[281]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::
[1184]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
[1314]84#-Q- ifort_CICLAD ###PBS -q h12   # Queue for 12 hours at ciclad only
[1184]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::
[1291]89#-Q- ifort_CICLAD #PBS -l mem=6gb
[1292]90#-Q- ifort_CICLAD #PBS -l vmem=30gb
[2]91#-Q- default #!/bin/ksh
92#-Q- default ##################
93#-Q- default ## DEFAULT HOST ##
94#-Q- default ##################
[815]95#-Q- default #For MPI use, uncomment next line :
[2]96#-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot::
97
[373]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
[2]104# IPSL (2006)
105#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
[373]106#
107#**************************************************************
[2]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--------------------------------------------------------------------==
[815]130#D- -1. PLACE FOR USER MODIFICATION
131#D-     - Job Verbosity
132#D-     - PeriodNb
133#D-     - Experience type : DEB(ug), DEV(elopment), RUN
[2]134#D--------------------------------------------------------------------==
135
[1356]136#D- Task type DO NOT CHANGE (computing, post-processing or checking)
[815]137TaskType=computing
[1301]138
[2]139#D- Increased verbosity (1, 2, 3)
140Verbosity=3
[1301]141
[1282]142#D- postProcessingStopLevel (0,1,2,3)
[1301]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
[475]149#D- Experience type : DEB(ug), DEV(elopment), RUN (default)
[1282]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
[475]153JobType=RUN
[1301]154
[2]155#D- Number of execution in one job
[185]156PeriodNb=1
[2]157
158#D-
[815]159#D- --------------------------------------------------------------------------------------------------#
160#D-                          ! OPTIONNAL FEATURES /!\ USE WITH CARE !                                 #
161#D- --------------------------------------------------------------------------------------------------#
[2]162
[475]163
[1096]164#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
[2]165#D- Default=true
[815]166#D-
[1095]167DEBUG_debug=true
[2]168
[988]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-
[1095]173BigBrother=true
[988]174
[2]175#D- Set DEBUG_sys to false to disable output calls of function
[988]176#D- true when JobType=DEB # means DEB(ug)
[815]177#D-
[2]178#DEBUG_sys=false
179
180#D- Define running directory
181#D- Default=${TMPDIR} ie temporary batch directory
[815]182#D-
[154]183#RUN_DIR_PATH=/workdir/or/scratchdir/of/this/machine
[2]184
185#D- Define submit directory
[92]186#D- Default= where you launch qsub (variable from scheduler)
[815]187#D-
[92]188#SUBMIT_DIR=$( pwd )
[2]189
[475]190#D- Define input file root directory
191#D- Default=/IGCMG/common/account/of/this/machine
[1373]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
[475]199#R_IN=/u/rech/por/rpor111/DATA
200
[2]201#D- Turn in dry run mode ? (0,1,2,3)
202#D- Default=0
[815]203#D-
[2]204#DRYRUN=3
[815]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-# -------------------------------------------------------------------------------------
[2]219
[475]220#D-
221# --------------------------------------------------------------------------------------------------#
[815]222#D- ! END OF OPTIONNAL FEATURES /!\ DO NOT MODIFY ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING #
[475]223# --------------------------------------------------------------------------------------------------#
[2]224
225#D-
226#D--------------------------------------------------------------------==
[1051]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)
[2]233#D--------------------------------------------------------------------==
234
[815]235#---------------------------------------------------------------------==
[2]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
[832]245#-------
246( ${DEBUG_debug} ) && IGCM_debug_Check
247( ${DEBUG_debug} ) && IGCM_card_Check
248( ${DEBUG_debug} ) && IGCM_date_Check
[2]249
[815]250#--------------------------------------------------------------------==
[2]251
252#-- Resolution FLAG for oasis input
[511]253#RESOL="ORCA2xLMD9671"
[138]254[ -f ${SUBMIT_DIR}/../.resol ] && RESOL=$(head -1 ${SUBMIT_DIR}/../.resol)
[511]255#-- Chemistrie FLAG to ease chemistries configurations management
256#CHEM="AER"
[815]257[ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie)
[2]258
259#D-
260#D--------------------------------------------------------------------==
[1051]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
[1053]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
[1051]283# ------------------------------------------------------------------
284# Activate BigBrother so as to supervise this simulation
285# ------------------------------------------------------------------
[1189]286IGCM_debug_BigBro_Initialize
[1051]287
288#D-
289#D--------------------------------------------------------------------==
[815]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
[1051]297#D--------------------------------------------------------------------==
[2]298IGCM_config_Initialize
299
300# --------------------------------------------------------------------==
[815]301# Define, create and cd RUN_DIR
[2]302# --------------------------------------------------------------------==
[804]303RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$}
[2]304IGCM_sys_MkdirWork ${RUN_DIR}
305IGCM_sys_Cd ${RUN_DIR}
306
[436]307# ------------------------------------------------------------------
308# Test if all was right before proceeding further
309# ------------------------------------------------------------------
[432]310IGCM_debug_Verif_Exit
311
[2]312#D-
[815]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---------------------------------------------------------------------==
[2]323IGCM_comp_Initialize
324
[815]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---------------------------------------------------------------------==
[380]332IGCM_config_Check
[2]333
[380]334# ------------------------------------------------------------------
[815]335# Test if all was right before entering the period loop
[380]336# ------------------------------------------------------------------
337IGCM_debug_Verif_Exit
338
[815]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---------------------------------------------------------------------==
[2]345
346Period=1
347
[120]348PeriodContinue=false
349if [ ${Period} -le ${PeriodNb} ]; then
[815]350  PeriodContinue=true
[120]351fi
352while ( ${PeriodContinue} ) ; do
353
[785]354  echo
355  echo "Starting iteration ${Period} / ${PeriodNb}"
[2]356
[785]357  #D-
358  # ------------------------------------------------------------------
[815]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
[785]366  # ------------------------------------------------------------------
367  IGCM_config_PeriodStart
[2]368
[785]369  #D-
370  # ------------------------------------------------------------------
[815]371  #D-   4.2 BEGIN COMPUTATION ONLY IF NEEDED
[785]372  # ------------------------------------------------------------------
373  if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then
[1351]374    IGCM_debug_Print 1 "break because '\${SimulationLengthInDays} -gt \${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}"
[785]375    break ;
376  fi
[2]377
[785]378  #D-
379  # ------------------------------------------------------------------
[815]380  #D-   4.3 CALL OPTIONNAL FUNCTION WITHIN DRIVER
381  #D-       - to set special variables used in lists (Param, Init or Bc).
[785]382  # ------------------------------------------------------------------
383  IGCM_comp_PeriodStart
[2]384
[785]385  #D-
386  # ------------------------------------------------------------------
[815]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.
[785]390  # ------------------------------------------------------------------
391  IGCM_comp_GetInputParametersFiles
[262]392
[785]393  #D-
394  # ------------------------------------------------------------------
[815]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.
[785]400  # ------------------------------------------------------------------
401  IGCM_comp_GetInputInitialStateFiles
[2]402
[785]403  #D-
404  # ------------------------------------------------------------------
[815]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.
[785]408  # ------------------------------------------------------------------
409  IGCM_comp_GetInputBoundaryFiles
[2]410
[785]411  #D-
412  # ------------------------------------------------------------------
[815]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}
[785]417  # ------------------------------------------------------------------
[815]418  IGCM_comp_GetInputSmoothFiles
[2]419
[785]420  #D-
421  # ------------------------------------------------------------------
[815]422  #D-   4.8 GET RESTART FILES
423  #D-       - (restartphy.nc, orca_restart.nc ...)
424  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
[785]425  #D-
[815]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)
[785]429  #D-
[815]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}
[785]433  #D-
[815]434  #D-       - ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
[785]435  # ------------------------------------------------------------------
436  IGCM_comp_GetInputRestartFiles
[2]437
[785]438  # ------------------------------------------------------------------
[1409]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  # ------------------------------------------------------------------
[815]447  # Test if all was right before Update
[785]448  # ------------------------------------------------------------------
449  IGCM_debug_Verif_Exit
[2]450
[815]451  #D-
[785]452  # ------------------------------------------------------------------
[1409]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
[785]457  # ------------------------------------------------------------------
458  IGCM_sys_activ_variables
[2]459
[785]460  #D-
461  # ------------------------------------------------------------------
[1409]462  #D-   4.11 UPDATE ParametersFiles
[815]463  #D-        - (.def, namelist ...)
464  #D-        - with current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
[785]465  # ------------------------------------------------------------------
466  IGCM_comp_Update
467
468  # ------------------------------------------------------------------
[815]469  # Test if all was right before execution
[785]470  # ------------------------------------------------------------------
471  IGCM_debug_Verif_Exit
472
473  #D-
[815]474  #D---------------------------------------------------------------------==
475  #D- 5. EXECUTION
476  #D---------------------------------------------------------------------==
[785]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
[2]504    fi
[785]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 "========================================================================"
[2]518
[785]519  echo
520  echo "#######################################"
521  echo "#       DIR AFTER RUN EXECUTION       #"
522  echo "#######################################"
523  echo
524  ls -lrt
[2]525
[785]526  #D-
[815]527  #D---------------------------------------------------------------------==
528  #D- 6. POST EXECUTION OPERATIONS
529  #D---------------------------------------------------------------------==
530
531  #D-
[785]532  # ------------------------------------------------------------------
[815]533  #D-   6.1. DESACTIVATE RUNNING ENVIRONNEMENT VARIABLES
[785]534  # ------------------------------------------------------------------
535  IGCM_sys_desactiv_variables
[2]536
[785]537  #D-
538  # ------------------------------------------------------------------
[815]539  #D-   6.2. SAVE OUTPUTS
540  #D-        - On archive/storage machine
541  #D-        - netcdf outputs, restarts and text files of models
[785]542  # ------------------------------------------------------------------
543  IGCM_comp_Finalize
[2]544
[785]545  # ------------------------------------------------------------------
[815]546  # Test if all was right after Finalize
[785]547  # ------------------------------------------------------------------
548  IGCM_debug_Verif_Exit
[2]549
[785]550  #D-
551  # ------------------------------------------------------------------
[815]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)
[785]555  # ------------------------------------------------------------------
556  IGCM_post_Configure
[2]557
[785]558  #D-
559  # ------------------------------------------------------------------
[815]560  #D-   6.4. SUBMIT POST-PROCESSING
561  #D-        - remote rebuild or/and post-treatment process if necessary
[785]562  # ------------------------------------------------------------------
563  IGCM_post_Submit
[380]564
[785]565  #D-
566  # ------------------------------------------------------------------
[815]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
[785]572  # ------------------------------------------------------------------
573  IGCM_config_PeriodEnd
[2]574
[785]575  echo "Ending iteration ${Period}"
576  (( Period = Period + 1 ))
[2]577
[785]578  # End loop if date end is reached
579  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
580    break ;
581  fi
[2]582
[785]583  PeriodContinue=false
584  if [ ${Period} -le ${PeriodNb} ]; then
585    PeriodContinue=true
586  fi
587done
[2]588
589#D-
[815]590#D---------------------------------------------------------------------==
591#D- 7. SUBMIT NEXT JOB OR SEND MAIL IF SIMULATION IS OVER.
592#D---------------------------------------------------------------------==
[2]593IGCM_config_Finalize
594
595date
Note: See TracBrowser for help on using the repository browser.