source: trunk/libIGCM/AA_job @ 1560

Last change on this file since 1560 was 1558, checked in by jgipsl, 21 months ago

First version possible to use at spirit and spiritx on IPSL ESPRI MESO cluster.

The execution part in libIGCM_sys_mesoipsl.ksh comes from libIGCM_sys_jeanzay.ksh. It has only been tested for the case MPMD MPI only and SPMD MPI only.

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