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

Last change on this file since 156 was 156, checked in by sdipsl, 15 years ago
  • Define BIG_DIR : where files will be store waiting for patch or rebuild if rebuildFromArchive=false

-- > typically somewhere on the scratch or on the work

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