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

Last change on this file since 2442 was 2442, checked in by acosce, 10 years ago

Add DUST configuration in compilation and driver

File size: 3.8 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        DUST)
45        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
46        ;;
47        NMHC) 
48        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
49        ;;
50        NMHC_AER)
51        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
52        ;;
53        CH4)
54        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
55        ;;
56        CH4_AER)
57        IGCM_comp_modifyDefFile nonblocker run.def config_inca aero
58        ;;
59        GES)
60        IGCM_comp_modifyDefFile nonblocker run.def config_inca chem
61        esac
62
63    # inca.def : Activate reading of 10m wind in files if climatological=n in inca.card
64    if [ ! X${inca_UserChoices_climatological} = X ] ; then
65        IGCM_comp_modifyDefFile nonblocker inca.def climatological  ${inca_UserChoices_climatological}
66    else
67        IGCM_comp_modifyDefFile nonblocker inca.def climatological  n
68    fi
69
70    # inca.def : choose write frequency for inca_avgr in inca.card
71    if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then
72        IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem  ${inca_UserChoices_freq_write_chem}
73    else
74        IGCM_comp_modifyDefFile nonblocker inca.def  freq_write_chem  86400
75    fi
76
77    #inca.def : choose aerosol effect with feedback variable
78    if [ ! X${inca_UserChoices_feedb} = X ] ; then
79        IGCM_comp_modifyDefFile nonblocker inca.def  feedb  ${inca_UserChoices_feedb}
80    else
81        IGCM_comp_modifyDefFile nonblocker inca.def feedb  0
82    fi
83   
84    #inca.def : choose output library
85    if [  X${inca_UserChoices_XIOS} = Xy ] ; then
86        IGCM_comp_modifyDefFile nonblocker inca.def  XIOS_INCA_OK  y
87    else
88        IGCM_comp_modifyDefFile nonblocker inca.def  XIOS_INCA_OK n
89    fi
90
91    if [  X${inca_UserChoices_IOIPSL} = Xy ] ; then
92        IGCM_comp_modifyDefFile nonblocker inca.def  IOIPSL_INCA_OK  y
93    else
94        IGCM_comp_modifyDefFile nonblocker inca.def  IOIPSL_INCA_OK n
95    fi
96
97
98    if [ X${inca_UserChoices_XIOS}  = Xy ] ; then
99    # Add include of INCA context in iodef.xml
100    # In iodef.xml add on next line after "COMPONENT CONTEXT"
101    #  <context id="inca" src="./context_inca.xml"/>
102        echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp
103        cp iodef.xml iodef.xml.tmp
104        sed -e "/COMPONENT CONTEXT/r add.tmp" \
105            iodef.xml.tmp > iodef.xml
106        rm iodef.xml.tmp add.tmp
107    fi
108
109    IGCM_debug_PopStack "CHM_Update"
110}
111
112#-----------------------------------------------------------------
113function CHM_Finalize
114{
115    IGCM_debug_PushStack "CHM_Finalize"
116
117    echo FINALIZE CHM !!!
118#
119#    IGCM_sys_Mkdir ${R_OUT_EXE}
120#    cd ${MODIPSL}
121#    tar cf src_${config_UserChoices_JobName}.tar  modeles
122#    IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/.
123#    cd -
124#
125
126    IGCM_debug_PopStack "CHM_Finalize"
127}
Note: See TracBrowser for help on using the repository browser.