source: branches/libIGCM_concurrent/AA_job @ 1629

Last change on this file since 1629 was 1629, checked in by aclsce, 4 months ago

Modified to work on irene-amd machine.

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