source: branches/libIGCM_CESMEP/AA_job

Last change on this file was 1585, checked in by ssenesi, 12 months ago

merge branch libIGCM_CESMEP with trunk that handles RedHat8 on Irene

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