source: tags/libIGCM_v1_7/libIGCM_sys/libIGCM_sys_default.ksh @ 302

Last change on this file since 302 was 288, checked in by mafoipsl, 14 years ago

Add SUBLIT_DIR in messgae snt at the end of each simulation. Complete messages in clean_month.

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