source: trunk/libIGCM/AA_job

Last change on this file was 1619, checked in by acosce, 3 months ago

fix a bug : error message was not in the appropriate section

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