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

Last change on this file since 2478 was 2478, checked in by acosce, 6 years ago

cut-copy from IPSCLM6CHT to be ok for diff_configuration (one empty line difference)

File size: 4.0 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_wind_method} = X ] ; then
99    IGCM_comp_modifyDefFile nonblocker inca.def  wind_method  threshold
100    else
101    IGCM_comp_modifyDefFile nonblocker inca.def  wind_method ${inca_UserChoices_wind_method}
102    fi
103
104
105
106    if [ X${inca_UserChoices_XIOS}  = Xy ] ; then
107    # Add include of INCA context in iodef.xml
108    # In iodef.xml add on next line after "COMPONENT CONTEXT"
109    #  <context id="inca" src="./context_inca.xml"/>
110        echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp
111        cp iodef.xml iodef.xml.tmp
112        sed -e "/COMPONENT CONTEXT/r add.tmp" \
113            iodef.xml.tmp > iodef.xml
114        rm iodef.xml.tmp add.tmp
115    fi
116
117    IGCM_debug_PopStack "CHM_Update"
118}
119
120#-----------------------------------------------------------------
121function CHM_Finalize
122{
123    IGCM_debug_PushStack "CHM_Finalize"
124
125    echo FINALIZE CHM !!!
126#
127#    IGCM_sys_Mkdir ${R_OUT_EXE}
128#    cd ${MODIPSL}
129#    tar cf src_${config_UserChoices_JobName}.tar  modeles
130#    IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/.
131#    cd -
132#
133
134    IGCM_debug_PopStack "CHM_Finalize"
135}
Note: See TracBrowser for help on using the repository browser.