source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh @ 156

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