source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh @ 130

Last change on this file since 130 was 130, checked in by sdipsl, 15 years ago

MAF, SD ; Process mfget file by file to avoid trouble. IDRIS works on this issue.

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