source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh @ 265

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

-Handle 3hours files
-Use SmoothFiles? section

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