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

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