source: CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/DRIVER/xios.driver @ 2316

Last change on this file since 2316 was 2315, checked in by sdipsl, 10 years ago

Stack was corrupted. Fix needed for bigbrother

File size: 1.5 KB
Line 
1#!/bin/ksh
2
3function XIOS_sed_xml
4{
5# Usage : XIOS_sed_xml xml_file attribute value
6#         In file xml_file modify at the line containing id="attribute" the attribute value ">value<"
7    IGCM_debug_PushStack "XIOS_sed_xml"
8    # Test if the fichier exist
9    if [ ! -f ${1} ] ; then
10        echo "WARNING : ${1} file does not exist. Following will not be done : XIOS_sed_xml : ${1} ${2} ${3}"
11        IGCM_debug_PopStack "XIOS_sed_xml"
12        return
13    fi
14    sed -e "s/\(<[^\"]*\"${2}\".*>\)\([^<]*\)\(<[^>]*\)/\1${3}\3/" ${1} > ${1}.tmp
15    RET=$?
16    echo "XIOS_sed_xml" : ${1} ${2} ${3}
17    \mv ${1}.tmp ${1}
18    IGCM_debug_PopStack "XIOS_sed_xml"
19    return $RET
20}
21
22#-----------------------------------
23function IOS_Initialize
24{ 
25    IGCM_debug_PushStack "IOS_Initialize"
26
27    echo INITIALIZE IOS !!!
28
29    IGCM_debug_PopStack "IOS_Initialize"
30}
31
32#-----------------------------------
33function IOS_Update
34{
35    IGCM_debug_PushStack "IOS_Update"
36
37    echo UPDATE IOS !!!
38# Activate server mode
39    XIOS_sed_xml iodef.xml using_server true
40# If lmdz_UserChoices_XIOS=y add LMDZ as component id :
41    if [ X${lmdz_UserChoices_XIOS}  = Xy ] ; then
42        XIOS_sed_xml iodef.xml oasis_codes_id LMDZ,oceanx
43    fi
44    if [ -f namcouple ] ; then
45        sed -e "s/2  LMDZ oceanx/3 LMDZ oceanx ${config_Executable_IOS[1]}/" namcouple > namcouple.tmp
46        IGCM_sys_Mv namcouple.tmp namcouple
47    fi
48
49    IGCM_debug_PopStack "IOS_Update"
50}
51
52#-----------------------------------
53function IOS_Finalize
54{
55    IGCM_debug_PushStack "IOS_Finalize"
56
57    echo FINALIZE IOS !!!
58
59    IGCM_debug_PopStack "IOS_Finalize"
60}
Note: See TracBrowser for help on using the repository browser.