1 | #!/bin/ksh |
---|
2 | |
---|
3 | #D- Driver du script pour INCA |
---|
4 | #----------------------------------------------------------------- |
---|
5 | function 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 | #----------------------------------------------------------------- |
---|
18 | function CHM_Initialize |
---|
19 | { |
---|
20 | IGCM_debug_PushStack "CHM_Initialize" |
---|
21 | |
---|
22 | if [ X$ResolAtm != X ] ; then |
---|
23 | # ResolAtm is set in config.card |
---|
24 | RESOL_ATM_3D=${ResolAtm} |
---|
25 | RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' ) |
---|
26 | RESOL_ATM_X=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $1}' ) |
---|
27 | RESOL_ATM_Y=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $2}' ) |
---|
28 | |
---|
29 | RESOL_CHM=${RESOL_ATM_X}${RESOL_ATM_Y}-L${RESOL_ATM_Z} |
---|
30 | elif [ -f ${SUBMIT_DIR}/../.resol ] ; then |
---|
31 | [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19 |
---|
32 | RESOL_CHM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}') |
---|
33 | else |
---|
34 | IGCM_debug_Exit "ResolAtm is not set in config.card and the .resol file does not exist." |
---|
35 | IGCM_debug_Verif_Exit |
---|
36 | fi |
---|
37 | |
---|
38 | echo 'resol chimie', $RESOL_CHM |
---|
39 | CHEM=${ConfChem} |
---|
40 | echo "INCA Tag : LMDZ-INCA" ${config_UserChoices_TagName} |
---|
41 | |
---|
42 | ##- LMDZ physics version |
---|
43 | ## Read LMDZ_Physics option in lmdz.card, if not present take default value AP (old physics) |
---|
44 | if [ ! X${lmdz_UserChoices_LMDZ_Physics} = X ] ; then |
---|
45 | LMDZ_Physics=${lmdz_UserChoices_LMDZ_Physics} |
---|
46 | else |
---|
47 | LMDZ_Physics=AP |
---|
48 | fi |
---|
49 | echo LMDZ physics version : ${LMDZ_Physics} |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | IGCM_debug_PopStack "CHM_Initialize" |
---|
55 | } |
---|
56 | |
---|
57 | #----------------------------------------------------------------- |
---|
58 | function CHM_Update |
---|
59 | { |
---|
60 | IGCM_debug_PushStack "CHM_Update" |
---|
61 | |
---|
62 | if [ X${inca_UserChoices_output_frequency_chem} = X ] || [ X${inca_UserChoices_output_frequency_chem} = XNONE ] ; then |
---|
63 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled FALSE |
---|
64 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
65 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq 1d |
---|
66 | |
---|
67 | else |
---|
68 | if [ X${inca_UserChoices_output_frequency_chem} = X1d ] || [ X${inca_UserChoices_output_frequency_chem} = X1mo ] ; then |
---|
69 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
70 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca${inca_UserChoices_output_frequency_chem}_chem |
---|
71 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
72 | else |
---|
73 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry enabled TRUE |
---|
74 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry name inca1d_chem |
---|
75 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml chemistry output_freq ${inca_UserChoices_output_frequency_chem} |
---|
76 | |
---|
77 | fi |
---|
78 | fi |
---|
79 | |
---|
80 | if [ X${inca_UserChoices_output_frequency_emi} = X ] || [ X${inca_UserChoices_output_frequency_emi} = XNONE ] ; then |
---|
81 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled FALSE |
---|
82 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
83 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq 1d |
---|
84 | |
---|
85 | else |
---|
86 | if [ X${inca_UserChoices_output_frequency_emi} = X1d ] || [ X${inca_UserChoices_output_frequency_emi} = X1mo ] ; then |
---|
87 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
88 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca${inca_UserChoices_output_frequency_emi}_emi |
---|
89 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
90 | else |
---|
91 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions enabled TRUE |
---|
92 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions name inca1d_emi |
---|
93 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml emissions output_freq ${inca_UserChoices_output_frequency_emi} |
---|
94 | fi |
---|
95 | fi |
---|
96 | |
---|
97 | |
---|
98 | if [ X${inca_UserChoices_output_frequency_species} = X ] || [ X${inca_UserChoices_output_frequency_species} = XNONE ] ; then |
---|
99 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled FALSE |
---|
100 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
101 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq 1d |
---|
102 | |
---|
103 | else |
---|
104 | if [ X${inca_UserChoices_output_frequency_species} = X1d ] || [ X${inca_UserChoices_output_frequency_species} = X1mo ] ; then |
---|
105 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
106 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca${inca_UserChoices_output_frequency_species}_species |
---|
107 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
108 | else |
---|
109 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species enabled TRUE |
---|
110 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species name inca1d_species |
---|
111 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml species output_freq ${inca_UserChoices_output_frequency_species} |
---|
112 | fi |
---|
113 | fi |
---|
114 | |
---|
115 | |
---|
116 | if [ X${inca_UserChoices_output_frequency_forcage} = X ] || [ X${inca_UserChoices_output_frequency_forcage} = XNONE ] ; then |
---|
117 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled FALSE |
---|
118 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
119 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq 1d |
---|
120 | |
---|
121 | else |
---|
122 | if [ X${inca_UserChoices_output_frequency_forcage} = X1d ] || [ X${inca_UserChoices_output_frequency_forcage} = X1mo ] ; then |
---|
123 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
124 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca${inca_UserChoices_output_frequency_forcage}_forcage |
---|
125 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
126 | else |
---|
127 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage enabled TRUE |
---|
128 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage name inca1d_forcage |
---|
129 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml forcage output_freq ${inca_UserChoices_output_frequency_forcage} |
---|
130 | fi |
---|
131 | fi |
---|
132 | |
---|
133 | |
---|
134 | if [ X${inca_UserChoices_output_frequency_aero} = X ] || [ X${inca_UserChoices_output_frequency_aero} = XNONE ] ; then |
---|
135 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled FALSE |
---|
136 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
137 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq 1d |
---|
138 | |
---|
139 | else |
---|
140 | if [ X${inca_UserChoices_output_frequency_aero} = X1d ] || [ X${inca_UserChoices_output_frequency_aero} = X1mo ] ; then |
---|
141 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
142 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca${inca_UserChoices_output_frequency_aero}_aero |
---|
143 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
144 | else |
---|
145 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero enabled TRUE |
---|
146 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero name inca1d_aero |
---|
147 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero output_freq ${inca_UserChoices_output_frequency_aero} |
---|
148 | fi |
---|
149 | fi |
---|
150 | |
---|
151 | |
---|
152 | if [ X${inca_UserChoices_output_frequency_dep} = X ] || [ X${inca_UserChoices_output_frequency_dep} = XNONE ] ; then |
---|
153 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled FALSE |
---|
154 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
155 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq 1d |
---|
156 | |
---|
157 | else |
---|
158 | if [ X${inca_UserChoices_output_frequency_dep} = X1d ] || [ X${inca_UserChoices_output_frequency_dep} = X1mo ] ; then |
---|
159 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
160 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca${inca_UserChoices_output_frequency_dep}_dep |
---|
161 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
162 | else |
---|
163 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel enabled TRUE |
---|
164 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel name inca1d_dep |
---|
165 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml dvel output_freq ${inca_UserChoices_output_frequency_dep} |
---|
166 | fi |
---|
167 | fi |
---|
168 | |
---|
169 | if [ X${inca_UserChoices_output_frequency_washrate} = X ] || [ X${inca_UserChoices_output_frequency_washrate} = XNONE ] ; then |
---|
170 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled FALSE |
---|
171 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
172 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq 1d |
---|
173 | |
---|
174 | else |
---|
175 | if [ X${inca_UserChoices_output_frequency_washrate} = X1d ] || [ X${inca_UserChoices_output_frequency_washrate} = X1mo ] ; then |
---|
176 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
177 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca${inca_UserChoices_output_frequency_washrate}_washrate |
---|
178 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
179 | else |
---|
180 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout enabled TRUE |
---|
181 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout name inca1d_washrate |
---|
182 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml washout output_freq ${inca_UserChoices_output_frequency_washrate} |
---|
183 | fi |
---|
184 | fi |
---|
185 | |
---|
186 | if [ X${inca_UserChoices_output_frequency_veget} = X ] || [ X${inca_UserChoices_output_frequency_veget} = XNONE ] ; then |
---|
187 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled FALSE |
---|
188 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
189 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq 1d |
---|
190 | |
---|
191 | else |
---|
192 | if [ X${inca_UserChoices_output_frequency_veget} = X1d ] || [ X${inca_UserChoices_output_frequency_veget} = X1mo ] ; then |
---|
193 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
194 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca${inca_UserChoices_output_frequency_veget}_veget |
---|
195 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
196 | else |
---|
197 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation enabled TRUE |
---|
198 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation name inca1d_veget |
---|
199 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml vegetation output_freq ${inca_UserChoices_output_frequency_veget} |
---|
200 | fi |
---|
201 | fi |
---|
202 | |
---|
203 | |
---|
204 | if [ X${inca_UserChoices_output_frequency_reacflux} = X ] || [ X${inca_UserChoices_output_frequency_reacflux} = XNONE ] ; then |
---|
205 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled FALSE |
---|
206 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
207 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq 1d |
---|
208 | |
---|
209 | else |
---|
210 | if [ X${inca_UserChoices_output_frequency_reacflux} = X1d ] || [ X${inca_UserChoices_output_frequency_reacflux} = X1mo ] ; then |
---|
211 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
212 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca${inca_UserChoices_output_frequency_reacflux}_reacflux |
---|
213 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
214 | else |
---|
215 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux enabled TRUE |
---|
216 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux name inca1d_reacflux |
---|
217 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml reacflux output_freq ${inca_UserChoices_output_frequency_reacflux} |
---|
218 | fi |
---|
219 | fi |
---|
220 | |
---|
221 | |
---|
222 | if [ X${inca_UserChoices_output_frequency_phtrate} = X ] || [ X${inca_UserChoices_output_frequency_phtrate} = XNONE ] ; then |
---|
223 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled FALSE |
---|
224 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
225 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq 1d |
---|
226 | |
---|
227 | else |
---|
228 | if [ X${inca_UserChoices_output_frequency_phtrate} = X1d ] || [ X${inca_UserChoices_output_frequency_phtrate} = X1mo ] ; then |
---|
229 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
230 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca${inca_UserChoices_output_frequency_phtrate}_phtrate |
---|
231 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
232 | else |
---|
233 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate enabled TRUE |
---|
234 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate name inca1d_phtrate |
---|
235 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml phtrate output_freq ${inca_UserChoices_output_frequency_phtrate} |
---|
236 | fi |
---|
237 | fi |
---|
238 | |
---|
239 | if [ X${inca_UserChoices_output_frequency_ges} = X ] || [ X${inca_UserChoices_output_frequency_ges} = XNONE ] ; then |
---|
240 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled FALSE |
---|
241 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
242 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq 1d |
---|
243 | |
---|
244 | else |
---|
245 | if [ X${inca_UserChoices_output_frequency_ges} = X1d ] || [ X${inca_UserChoices_output_frequency_ges} = X1mo ] ; then |
---|
246 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
247 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca${inca_UserChoices_output_frequency_ges}_ges |
---|
248 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
249 | else |
---|
250 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges enabled TRUE |
---|
251 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges name inca1d_ges |
---|
252 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml ges output_freq ${inca_UserChoices_output_frequency_ges} |
---|
253 | fi |
---|
254 | fi |
---|
255 | |
---|
256 | if [ X${inca_UserChoices_output_frequency_invariants} = X ] || [ X${inca_UserChoices_output_frequency_invariants} = XNONE ] ; then |
---|
257 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled FALSE |
---|
258 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
259 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq 1d |
---|
260 | |
---|
261 | else |
---|
262 | if [ X${inca_UserChoices_output_frequency_invariants} = X1d ] || [ X${inca_UserChoices_output_frequency_invariants} = X1mo ] ; then |
---|
263 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
264 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca${inca_UserChoices_output_frequency_invariants}_invariants |
---|
265 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
266 | else |
---|
267 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants enabled TRUE |
---|
268 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants name inca1d_invariants |
---|
269 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml invariants output_freq ${inca_UserChoices_output_frequency_invariants} |
---|
270 | fi |
---|
271 | fi |
---|
272 | |
---|
273 | if [ X${inca_UserChoices_output_frequency_aero_chem} = X ] || [ X${inca_UserChoices_output_frequency_aero_chem} = XNONE ] ; then |
---|
274 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled FALSE |
---|
275 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1d_aero_chem |
---|
276 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq 1d |
---|
277 | |
---|
278 | else |
---|
279 | if [ X${inca_UserChoices_output_frequency_aero_chem} = X1d ] || [ X${inca_UserChoices_output_frequency_aero_chem} = X1mo ] || [ X${inca_UserChoices_output_frequency_aero_chem} = X1ts ] ; then |
---|
280 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
281 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca${inca_UserChoices_output_frequency_aero_chem}_aero_chem |
---|
282 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
283 | else |
---|
284 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem enabled TRUE |
---|
285 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem name inca1ts_aero_chem |
---|
286 | IGCM_comp_modifyXmlFile nonblocker file_def_inca.xml aero_chem output_freq ${inca_UserChoices_output_frequency_aero_chem} |
---|
287 | fi |
---|
288 | fi |
---|
289 | |
---|
290 | case ${CHEM} in |
---|
291 | AER) |
---|
292 | |
---|
293 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
294 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
295 | else |
---|
296 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
297 | fi |
---|
298 | ;; |
---|
299 | DUSS) |
---|
300 | |
---|
301 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
302 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
303 | else |
---|
304 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
305 | fi |
---|
306 | ;; |
---|
307 | NMHC) |
---|
308 | |
---|
309 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
310 | ;; |
---|
311 | NMHC_AER) |
---|
312 | |
---|
313 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
314 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
315 | else |
---|
316 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
317 | fi |
---|
318 | ;; |
---|
319 | |
---|
320 | NMHC_AER_S) |
---|
321 | |
---|
322 | if [ X${LMDZ_Physics} = X"AP" ] ; then |
---|
323 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aero |
---|
324 | else |
---|
325 | IGCM_comp_modifyDefFile nonblocker run.def config_inca aeNP |
---|
326 | fi |
---|
327 | ;; |
---|
328 | GES) |
---|
329 | |
---|
330 | IGCM_comp_modifyDefFile nonblocker run.def config_inca chem |
---|
331 | esac |
---|
332 | |
---|
333 | |
---|
334 | # inca.def : Activate reading of 10m wind in files if LMDZ_10m_winds=n in inca.card |
---|
335 | if [ ! X${inca_UserChoices_LMDZ_10m_winds} = X ] ; then |
---|
336 | IGCM_comp_modifyDefFile nonblocker inca.def LMDZ_10m_winds ${inca_UserChoices_LMDZ_10m_winds} |
---|
337 | else |
---|
338 | IGCM_comp_modifyDefFile nonblocker inca.def LMDZ_10m_winds n |
---|
339 | fi |
---|
340 | |
---|
341 | |
---|
342 | if [ ! X${inca_UserChoices_wind_parameter} = X ] ; then |
---|
343 | IGCM_comp_modifyDefFile nonblocker inca.def tref ${inca_UserChoices_wind_parameter} |
---|
344 | else |
---|
345 | IGCM_comp_modifyDefFile nonblocker inca.def tref DEFAULT |
---|
346 | fi |
---|
347 | |
---|
348 | if [ X${inca_UserChoices_seasalt_corr} = X ] ; then |
---|
349 | IGCM_comp_modifyDefFile nonblocker inca.def ss_corr DEFAULT |
---|
350 | else |
---|
351 | IGCM_comp_modifyDefFile nonblocker inca.def ss_corr ${inca_UserChoices_seasalt_corr} |
---|
352 | fi |
---|
353 | |
---|
354 | |
---|
355 | |
---|
356 | # inca.def : choose write frequency for inca_avgr in inca.card |
---|
357 | if [ ! X${inca_UserChoices_freq_write_chem} = X ] ; then |
---|
358 | IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem ${inca_UserChoices_freq_write_chem} |
---|
359 | else |
---|
360 | IGCM_comp_modifyDefFile nonblocker inca.def freq_write_chem 86400 |
---|
361 | fi |
---|
362 | |
---|
363 | #inca.def : choose aerosol effect with feedback variable |
---|
364 | if [ ! X${inca_UserChoices_feedb} = X ] ; then |
---|
365 | IGCM_comp_modifyDefFile nonblocker inca.def feedb ${inca_UserChoices_feedb} |
---|
366 | else |
---|
367 | IGCM_comp_modifyDefFile nonblocker inca.def feedb 0 |
---|
368 | fi |
---|
369 | |
---|
370 | #inca.def : choose coupled model with orchidee |
---|
371 | if [ ! X${inca_UserChoices_CoupOrchInca} = X ]; then |
---|
372 | IGCM_comp_modifyDefFile nonblocker inca.def CoupOrchInca ${inca_UserChoices_CoupOrchInca} |
---|
373 | else |
---|
374 | IGCM_comp_modifyDefFile nonblocker inca.def CoupOrchInca n |
---|
375 | fi |
---|
376 | |
---|
377 | #inca.def : choose sedimentation schema |
---|
378 | if [ ! X${inca_UserChoices_multilayer_sedim} = X ]; then |
---|
379 | IGCM_comp_modifyDefFile nonblocker inca.def multilayer_sediment ${inca_UserChoices_multilayer_sedim} |
---|
380 | else |
---|
381 | IGCM_comp_modifyDefFile nonblocker inca.def multilayer_sediment y |
---|
382 | fi |
---|
383 | |
---|
384 | #inca.def : choose calcul interactif des diagnostiques flux chimique ou non |
---|
385 | if [ ! X${inca_UserChoices_calcul_flux} = X ]; then |
---|
386 | IGCM_comp_modifyDefFile nonblocker inca.def calcul_flux ${inca_UserChoices_calcul_flux} |
---|
387 | else |
---|
388 | IGCM_comp_modifyDefFile nonblocker inca.def calcul_flux n |
---|
389 | fi |
---|
390 | |
---|
391 | #inca.def : choose aircraft emission |
---|
392 | if [ ! X${inca_UserChoices_flag_plane} = X ]; then |
---|
393 | IGCM_comp_modifyDefFile nonblocker inca.def flag_plane ${inca_UserChoices_flag_plane} |
---|
394 | else |
---|
395 | IGCM_comp_modifyDefFile nonblocker inca.def flag_plane 0 |
---|
396 | fi |
---|
397 | |
---|
398 | #inca.def : choose time interpolation for sflx.nc |
---|
399 | if [ ! X${inca_UserChoices_emi_interp_time} = X ]; then |
---|
400 | IGCM_comp_modifyDefFile nonblocker inca.def emi_interp_time ${inca_UserChoices_emi_interp_time} |
---|
401 | else |
---|
402 | IGCM_comp_modifyDefFile nonblocker inca.def emi_interp_time 1 |
---|
403 | fi |
---|
404 | |
---|
405 | |
---|
406 | |
---|
407 | #inca.def : choose which xml will be use (with group or no = cmip files) |
---|
408 | if [ X${inca_UserChoices_cmip_xml} = Xy ] ; then |
---|
409 | |
---|
410 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml y |
---|
411 | else |
---|
412 | IGCM_comp_modifyDefFile nonblocker inca.def cmip_xml n |
---|
413 | fi |
---|
414 | |
---|
415 | |
---|
416 | |
---|
417 | # Add include of INCA context in iodef.xml |
---|
418 | # In iodef.xml add on next line after "COMPONENT CONTEXT" |
---|
419 | # <context id="inca" src="./context_inca.xml"/> |
---|
420 | echo '<context id="inca" src="./context_inca.xml"/>' > add.tmp |
---|
421 | cp iodef.xml iodef.xml.tmp |
---|
422 | sed -e "/COMPONENT CONTEXT/r add.tmp" \ |
---|
423 | iodef.xml.tmp > iodef.xml |
---|
424 | rm iodef.xml.tmp add.tmp |
---|
425 | |
---|
426 | |
---|
427 | # Add LongName as global attribute in XIOS output files (if LongName is not empty) |
---|
428 | if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then |
---|
429 | listfile=$(ls file_def*inca.xml) |
---|
430 | echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp |
---|
431 | for file in ${listfile} |
---|
432 | do |
---|
433 | cp ${file} ${file}.tmp |
---|
434 | sed -e "/<file id/r add.tmp" \ |
---|
435 | ${file}.tmp > ${file} |
---|
436 | rm ${file}.tmp |
---|
437 | done |
---|
438 | rm add.tmp |
---|
439 | fi |
---|
440 | |
---|
441 | IGCM_debug_PopStack "CHM_Update" |
---|
442 | } |
---|
443 | |
---|
444 | #----------------------------------------------------------------- |
---|
445 | function CHM_Finalize |
---|
446 | { |
---|
447 | IGCM_debug_PushStack "CHM_Finalize" |
---|
448 | |
---|
449 | echo FINALIZE CHM !!! |
---|
450 | # |
---|
451 | # IGCM_sys_Mkdir ${R_OUT_EXE} |
---|
452 | # cd ${MODIPSL} |
---|
453 | # tar cf src_${config_UserChoices_JobName}.tar modeles |
---|
454 | # IGCM_sys_Mv src_${config_UserChoices_JobName}.tar ${R_OUT_EXE}/. |
---|
455 | # cd - |
---|
456 | # |
---|
457 | |
---|
458 | IGCM_debug_PopStack "CHM_Finalize" |
---|
459 | } |
---|