source: branches/libIGCM_concurrent/AA_job @ 1628

Last change on this file since 1628 was 1628, checked in by aclsce, 3 months ago

Modified to add the functionality to run many instances in concurrent mode.
Only available on Irene SKL with slurm.

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