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

Last change on this file since 145 was 145, checked in by sdipsl, 15 years ago
  • Cesium : netcdf 3.6.3 depends on hdf5/1.8.2
  • Be more flexible in IGCM_sys_Get on post-processing machine
  • Property svn:keywords set to Date Author Revision
File size: 35.2 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    typeset RET
696
697    echo mv $@ > out_rsync 2>&1
698    \mv $@ >> out_rsync 2>&1
699    RET=$?
700
701    if [ ${RET} -gt 0 ] ; then
702        echo "IGCM_sys_Mv : error in mv."
703        cat out_rsync
704        IGCM_debug_Exit "IGCM_sys_Mv"
705    fi
706
707    IGCM_debug_PopStack "IGCM_sys_Mv"
708}
709
710#D-#==================================================
711#D-function IGCM_sys_Put_Dir
712#D-* Purpose: Copy a complete directory on $(ARCHIVE)
713#D-* Examples:
714#D-
715function IGCM_sys_Put_Dir {
716    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
717    if ( $DEBUG_sys ) ; then
718        echo "IGCM_sys_Put_Dir :" $@
719    fi
720    if [ $DRYRUN = 0 ]; then
721        if [ ! -d ${1} ] ; then
722            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
723            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
724            return
725        fi
726
727        typeset RET
728
729        # Only if we use rsync
730        #IGCM_sys_TestDirArchive $( dirname $2 )
731        #
732        #USUAL WAY
733        \cp -r $1 $2 > out_rsync 2>&1
734        RET=$?
735
736        if [ ${RET} -gt 0 ] ; then
737            echo "IGCM_sys_Put_Dir : error."
738            cat out_rsync
739            IGCM_debug_Exit "IGCM_sys_Put_Dir"
740        fi
741    else
742        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
743    fi
744    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
745}
746
747#D-#==================================================
748#D-function IGCM_sys_Get_Dir
749#D-* Purpose: Copy a complete directory from $(ARCHIVE)
750#D-* Examples:
751#D-
752function IGCM_sys_Get_Dir {
753    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
754    if ( $DEBUG_sys ) ; then
755        echo "IGCM_sys_Get_Dir :" $@
756    fi
757    if [ $DRYRUN = 0 ]; then
758        if [ ! -d ${1} ] ; then
759            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
760            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
761            return
762        fi
763
764        typeset RET
765
766        # Only if we use rsync
767        #IGCM_sys_TestDirArchive $( dirname $2 )
768        #
769        #USUAL WAY
770        \cp -r $1 $2 > out_rsync 2>&1
771        RET=$?
772
773        if [ ${RET} -gt 0 ] ; then
774            echo "IGCM_sys_Get_Dir : error."
775            cat out_rsync
776            IGCM_debug_Exit "IGCM_sys_Get_Dir"
777        fi
778    else
779        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
780    fi
781    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
782}
783
784#D-#==================================================
785#D-function IGCM_sys_Get_Master
786#D-* Purpose: Copy a complete directory from MASTER filesystem
787#D-* Examples:
788#D-
789function IGCM_sys_Get_Master {
790    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
791    if ( $DEBUG_sys ) ; then
792        echo "IGCM_sys_Get_Master :" $@
793    fi
794    if [ $DRYRUN = 0 ]; then
795        if [ ! -d ${1} ] ; then
796            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
797            IGCM_debug_PopStack "IGCM_sys_Get_Master"
798            return
799        fi
800
801        typeset RET
802        sleep 60
803
804        #USUAL WAY
805        \cp -r $1 $2 > out_rsync 2>&1
806        RET=$?
807
808        if [ ${RET} -gt 0 ] ; then
809            echo "IGCM_sys_Get_Master : error."
810            cat out_rsync
811            IGCM_debug_Exit "IGCM_sys_Get_Master"
812        fi
813    else
814        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
815    fi
816    IGCM_debug_PopStack "IGCM_sys_Get_Master"
817}
818
819#D-#==================================================
820#D-function IGCM_sys_Put_Out
821#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
822#D-* Examples:
823#D-
824function IGCM_sys_Put_Out {
825    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
826    if ( $DEBUG_sys ) ; then
827        echo "IGCM_sys_Put_Out :" $@
828    fi
829    if [ $DRYRUN = 0 ]; then
830        if [ ! -f ${1} ] ; then
831            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
832            IGCM_debug_PopStack "IGCM_sys_Put_Out"
833            return 1
834        fi
835        #
836        IGCM_sys_MkdirArchive $( dirname $2 )
837        #
838        typeset RET
839        #
840        if [ X${JobType} = XRUN ] ; then
841            IGCM_sys_Chmod 444 ${1}
842        fi
843        #
844        # USUAL WAY
845        putfer $1 $2 > out_rsync 2>&1
846        RET=$?
847
848#       #RSYNC WITH NETWORK RSH CALL
849#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
850#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
851
852#       #RSYNC WITH NFS USE
853#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
854#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
855
856#       RET=$?
857#       IGCM_sys_Rsync_out $RET
858
859#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
860#       (( RET=RET+$? ))
861
862        if [ ${RET} -gt 0 ] ; then
863            echo "IGCM_sys_Put_Out : error."
864            cat out_rsync
865            IGCM_debug_Exit "IGCM_sys_Put_Out"
866        fi
867    else
868        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
869    fi
870    IGCM_debug_PopStack "IGCM_sys_Put_Out"
871    return 0
872}
873
874#D-#==================================================
875#D-function IGCM_sys_Get
876#D-* Purpose: Get a file from ${ARCHIVE}
877#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
878#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
879function IGCM_sys_Get {
880    IGCM_debug_PushStack "IGCM_sys_Get" $@
881
882    typeset DEST RET dm_liste ifile target file_work
883
884    if ( $DEBUG_sys ) ; then
885        echo "IGCM_sys_Get :" $@
886    fi
887    if [ $DRYRUN -le 2 ]; then
888        if [ X${1} = X'/l' ] ; then
889            # test if the first file is present in the old computation :
890            eval set +A dm_liste \${${2}}
891        else
892            eval set +A dm_liste ${1}
893        fi
894        eval DEST=\${${#}}
895
896        #=====================================================
897        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
898        #=====================================================
899
900        # Is it an R_OUT file (not R_IN) ?
901        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
902        #if [ $? -eq 0 ] ; then
903        #    # Yes  ? then we try to get it in SCRATCHDIR
904        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
905        #    if [ -f ${file_work[0]} ] ; then
906        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
907        #       IGCM_debug_PopStack "IGCM_sys_Get"
908        #       return
909        #    fi
910        #fi
911
912        # test if the (first) file is present in the old computation :
913        IGCM_sys_TestFileArchive ${dm_liste[0]}
914        RET=$?
915        if [ ${RET} -gt 0 ] ; then
916            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
917            IGCM_debug_Exit "IGCM_sys_Get"
918            #IGCM_debug_PopStack "IGCM_sys_Get"
919            #return
920        fi
921
922        dmget ${dm_liste[*]} > out_rsync 2>&1
923        RET=$?
924        if [ ${RET} -gt 0 ] ; then
925            echo "WARNING IGCM_sys_Get : demigration error."
926            cat out_rsync
927            #IGCM_debug_Exit "IGCM_sys_Get"
928            #IGCM_debug_PopStack "IGCM_sys_Get"
929            #return
930        fi
931
932        #USUAL WAY
933        (( RET=0 ))
934        if [ X${1} = X'/l' ] ; then
935            (( RET=0 ))
936            for target in ${dm_liste[*]} ; do
937                local_file=$( basename ${target} )
938                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
939                (( RET = RET + $? ))
940            done
941        else
942            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
943            RET=$?
944        fi
945
946#       #RSYNC WITH NETWORK RSH CALL
947#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
948#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
949
950#       #RSYNC WITH NFS USE
951#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
952#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
953
954#       RET=$?
955#       IGCM_sys_Rsync_out $RET
956
957#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
958#       (( RET=RET+$? ))
959
960        if [ ${RET} -gt 0 ] ; then
961            echo "IGCM_sys_Get : copy error."
962            cat out_rsync
963            IGCM_debug_Exit "IGCM_sys_Get"
964        fi
965    else
966        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
967    fi
968    IGCM_debug_PopStack "IGCM_sys_Get"
969}
970
971#D-#==================================================
972#D-function IGCM_sys_Put_Dods
973#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
974#D-* Examples:
975#D-
976function IGCM_sys_Put_Dods {
977    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
978    if ( $DEBUG_sys ) ; then
979        echo "IGCM_sys_Put_Dods :" $@
980    fi
981    if [ $DRYRUN = 0 ]; then
982        if [ ! -d ${R_SAVE}/${1} ] ; then
983            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
984            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
985            return
986        fi
987
988        typeset RET
989        #
990        cd ${R_SAVE}
991        dods_rm public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
992        #/bin/chmod -R u+w  ${R_SAVE}/${1}
993        dods_cp ${1} public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
994        #/bin/chmod -R +rX ${R_SAVE}/${1}
995        #/bin/chmod -R a+rX /dmnfs/cont003/dods/public/${LOGIN}/${config_UserChoices_TagName}
996        #RET=$?
997        RET=0
998       
999        if [ ${RET} -gt 0 ] ; then
1000            echo "IGCM_sys_Put_Dods : error."
1001            IGCM_debug_Exit "IGCM_sys_Put_Dods"
1002        fi
1003    else
1004        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1005    fi
1006    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1007}
1008
1009############################################################## A REVOIR !!
1010
1011#D-#==================================================
1012#D-function IGCM_sys_Rapatrie
1013#D-* Purpose: Rapatrie
1014#D-* Examples:
1015#D-
1016function IGCM_sys_Rapatrie {
1017    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
1018    if ( $DEBUG_sys ) ; then
1019        echo "IGCM_sys_Rapatrie :" $@
1020    fi
1021
1022    typeset RET=0
1023
1024    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
1025    let $(( RET=RET+$? ))
1026    IGCM_sys_Cd $1 ;
1027    let $(( RET=RET+$? ))
1028    IGCM_sys_UnTar $2 ;
1029    let $(( RET=RET+$? ))
1030
1031    if [ ${RET} -gt 0 ] ; then
1032        echo "IGCM_sys_Rapatrie : erreur."
1033        IGCM_debug_Exit "IGCM_sys_Rapatrie"
1034    fi
1035    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
1036}
1037
1038############################################################## A FINIR !!
1039
1040#D-#==================================================
1041#D-function IGCM_sys_GetDate_FichWork
1042#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1043#D-* Examples:
1044#D-
1045function IGCM_sys_GetDate_FichWork {
1046    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1047    if ( $DEBUG_sys ) ; then
1048        echo "IGCM_sys_GetDate_FichWork :" $@
1049    fi
1050    # donne la date filesys d'un fichier sur la machine work
1051    IGCM_debug_PopStack "IGCM_sys_FichWork"
1052}
1053
1054#D-#==================================================
1055#D-function IGCM_sys_GetDate_FichArchive
1056#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1057#D-* Examples:
1058#D-
1059function IGCM_sys_GetDate_FichArchive {
1060    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1061    if ( $DEBUG_sys ) ; then
1062        echo "IGCM_sys_GetDate_FichArchive :" $@
1063    fi
1064    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1065}
1066
1067##############################################################
1068# REBUILD OPERATOR
1069
1070function IGCM_sys_rebuild {
1071    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1072    if ( $DEBUG_sys ) ; then
1073        echo "IGCM_sys_rebuild :" $@
1074    fi
1075    /home/cont003/p86ipsl/CESIUM/bin/rebuild -f -o $@
1076    if [ $? -gt 0 ] ; then
1077       echo "IGCM_sys_rebuild : erreur ${@}."
1078       IGCM_debug_Exit "rebuild"
1079    fi
1080
1081    IGCM_debug_PopStack "IGCM_sys_rebuild"
1082}
1083
1084##############################################################
1085# NCO OPERATOR
1086
1087function IGCM_sys_ncap {
1088    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1089    if ( $DEBUG_sys ) ; then
1090        echo "IGCM_sys_ncap :" $@
1091    fi
1092    ncap $@
1093    if [ $? -gt 0 ] ; then
1094       echo "IGCM_sys_ncap : erreur ${@}."
1095#       IGCM_debug_Exit "ncap"
1096    fi
1097
1098    IGCM_debug_PopStack "IGCM_sys_ncap"
1099}
1100
1101ncatted=ncatted
1102# Problem with ksh and string passed in this function to ncatted !
1103# function IGCM_sys_ncatted {
1104#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1105#     if ( $DEBUG_sys ) ; then
1106#       echo "IGCM_sys_ncatted :" $@
1107#     fi
1108#     ncatted $@
1109#     if [ $? -gt 0 ] ; then
1110#        echo "IGCM_sys_ncatted : erreur ${@}."
1111#        IGCM_debug_Exit "ncatted"
1112#     fi
1113
1114#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1115# }
1116
1117function IGCM_sys_ncbo {
1118    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1119    if ( $DEBUG_sys ) ; then
1120        echo "IGCM_sys_ncbo :" $@
1121    fi
1122    ncbo $@
1123    if [ $? -gt 0 ] ; then
1124       echo "IGCM_sys_ncbo : erreur ${@}."
1125#       IGCM_debug_Exit "ncbo"
1126    fi
1127
1128    IGCM_debug_PopStack "IGCM_sys_ncbo"
1129}
1130
1131function IGCM_sys_ncdiff {
1132    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1133    if ( $DEBUG_sys ) ; then
1134        echo "IGCM_sys_ncdiff :" $@
1135    fi
1136    ncdiff $@
1137    if [ $? -gt 0 ] ; then
1138       echo "IGCM_sys_ncdiff : erreur ${@}."
1139#       IGCM_debug_Exit "ncdiff"
1140    fi
1141
1142    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1143}
1144
1145function IGCM_sys_ncea {
1146    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1147    if ( $DEBUG_sys ) ; then
1148        echo "IGCM_sys_ncea :" $@
1149    fi
1150    ncea $@
1151    if [ $? -gt 0 ] ; then
1152       echo "IGCM_sys_ncea : erreur ${@}."
1153#       IGCM_debug_Exit "ncea"
1154    fi
1155
1156    IGCM_debug_PopStack "IGCM_sys_ncea"
1157}
1158
1159function IGCM_sys_ncecat {
1160    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1161    if ( $DEBUG_sys ) ; then
1162        echo "IGCM_sys_ncecat :" $@
1163    fi
1164    ncecat $@
1165    if [ $? -gt 0 ] ; then
1166       echo "IGCM_sys_ncecat : erreur ${@}."
1167#       IGCM_debug_Exit "ncecat"
1168    fi
1169
1170    IGCM_debug_PopStack "IGCM_sys_ncecat"
1171}
1172
1173function IGCM_sys_ncflint {
1174    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1175    if ( $DEBUG_sys ) ; then
1176        echo "IGCM_sys_ncflint :" $@
1177    fi
1178    ncflint $@
1179    if [ $? -gt 0 ] ; then
1180       echo "IGCM_sys_ncflint : erreur ${@}."
1181#       IGCM_debug_Exit "ncflint"
1182    fi
1183
1184    IGCM_debug_PopStack "IGCM_sys_ncflint"
1185}
1186
1187function IGCM_sys_ncks {
1188    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1189    if ( $DEBUG_sys ) ; then
1190        echo "IGCM_sys_ncks :" $@
1191    fi
1192    ncks $@
1193    if [ $? -gt 0 ] ; then
1194       echo "IGCM_sys_ncks : erreur ${@}."
1195#       IGCM_debug_Exit "ncks"
1196    fi
1197
1198    IGCM_debug_PopStack "IGCM_sys_ncks"
1199}
1200
1201function IGCM_sys_ncpdq {
1202    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1203    if ( $DEBUG_sys ) ; then
1204        echo "IGCM_sys_ncpdq :" $@
1205    fi
1206    ncpdq $@
1207    if [ $? -gt 0 ] ; then
1208       echo "IGCM_sys_ncpdq : erreur ${@}."
1209#       IGCM_debug_Exit "ncpdq"
1210    fi
1211
1212    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1213}
1214
1215function IGCM_sys_ncra {
1216    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1217    if ( $DEBUG_sys ) ; then
1218        echo "IGCM_sys_ncra :" $@
1219    fi
1220    ncra $@
1221    if [ $? -gt 0 ] ; then
1222       echo "IGCM_sys_ncra : erreur ${@}."
1223#       IGCM_debug_Exit "ncra"
1224    fi
1225
1226    IGCM_debug_PopStack "IGCM_sys_ncra"
1227}
1228
1229function IGCM_sys_ncrcat {
1230    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1231    if ( $DEBUG_sys ) ; then
1232        echo "IGCM_sys_ncrcat :" $@
1233    fi
1234    ncrcat $@
1235    if [ $? -gt 0 ] ; then
1236       echo "IGCM_sys_ncrcat : erreur ${@}."
1237#       IGCM_debug_Exit "ncrcat"
1238    fi
1239
1240    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1241}
1242
1243function IGCM_sys_ncrename {
1244    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1245    if ( $DEBUG_sys ) ; then
1246        echo "IGCM_sys_ncrename :" $@
1247    fi
1248    ncrename $@
1249    if [ $? -gt 0 ] ; then
1250       echo "IGCM_sys_ncrename : erreur ${@}."
1251#       IGCM_debug_Exit "ncrename"
1252    fi
1253
1254    IGCM_debug_PopStack "IGCM_sys_ncrename"
1255}
1256
1257function IGCM_sys_ncwa {
1258    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1259    if ( $DEBUG_sys ) ; then
1260        echo "IGCM_sys_ncwa :" $@
1261    fi
1262    ncwa $@
1263    if [ $? -gt 0 ] ; then
1264       echo "IGCM_sys_ncwa : erreur ${@}."
1265#       IGCM_debug_Exit "ncwa"
1266    fi
1267
1268    IGCM_debug_PopStack "IGCM_sys_ncwa"
1269}
1270
1271############################################################
1272# Activate Running Environnment Variables
1273
1274function IGCM_sys_activ_variables {
1275    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1276    if ( $DEBUG_sys ) ; then
1277        echo "IGCM_sys_activ_variables"
1278    fi
1279    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1280}
1281
1282############################################################
1283# Desactivate Running Environnment Variables
1284
1285function IGCM_sys_desactiv_variables {
1286    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1287    if ( $DEBUG_sys ) ; then
1288        echo "IGCM_sys_desactiv_variables"
1289    fi
1290    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1291}
1292
1293############################################################
1294# Build run file
1295
1296function IGCM_sys_build_run_file {
1297    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1298    if ( $DEBUG_sys ) ; then
1299        echo "IGCM_sys_build_run_file"
1300    fi
1301    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1302}
Note: See TracBrowser for help on using the repository browser.