source: trunk/libIGCM/ins_job @ 1533

Last change on this file since 1533 was 1533, checked in by aclsce, 4 years ago

Use of xlarge nodes for post-processing tasks of irene-skl computing runs.

  • Property svn:executable set to *
  • Property svn:keywords set to Revision Author Date
File size: 20.3 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Jacques Belier
5# Contact:
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13#---------------------------------------------------------------------
14#- Installation of jobs according to environment
15#---------------------------------------------------------------------
16function ins_job_Usage
17{
18print - "
19ins_job installs the jobs in the directories
20which contain a file config.card
21
22ins_job must be launched on the host
23on which the job will be submitted
24
25Usage :
26  ${b_n} [-h] [-v] [-e]
27  or on irene/TGCC :
28  ${b_n} [-h] [-v] [-e] [-p project] [-q type_of_node] [-c number of cores]
29  or on ada /IDRIS
30  ${b_n} [-h] [-v] [-e] [-m MPI environment]
31Options :
32  -h                  : help
33  -v                  : verbose mode
34  -e                  : turn on ensemble mode (hindcast/forecast or date restart)
35  -f                  : ins_job is force to create jobs even if they already exist
36on irene only :
37  -p project          : add default project on irene
38  -q type_of_node     : add default type of nodes for postprocessing on irene skylake/xlarge
39  -c number of cores  : add default number of cores for postprocessing on irene 1-112
40on ada only :
41  - m MPI environment : add default MPI environment (Intel MPI or IBM MPI)
42"
43}
44function ins_job_Warning
45{
46   [[ ${x_v} = 'verbose' ]] && print - "\n############### WARNING ###############";
47   [[ ${x_v} = 'verbose' ]] && print - "File ${n_f} already exists\nin directory ${j}";
48   [[ ${x_v} = 'verbose' ]] && print - "You must delete this file to update !";
49}
50
51function ins_job_Check_JobName
52{
53  verif=${JobName##[a-zA-Z]*(?([.\-])[a-zA-Z0-9])}
54
55  if [ ${#verif} -ne 0 ] ; then
56    echo "################ ERROR ################"
57    echo "${JobName} is invalid."
58    echo "- JobName can only contain alphanumeric characters, \".\" and \"-\""
59    echo "- JobName must start with a letter"
60
61    ((NbErr=NbErr+1))
62
63    Status=1
64  else
65    Status=0
66  fi
67
68  return ${Status}
69}
70
71#-
72#     dirname     and      basename
73#-
74d_n=$(dirname ${0}); b_n=$(basename ${0});
75#-
76# Retrieving and validation of the options
77#-
78x_v='silencious';
79x_e=false;
80x_f=false;
81x_p=false;
82x_q=false;
83x_c=false;
84x_m=false;
85while getopts :hvefc:p:m:q:s: V ; do
86  case $V in
87  (h)  ins_job_Usage; exit 0;;
88  (v)  x_v='verbose';;
89  (e)  x_e=true;;
90  (f)  x_f=true;;
91  (p)  x_p=true
92       ProjectID=${OPTARG} ;;
93  (q)  x_q=true
94       ProjectNode=${OPTARG} ;;
95  (c)  x_c=true
96       ProjectCore=${OPTARG} ;;
97  (m)  x_m=true
98       MPIEnvironment=${OPTARG} ;;
99  (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2;
100       exit 2;;
101  (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2;
102       exit 2;;
103  esac
104done
105[ ${x_v} = 'silencious' ] && export DEBUG_sys=false
106shift $(($OPTIND-1));
107#-
108# Define working files
109#-
110F_MOD=$(cd ${d_n}'/..';/bin/pwd;)
111# [[ ${F_MOD##*/} != 'modipsl' ]] && \
112#  { print - "directory 'modipsl' unreachable"; exit 3; }
113W_W=${d_n}'/../libIGCM'
114[[ ! -d ${W_W} ]] && { print - "${W_W} unreachable"; exit 3; }
115libIGCM=$(cd ${W_W};/bin/pwd;)
116F_JOB=${libIGCM}'/AA_job';
117[[ ! -f ${F_JOB} ]] && { print - "${F_JOB} unreachable"; exit 3; }
118F_RCI=${libIGCM}'/run.card.init';
119[[ ! -f ${F_RCI} ]] && { print - "${F_RCI} unreachable"; exit 3; }
120#-
121# Accessing to functions (without stack)
122#-
123# No verbosity (0, 1, 2, 3)
124Verbosity=0
125# No de debug
126DEBUG_debug=false
127# Dont move libIGCM
128MirrorlibIGCM=false
129# Behave like computing job
130TaskType=computing
131# Source libIGCM
132. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
133. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
134. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
135. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
136. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
137if [ $x_e = 'true' ] ; then
138  . ${libIGCM}/libIGCM_ensemble/libIGCM_ensemble.ksh
139fi
140
141#-
142[[ ${x_v} = 'verbose' ]] && \
143 {
144  print - "";
145  print - '--- Host        : '${SYSTEM};
146  print - '--- modipsl     : '${F_MOD};
147  print - '--- libIGCM     : '${libIGCM};
148  print - '--- basic job   : '${F_JOB};
149  print - '--- basic card  : '${F_RCI};
150 }
151#-
152[[ ${x_v} = 'verbose' ]] && print - "\nInstallation of jobs for '${SYSTEM}'";
153#-
154
155NbErr=0
156
157#-
158# Define Project parameters to set up jobs header for Irene (TGCC)
159# on Irene define ProjectID and ProjectCore : option or answer
160# on Irene ProjectNode default projectnode set to xlarge since 17/10/2018
161#-
162
163
164if [ X"${SYSTEM}" == "Xirene" ] ; then
165
166  #- set ProjectID if required
167  if ( ! ${x_p} ) ; then
168    print - "Wait for the next question ..."
169    #- default ProjectID
170    ProjectID=$( ccc_myproject | grep -i irene |grep -i skylake | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | sort -u | grep -v gencmip6 | head -n 1 )
171    answer=""
172    print - "Hit Enter or give project ID (default is ${ProjectID}), possible projects are $( echo $( ccc_myproject | grep -i irene | grep -i skylake | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | grep -v gencmip6 | sort -u ) ) or other xxxcmip6 : $(for i in $(groups) ; do echo $i|grep -v gencmip6|grep .cmip6 1>/dev/null 2>&1 && echo -n $i " " ; done ; echo ) "
173    read answer
174
175    if [ "X${answer}" != "X" ] ; then
176      ProjectID=${answer}
177    fi
178
179  fi # if ( ! ${x_p} )
180
181  echo  ProjectID is ${ProjectID} at Irene
182
183
184  # set ProjectNode if required
185  if ( ! ${x_q} ) ; then 
186     #- default ProjectNode
187     ProjectNode="xlarge"
188     #- is xlarge possible for ${ProjectID} ?
189     echo $(ccc_myproject | grep -i irene | grep -i xlarge | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | grep -v gencmip6 | sort -u) $(for i in $(groups) ; do echo $i|grep -v gencmip6|grep .cmip6 1>/dev/null 2>&1 && echo -n $i " " ; done ) | grep ${ProjectID} >/dev/null 2>&1  || ProjectNode="xlarge"
190
191     if [ "X${ProjectNode}" == "Xxlarge" ] ; then
192       answerOK=false
193 
194       while ( ! ${answerOK} ) ; do
195         answer="" 
196         print - "Hit Enter or give TYPE OF NODE required for post-processing (default is \"${ProjectNode}\"), possible types of nodes are \"skylake\" or \"xlarge\" : " 
197         read answer
198         [ "X${answer}" == "X" ] || [ "X${answer}" == "Xskylake" ] || [ "X${answer}" == "Xxlarge" ] && answerOK=true
199       done
200 
201       if [ "X${answer}" != "X" ] ; then
202         ProjectNode=${answer} 
203       fi
204
205     else
206       print - "PostProcessing will be done on ${ProjectNode}"
207     fi
208 
209  fi # if ( ! ${x_q} )
210  echo ProjectNode for post-processing is ${ProjectNode} at Irene
211
212  #- ProjectNode is known (option or answer) set ProjectCoreMax
213  [ "${ProjectNode}" = "xlarge" ] && ProjectCoreMax="112" || ProjectCoreMax="48" 
214  #- ProjectCoreMax is 48 for standard and 112 for xlarge
215
216  if ( ! ${x_c} ) ; then
217    #- ProjectNode is known (option or answer), set ProjectCore default
218    [ "${ProjectNode}" = "xlarge" ] && ProjectCore="8" || ProjectCore="4" 
219
220    # let check minimum/maximum value 1/${ProjectCoreMax}
221
222    answerOK=false
223
224    while ( ! ${answerOK} ) ; do
225      answer=""
226      print - "possible numbers of cores are \"1\" to \"${ProjectCoreMax}\" for ${ProjectNode} : "
227      print - "Hit Enter or give NUMBER OF CORES required for post-processing (default is \"${ProjectCore}\")"
228      read answer
229      [ "X${answer}" == "X" ] || [ ${answer} -ge 1 -a ${answer} -le ${ProjectCoreMax} ] && answerOK=true
230    done
231
232    if [ "X${answer}" != "X" ] ; then
233      ProjectCore=${answer}
234    fi
235
236  fi # if ( ! ${x_c} )
237
238  echo ProjectCore for post-processing is ${ProjectCore}
239  #- ProjectCore is set (option or answer)
240
241elif [ X"${SYSTEM}" == "Xirene-amd" ] ; then
242
243  #- set ProjectID if required
244  if ( ! ${x_p} ) ; then
245    print - "Wait for the next question ..."
246    #- default ProjectID
247    ProjectID=$( ccc_myproject | grep -i irene |grep -i rome | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | sort -u | grep -v gencmip6 | head -n 1 )
248    answer=""
249    print - "Hit Enter or give project ID (default is ${ProjectID}), possible projects are $( echo $( ccc_myproject | grep -i irene | grep -i rome | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | grep -v gencmip6 | sort -u ) ) or other xxxcmip6 : $(for i in $(groups) ; do echo $i|grep -v gencmip6|grep .cmip6 1>/dev/null 2>&1 && echo -n $i " " ; done ; echo ) "
250    read answer
251
252    if [ "X${answer}" != "X" ] ; then
253      ProjectID=${answer}
254    fi
255
256  fi # if ( ! ${x_p} )
257
258  echo  ProjectID is ${ProjectID} at Irene-amd
259
260  # set ProjectNode if required
261  if ( ! ${x_q} ) ; then 
262     #- default ProjectNode
263     ProjectNode="rome"
264     #- is xlarge possible for ${ProjectID} ?
265     echo $(ccc_myproject | grep -i irene | grep -i xlarge | gawk '{ if ( $3 ~ /^project$/ && $4 !~ /^tgcc/ ) { print $4 } }' | grep -v gencmip6 | sort -u) $(for i in $(groups) ; do echo $i|grep -v gencmip6|grep .cmip6 1>/dev/null 2>&1 && echo -n $i " " ; done ) | grep ${ProjectID} >/dev/null 2>&1  || ProjectNode="rome"
266
267     if [ "X${ProjectNode}" == "Xxlarge" ] ; then
268       answerOK=false
269 
270       while ( ! ${answerOK} ) ; do
271         answer="" 
272         print - "Hit Enter or give TYPE OF NODE required for post-processing (default is \"${ProjectNode}\"), possible types of nodes are \"rome\"  : " 
273         read answer
274         [ "X${answer}" == "X" ] || [ "X${answer}" == "Xrome" ] && answerOK=true
275       done
276 
277       if [ "X${answer}" != "X" ] ; then
278         ProjectNode=${answer} 
279       fi
280
281     else
282       print - "PostProcessing will be done on ${ProjectNode}"
283     fi
284 
285  fi # if ( ! ${x_q} )
286  echo ProjectNode for post-processing is ${ProjectNode} at Irene-amd
287
288  #- ProjectNode is known (option or answer) set ProjectCoreMax
289  [ "${ProjectNode}" = "xlarge" ] && ProjectCoreMax="112" || ProjectCoreMax="48" 
290  #- ProjectCoreMax is 48 for standard and 112 for xlarge
291
292  if ( ! ${x_c} ) ; then
293    #- ProjectNode is known (option or answer), set ProjectCore default
294    [ "${ProjectNode}" = "xlarge" ] && ProjectCore="8" || ProjectCore="4" 
295
296    # let check minimum/maximum value 1/${ProjectCoreMax}
297
298    answerOK=false
299
300    while ( ! ${answerOK} ) ; do
301      answer=""
302      print - "possible numbers of cores are \"1\" to \"${ProjectCoreMax}\" for ${ProjectNode} : "
303      print - "Hit Enter or give NUMBER OF CORES required for post-processing (default is \"${ProjectCore}\")"
304      read answer
305      [ "X${answer}" == "X" ] || [ ${answer} -ge 1 -a ${answer} -le ${ProjectCoreMax} ] && answerOK=true
306    done
307
308    if [ "X${answer}" != "X" ] ; then
309      ProjectCore=${answer}
310    fi
311
312  fi # if ( ! ${x_c} )
313
314  echo ProjectCore for post-processing is ${ProjectCore}
315  #- ProjectCore is set (option or answer)
316
317elif [ X"${SYSTEM}" == "Xjeanzay" ] ; then
318
319  #- set ProjectID if required
320  if ( ! ${x_p} ) ; then
321    print - "Wait for the next question ..."
322    #- default ProjectID
323    ProjectID=$( echo $IDRPROJ )
324    answer=""
325    print - "Hit Enter or give project ID (default is ${ProjectID}), possible projects are: $( groups ; echo ) "
326    read answer
327
328    if [ "X${answer}" != "X" ] ; then
329      ProjectID=${answer}
330    fi
331
332  fi # if ( ! ${x_p} )
333
334  ProjectID=${ProjectID}
335  echo  ProjectID is ${ProjectID} at Jean-Zay
336
337elif [ X"${SYSTEM}" == "Xada" ] ; then
338  if ( ! ${x_m} ) ; then
339    MPIEnvironment=IBM
340    # Intel MPI Environment.
341    answerOK=false     
342    while ( ! ${answerOK} ) ; do
343      answer=""
344      print - "Hit Enter or give MPI Environement (default is ${MPIEnvironment}), possible MPI environments are IBM (MPI IBM) and Intel (MPI Intel) :"
345      read answer
346      [ "X${answer}" == "X" ] || [ "X${answer}" == "XIBM" ] || [ "X${answer}" == "XIntel" ] && answerOK=true
347    done
348
349    if [ "X${answer}" != "X" ] ; then
350      MPIEnvironment=${answer}
351    fi
352  fi # if ( ! ${x_pm} )
353  echo MPIEnvironment is ${MPIEnvironment}
354
355elif [ X"${SYSTEM}" == "Xlxiv8" ] || [ X"${SYSTEM}" == "Xifort_CICLAD" ] ; then
356  # obelix, ciclad, climserv
357  echo ""
358  echo "You need to check and maybe adapt headers in the main job especially the line: "
359  echo "  #PBS -l nodes=x:ppn=y "
360  echo "where x is the number of nodes, y the number of cores per node and x*y is the total number of cores for the job. "
361  echo "y must not be bigger than the maximum numer of cores per node on the machine (often 8 or 16)."
362fi # if [ X"${SYSTEM}" == "Xirene" ]
363
364#-
365# Define the pattern string to substitute
366#-
367W_P='#-Q- '; W_W=${W_P}${SYSTEM}' ';
368#-
369# Extract list of 'config.card' files
370# and create jobs with AA_job
371#-
372F_CFG='config.card';
373F_CFG_ENS='ensemble.card';
374SUBMIT_DIR_ENS=$( pwd )
375for i in $( pwd )/config.card
376do
377  if [ ! -f $i ] ; then
378    echo ""
379    echo "################## WARNING ##################"
380    echo "No config.card available in current directory"
381    echo ""
382    continue
383  fi
384
385
386  j=$(cd ${i%/*};/bin/pwd;)
387  n_f=${F_RCI##*/};
388
389  if [ ! X$( echo ${j} | grep EXPERIMENTS ) = X ] ; then
390    # Do not treat config.card if it is in sub-directory of EXPERIMENTS
391    # Continue to next config.card
392    continue
393  else
394    [[ ${x_v} = 'verbose' ]] && print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}";
395  fi
396
397  # Find out if new structure and set .resol filename
398  if [ -d ${j}/EXPERIMENTS ] && [ -d ${j}/GENERAL ] ; then
399    # New Structure
400    [[ ${x_v} = 'verbose' ]] && echo "This is new configuration structure"
401    new_struct=yes
402    resolfile=$j/.resol
403  else
404    # Old Structure
405    new_struct=no
406    resolfile=$j/../.resol
407  fi
408
409  # Get all variables declared in section UserChoices in config.card
410  IGCM_card_DefineArrayFromSection ${j}'/'${F_CFG} UserChoices
411  # Set default values
412  config_UserChoices_ExpType=""
413  RESOL_ATM_3D=this_is_a_test_string
414  RESOL=this_is_another_test_string
415  typeset option
416  for option in ${config_UserChoices[*]} ; do
417    IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices ${option}
418  done
419
420  # Find the JobName : JobName might contain the variable RESOL_ATM_3D that will be replaced by what is in .resol file
421  if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then
422    TRUERESOL=$( tail -1 $resolfile | awk "-F=" '{print $2}' )
423    echo TRUERESOL = $TRUERESOL
424    JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" )
425    IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName}
426  elif [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then
427    TRUERESOL=$( head -1 $resolfile  )
428    JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" )
429    IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName}
430  else
431    JobName=${config_UserChoices_JobName}
432  fi
433
434  # Check JobName validity : only alphanumerical characters, "-" and "." are authorized
435  ins_job_Check_JobName
436  RetCode=$?
437  [[ $RetCode -gt 0 ]] && continue
438
439  [[ ${x_v} = 'verbose' ]] && echo "JobName=${JobName}"
440
441  # Add specific treatment for new type of directory structure
442  if [ ${new_struct} == yes ] ; then
443
444    if [ "X${config_UserChoices_ExpType}" = X ] ; then
445      echo "\nERROR in ${j}/config.card"
446      echo "ins_job stops here"
447      echo "=> The variable ExpType must be added in config.card in section UserChoices"
448      echo "=> ExpType gives the directory for the .card configuration files for the wanted experiement. For exemple ExpType=IPSLCM5/historical"
449      exit 4
450    else
451      [[ ${x_v} = 'verbose' ]] && echo "ExpType= ${config_UserChoices_ExpType}"
452    fi
453
454    if [ -d ${j}/${JobName} ] ; then
455      echo "Directory ${j}/${JobName} exists already. It will not be overwritten."
456      echo "Remove the existing directory or change JobName before relaunching ins_job."
457      #continue
458      exit 
459    fi
460    echo "=> Submit directory ${JobName} will be created with cards from EXPERIMENTS/${config_UserChoices_ExpType}"
461    cp -r ${j}/EXPERIMENTS/${config_UserChoices_ExpType} ${j}/${JobName}
462    cp -r ${j}/GENERAL/* ${j}/${JobName}/.
463    cp -f ${j}/${F_CFG}  ${j}/${JobName}/.
464    if [ -f ${F_CFG_ENS} ] ; then
465      cp -f ${j}/${F_CFG_ENS}  ${j}/${JobName}/.
466      SUBMIT_DIR_ENS=${j}/${JobName}
467    fi
468    rm -f ${j}/${F_CFG}
469    # rm -f ${j}/${F_CFG_ENS}
470    rm -f ${j}/${F_CFG}.bak
471    j=${j}/${JobName}
472    [[ ${x_v} = 'verbose' ]] && echo new j=$j
473  fi
474  # end specific treatment for new type directory structure
475
476  [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; } || \
477   {
478    [[ ${x_v} = 'verbose' ]] && print - "\nCopying file ${F_RCI}\nin directory ${j}";
479    \cp ${F_RCI} ${j};
480   }
481
482  #==================================
483  # Read ListOfComponents section:
484  #echo
485  #IGCM_debug_Print 1 "DefineArrayFromSection : ListOfComponents"
486
487  IGCM_card_DefineArrayFromSection  ${j}'/'${F_CFG} ListOfComponents
488  for comp in ${config_ListOfComponents[*]} ; do
489    IGCM_card_DefineArrayFromOption  ${j}'/'${F_CFG} ListOfComponents ${comp}
490  done
491  #IGCM_debug_Print 3 ${config_ListOfComponents[*]}
492
493  #==================================
494  # Read Executable section:
495  IGCM_card_DefineArrayFromSection ${j}'/'${F_CFG} Executable
496
497  # Define the execution context (MPMD, SPMD, MPI/OMP ...)
498  IGCM_config_ConfigureExecution ${j}'/'${F_CFG}
499
500  # coreNumber    : TOTAL NUMBER OF CORES
501  # mpiTasks      : TOTAL NUMBER OF MPI TASKS
502  # openMPthreads : NUMBER OF OpenMP THREADS
503
504  # File name for Job
505  n_f='Job_'${JobName};
506  [[ ${x_f} = 'false' ]] && [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; }
507  [[ ${x_v} = 'verbose' ]] && print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}";
508  sed -e "/^${W_W} */ s///" \
509      -e "/^${W_P}/d"       \
510      -e "s%::modipsl::%${F_MOD}%" \
511      -e "s/::Jobname::/${JobName}/" \
512      -e "s/::default_project::/${ProjectID}/" \
513      ${F_JOB} > ${j}'/'${n_f}
514  chmod u+x ${j}'/'${n_f}
515
516  # update Headers so that ressources description are accurate (MPMD/SPMD/...)
517  IGCM_sys_updateHeaders ${j}'/'${n_f}
518done
519
520#-
521# Extract list of AA_* files in libIGCM
522# and create jobs (for all except AA_job)
523#-
524for i in $(find ${libIGCM} -maxdepth 1 -name "AA_*" -print)
525do
526  i_f=${i##*/};
527  [[ ${i_f} = 'AA_job' ]] && { continue; }
528  j=${i%/*}; n_f=${i_f#AA_}'.job';
529  [[ ${x_f} = 'false' ]] && [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; }
530  [[ ${x_v} = 'verbose' ]] && print - "\nIn directory ${j}\n${i_f} -> ${n_f}"
531  sed -e "/^${W_W} */ s///" \
532      -e "s%::modipsl::%${F_MOD}%" \
533      -e "/^${W_P}/d"       \
534      -e "s/::default_node::/${ProjectNode}/" \
535      -e "s/::default_core::/${ProjectCore}/" \
536      -e "s/::default_project::/${ProjectID}/" \
537      -e "s/::default_post_project::/${ProjectID}/" \
538      ${i} > ${j}'/'${n_f}
539  chmod u+x ${j}'/'${n_f}
540done
541#-
542# set default_project in libIGCM_sys_irene and libIGCM_sys_jeanzay.
543#-
544if [ X"${SYSTEM}" == "Xirene" ] ; then
545  i=${libIGCM}/libIGCM_sys/libIGCM_sys_irene.ksh
546  sed -i -e "s/::default_project::/${ProjectID}/" ${i}
547elif [ X"${SYSTEM}" == "Xirene-amd" ] ; then
548  i=${libIGCM}/libIGCM_sys/libIGCM_sys_irene-amd.ksh
549  sed -i -e "s/::default_project::/${ProjectID}/" ${i}
550elif [ X"${SYSTEM}" == "Xjeanzay" ] ; then
551  i=${libIGCM}/libIGCM_sys/libIGCM_sys_jeanzay.ksh
552  sed -i -e "s/::default_project::/${ProjectID}/" ${i}
553fi
554#-
555# Limited to hindcast/forecast and date restart Ensemble for the time being
556if [ ${x_e} = 'true' ] ; then
557    if [ ! -f ${F_CFG_ENS} ] ; then
558       echo ""
559       echo "################## WARNING ##################"
560       echo "No ensemble.card available in current directory"
561       echo ""
562       exit
563      #  continue
564   fi
565
566  #.. Read input data from ensemble.card ..
567  SUBMIT_DIR=${SUBMIT_DIR_ENS}
568  RUN_DIR="${CCCWORKDIR}/ENSEMBLE_TMP"
569  #
570  # Copy initial things around and define variables (hindcast/forecast case)
571  IGCM_sys_Cd ${SUBMIT_DIR}
572  IGCM_ensemble_Init
573
574  if [[ ${ensemble_Ens_DATE_active} = 'y' ]] ; then
575    IGCM_sys_Cd ${SUBMIT_DIR}
576    IGCM_ensemble_DateInit
577    # As it says
578    IGCM_sys_Cd ${SUBMIT_DIR}
579    IGCM_ensemble_DateNonPeriodicStarts
580  fi
581
582  if [[ ${ensemble_Ens_PERTURB_active} = 'y' ]] ; then
583    IGCM_sys_Cd ${SUBMIT_DIR}
584    IGCM_ensemble_CastInit
585    # As it says
586    IGCM_sys_Cd ${SUBMIT_DIR}
587    IGCM_ensemble_CastPeriodicStarts
588    # As it says
589    #IGCM_sys_Cd ${SUBMIT_DIR}
590    #IGCM_ensemble_CastMemberList
591  fi
592  # Done
593  IGCM_sys_Cd ${SUBMIT_DIR}
594  # Clean
595  IGCM_sys_Rm -rf ${RUN_DIR}
596 
597fi
598#-
599[[ ${x_v} = 'verbose' ]] && print - "";
600#-
601# That's all folks
602#-
603
604if [ ${NbErr} -ne 0 ] ; then
605  echo "################ ERROR ################"
606  echo "${NbErr} invalid JobName(s) found, check the log"
607fi
608
609
610exit 0;
Note: See TracBrowser for help on using the repository browser.