source: branches/libIGCM_CESMEP/AA_job @ 1553

Last change on this file since 1553 was 1536, checked in by rpennel, 4 years ago

Add possibility to specify wall time with ins_job

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