source: tags/libIGCM_v1_7/libIGCM_sys/libIGCM_sys_claude.ksh @ 1137

Last change on this file since 1137 was 308, checked in by mafoipsl, 14 years ago

Include changeset [305] into libIGCM_v1_7.

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