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

Last change on this file since 173 was 173, checked in by mafoipsl, 15 years ago

Add DRYRUN capability in Sys_Mv for all systems supported.

  • 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.8 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" ${config_UserChoices_MailName} <  job_end.mail
241    elif [ -f ~/.forward ] ; then
242        mailx -s "${config_UserChoices_JobName} completed" $( 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    if [ $DRYRUN = 0 ]; then
725
726        typeset RET
727           
728        echo mv $@ > out_rsync 2>&1
729        \mv $@ >> out_rsync 2>&1
730        RET=$?
731   
732        if [ ${RET} -gt 0 ] ; then
733            echo "IGCM_sys_Mv : error in mv."
734            cat out_rsync
735            IGCM_debug_Exit "IGCM_sys_Mv"
736        fi
737    else
738        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
739    fi
740
741    IGCM_debug_PopStack "IGCM_sys_Mv"
742}
743
744#D-#==================================================
745#D-function IGCM_sys_Put_Dir
746#D-* Purpose: Copy a complete directory on $(ARCHIVE)
747#D-* Examples:
748#D-
749function IGCM_sys_Put_Dir {
750    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
751    if ( $DEBUG_sys ) ; then
752        echo "IGCM_sys_Put_Dir :" $@
753    fi
754    if [ $DRYRUN = 0 ]; then
755        if [ ! -d ${1} ] ; then
756            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
757            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
758            return
759        fi
760
761        typeset RET
762
763        # Only if we use rsync
764        #IGCM_sys_TestDirArchive $( dirname $2 )
765        #
766        #USUAL WAY
767        \cp -R $1 $2 > out_rsync 2>&1
768        RET=$?
769
770        if [ ${RET} -gt 0 ] ; then
771            echo "IGCM_sys_Put_Dir : error."
772            cat out_rsync
773            IGCM_debug_Exit "IGCM_sys_Put_Dir"
774        fi
775    else
776        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
777    fi
778    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
779}
780
781#D-#==================================================
782#D-function IGCM_sys_Get_Dir
783#D-* Purpose: Copy a complete directory from $(ARCHIVE)
784#D-* Examples:
785#D-
786function IGCM_sys_Get_Dir {
787    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
788    if ( $DEBUG_sys ) ; then
789        echo "IGCM_sys_Get_Dir :" $@
790    fi
791    if [ $DRYRUN = 0 ]; then
792        if [ ! -d ${1} ] ; then
793            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
794            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
795            return
796        fi
797
798        typeset RET
799
800        #USUAL WAY
801        \cp -R $1 $2 > out_rsync 2>&1
802        RET=$?
803
804        if [ ${RET} -gt 0 ] ; then
805            echo "IGCM_sys_Get_Dir : error."
806            cat out_rsync
807            IGCM_debug_Exit "IGCM_sys_Get_Dir"
808        fi
809    else
810        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
811    fi
812    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
813}
814
815#D-#==================================================
816#D-function IGCM_sys_Get_Master
817#D-* Purpose: Copy a complete directory from MASTER filesystem
818#D-* Examples:
819#D-
820function IGCM_sys_Get_Master {
821    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
822    if ( $DEBUG_sys ) ; then
823        echo "IGCM_sys_Get_Master :" $@
824    fi
825    if [ $DRYRUN = 0 ]; then
826        if [ ! -d ${1} ] ; then
827            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
828            IGCM_debug_PopStack "IGCM_sys_Get_Master"
829            return
830        fi
831
832        typeset RET
833        sleep 60
834
835        #USUAL WAY
836        cp -R $1 $2 > out_rsync 2>&1
837        RET=$?
838
839        if [ ${RET} -gt 0 ] ; then
840            echo "IGCM_sys_Get_Master : error."
841            cat out_rsync
842            IGCM_debug_Exit "IGCM_sys_Get_Master"
843        fi
844    else
845        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
846    fi
847    IGCM_debug_PopStack "IGCM_sys_Get_Master"
848}
849
850#D-#==================================================
851#D-function IGCM_sys_Put_Rest
852#D-* Purpose: commande de transfert des restarts $(ARCHIVE).
853#D-           Quitte si le fichier ou si le répertoire d'arriver n'existe pas.
854#D-* Examples:
855#D-
856function IGCM_sys_Put_Rest {
857    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
858    if ( $DEBUG_sys ) ; then
859        echo "IGCM_sys_Put_Rest :" $@
860    fi
861    if [ $DRYRUN = 0 ]; then
862
863        IGCM_sys_TestDirArchive $( dirname $2 )
864
865        if [ ! -f ${1} ] ; then
866            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
867            IGCM_debug_Exit "IGCM_sys_Put_Rest"
868        fi
869        if [ X${JobType} = XRUN ] ; then
870            IGCM_sys_Chmod 444 ${1}
871        fi
872
873        typeset RET
874
875        echo ${RSYNC} ${RSYNC_opt} $1 $2 > out_rsync 2>&1
876        ${RSYNC} ${RSYNC_opt} $1 $2 >> out_rsync 2>&1
877        RET=$?
878        IGCM_sys_Rsync_out $RET
879
880        ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
881        (( RET=RET+$? ))
882
883        if [ ${RET} -gt 0 ] ; then
884            echo "IGCM_sys_Put_Rest : error."
885            cat out_rsync
886            IGCM_debug_Exit "IGCM_sys_Put_Rest"
887        fi
888    else
889        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
890    fi
891    IGCM_debug_PopStack "IGCM_sys_Put_Rest"
892}
893
894#D-#==================================================
895#D-function IGCM_sys_Put_Out
896#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
897#D-* Examples:
898#D-
899function IGCM_sys_Put_Out {
900    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
901    if ( $DEBUG_sys ) ; then
902        echo "IGCM_sys_Put_Out :" $@
903    fi
904    if [ $DRYRUN = 0 ]; then
905        if [ -f ${1} ] ; then
906            if [ ! -d $( dirname $2 ) ] ; then
907                IGCM_sys_MkdirArchive $( dirname $2 )
908            fi
909        else
910            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
911            IGCM_debug_PopStack "IGCM_sys_Put_Out"
912            return 1
913        fi
914
915        typeset RET
916        #
917        if [ X${JobType} = XRUN ] ; then
918            IGCM_sys_Chmod 444 ${1}
919        fi
920        #
921
922        echo ${RSYNC} ${RSYNC_opt} $1 $2 > out_rsync 2>&1
923        ${RSYNC} ${RSYNC_opt} $1 $2 >> out_rsync 2>&1
924        RET=$?
925        IGCM_sys_Rsync_out $RET
926
927        ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
928        (( RET=RET+$? ))
929
930        if [ ${RET} -gt 0 ] ; then
931            echo "IGCM_sys_Put_Out : error."
932            cat out_rsync
933            IGCM_debug_Exit "IGCM_sys_Put_Out"
934        fi
935    else
936        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
937    fi
938    IGCM_debug_PopStack "IGCM_sys_Put_Out"
939    return 0
940}
941
942#D-#==================================================
943#D-function IGCM_sys_Get
944#D-* Purpose: Get a file from ${ARCHIVE}
945#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
946#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
947function IGCM_sys_Get {
948    IGCM_debug_PushStack "IGCM_sys_Get" $@
949
950    typeset DEST RET dm_liste ifile target
951
952    if ( $DEBUG_sys ) ; then
953        echo "IGCM_sys_Get :" $@
954    fi
955    if [ $DRYRUN -le 2 ]; then
956        if [ X${1} = X'/l' ] ; then
957            # test if the first file is present in the old computation :
958            eval set +A dm_liste \${${2}}
959        else
960            dm_liste=${1}
961        fi
962        eval DEST=\${${#}}
963
964        # test if the (first) file is present in the old computation :
965        IGCM_sys_TestFileArchive ${dm_liste[0]}
966        RET=$?
967        if [ ${RET} -gt 0 ] ; then
968            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
969            IGCM_debug_Exit "IGCM_sys_Get"
970            #return
971        fi
972
973        (( RET=0 ))
974        for target in ${dm_liste[*]} ; do
975          ln -s ${target} ${DEST} >> out_rsync 2>&1
976          (( RET=RET+$? ))
977        done
978
979#       echo ${RSYNC} ${RSYNC_opt} $@ > out_rsync 2>&1
980#       ${RSYNC} ${RSYNC_opt} $@ >> out_rsync 2>&1
981#       RET=$?
982#       IGCM_sys_Rsync_out $RET
983
984#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
985#       (( RET=RET+$? ))
986
987        if [ ${RET} -gt 0 ] ; then
988            echo "IGCM_sys_Get : copy error."
989            cat out_rsync
990            IGCM_debug_Exit "IGCM_sys_Get"
991        fi
992    else
993        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
994    fi
995    IGCM_debug_PopStack "IGCM_sys_Get"
996}
997
998#D-#==================================================
999#D-function IGCM_sys_Put_Dods
1000#D-* Purpose: DO NOTHING ! Put $(ARCHIVE) files on DODS internet protocole.
1001#D-* Examples:
1002#D-
1003function IGCM_sys_Put_Dods {
1004    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
1005    if ( $DEBUG_sys ) ; then
1006        echo "IGCM_sys_Put_Dods :" $@
1007    fi
1008    if [ $DRYRUN = 0 ]; then
1009        if [ ! -f ${1} ] ; then
1010            echo "WARNING : IGCM_sys_Put_Dods ${1} DOES NOT EXIST ."
1011            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1012            return
1013        fi
1014        #DO NOTHING
1015    else
1016        IGCM_err "DRYRUN mode = " $DRYRUN
1017    fi
1018    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1019}
1020
1021############################################################## A REVOIR !!
1022
1023#D-#==================================================
1024#D-function IGCM_sys_Rapatrie
1025#D-* Purpose: Rapatrie
1026#D-* Examples:
1027#D-
1028function IGCM_sys_Rapatrie {
1029    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
1030    if ( $DEBUG_sys ) ; then
1031        echo "IGCM_sys_Rapatrie :" $@
1032    fi
1033
1034    typeset RET=0
1035
1036    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
1037    let $(( RET=RET+$? ))
1038    IGCM_sys_Cd $1 ;
1039    let $(( RET=RET+$? ))
1040    IGCM_sys_UnTar $2 ;
1041    let $(( RET=RET+$? ))
1042
1043    if [ ${RET} -gt 0 ] ; then
1044        echo "IGCM_sys_Rapatrie : erreur."
1045        IGCM_debug_Exit "IGCM_sys_Rapatrie"
1046    fi
1047    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
1048}
1049
1050############################################################## A FINIR !!
1051
1052#D-#==================================================
1053#D-function IGCM_sys_GetDate_FichWork
1054#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1055#D-* Examples:
1056#D-
1057function IGCM_sys_GetDate_FichWork {
1058    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1059    if ( $DEBUG_sys ) ; then
1060        echo "IGCM_sys_GetDate_FichWork :" $@
1061    fi
1062    # donne la date filesys d'un fichier sur la machine work
1063    IGCM_debug_PopStack "IGCM_sys_FichWork"
1064}
1065
1066#D-#==================================================
1067#D-function IGCM_sys_GetDate_FichArchive
1068#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1069#D-* Examples:
1070#D-
1071function IGCM_sys_GetDate_FichArchive {
1072    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1073    if ( $DEBUG_sys ) ; then
1074        echo "IGCM_sys_GetDate_FichArchive :" $@
1075    fi
1076    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1077}
1078
1079
1080##############################################################
1081# NCO OPERATOR
1082
1083function IGCM_sys_ncap {
1084    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1085    if ( $DEBUG_sys ) ; then
1086        echo "IGCM_sys_ncap :" $@
1087    fi
1088    /usr/bin/ncap $@
1089    if [ $? -gt 0 ] ; then
1090       echo "IGCM_sys_ncap : erreur ${@}."
1091#       IGCM_debug_Exit "ncap"
1092    fi
1093
1094    IGCM_debug_PopStack "IGCM_sys_ncap"
1095}
1096
1097ncatted=/usr/bin/ncatted
1098# Problem with ksh and string passed in this function to ncatted !
1099# function IGCM_sys_ncatted {
1100#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1101#     if ( $DEBUG_sys ) ; then
1102#       echo "IGCM_sys_ncatted :" $@
1103#     fi
1104#     /usr/bin/ncatted $@
1105#     if [ $? -gt 0 ] ; then
1106#        echo "IGCM_sys_ncatted : erreur ${@}."
1107#        IGCM_debug_Exit "ncatted"
1108#     fi
1109
1110#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1111# }
1112
1113function IGCM_sys_ncbo {
1114    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1115    if ( $DEBUG_sys ) ; then
1116        echo "IGCM_sys_ncbo :" $@
1117    fi
1118    /usr/bin/ncbo $@
1119    if [ $? -gt 0 ] ; then
1120       echo "IGCM_sys_ncbo : erreur ${@}."
1121#       IGCM_debug_Exit "ncbo"
1122    fi
1123
1124    IGCM_debug_PopStack "IGCM_sys_ncbo"
1125}
1126
1127function IGCM_sys_ncdiff {
1128    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1129    if ( $DEBUG_sys ) ; then
1130        echo "IGCM_sys_ncdiff :" $@
1131    fi
1132    /usr/bin/ncdiff $@
1133    if [ $? -gt 0 ] ; then
1134       echo "IGCM_sys_ncdiff : erreur ${@}."
1135#       IGCM_debug_Exit "ncdiff"
1136    fi
1137
1138    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1139}
1140
1141function IGCM_sys_ncea {
1142    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1143    if ( $DEBUG_sys ) ; then
1144        echo "IGCM_sys_ncea :" $@
1145    fi
1146    /usr/bin/ncea $@
1147    if [ $? -gt 0 ] ; then
1148       echo "IGCM_sys_ncea : erreur ${@}."
1149#       IGCM_debug_Exit "ncea"
1150    fi
1151
1152    IGCM_debug_PopStack "IGCM_sys_ncea"
1153}
1154
1155function IGCM_sys_ncecat {
1156    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1157    if ( $DEBUG_sys ) ; then
1158        echo "IGCM_sys_ncecat :" $@
1159    fi
1160    /usr/bin/ncecat $@
1161    if [ $? -gt 0 ] ; then
1162       echo "IGCM_sys_ncecat : erreur ${@}."
1163#       IGCM_debug_Exit "ncecat"
1164    fi
1165
1166    IGCM_debug_PopStack "IGCM_sys_ncecat"
1167}
1168
1169function IGCM_sys_ncflint {
1170    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1171    if ( $DEBUG_sys ) ; then
1172        echo "IGCM_sys_ncflint :" $@
1173    fi
1174    /usr/bin/ncflint $@
1175    if [ $? -gt 0 ] ; then
1176       echo "IGCM_sys_ncflint : erreur ${@}."
1177#       IGCM_debug_Exit "ncflint"
1178    fi
1179
1180    IGCM_debug_PopStack "IGCM_sys_ncflint"
1181}
1182
1183function IGCM_sys_ncks {
1184    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1185    if ( $DEBUG_sys ) ; then
1186        echo "IGCM_sys_ncks :" $@
1187    fi
1188    /usr/bin/ncks $@
1189    if [ $? -gt 0 ] ; then
1190       echo "IGCM_sys_ncks : erreur ${@}."
1191#       IGCM_debug_Exit "ncks"
1192    fi
1193
1194    IGCM_debug_PopStack "IGCM_sys_ncks"
1195}
1196
1197function IGCM_sys_ncpdq {
1198    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1199    if ( $DEBUG_sys ) ; then
1200        echo "IGCM_sys_ncpdq :" $@
1201    fi
1202    /usr/bin/ncpdq $@
1203    if [ $? -gt 0 ] ; then
1204       echo "IGCM_sys_ncpdq : erreur ${@}."
1205#       IGCM_debug_Exit "ncpdq"
1206    fi
1207
1208    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1209}
1210
1211function IGCM_sys_ncra {
1212    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1213    if ( $DEBUG_sys ) ; then
1214        echo "IGCM_sys_ncra :" $@
1215    fi
1216    /usr/bin/ncra $@
1217    if [ $? -gt 0 ] ; then
1218       echo "IGCM_sys_ncra : erreur ${@}."
1219#       IGCM_debug_Exit "ncra"
1220    fi
1221
1222    IGCM_debug_PopStack "IGCM_sys_ncra"
1223}
1224
1225function IGCM_sys_ncrcat {
1226    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1227    if ( $DEBUG_sys ) ; then
1228        echo "IGCM_sys_ncrcat :" $@
1229    fi
1230    /usr/bin/ncrcat $@
1231    if [ $? -gt 0 ] ; then
1232       echo "IGCM_sys_ncrcat : erreur ${@}."
1233#       IGCM_debug_Exit "ncrcat"
1234    fi
1235
1236    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1237}
1238
1239function IGCM_sys_ncrename {
1240    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1241    if ( $DEBUG_sys ) ; then
1242        echo "IGCM_sys_ncrename :" $@
1243    fi
1244    /usr/bin/ncrename $@
1245    if [ $? -gt 0 ] ; then
1246       echo "IGCM_sys_ncrename : erreur ${@}."
1247#       IGCM_debug_Exit "ncrename"
1248    fi
1249
1250    IGCM_debug_PopStack "IGCM_sys_ncrename"
1251}
1252
1253function IGCM_sys_ncwa {
1254    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1255    if ( $DEBUG_sys ) ; then
1256        echo "IGCM_sys_ncwa :" $@
1257    fi
1258    /usr/bin/ncwa $@
1259    if [ $? -gt 0 ] ; then
1260       echo "IGCM_sys_ncwa : erreur ${@}."
1261#       IGCM_debug_Exit "ncwa"
1262    fi
1263
1264    IGCM_debug_PopStack "IGCM_sys_ncwa"
1265}
1266
1267############################################################
1268# Activate Running Environnment Variables
1269
1270function IGCM_sys_activ_variables {
1271    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1272    if ( $DEBUG_sys ) ; then
1273        echo "IGCM_sys_activ_variables"
1274    fi
1275    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1276}
1277
1278############################################################
1279# Desactivate Running Environnment Variables
1280
1281function IGCM_sys_desactiv_variables {
1282    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1283    if ( $DEBUG_sys ) ; then
1284        echo "IGCM_sys_desactiv_variables"
1285    fi
1286    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1287}
1288
1289############################################################
1290# Build run file
1291
1292function IGCM_sys_build_run_file {
1293    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1294    if ( $DEBUG_sys ) ; then
1295        echo "IGCM_sys_build_run_file"
1296    fi
1297    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1298}
Note: See TracBrowser for help on using the repository browser.