source: branches/libIGCM_PREPOST/AA_job @ 1653

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

Fixed some bugs.

  • 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
207NbPeriodsPerJob=1
208
209#D-
210#D- --------------------------------------------------------------------------------------------------#
211#D-                          ! OPTIONNAL FEATURES /!\ USE WITH CARE !                                 #
212#D- --------------------------------------------------------------------------------------------------#
213
214
215#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
216#D- Default=true
217#D-
218DEBUG_debug=true
219
220#D- Messaging : all activities and call stacks will be sent to ipsl servers
221#D- If true will imply DEBUG_debug=true
222#D- Default=false
223#D-
224BigBrother=false
225
226#D- Set DEBUG_sys to false to disable output calls of function
227#D- true when JobType=DEB # means DEB(ug)
228#D-
229#DEBUG_sys=false
230
231#D- Define running directory
232#D- Default=${TMPDIR} ie temporary batch directory
233#D- Warning: the RUN_DIR_PATH directory might be deleted at the end of the simulation
234#D- You need to make a simulation TEST to check the functionnality of your computer (automatic or manual removal)
235#
236#RUN_DIR_PATH=/scratch_tmp_disk_of_this_machine/RUN_DIR/
237
238#D- Define submit directory
239#D- Default= where you launch qsub (variable from scheduler)
240#D-
241#SUBMIT_DIR=$( pwd )
242
243#D- Define input file root directory R_IN
244#D- MESO-IPSL:     /projsu/igcmg/IGCM
245#D- TGCC:          /ccc/work/cont003/igcmg/igcmg/IGCM
246#D- IDRIS:         /gpfswork/rech/psl/commun/IGCM
247#D- LSCE/OBELIX:   /home/orchideeshare/igcmg/IGCM
248#D- Other default: /home_local/${LOGIN}/IGCM
249
250#D- Change below to override the default
251#R_IN=/u/rech/por/rpor111/DATA
252
253#D- Turn in dry run mode ? (0,1,2,3,4)
254#D- Default=0
255#D-
256DRYRUN=0
257#D-# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE !
258#D-# -------------------------------------------------------------------------------------
259#D-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
260#D-# |          |  Cp/Exe/param/files |            |         |                           |
261#D-# |          |  Chmod Qsub         |            |         |                           |
262#D-# -------------------------------------------------------------------------------------
263#D-# |    0     |       yes           |    yes     |  yes    |      yes                  |
264#D-# -------------------------------------------------------------------------------------
265#D-# |    1     |       yes           |    yes     |  yes    |      no                   |
266#D-# -------------------------------------------------------------------------------------
267#D-# |    2     |       yes           |    yes     |  no     |      no                   |
268#D-# -------------------------------------------------------------------------------------
269#D-# |    3     |       yes           |    no      |  no     |      no                   |
270#D-# -------------------------------------------------------------------------------------
271#D-# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
272#D-# -------------------------------------------------------------------------------------
273#D-
274# --------------------------------------------------------------------------------------------------#
275#D- ! END OF OPTIONNAL FEATURES /!\ DO NOT MODIFY ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING #
276# --------------------------------------------------------------------------------------------------#
277
278#D-
279#D--------------------------------------------------------------------==
280#D- 0.0 SYSTEM ENVIRONMENT
281#D-     - Define variables for Number of processors
282#D-     - Define MPI variables
283#D-     - Define batch scheduler variables
284#D-     - Source IGCM Library
285#D-     - Get RESOLution in .resol file (temporary)
286#D--------------------------------------------------------------------==
287
288#---------------------------------------------------------------------==
289
290. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
291. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
292. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
293#-------
294. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
295. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
296. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
297. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
298#-------
299( ${DEBUG_debug} ) && IGCM_debug_Check
300( ${DEBUG_debug} ) && IGCM_card_Check
301( ${DEBUG_debug} ) && IGCM_date_Check
302
303#--------------------------------------------------------------------==
304
305#-- Resolution FLAG for oasis input
306#RESOL="ORCA2xLMD9671"
307[ -f ${SUBMIT_DIR}/../.resol ] && RESOL=$(head -1 ${SUBMIT_DIR}/../.resol)
308#-- Chemistrie FLAG to ease chemistries configurations management
309#CHEM="AER"
310[ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie)
311
312#D-
313#D--------------------------------------------------------------------==
314#D- 0.1 COMMON ENVIRONMENT
315#D-     - Read libIGCM compatibility version in config.card
316#D-     - Read UserChoices section
317#D-     - Read Ensemble section
318#D-     - Read Post section
319#D-     - Define all netcdf output directories
320#D--------------------------------------------------------------------==
321IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
322#-Q- jeanzay if [ ${job_type} != "postrun" ] ; then
323if [ ! -r ${SUBMIT_DIR}/run.card ] ; then
324  #================================================#
325  #         The file run.card doesn't exist        #
326  #================================================#
327  FirstInitialize=true
328  #copy initial run.card
329  IGCM_sys_Cp ${SUBMIT_DIR}/run.card.init ${SUBMIT_DIR}/run.card
330  IGCM_debug_Print 2 "run.card copied from run.card.init"
331else
332  FirstInitialize=false
333  IGCM_debug_Print 2 "run.card exists"
334fi
335#-Q- jeanzay fi
336# ------------------------------------------------------------------
337# Activate BigBrother so as to supervise this simulation
338# ------------------------------------------------------------------
339IGCM_debug_BigBro_Initialize
340
341#D-
342#D--------------------------------------------------------------------==
343#D- 1. INITIALIZE CONFIGURATION
344#D-    - Simulation configuration
345#D-    - Simulation parameters
346#D-    - Execution parameter
347#D-    - Define input files directory
348#D-    - Read or initialize CumulPeriod
349#D-    - run.card
350#D--------------------------------------------------------------------==
351IGCM_config_Initialize
352
353# --------------------------------------------------------------------==
354# Define, create and cd RUN_DIR
355# --------------------------------------------------------------------==
356RUN_DIR=${RUN_DIR:=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$}}
357IGCM_sys_MkdirWork ${RUN_DIR}
358IGCM_sys_Cd ${RUN_DIR}
359
360# ------------------------------------------------------------------
361# Test if all was right before proceeding further
362# ------------------------------------------------------------------
363IGCM_debug_Verif_Exit
364
365#D-
366#D---------------------------------------------------------------------==
367#D- 2. INITIALIZE ALL COMPONENT OF THE CONFIGURATION
368#D-    - Define component executable
369#D-    - Define Write Frequency by component "1M" "1D" ...
370#D-    - Source ${comp}.driver
371#D-    - Define Storage Places by component
372#D-    - ${comp}_Initialize :
373#D-    - Patterns to sed
374#D-    - Variables from namelist
375#D---------------------------------------------------------------------==
376IGCM_comp_Initialize
377
378#D-
379#D---------------------------------------------------------------------==
380#D- 3. PERFORM GENERAL VERIFICATION
381#D-    - Verify compatibility of period length, write frequencies, ...
382#D-    - Verify compatibility of rebuild choices and post-process choices
383#D-    - Will stop here if something is wrong
384#D---------------------------------------------------------------------==
385IGCM_config_Check
386
387# ------------------------------------------------------------------
388# Test if all was right before entering the period loop
389# ------------------------------------------------------------------
390IGCM_debug_Verif_Exit
391
392#D-
393#D---------------------------------------------------------------------==
394#D- 4. ENTER THE DEEP EXECUTION LOOP
395#D-    ! FASTEN YOUR SEAT BELTS PLEASE. !
396#D-    !   WE WILL CROSS TURBULENCES.   !
397#D---------------------------------------------------------------------==
398
399Period=1
400
401PeriodContinue=false
402if [ ${Period} -le ${NbPeriodsPerJob} ]; then
403  PeriodContinue=true
404fi
405while ( ${PeriodContinue} ) ; do
406
407  echo
408  echo "Starting iteration ${Period} / ${NbPeriodsPerJob}"
409
410  #D-
411  # ------------------------------------------------------------------
412  #D-   4.1 COMPUTE AND DEFINE DATE INFORMATION.
413  #D-       - ${PeriodDateBegin}
414  #D-       - ${PeriodDateEnd}
415  #D-       - ${CumulPeriod}
416  #D-       - ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd}
417  #D-       - ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0
418  #D-       - update run.card value
419  # ------------------------------------------------------------------
420  IGCM_config_PeriodStart
421
422  #D-
423  # ------------------------------------------------------------------
424  #D-   4.2 BEGIN COMPUTATION ONLY IF NEEDED
425  # ------------------------------------------------------------------
426  if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then
427    IGCM_debug_Print 1 "break because '\${SimulationLengthInDays} -gt \${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}"
428    break ;
429  fi
430
431  #D-
432  # ------------------------------------------------------------------
433  #D-   4.3 CALL OPTIONNAL FUNCTION WITHIN DRIVER
434  #D-       - to set special variables used in lists (Param, Init or Bc).
435  # ------------------------------------------------------------------
436  IGCM_comp_PeriodStart
437
438#-Q- jeanzay if [ ${job_type} = "prerun" ] ; then
439 
440  #D-
441  # ------------------------------------------------------------------
442  #D-   4.4 GET PARAMETERS TEXT FILES UPDATED BY JOB
443  #D-       - (.def, namelist ...)
444  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
445  # ------------------------------------------------------------------
446  IGCM_comp_GetInputParametersFiles
447
448  #D-
449  # ------------------------------------------------------------------
450  #D-   4.5 GET INITIAL STATE
451  #D-       - (Etat0, carteveg,relief...)
452  #D-       - NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1
453  #D-       - AND ???_Restart=NO
454  #D-       - READ AND USE BY GCM FOR ONLY ONE EXECUTION.
455  # ------------------------------------------------------------------
456  IGCM_comp_GetInputInitialStateFiles
457
458  #D-
459  # ------------------------------------------------------------------
460  #D-   4.6 GET BOUNDARIES CONDITIONS
461  #D-       - (SST, WIND[X,Y,Z], LAI ...)
462  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
463  # ------------------------------------------------------------------
464  IGCM_comp_GetInputBoundaryFiles
465
466  #D-
467  # ------------------------------------------------------------------
468  #D-   4.7 GET SmoothFiles CONDITIONS
469  #D-       - (SST, WIND[X,Y,Z], LAI ...)
470  #D-       - READ AND USE BY GCM AT EACH EXECUTION
471  #D-       - Do not change at each ${Period}
472  # ------------------------------------------------------------------
473  IGCM_comp_GetInputSmoothFiles
474
475  #D-
476  # ------------------------------------------------------------------
477  #D-   4.8 GET RESTART FILES
478  #D-       - (restartphy.nc, orca_restart.nc ...)
479  #D-       - READ AND USE BY GCM AT EACH EXECUTION.
480  #D-
481  #D-       - IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART
482  #D-       - ONLY IF CumulPeriod= (=> NUMERO) == 1
483  #D-       - MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e)
484  #D-
485  #D-       - IF CumulPeriod == 1
486  #D-       - AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART
487  #D-       - MUST BRING THIS RESTART IN ${RUN_DIR_PATH}
488  #D-
489  #D-       - ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
490  # ------------------------------------------------------------------
491  IGCM_comp_GetInputRestartFiles
492
493  # ------------------------------------------------------------------
494  #D-   4.9 GET BINARY FILES
495  #D-       - USED BY AT EACH EXECUTION.
496  #D-       - CHECK BINARIES HAS BEEN COMPILED WITH THE SAME COMPILER
497  #D-       - RELOAD THE APPROPRIATE ENVIRONMENT THE FIRST TIME IF NEEDED
498  # ------------------------------------------------------------------
499  IGCM_comp_GetInputBinaryFiles
500
501  # ------------------------------------------------------------------
502  # Test if all was right before Update
503  # ------------------------------------------------------------------
504  IGCM_debug_Verif_Exit
505
506  #D-
507  # ------------------------------------------------------------------
508  #D-   4.10 ACTIVATE RUNNING ENVIRONNEMENT VARIABLES
509  #D-       - including module load associated to compiler & tools
510  #D-       - .env_intel17.0.2_curie
511  #D-       - .env_netcdf4.3.3.1_curie
512  # ------------------------------------------------------------------
513  IGCM_sys_activ_variables
514
515  #D-
516  # ------------------------------------------------------------------
517  #D-   4.11 UPDATE ParametersFiles
518  #D-        - (.def, namelist ...)
519  #D-        - with current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
520  # ------------------------------------------------------------------
521  IGCM_comp_Update
522
523  # ------------------------------------------------------------------
524  # Test if all was right before execution
525  # ------------------------------------------------------------------
526  IGCM_debug_Verif_Exit
527
528#-Q- jeanzay # Workaround at Jean-Zay
529#-Q- jeanzay source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt
530
531  #D-
532  #D---------------------------------------------------------------------==
533  #D- 5. EXECUTION
534  #D---------------------------------------------------------------------==
535
536  echo
537  echo "#######################################"
538  echo "#      DIR BEFORE RUN EXECUTION       #"
539  echo "#######################################"
540  echo
541  ls -lrt
542
543  echo "========================================================================"
544  if [ ${DRYRUN_DEBUG} = 4 ] ; then
545      IGCM_sys_create_run_dir
546  else
547      if [ ${DRYRUN} -le 1 ] ; then
548#-Q- jeanzay if [ ${job_type} = "prerun" ] ; then
549#-Q- jeanzay IGCM_sys_launch_job_compute
550#-Q- jeanzay fi
551          REAL_DATE_INIT=$( date )
552          echo                                                                                   > ${Exe_Output}
553          echo "#######################################"                                        >> ${Exe_Output}
554          echo "EXECUTION of : ${EXECUTION}"
555          echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
556          echo                                                                                  >> ${Exe_Output}
557          typeset RET
558          RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
559          ${EXECUTION}  >> ${Exe_Output} 2>&1
560          RET=$?
561          RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
562          if [ ${RET} -gt 0 ] ; then
563              echo "Return code of executable :" ${RET}
564              IGCM_debug_Exit "EXECUTABLE"
565              IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
566              IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
567
568              echo ""
569              echo "to debug your experience, you can analyze the various files (*.err, *.out, and parameters files) available in the Debug/ directory "
570              echo "these files are managed by the list [OutputText] defined in componant's card (COMP/*.card)"
571              echo ""
572
573              ExecutionFail=true
574          fi
575          echo                                            >> ${Exe_Output}
576          echo "#######################################"  >> ${Exe_Output}
577          echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
578          echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
579          echo                                            >> ${Exe_Output}
580      else
581          echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
582          echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
583          if ( $DEBUG_debug ) ; then
584              echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
585          fi
586      fi
587  fi
588  echo "========================================================================"
589#-Q- jeanzay fi
590
591  echo
592  echo "#######################################"
593  echo "#       DIR AFTER RUN EXECUTION       #"
594  echo "#######################################"
595  echo
596  ls -lrt
597
598  #D-
599  #D---------------------------------------------------------------------==
600  #D- 6. POST EXECUTION OPERATIONS
601  #D---------------------------------------------------------------------==
602
603  #D-
604  # ------------------------------------------------------------------
605  #D-   6.1. DESACTIVATE RUNNING ENVIRONNEMENT VARIABLES
606  # ------------------------------------------------------------------
607  IGCM_sys_desactiv_variables
608
609  #D-
610  # ------------------------------------------------------------------
611  #D-   6.2. SAVE OUTPUTS
612  #D-        - On archive/storage machine
613  #D-        - netcdf outputs, restarts and text files of models
614  # ------------------------------------------------------------------
615  IGCM_comp_Finalize
616
617  # ------------------------------------------------------------------
618  # Test if all was right after Finalize
619  # ------------------------------------------------------------------
620  IGCM_debug_Verif_Exit
621
622  #D-
623  # ------------------------------------------------------------------
624  #D-   6.3. CONFIGURE POST-PROCESSING
625  #D-        - asynchronous post-treatment (Level 0) when necessary (rebuild/pack)
626  #D-        - classic post-treatment      (Level 1) when necessary (TimeSeries/Seasonal)
627  # ------------------------------------------------------------------
628  IGCM_post_Configure
629
630  #D-
631  # ------------------------------------------------------------------
632  #D-   6.4. SUBMIT POST-PROCESSING
633  #D-        - remote rebuild or/and post-treatment process if necessary
634  # ------------------------------------------------------------------
635  IGCM_post_Submit
636
637  #D-
638  # ------------------------------------------------------------------
639  #D-   6.5. FINALYZE CURRENT LOOP AND PREPARE NEXT ONE
640  #D-        - Manage executable size to save only different binary
641  #D-        - Write in run.card user, system and elapse time
642  #D-        - Check that everything went well ! No ? then we stop.
643  #D-        - Determine next computed period
644  # ------------------------------------------------------------------
645  IGCM_config_PeriodEnd
646
647  echo "Ending iteration ${Period}"
648  (( Period = Period + 1 ))
649
650  # End loop if date end is reached
651  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
652    break ;
653  fi
654
655  PeriodContinue=false
656  if [ ${Period} -le ${NbPeriodsPerJob} ]; then
657    PeriodContinue=true
658  fi
659done
660
661#D-
662#D---------------------------------------------------------------------==
663#D- 7. SUBMIT NEXT JOB OR SEND MAIL IF SIMULATION IS OVER.
664#D---------------------------------------------------------------------==
665IGCM_config_Finalize
666
667date
Note: See TracBrowser for help on using the repository browser.