1 | SUBROUTINE condsurfs(jour, edgar, flag_dms, |
---|
2 | . lmt_so2h, lmt_so2b, lmt_so2bb, lmt_so2ba, |
---|
3 | . lmt_so2volc, lmt_altvolc, |
---|
4 | . lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc) |
---|
5 | USE dimphy |
---|
6 | IMPLICIT none |
---|
7 | c |
---|
8 | c Lire les conditions aux limites du modele pour la chimie. |
---|
9 | c -------------------------------------------------------- |
---|
10 | c |
---|
11 | #include "dimensions.h" |
---|
12 | #include "netcdf.inc" |
---|
13 | c |
---|
14 | REAL lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon) |
---|
15 | REAL lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon) |
---|
16 | REAL lmt_so2volc(klon), lmt_altvolc(klon) |
---|
17 | REAL lmt_dms(klon), lmt_dmsconc(klon) |
---|
18 | LOGICAL edgar |
---|
19 | INTEGER flag_dms |
---|
20 | c |
---|
21 | INTEGER jour, i |
---|
22 | INTEGER ierr |
---|
23 | INTEGER nid,nvarid |
---|
24 | INTEGER debut(2),epais(2) |
---|
25 | c |
---|
26 | IF (jour.LT.0 .OR. jour.GT.(360-1)) THEN |
---|
27 | IF ((jour.GT.(360-1)) .AND. (jour.LE.367)) THEN |
---|
28 | jour=360-1 |
---|
29 | print *,'JE: jour changed to jour= ',jour |
---|
30 | ELSE |
---|
31 | PRINT*,'Le jour demande n est pas correcte:', jour |
---|
32 | CALL ABORT |
---|
33 | ENDIF |
---|
34 | ENDIF |
---|
35 | c |
---|
36 | ierr = NF_OPEN ("limitsoufre.nc", NF_NOWRITE, nid) |
---|
37 | if (ierr.ne.NF_NOERR) then |
---|
38 | write(6,*)' Pb d''ouverture du fichier limitsoufre.nc' |
---|
39 | write(6,*)' ierr = ', ierr |
---|
40 | call exit(1) |
---|
41 | endif |
---|
42 | c |
---|
43 | c Tranche a lire: |
---|
44 | debut(1) = 1 |
---|
45 | debut(2) = jour+1 |
---|
46 | epais(1) = klon |
---|
47 | epais(2) = 1 |
---|
48 | c |
---|
49 | ierr = NF_INQ_VARID (nid, "VOLC", nvarid) |
---|
50 | cnhl #ifdef NC_DOUBLE |
---|
51 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2volc) |
---|
52 | cnhl #else |
---|
53 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2volc) |
---|
54 | cnhl #endif |
---|
55 | IF (ierr .NE. NF_NOERR) THEN |
---|
56 | PRINT*, 'Pb de lecture pour les sources so2 volcan' |
---|
57 | CALL exit(1) |
---|
58 | ENDIF |
---|
59 | c |
---|
60 | ierr = NF_INQ_VARID (nid, "ALTI", nvarid) |
---|
61 | cnhl #ifdef NC_DOUBLE |
---|
62 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_altvolc) |
---|
63 | cnhl #else |
---|
64 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_altvolc) |
---|
65 | cnhl #endif |
---|
66 | IF (ierr .NE. NF_NOERR) THEN |
---|
67 | PRINT*, 'Pb de lecture pour les altitudes volcan' |
---|
68 | CALL exit(1) |
---|
69 | ENDIF |
---|
70 | c |
---|
71 | IF (edgar) THEN !--EDGAR w/o ship and biomass burning |
---|
72 | c |
---|
73 | ierr = NF_INQ_VARID (nid, "SO2ED95L", nvarid) |
---|
74 | cnhl #ifdef NC_DOUBLE |
---|
75 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b) |
---|
76 | cnhl #else |
---|
77 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b) |
---|
78 | cnhl #endif |
---|
79 | IF (ierr .NE. NF_NOERR) THEN |
---|
80 | PRINT*, 'Pb de lecture pour les sources so2 edgar low' |
---|
81 | CALL exit(1) |
---|
82 | ENDIF |
---|
83 | c |
---|
84 | ierr = NF_INQ_VARID (nid, "SO2ED95H", nvarid) |
---|
85 | cnhl #ifdef NC_DOUBLE |
---|
86 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h) |
---|
87 | cnhl #else |
---|
88 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h) |
---|
89 | cnhl #endif |
---|
90 | IF (ierr .NE. NF_NOERR) THEN |
---|
91 | PRINT*, 'Pb de lecture pour les sources so2 edgar high' |
---|
92 | CALL exit(1) |
---|
93 | ENDIF |
---|
94 | c |
---|
95 | ELSE !--GEIA |
---|
96 | c |
---|
97 | ierr = NF_INQ_VARID (nid, "SO2H", nvarid) |
---|
98 | cnhl #ifdef NC_DOUBLE |
---|
99 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2h) |
---|
100 | cnhl #else |
---|
101 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2h) |
---|
102 | cnhl #endif |
---|
103 | IF (ierr .NE. NF_NOERR) THEN |
---|
104 | PRINT*, 'Pb de lecture pour les sources so2 haut' |
---|
105 | CALL exit(1) |
---|
106 | ENDIF |
---|
107 | c |
---|
108 | ierr = NF_INQ_VARID (nid, "SO2B", nvarid) |
---|
109 | cnhl #ifdef NC_DOUBLE |
---|
110 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2b) |
---|
111 | cnhl #else |
---|
112 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2b) |
---|
113 | cnhl #endif |
---|
114 | IF (ierr .NE. NF_NOERR) THEN |
---|
115 | PRINT*, 'Pb de lecture pour les sources so2 bas' |
---|
116 | CALL exit(1) |
---|
117 | ENDIF |
---|
118 | c |
---|
119 | ENDIF !--edgar |
---|
120 | c |
---|
121 | ierr = NF_INQ_VARID (nid, "SO2BB", nvarid) |
---|
122 | cnhl #ifdef NC_DOUBLE |
---|
123 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2bb) |
---|
124 | cnhl #else |
---|
125 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2bb) |
---|
126 | cnhl #endif |
---|
127 | IF (ierr .NE. NF_NOERR) THEN |
---|
128 | PRINT*, 'Pb de lecture pour les sources so2 bb' |
---|
129 | CALL exit(1) |
---|
130 | ENDIF |
---|
131 | c |
---|
132 | ierr = NF_INQ_VARID (nid, "SO2BA", nvarid) |
---|
133 | cnhl #ifdef NC_DOUBLE |
---|
134 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_so2ba) |
---|
135 | cnhl #else |
---|
136 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_so2ba) |
---|
137 | cnhl #endif |
---|
138 | IF (ierr .NE. NF_NOERR) THEN |
---|
139 | PRINT*, 'Pb de lecture pour les sources so2 bateau' |
---|
140 | CALL exit(1) |
---|
141 | ENDIF |
---|
142 | c |
---|
143 | ierr = NF_INQ_VARID (nid, "DMSB", nvarid) |
---|
144 | cnhl #ifdef NC_DOUBLE |
---|
145 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dmsbio) |
---|
146 | cnhl #else |
---|
147 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsbio) |
---|
148 | cnhl #endif |
---|
149 | IF (ierr .NE. NF_NOERR) THEN |
---|
150 | PRINT*, 'Pb de lecture pour les sources dms bio' |
---|
151 | CALL exit(1) |
---|
152 | ENDIF |
---|
153 | c |
---|
154 | ierr = NF_INQ_VARID (nid, "H2SB", nvarid) |
---|
155 | cnhl #ifdef NC_DOUBLE |
---|
156 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_h2sbio) |
---|
157 | cnhl #else |
---|
158 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_h2sbio) |
---|
159 | cnhl #endif |
---|
160 | IF (ierr .NE. NF_NOERR) THEN |
---|
161 | PRINT*, 'Pb de lecture pour les sources h2s bio' |
---|
162 | CALL exit(1) |
---|
163 | ENDIF |
---|
164 | c |
---|
165 | IF (flag_dms.EQ.1) THEN |
---|
166 | c |
---|
167 | ierr = NF_INQ_VARID (nid, "DMSL", nvarid) |
---|
168 | cnhl #ifdef NC_DOUBLE |
---|
169 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms) |
---|
170 | cnhl #else |
---|
171 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms) |
---|
172 | cnhl #endif |
---|
173 | IF (ierr .NE. NF_NOERR) THEN |
---|
174 | PRINT*, 'Pb de lecture pour les sources dms liss' |
---|
175 | CALL exit(1) |
---|
176 | ENDIF |
---|
177 | c |
---|
178 | ELSEIF (flag_dms.EQ.2) THEN |
---|
179 | c |
---|
180 | ierr = NF_INQ_VARID (nid, "DMSW", nvarid) |
---|
181 | cnhl #ifdef NC_DOUBLE |
---|
182 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut, epais, lmt_dms) |
---|
183 | cnhl #else |
---|
184 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dms) |
---|
185 | cnhl #endif |
---|
186 | IF (ierr .NE. NF_NOERR) THEN |
---|
187 | PRINT*, 'Pb de lecture pour les sources dms wann' |
---|
188 | CALL exit(1) |
---|
189 | ENDIF |
---|
190 | c |
---|
191 | ELSEIF (flag_dms.EQ.3) THEN |
---|
192 | c |
---|
193 | ierr = NF_INQ_VARID (nid, "DMSC1", nvarid) |
---|
194 | cnhl #ifdef NC_DOUBLE |
---|
195 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
196 | cnhl #else |
---|
197 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
198 | cnhl #endif |
---|
199 | IF (ierr .NE. NF_NOERR) THEN |
---|
200 | PRINT*, 'Pb de lecture pour les sources dmsconc old' |
---|
201 | CALL exit(1) |
---|
202 | ENDIF |
---|
203 | c |
---|
204 | ELSEIF (flag_dms.EQ.4) THEN |
---|
205 | c |
---|
206 | ierr = NF_INQ_VARID (nid, "DMSC2", nvarid) |
---|
207 | cnhl #ifdef NC_DOUBLE |
---|
208 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
209 | cnhl #else |
---|
210 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
211 | cnhl #endif |
---|
212 | IF (ierr .NE. NF_NOERR) THEN |
---|
213 | PRINT*, 'Pb de lecture pour les sources dms conc 2' |
---|
214 | CALL exit(1) |
---|
215 | ENDIF |
---|
216 | c |
---|
217 | ELSEIF (flag_dms.EQ.5) THEN |
---|
218 | c |
---|
219 | ierr = NF_INQ_VARID (nid, "DMSC3", nvarid) |
---|
220 | cnhl #ifdef NC_DOUBLE |
---|
221 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
222 | cnhl #else |
---|
223 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
224 | cnhl #endif |
---|
225 | IF (ierr .NE. NF_NOERR) THEN |
---|
226 | PRINT*, 'Pb de lecture pour les sources dms conc 3' |
---|
227 | CALL exit(1) |
---|
228 | ENDIF |
---|
229 | c |
---|
230 | ELSEIF (flag_dms.EQ.6) THEN |
---|
231 | c |
---|
232 | ierr = NF_INQ_VARID (nid, "DMSC4", nvarid) |
---|
233 | cnhl #ifdef NC_DOUBLE |
---|
234 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
235 | cnhl #else |
---|
236 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
237 | cnhl #endif |
---|
238 | IF (ierr .NE. NF_NOERR) THEN |
---|
239 | PRINT*, 'Pb de lecture pour les sources dms conc 4' |
---|
240 | CALL exit(1) |
---|
241 | ENDIF |
---|
242 | c |
---|
243 | ELSEIF (flag_dms.EQ.7) THEN |
---|
244 | c |
---|
245 | ierr = NF_INQ_VARID (nid, "DMSC5", nvarid) |
---|
246 | cnhl #ifdef NC_DOUBLE |
---|
247 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
248 | cnhl #else |
---|
249 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
250 | cnhl #endif |
---|
251 | IF (ierr .NE. NF_NOERR) THEN |
---|
252 | PRINT*, 'Pb de lecture pour les sources dms conc 5' |
---|
253 | CALL exit(1) |
---|
254 | ENDIF |
---|
255 | c |
---|
256 | ELSEIF (flag_dms.EQ.8) THEN |
---|
257 | c |
---|
258 | ierr = NF_INQ_VARID (nid, "DMSC6", nvarid) |
---|
259 | cnhl #ifdef NC_DOUBLE |
---|
260 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
261 | cnhl #else |
---|
262 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
263 | cnhl #endif |
---|
264 | IF (ierr .NE. NF_NOERR) THEN |
---|
265 | PRINT*, 'Pb de lecture pour les sources dms conc 6' |
---|
266 | CALL exit(1) |
---|
267 | ENDIF |
---|
268 | c |
---|
269 | ELSEIF (flag_dms.EQ.9) THEN |
---|
270 | c |
---|
271 | ierr = NF_INQ_VARID (nid, "DMSC7", nvarid) |
---|
272 | cnhl #ifdef NC_DOUBLE |
---|
273 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
274 | cnhl #else |
---|
275 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
276 | cnhl #endif |
---|
277 | IF (ierr .NE. NF_NOERR) THEN |
---|
278 | PRINT*, 'Pb de lecture pour les sources dms conc 7' |
---|
279 | CALL exit(1) |
---|
280 | ENDIF |
---|
281 | c |
---|
282 | ELSEIF (flag_dms.EQ.10) THEN |
---|
283 | c |
---|
284 | ierr = NF_INQ_VARID (nid, "DMSC8", nvarid) |
---|
285 | cnhl #ifdef NC_DOUBLE |
---|
286 | ierr = NF_GET_VARA_DOUBLE (nid, nvarid, debut,epais,lmt_dmsconc) |
---|
287 | cnhl #else |
---|
288 | cnhl ierr = NF_GET_VARA_REAL (nid, nvarid, debut, epais, lmt_dmsconc) |
---|
289 | cnhl #endif |
---|
290 | IF (ierr .NE. NF_NOERR) THEN |
---|
291 | PRINT*, 'Pb de lecture pour les sources dms conc 8' |
---|
292 | CALL exit(1) |
---|
293 | ENDIF |
---|
294 | c |
---|
295 | ELSE |
---|
296 | c |
---|
297 | PRINT *,'choix non possible pour flag_dms' |
---|
298 | STOP |
---|
299 | c |
---|
300 | ENDIF |
---|
301 | c |
---|
302 | ierr = NF_CLOSE(nid) |
---|
303 | c |
---|
304 | IF (flag_dms.LE.2) THEN |
---|
305 | DO i=1, klon |
---|
306 | lmt_dmsconc(i)=0.0 |
---|
307 | ENDDO |
---|
308 | ELSE |
---|
309 | DO i=1, klon |
---|
310 | lmt_dms(i)=0.0 |
---|
311 | ENDDO |
---|
312 | ENDIF |
---|
313 | c |
---|
314 | PRINT*, 'Sources SOUFRE lues pour jour: ', jour |
---|
315 | c |
---|
316 | RETURN |
---|
317 | END |
---|