source: trunk/libIGCM/AA_job @ 1659

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

Merged with branches/libIGCM_PREPOST to split main Job into 3 Jobs (prerun, compute and postrun) on JeanZay? supercomputer at IDRIS.
Prerun and postrun run on prepost partition to have access to STORE space.

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