source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh @ 153

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