source: trunk/libIGCM/AA_job @ 1516

Last change on this file since 1516 was 1509, checked in by jgipsl, 4 years ago

Small change, remove apostrophe ' to have colors interpret correctly the syntax

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