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

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

MM, NVu, PC : update obelix system.

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