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