source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh @ 173

Last change on this file since 173 was 173, checked in by mafoipsl, 15 years ago

Add DRYRUN capability in Sys_Mv for all systems supported.

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