source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh @ 409

Last change on this file since 409 was 409, checked in by sdipsl, 13 years ago
  • correct bug with TS 3D without chunck see ticket #52
  • catch return code from all nco operator except ncrcat and exit if SpaceName? is PROD. clean error code handling. Special case for cdo command. see ticket #51
    • it means that if SpaceName?=PROD all must run absolutely perfectly ; otherwise libIGCM will stop.
  • For Smooth file, first access is always true for Period=1. Get Files when SmoothMin?<CumulPeriod?<SmoothMax? and modulo [min]:[modulo:][max] is true. see ticket #44
  • Under testing : do not use unless you are willing to help testing.
  • 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: 34.3 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
5# Contact: Martial.Mancip__at__ipsl.jussieu.fr
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#=========================================================
15# The documentation of this file can be automatically generated
16# if you use the prefix #D- for comments to be extracted.
17# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
18#=========================================================
19
20#D-#==================================================
21#D-LibIGCM_sys for Mercure SX8-R
22#D-#==================================================
23#D-
24#D- This ksh library if a layer under some usefull
25#D-environment variables and shell commands.
26#D-All those definitions depend on host particularities.
27#D-It manages a stack mechanism and test validity of operations.
28#D-All function described bellow must be prefixed by IGCM_sys.
29
30#====================================================
31# libIGCM_sys PARAMETERS
32#====================================================
33
34# gawk specific location on SX9
35export PATH=/applications/gawk-3.0.4/bin:${PATH}
36
37#====================================================
38# set DEBUG_sys to true to output calls of function
39typeset -r DEBUG_sys=${DEBUG_sys:=true}
40
41#====================================================
42# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
43typeset -r DRYRUN=${DRYRUN:=0}
44
45# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
46# -------------------------------------------------------------------------------------
47# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
48# |          |  Cp/Exe param files |            |  Chmod  |                           |
49# |          |      Qsub           |            |         |                           |
50# -------------------------------------------------------------------------------------
51# |    0     |       yes           |    yes     |  yes    |      yes                  |
52# -------------------------------------------------------------------------------------
53# |    1     |       yes           |    yes     |  yes    |      no                   |
54# -------------------------------------------------------------------------------------
55# |    2     |       yes           |    yes     |  no     |      no                   |
56# -------------------------------------------------------------------------------------
57# |    3     |       yes           |    no      |  no     |      no                   |
58# -------------------------------------------------------------------------------------
59
60#=====================================================
61# Global Variables :
62#=====================================================
63# Language : "fr" or "en"
64typeset -r MYLANG="fr"
65
66#=====================================================
67# Host and user names
68# $hostname ou hostname
69typeset  HOST=${HOST:=$( hostname )}
70# $username ou whoami
71typeset  LOGIN=${LOGIN:=$( whoami )}
72# $hostname of the MASTER job
73typeset -r MASTER=mercure
74
75#D-
76#D-#==================================================
77#D-Program used in libIGCM
78#D-#==================================================
79
80# rsync with path
81typeset -r RSYNC=/home/cont003/p86denv/SX_RSYNC/bin/rsync
82# RSYNC_opt args to rsync
83typeset -r RSYNC_opt="-va"
84# ie storage filesystem
85typeset -r RHOST=mercure
86
87#====================================================
88# Host specific DIRECTORIES
89#====================================================
90
91#====================================================
92#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
93typeset -r R_EXE="${MODIPSL}/bin"
94
95#====================================================
96#- SUBMIT_DIR : submission dir
97typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
98
99#====================================================
100#- ARCHIVE
101typeset -r ARCHIVE=${DMFDIR}
102
103# ============ CESIUM START ============ #
104
105#====================================================
106#- Mirror libIGCM from mercure to cesium if needed
107#ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $2}' )
108#if [ ! ${ROOTSYS} = "home" ] ; then
109#    typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
110#else
111#    typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
112#fi
113
114#====================================================
115#- libIGCM_POST
116#if ( ${MirrorlibIGCM} ) ; then
117#    PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
118#    typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM
119#else
120#    typeset -r libIGCM_POST=${libIGCM}
121#fi
122
123# ============ CESIUM  END  ============ #
124
125#====================================================
126#- Mirror libIGCM from mercure to cesium if needed
127typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
128
129#====================================================
130#- libIGCM_POST
131typeset -r libIGCM_POST=${libIGCM}
132
133#====================================================
134#- IN
135typeset -r R_IN=${R_IN:=/dmnfs/cont003/p86ipsl/IGCM}
136
137#====================================================
138#- OUT
139typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
140
141#====================================================
142#- OUT_POST
143typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT
144
145#====================================================
146#- RUN_DIR_PATH : Temporary working directory (=> TMP)
147typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${LOCALTMPDIR}}
148
149#====================================================
150#- BIG_DIR : BIG_DIR to store files waiting for rebuild
151typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}
152
153#====================================================
154#- HOST_MPIRUN_COMMAND
155typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="mpirun"}
156
157#====================================================
158#- Max number of arguments passed to nco operator or demigration command
159UNIX_MAX_LIMIT=360
160
161#D-#==================================================
162#D-function IGCM_sys_RshArchive
163#D-* Purpose: Archive rsh command
164#D-* Examples:
165#D-
166function IGCM_sys_RshArchive {
167    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
168    /bin/ksh <<-EOF
169${@}
170EOF
171    if [ $? -gt 0 ] ; then
172        echo "IGCM_sys_RshArchive : erreur."
173        IGCM_debug_Exit "IGCM_sys_RshArchive"
174    fi
175    IGCM_debug_PopStack "IGCM_sys_RshArchive"
176}
177
178#D-#==================================================
179#D-function IGCM_sys_RshPost
180#D-* Purpose: Post-process rsh command
181#D-* Examples:
182#D-
183function IGCM_sys_RshPost {
184    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
185    if ( $DEBUG_sys ) ; then
186        echo "IGCM_sys_RshPost :" $@
187    fi
188
189# ============ CESIUM START ============ #
190#    typeset NB_ESSAI DELAI status
191#    #nombre d'essai avant abandon
192#    NB_ESSAI=5
193#    #temps entre chaque essai
194#    DELAI=10
195#    i=0
196#    while [ $i -ne $NB_ESSAI ] ; do
197#        ssh -t mercure ssh cesium /bin/ksh ${@} 2>/dev/null
198#        status=$?
199#        if [ ${status} -ne 0 ];
200#        then
201#            sleep $DELAI
202#        else
203#            break
204#        fi
205#        let i=$i+1
206#    done
207# ============ CESIUM  END  ============ #
208
209
210    /bin/ksh ${@}
211    if [ $? -gt 0 ] ; then
212        echo "IGCM_sys_RshPost : erreur."
213        IGCM_debug_Exit "IGCM_sys_RshPost"
214    fi
215    IGCM_debug_PopStack "IGCM_sys_RshPost"
216}
217
218#D-#==================================================
219#D-function IGCM_sys_SendMail
220#D-* Purpose: Send mail when simulation is over
221#D-* Examples:
222#D-
223function IGCM_sys_SendMail {
224    IGCM_debug_PushStack "IGCM_sys_SendMail" $@
225    if ( $DEBUG_sys ) ; then
226        echo "IGCM_sys_SendMail :" $@
227    fi
228
229    ssh mercure /bin/ksh <<-EOF
230    export LOGIN=${LOGIN}
231    export config_UserChoices_JobName=${config_UserChoices_JobName}
232    export config_UserChoices_MailName=${config_UserChoices_MailName}
233    export DateBegin=${DateBegin}
234    export DateEnd=${DateEnd}
235    export R_SAVE=${R_SAVE}
236    export SUBMIT_DIR=${SUBMIT_DIR}
237
238    cat  << END_MAIL > job_end.mail
239Dear ${LOGIN},
240
241  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`.
242  Job started : ${DateBegin}
243  Job ended   : ${DateEnd}
244  Ouput files are available in ${R_SAVE}
245  Script files and Script Outputs are available in ${SUBMIT_DIR}
246END_MAIL
247
248    if [ ! -z ${config_UserChoices_MailName} ] ; then
249       mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
250    elif [ -f ~/.forward ] ; then
251       mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
252    fi
253
254    sleep 10
255    rm -f job_end.mail
256EOF
257
258    if [ $? -gt 0 ] ; then
259        echo "IGCM_sys_SendMail : erreur."
260        IGCM_debug_Exit "IGCM_sys_SendMail"
261    fi
262    IGCM_debug_PopStack "IGCM_sys_SendMail"
263}
264
265#D-#==================================================
266#D-function IGCM_sys_Mkdir
267#D-* Purpose: Master locale mkdir command
268#D-* Examples:
269#D-
270function IGCM_sys_Mkdir {
271    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
272    if ( $DEBUG_sys ) ; then
273        echo "IGCM_sys_Mkdir :" $@
274    fi
275    if [ ! -d ${1} ]; then
276        \mkdir -p $1
277        if [ $? -gt 0 ] ; then
278            echo "IGCM_sys_Mkdir : erreur."
279            IGCM_debug_Exit "IGCM_sys_Mkdir"
280        fi
281    fi
282    # vérification :
283    if [ ! -d ${1} ] ; then
284        echo "IGCM_sys_Mkdir : erreur."
285        IGCM_debug_Exit "IGCM_sys_Mkdir"
286    fi
287    IGCM_debug_PopStack "IGCM_sys_Mkdir"
288}
289
290#D-#==================================================
291#D-function IGCM_sys_MkdirArchive
292#D-* Purpose: Mkdir on Archive
293#D-* Examples:
294#D-
295function IGCM_sys_MkdirArchive {
296    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
297    if ( $DEBUG_sys ) ; then
298        echo "IGCM_sys_MkdirArchive :" $@
299    fi
300    #- creation de repertoire sur le serveur fichier
301    if [ ! -d ${1} ]; then 
302        \mkdir -p $1
303        if [ $? -gt 0 ] ; then
304            echo "IGCM_sys_MkdirArchive : erreur."
305            IGCM_debug_Exit "IGCM_sys_MkdirArchive"
306        fi
307    fi
308    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
309}
310
311#D-#==================================================
312#D-function IGCM_sys_MkdirWork
313#D-* Purpose: Mkdir on Work
314#D-* Examples:
315#D-
316function IGCM_sys_MkdirWork {
317    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
318    if ( $DEBUG_sys ) ; then
319        echo "IGCM_sys_MkdirWork :" $@
320    fi
321    #- creation de repertoire sur le serveur fichier
322    if [ ! -d ${1} ]; then 
323        \mkdir -p $1
324        if [ $? -gt 0 ] ; then
325            echo "IGCM_sys_MkdirWork : erreur."
326            IGCM_debug_Exit "IGCM_sys_MkdirWork"
327        fi
328    fi
329    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
330}
331
332#D-#==================================================
333#D-function IGCM_sys_Cd
334#D-* Purpose: master cd command
335#D-* Examples:
336#D-
337function IGCM_sys_Cd {
338    IGCM_debug_PushStack "IGCM_sys_Cd" $@
339    if ( $DEBUG_sys ) ; then
340        echo "IGCM_sys_Cd :" $@
341    fi
342    \cd $1
343    if [ $? -gt 0 ] ; then
344        echo "IGCM_sys_Cd : erreur."
345        IGCM_debug_Exit "IGCM_sys_Cd"
346    fi
347    IGCM_debug_PopStack "IGCM_sys_Cd"
348}
349
350#D-#==================================================
351#D-function IGCM_sys_Chmod
352#D-* Purpose: Chmod
353#D-* Examples:
354#D-
355function IGCM_sys_Chmod {
356    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
357    if ( $DEBUG_sys ) ; then
358        echo "IGCM_sys_Chmod :" $@
359    fi
360    if [ $DRYRUN -le 1 ]; then
361        \chmod $@
362        if [ $? -gt 0 ] ; then
363            echo "IGCM_sys_Chmod : erreur."
364            IGCM_debug_Exit "IGCM_sys_Chmod"
365        fi
366    else
367        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
368    fi
369    IGCM_debug_PopStack "IGCM_sys_Chmod"
370}
371
372#D-#==================================================
373#D-function IGCM_sys_FileSize
374#D-* Purpose: Filesize
375#D-* Examples:
376#D-
377function IGCM_sys_FileSize {
378    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
379
380    typeset sizeF
381    set +A sizeF -- $( ls -la ${1} )
382    if [ $? -gt 0 ] ; then
383        IGCM_debug_Exit "IGCM_sys_FileSize"
384    fi
385    eval ${2}=${sizeF[4]}
386
387    IGCM_debug_PopStack "IGCM_sys_FileSize"
388}
389
390#D-#==================================================
391#D-function IGCM_sys_TestDir
392#D-* Purpose: Test Directory that must exists
393#D-* Examples:
394#D-
395function IGCM_sys_TestDir {
396    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
397    if ( $DEBUG_sys ) ; then
398        echo "IGCM_sys_TestDir :" $@
399    fi
400    typeset ExistFlag
401    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
402    IGCM_debug_PopStack "IGCM_sys_TestDir"
403
404    return ${ExistFlag}
405}
406
407#D-#==================================================
408#D-function IGCM_sys_TestDirArchive
409#D-* Purpose: Test Directory that must exists on Archive
410#D-* Examples:
411#D-
412function IGCM_sys_TestDirArchive {
413    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
414    if ( $DEBUG_sys ) ; then
415        echo "IGCM_sys_TestDirArchive :" $@
416    fi
417    typeset ExistFlag
418    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
419    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
420
421    return ${ExistFlag}
422}
423
424#D-#==================================================
425#D-function IGCM_sys_TestFileArchive
426#D-* Purpose: Test file that must NOT EXISTS on Archive
427#D-* Examples:
428#D-
429function IGCM_sys_TestFileArchive {
430    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
431    typeset ExistFlag
432    ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
433    IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
434
435    return ${ExistFlag}
436}
437
438#D-#==================================================
439#D-function IGCM_sys_CountFileArchive
440#D-* Purpose: Count files on Archive filesystem
441#D-* Examples:
442#D-
443function IGCM_sys_CountFileArchive {
444    IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
445    ls ${@} 2>/dev/null | wc -l
446    if [ $? -gt 0 ] ; then
447        echo "IGCM_sys_CountFileArchive : erreur."
448    fi
449    IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
450}
451
452#D-#==================================================
453#D-function IGCM_sys_Tree
454#D-* Purpose: Tree directories with files on ${ARCHIVE}
455#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
456#D-
457function IGCM_sys_Tree {
458    IGCM_debug_PushStack "IGCM_sys_Tree" $@
459    if ( $DEBUG_sys ) ; then
460        echo "IGCM_sys_Tree :" $@
461    fi
462
463    \ls -lR ${@}
464
465    IGCM_debug_PopStack "IGCM_sys_Tree"
466}
467
468#D-#==================================================
469#D-function IGCM_sys_Tar
470#D-* Purpose: master un-tar command
471#D-* Examples:
472#D-
473function IGCM_sys_Tar {
474    IGCM_debug_PushStack "IGCM_sys_Tar" $@
475    if ( $DEBUG_sys ) ; then
476        echo "IGCM_sys_Tar :" $@
477    fi
478    \tar xvf $1
479    if [ $? -gt 0 ] ; then
480        echo "IGCM_sys_Tar : erreur."
481        IGCM_debug_Exit "IGCM_sys_Tar"
482    fi
483    IGCM_debug_PopStack "IGCM_sys_Tar"
484}
485
486#D-#==================================================
487#D-function IGCM_sys_UnTar
488#D-* Purpose: master un-tar command
489#D-* Examples:
490#D-
491function IGCM_sys_UnTar {
492    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
493    if ( $DEBUG_sys ) ; then
494        echo "IGCM_sys_UnTar :" $@
495    fi
496    \tar xvf $1
497    if [ $? -gt 0 ] ; then
498        echo "IGCM_sys_UnTar : erreur."
499        IGCM_debug_Exit "IGCM_sys_UnTar"
500    fi
501    IGCM_debug_PopStack "IGCM_sys_UnTar"
502}
503
504#D-#==================================================
505#D-function IGCM_sys_Qsub
506#D-* Purpose: Qsub new job
507#D-* Examples:
508#D-
509function IGCM_sys_Qsub {
510    IGCM_debug_PushStack "IGCM_sys_Qsub" $@
511    if ( $DEBUG_sys ) ; then
512        echo "IGCM_sys_Qsub :" $@
513    fi
514    /usr/bin/nqsII/qsub -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
515    if [ $? -gt 0 ] ; then
516        echo "IGCM_sys_Qsub : erreur -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} $@."
517        IGCM_debug_Exit "IGCM_sys_Qsub"
518    fi
519    IGCM_debug_PopStack "IGCM_sys_Qsub"
520}
521
522#D-#==================================================
523#D-function IGCM_sys_QsubPost
524#D-* Purpose: Qsub new job on scalaire
525#D-* Examples:
526#D-
527function IGCM_sys_QsubPost {
528    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
529    if ( $DEBUG_sys ) ; then
530        echo "IGCM_sys_QsubPost :" $@
531    fi
532    # ============ CESIUM START ============ #
533    #/usr/local/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.e.out -E "-v ${listVarEnv}" ${libIGCM_POST}/$1.job
534    # ============ CESIUM  END  ============ #
535    /usr/bin/nqsII/qsub -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM}/$1.job -v ${listVarEnv}
536    if [ $? -gt 0 ] ; then
537        echo "IGCM_sys_QsubPost : erreur " $@
538        IGCM_debug_Exit "IGCM_sys_QsubPost"
539    fi
540    IGCM_debug_PopStack "IGCM_sys_QsubPost"
541}
542
543#D-*************************
544#D- File transfer functions
545#D-*************************
546#D-
547
548#D-#==================================================
549#D-function IGCM_sys_Rsync_out
550#D-* Purpose: treat return val of rsync
551#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
552#D-  Error values and explanations can depend on your system version.
553function IGCM_sys_Rsync_out {
554    RET=$1
555    if [ ! $RET ] ; then
556        echo "rsync error !"
557    fi
558
559    if [ $MYLANG = "fr" ]; then
560        case $RET in
561            0)  return ;;
562            1)  echo "Erreur de rsync ; RERR_SYNTAX : "
563                echo "Erreur de syntaxe ou d'utilisation."
564                return;;
565            2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
566                echo "Incompatibilité de protocole."
567                return;;
568            3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
569                echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
570                echo "répertoires"
571                return;;
572            4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
573                echo "Action demandée non supportée : une tentative de manipulation de"
574                echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
575                echo "été faite ; ou une option qui est supportée par le  client  mais"
576                echo "pas par le serveur a été spécifiée."
577                return;;
578            10) echo "Erreur de rsync ; RERR_SOCKETIO"
579                echo "Erreur dans le socket d'entrée sortie"
580                return;;
581            11) echo "Erreur de rsync ; RERR_FILEIO"
582                echo "Erreur d'entrée sortie fichier"
583                return;;
584            12) echo "Erreur de rsync ; RERR_STREAMIO"
585                echo "Erreur dans flux de donnée du protocole rsync"
586                return;;
587            13) echo "Erreur de rsync ; RERR_MESSAGEIO"
588                echo "Erreur avec les diagnostics du programme"
589                return;;
590            14) echo "Erreur de rsync ; RERR_IPC"
591                echo "Erreur dans le code IPC"
592                return;;
593            20) echo "Erreur de rsync ; RERR_SIGNAL"
594                echo "SIGUSR1 ou SIGINT reçu"
595                return;;
596            21) echo "Erreur de rsync ; RERR_WAITCHILD"
597                echo "Une erreur retournée par waitpid()"
598                return;;
599            22) echo "Erreur de rsync ; RERR_MALLOC"
600                echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
601                return;;
602            23) echo ""
603                echo "Erreur fichier inexistant"
604                return;;
605            30) echo "Erreur de rsync ; RERR_TIMEOUT"
606                echo "Temps d'attente écoulé dans l'envoi/réception de données"
607                return;;
608            *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
609                return;;
610        esac
611    elif [ $MYLANG = "en" ] ; then
612        case $RET in
613            0)  return;;               
614            1)  echo "rsync error : Syntax or usage error "
615                return;;
616            2)  echo "rsync error : Protocol incompatibility "
617                return;;
618            3)  echo "rsync error : Errors selecting input/output files, dirs"
619                return;;
620            4)  echo "rsync error : Requested action not supported: an attempt"
621                echo "was made to manipulate 64-bit files on a platform that cannot support"
622                echo "them; or an option was specified that is supported by the client and"
623                echo "not by the server."
624                return;;
625            5)  echo "rsync error : Error starting client-server protocol"
626                return;;
627            10) echo "rsync error : Error in socket I/O "
628                return;;
629            11) echo "rsync error : Error in file I/O "
630                return;;
631            12) echo "rsync error : Error in rsync protocol data stream "
632                return;;
633            13) echo "rsync error : Errors with program diagnostics "
634                return;;
635            14) echo "rsync error : Error in IPC code "
636                return;;
637            20) echo "rsync error : Received SIGUSR1 or SIGINT "
638                return;;
639            21) echo "rsync error : Some error returned by waitpid() "
640                return;;
641            22) echo "rsync error : Error allocating core memory buffers "
642                return;;
643            23) echo "rsync error : Partial transfer due to error"
644                return;;
645            24) echo "rsync error : Partial transfer due to vanished source files"
646                return;;
647            30) echo "rsync error : Timeout in data send/receive "
648                return;;
649            *)  echo "rsync error : return code of rsync unknown :" $RET
650                return;;
651        esac
652    else
653        echo "unknown language $MYLANG."
654        return
655    fi
656}
657   
658
659#D-#==================================================
660#D-function IGCM_sys_Miror_libIGCM
661#D-* Purpose: Mirror libIGCM PATH and lib to cesium
662#D-* Examples:
663#D-
664function IGCM_sys_Mirror_libIGCM {
665    IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
666    if ( $DEBUG_sys ) ; then
667        echo "IGCM_sys_Mirror_libIGCM"
668    fi
669
670    typeset RET DEST
671
672    mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
673
674    echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
675    ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
676    RET=$?
677
678    if [ ${RET} -gt 0 ] ; then
679        echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
680        cat out_rsync
681    fi
682    IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
683}
684
685#====================================================
686#- Call IGCM_sys_Mirror_libIGCM now !
687if ( $MirrorlibIGCM ) ; then
688    IGCM_sys_Mirror_libIGCM
689fi
690
691#D-#==================================================
692#D-function IGCM_sys_Cp
693#D-* Purpose: generic cp
694#D-* Examples:
695#D-
696function IGCM_sys_Cp {
697    IGCM_debug_PushStack "IGCM_sys_Cp" $@
698    if ( $DEBUG_sys ) ; then
699        echo "IGCM_sys_Cp :" $@
700    fi
701
702    typeset RET
703
704    echo cp $@ > out_rsync 2>&1
705    \cp $@ >> out_rsync 2>&1
706    RET=$?
707
708    if [ ${RET} -gt 0 ] ; then
709        echo "IGCM_sys_Cp : error."
710        cat out_rsync
711        IGCM_debug_Exit "IGCM_sys_Cp"
712     else
713         \rm out_rsync
714    fi
715    IGCM_debug_PopStack "IGCM_sys_Cp"
716}
717
718#D-#==================================================
719#D-function IGCM_sys_Rm
720#D-* Purpose: generic rm
721#D-* Examples:
722#D-
723function IGCM_sys_Rm {
724    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
725    if ( $DEBUG_sys ) ; then
726        echo "IGCM_sys_Rm :" $@
727    fi
728
729    typeset RET
730
731    echo rm $@ > out_rsync 2>&1
732    \rm $@ >> out_rsync 2>&1
733    RET=$?
734
735    if [ ${RET} -gt 0 ] ; then
736        echo "IGCM_sys_Rm : error."
737        cat out_rsync
738        IGCM_debug_Exit "IGCM_sys_Rm"
739    else
740        \rm out_rsync
741    fi
742    IGCM_debug_PopStack "IGCM_sys_Rm"
743}
744
745#D-#==================================================
746#D-function IGCM_sys_Mv
747#D-* Purpose: generic move
748#D-* Examples:
749#D-
750function IGCM_sys_Mv {
751    IGCM_debug_PushStack "IGCM_sys_Mv" $@
752    if ( $DEBUG_sys ) ; then
753        echo "IGCM_sys_Mv :" $@
754    fi
755
756    if [ $DRYRUN = 0 ]; then
757
758        typeset RET
759           
760        echo mv $@ > out_rsync 2>&1
761        \mv $@ >> out_rsync 2>&1
762        RET=$?
763   
764        if [ ${RET} -gt 0 ] ; then
765            echo "IGCM_sys_Mv : error in mv."
766            cat out_rsync
767            IGCM_debug_Exit "IGCM_sys_Mv"
768        else
769            \rm out_rsync
770        fi
771    else
772        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
773    fi
774
775    IGCM_debug_PopStack "IGCM_sys_Mv"
776}
777
778#D-#==================================================
779#D-function IGCM_sys_Put_Dir
780#D-* Purpose: Copy a complete directory on $(ARCHIVE)
781#D-* Examples:
782#D-
783function IGCM_sys_Put_Dir {
784    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
785    if ( $DEBUG_sys ) ; then
786        echo "IGCM_sys_Put_Dir :" $@
787    fi
788    if [ $DRYRUN = 0 ]; then
789        if [ ! -d ${1} ] ; then
790            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
791            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
792            return
793        fi
794
795        typeset RET
796
797        # Only if we use rsync
798        #IGCM_sys_TestDirArchive $( dirname $2 )
799        #
800        #USUAL WAY
801        \cp -r $1 $2 > out_rsync 2>&1
802        RET=$?
803
804        if [ ${RET} -gt 0 ] ; then
805            echo "IGCM_sys_Put_Dir : error."
806            cat out_rsync
807            IGCM_debug_Exit "IGCM_sys_Put_Dir"
808        else
809            \rm out_rsync
810        fi
811    else
812        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
813    fi
814    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
815}
816
817#D-#==================================================
818#D-function IGCM_sys_Get_Dir
819#D-* Purpose: Copy a complete directory from $(ARCHIVE)
820#D-* Examples:
821#D-
822function IGCM_sys_Get_Dir {
823    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
824    if ( $DEBUG_sys ) ; then
825        echo "IGCM_sys_Get_Dir :" $@
826    fi
827    if [ $DRYRUN = 0 ]; then
828        if [ ! -d ${1} ] ; then
829            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
830            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
831            return
832        fi
833
834        typeset RET
835
836        # Only if we use rsync
837        #IGCM_sys_TestDirArchive $( dirname $2 )
838        #
839        #USUAL WAY
840        \cp -r $1 $2 > out_rsync 2>&1
841        RET=$?
842
843        if [ ${RET} -gt 0 ] ; then
844            echo "IGCM_sys_Get_Dir : error."
845            cat out_rsync
846            IGCM_debug_Exit "IGCM_sys_Get_Dir"
847        else
848            \rm out_rsync
849        fi
850    else
851        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
852    fi
853    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
854}
855
856#D-#==================================================
857#D-function IGCM_sys_Put_Rest
858#D-* Purpose: Put computied restarts on $(ARCHIVE).
859#D-           File and target directory must exist.
860#D-* Examples:
861#D-
862function IGCM_sys_Put_Rest {
863    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
864    if ( $DEBUG_sys ) ; then
865        echo "IGCM_sys_Put_Rest :" $@
866    fi
867    if [ $DRYRUN = 0 ]; then
868        if [ ! -f ${1} ] ; then
869            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
870            IGCM_debug_Exit "IGCM_sys_Put_Rest"
871        fi
872
873        typeset RET
874        #
875        if [ X${JobType} = XRUN ] ; then
876            IGCM_sys_Chmod 444 ${1}
877        fi
878        #
879        IGCM_sys_TestDirArchive $( dirname $2 )
880        #
881        # USUAL WAY
882        putfer $1 $2 > out_rsync 2>&1
883        RET=$?
884
885#       #RSYNC WITH NETWORK SSH CALL
886#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
887#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
888
889#       #RSYNC WITH NFS USE
890#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
891#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
892
893#       RET=$?
894#       IGCM_sys_Rsync_out $RET
895
896#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
897#       (( RET=RET+$? ))
898
899        if [ ${RET} -gt 0 ] ; then
900            echo "IGCM_sys_Put_Rest : error."
901            cat out_rsync
902            IGCM_debug_Exit "IGCM_sys_Put_Rest"
903        else
904            \rm out_rsync
905        fi
906    else
907        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
908    fi
909    IGCM_debug_PopStack "IGCM_sys_Put_Rest"
910}
911
912#D-#==================================================
913#D-function IGCM_sys_Put_Out
914#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
915#D-* Examples:
916#D-
917function IGCM_sys_Put_Out {
918    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
919    if ( $DEBUG_sys ) ; then
920        echo "IGCM_sys_Put_Out :" $@
921    fi
922    if [ $DRYRUN = 0 ]; then
923        if [ ! -f ${1} ] ; then
924            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
925            IGCM_debug_PopStack "IGCM_sys_Put_Out"
926            return 1
927        fi
928        #
929        IGCM_sys_MkdirArchive $( dirname $2 )
930        #
931        typeset RET
932
933        #=====================================================
934        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
935        #=====================================================
936
937        #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
938        #if [ $? -eq 0 ] ; then
939        #    typeset WORKPATH FILEPATH
940        #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_OUT_SCR}|" )
941        #    IGCM_sys_MkdirWork ${WORKPATH}
942        #    FILEPATH=${WORKPATH}/$( basename $2 )
943        #    #
944        #    IGCM_sys_Cp ${1} ${FILEPATH}
945        #fi
946
947        if [ X${JobType} = XRUN ] ; then
948            if [ X${3} = X ] ; then
949                IGCM_sys_Chmod 444 ${1}
950            fi
951        fi
952        #
953        # USUAL WAY
954        putfer $1 $2 > out_rsync 2>&1
955        RET=$?
956
957#       #RSYNC WITH NETWORK SSH CALL
958#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
959#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
960
961#       #RSYNC WITH NFS USE
962#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
963#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
964
965#       RET=$?
966#       IGCM_sys_Rsync_out $RET
967
968#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
969#       (( RET=RET+$? ))
970
971        if [ ${RET} -gt 0 ] ; then
972            echo "IGCM_sys_Put_Out : error."
973            cat out_rsync
974            IGCM_debug_Exit "IGCM_sys_Put_Out"
975        else
976            \rm out_rsync
977        fi
978    else
979        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
980    fi
981    IGCM_debug_PopStack "IGCM_sys_Put_Out"
982    return 0
983}
984
985#D-#==================================================
986#D-function IGCM_sys_Get
987#D-* Purpose: Get a file from ${ARCHIVE}
988#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
989#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
990function IGCM_sys_Get {
991    IGCM_debug_PushStack "IGCM_sys_Get" $@
992
993    typeset DEST RET dm_liste ifile target file_work
994
995    if ( $DEBUG_sys ) ; then
996        echo "IGCM_sys_Get :" $@
997    fi
998    if [ $DRYRUN -le 2 ]; then
999        if [ X${1} = X'/l' ] ; then
1000            # test if the first file is present in the old computation :
1001            eval set +A dm_liste \${${2}}
1002        else
1003            eval set +A dm_liste ${1}
1004        fi
1005        eval DEST=\${${#}}
1006
1007        #=====================================================
1008        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
1009        #=====================================================
1010
1011        # Is it an R_OUT file (not R_IN) ?
1012        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
1013        #if [ $? -eq 0 ] ; then
1014        #    # Yes  ? then we try to get it in SCRATCHDIR
1015        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|" )
1016        #    if [ -f ${file_work[0]} ] ; then
1017        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
1018        #       IGCM_debug_PopStack "IGCM_sys_Get"
1019        #       return
1020        #    fi
1021        #fi
1022
1023        # test if the (first) file is present in the old computation :
1024        IGCM_sys_TestFileArchive ${dm_liste[0]}
1025        RET=$?
1026        if [ ${RET} -gt 0 ] ; then
1027            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
1028            IGCM_debug_Exit "IGCM_sys_Get"
1029            IGCM_debug_PopStack "IGCM_sys_Get"
1030            return
1031        fi
1032
1033        dmget ${dm_liste[*]} > out_rsync 2>&1
1034        RET=$?
1035        if [ ${RET} -gt 0 ] ; then
1036            echo "IGCM_sys_Get : demigration error."
1037            cat out_rsync
1038            IGCM_debug_Exit "IGCM_sys_Get"
1039        fi
1040
1041        #USUAL WAY
1042        if [ X${1} = X'/l' ] ; then
1043            (( RET=0 ))
1044            for target in ${dm_liste[*]} ; do
1045                local_file=$( basename ${target} )
1046                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
1047                (( RET = RET + $? ))
1048            done
1049        else
1050            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
1051            RET=$?
1052        fi
1053
1054#       #RSYNC WITH NETWORK SSH CALL
1055#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
1056#       ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
1057
1058#       #RSYNC WITH NFS USE
1059#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
1060#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
1061
1062#       RET=$?
1063#       IGCM_sys_Rsync_out $RET
1064
1065#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
1066#       (( RET=RET+$? ))
1067
1068        if [ ${RET} -gt 0 ] ; then
1069            echo "IGCM_sys_Get : copy error."
1070            cat out_rsync
1071            IGCM_debug_Exit "IGCM_sys_Get"
1072        else
1073            \rm out_rsync
1074        fi
1075    else
1076        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1077    fi
1078    IGCM_debug_PopStack "IGCM_sys_Get"
1079}
1080
1081############################################################## A FINIR !!
1082
1083#D-#==================================================
1084#D-function IGCM_sys_GetDate_FichWork
1085#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1086#D-* Examples:
1087#D-
1088function IGCM_sys_GetDate_FichWork {
1089    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1090    if ( $DEBUG_sys ) ; then
1091        echo "IGCM_sys_GetDate_FichWork :" $@
1092    fi
1093    # donne la date filesys d'un fichier sur la machine work
1094    IGCM_debug_PopStack "IGCM_sys_FichWork"
1095}
1096
1097#D-#==================================================
1098#D-function IGCM_sys_GetDate_FichArchive
1099#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1100#D-* Examples:
1101#D-
1102function IGCM_sys_GetDate_FichArchive {
1103    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1104    if ( $DEBUG_sys ) ; then
1105        echo "IGCM_sys_GetDate_FichArchive :" $@
1106    fi
1107    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1108}
1109
1110##############################################################
1111# REBUILD OPERATOR
1112
1113function IGCM_sys_rebuild {
1114    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1115    if ( $DEBUG_sys ) ; then
1116        echo "IGCM_sys_rebuild :" $@
1117    fi
1118    /home/cont003/p86ipsl/SX8/bin/rebuild -f -o $@
1119    if [ $? -gt 0 ] ; then
1120       echo "IGCM_sys_rebuild : erreur ${@}."
1121       IGCM_debug_Exit "rebuild"
1122    fi
1123
1124    IGCM_debug_PopStack "IGCM_sys_rebuild"
1125}
1126
1127############################################################
1128# Activate Running Environnment Variables
1129
1130function IGCM_sys_activ_variables {
1131    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1132    if ( $DEBUG_sys ) ; then
1133        echo "IGCM_sys_activ_variables"
1134    fi
1135
1136# --------------------------------------------------------------------
1137#D- MPI specifications
1138# --------------------------------------------------------------------
1139
1140#D-- MPISUSPEND
1141    export MPISUSPEND=${MPISUSPEND:=OFF}
1142
1143#D-- MPIPROGINF #other choices : ALL_DETAIL2
1144    export MPIPROGINF=ALL
1145#D- activate ftrace (with -ftrace)
1146    export F_FTRACE=YES
1147#D- communication information (with -ftrace)
1148    export MPICOMMINF=DETAIL
1149
1150# --------------------------------------------------------------------
1151#D- Other specifications
1152# --------------------------------------------------------------------
1153
1154#D- max number of character/line in output job
1155    export F_SYSLEN=5000
1156#D- number of error that can be admitted on the NEC
1157    export F_ERRCNT=0
1158#D- global performance
1159    export F_PROGINF=DETAIL
1160
1161#D- I/O performance (FORTRAN I/O only not netCDF)
1162    export F_FILEINF=${F_FILEINF:=NO}
1163#D- netCDF I/O performance
1164    export NC_FILEINF=${NC_FILEINF:=NO}
1165
1166    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1167}
1168
1169############################################################
1170# Desactivate Running Environnment Variables
1171
1172function IGCM_sys_desactiv_variables {
1173    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1174    if ( $DEBUG_sys ) ; then
1175        echo "IGCM_sys_desactiv_variables"
1176    fi
1177# --------------------------------------------------------------------
1178#D- MPI specifications
1179# --------------------------------------------------------------------
1180
1181#D-- MPIPROGINF
1182    export MPIPROGINF=NO
1183
1184# --------------------------------------------------------------------
1185#D- Other specifications
1186# --------------------------------------------------------------------
1187
1188#D- global performance
1189    export F_PROGINF=NO 
1190
1191    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1192}
1193
1194############################################################
1195# Build run file
1196
1197function IGCM_sys_build_run_file {
1198    IGCM_debug_PushStack "IGCM_sys_build_run_file" $@
1199    if ( $DEBUG_sys ) ; then
1200        echo "IGCM_sys_build_run_file " $@
1201    fi
1202    (( NUM_PROC_ATM = BATCH_NUM_PROC_TOT - 1 ))
1203    (( NUM_PROC_OASIS = BATCH_NUM_PROC_TOT - NUM_PROC_ATM ))
1204    (( NUM_PROC_OCE = BATCH_NUM_PROC_TOT - NUM_PROC_ATM ))
1205   
1206    if [ $1 = MPI2 ]; then
1207        cat <<EOF > run_file
1208-p 1 -np 1 -e ./oasis
1209EOF
1210        (( NUM_PROCESS = BATCH_NUM_PROC_TOT + 1 ))
1211        config_UserChoices_JobRunOptions='"-max_np ${NUM_PROCESS} -f"'
1212
1213    elif [ $1 = MPI1 ]; then
1214        cat <<EOF > run_file
1215-p $NUM_PROC_OASIS -e ./oasis
1216-p $NUM_PROC_ATM -e ./lmdz.x
1217-p $NUM_PROC_OCE -e ./opa.xx
1218EOF
1219 
1220    fi
1221
1222    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1223 
1224}
Note: See TracBrowser for help on using the repository browser.