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

Last change on this file since 217 was 217, checked in by sdipsl, 14 years ago

Avoid side effect with user environment. Do not define read-only varible potentially defined by system environment.

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