source: tags/libIGCM_v1_5/libIGCM_sys/libIGCM_sys_claude.ksh @ 487

Last change on this file since 487 was 228, checked in by mmaipsl, 14 years ago

Supress buggy space after HOST and LOGIN variables.
Add an optionnal argument to all IGCM_sys_Put_Out functions :
if any 3thrd argument is there, file won't be protected. If
there is no argument (default in libIGCM), file will be set read-only.

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