source: tags/libIGCM_v1_4/libIGCM_sys/libIGCM_sys_cesium.ksh @ 860

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

Bugfix with backward compatibility of create_ts (2D,3D,Chunck). It worked but a shell error without any affect was printed. (MAF,MM)
Some adjustment with cesium libIGCM_sys

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