source: branches/libIGCM_MPI_OpenMP/libIGCM_sys/libIGCM_sys_ulam.ksh @ 571

Last change on this file since 571 was 571, checked in by mafoipsl, 12 years ago

First try to merge libIGCM_MPI_OpenMP branch with libIGCM trunk revision 569. Tested on vargas with PackFrequency?=NONE included into config.card.

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