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

Last change on this file since 157 was 156, checked in by sdipsl, 15 years ago
  • Define BIG_DIR : where files will be store waiting for patch or rebuild if rebuildFromArchive=false

-- > typically somewhere on the scratch or on the work

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