source: CONFIG/UNIFORM/v6/LMDZORINCA_v6/GENERAL/DRIVER/inca.driver @ 2370

Last change on this file since 2370 was 2370, checked in by acosce, 7 years ago

Add xios in inca.def and inca.driver

File size: 3.5 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour INCA
4#-----------------------------------------------------------------
5function INCA_sed_replace
6{
7    IGCM_debug_PushStack "INCA_sed_replace"
8
9    sed -e "s/${2}/${3}/" ${1} > ${1}.tmp
10    RET=$?
11    echo "INCA_sed : ${1} ${2} ${3}"
12    \mv ${1}.tmp ${1}
13
14    IGCM_debug_PopStack "INCA_sed_replace"
15    return $RET
16}
17#-----------------------------------------------------------------
18function CHM_Initialize
19{
20    IGCM_debug_PushStack "CHM_Initialize"
21
22    RESOL_CHM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-FD" '{print $2}')
23
24    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19
25    RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}')
26    echo 'resol chimie', $RESOL_CHM
27
28    [ -f ${SUBMIT_DIR}/../.chimie ] && eval $(grep CHEM ${SUBMIT_DIR}/../.chimie) 
29    INCA_sed_replace ${SUBMIT_DIR}/config.card \${CHEM} ${CHEM}
30    echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName}
31
32    IGCM_debug_PopStack "CHM_Initialize"
33}
34
35#-----------------------------------------------------------------
36function CHM_Update
37{
38    IGCM_debug_PushStack "CHM_Update"
39
40    case ${CHEM} in
41        AER)
42        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
43        ;;
44        NMHC) 
45        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
46        ;;
47        NMHC_AER)
48        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
49        ;;
50        CH4)
51        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
52        ;;
53        CH4_AER)
54        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
55        ;;
56        GES)
57        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
58        esac
59
60    # inca.def : Activate reading of 10m wind in files if climatological=n in inca.card
61    if [ ! X${inca_UserChoices_climatological} = X ] ; then
62        IGCM_comp_modifyDefFile blocker inca.def climatological  ${inca_UserChoices_climatological}
63    else
64        IGCM_comp_modifyDefFile blocker inca.def climatological  n
65    fi
66
67    # inca.def : choose write frequency for inca_avgr in inca.card
68    if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then
69        IGCM_comp_modifyDefFile blocker inca.def freq_write_chem  ${inca_UserChoices_freq_write_chem}
70    else
71        IGCM_comp_modifyDefFile blocker inca.def  freq_write_chem  86400
72    fi
73
74    #inca.def : choose aerosol effect with feedback variable
75    if [ ! X${inca_UserChoices_feedb} = X ] ; then
76        IGCM_comp_modifyDefFile blocker inca.def  feedb  ${inca_UserChoices_feedb}
77    else
78        IGCM_comp_modifyDefFile blocker inca.def feedb  0
79    fi
80   
81    #inca.def : choose aerosol effect with feedback variable
82    if [  X${inca_UserChoices_XIOS} = Xy ] ; then
83        IGCM_comp_modifyDefFile blocker inca.def  XIOS_INCA_OK  y
84    else
85        IGCM_comp_modifyDefFile blocker inca.def  XIOS_INCA_OK n
86    fi
87
88
89    if [ X${inca_UserChoices_XIOS}  = Xy ] ; then
90    # Add include of INCA context in iodef.xml
91    # In iodef.xml add on next line after "COMPONENT CONTEXT"
92    #  <context id="inca" src="./context_inca.xml"/>
93        echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp
94        cp iodef.xml iodef.xml.tmp
95        sed -e "/COMPONENT CONTEXT/r add.tmp" \
96            iodef.xml.tmp > iodef.xml
97        rm iodef.xml.tmp add.tmp
98    fi
99
100    IGCM_debug_PopStack "CHM_Update"
101}
102
103#-----------------------------------------------------------------
104function CHM_Finalize
105{
106    IGCM_debug_PushStack "CHM_Finalize"
107
108    echo FINALIZE CHM !!!
109#
110#    IGCM_sys_Mkdir ${R_OUT_EXE}
111#    cd ${MODIPSL}
112#    tar cf src_${config_UserChoices_JobName}.tar  modeles
113#    IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/.
114#    cd -
115#
116
117    IGCM_debug_PopStack "CHM_Finalize"
118}
Note: See TracBrowser for help on using the repository browser.