1 | SUBROUTINE writerestart(fichnom,tab_cntrl, |
---|
2 | . phis,vcov,ucov,teta,masse,q,ps) |
---|
3 | |
---|
4 | USE IOIPSL |
---|
5 | USE infotrac |
---|
6 | USE comconst_mod |
---|
7 | USE comvert_mod, ONLY: ap,bp,presnivs,pa,preff,nivsigs,nivsig, |
---|
8 | . aps,bps,scaleheight,pseudoalt, |
---|
9 | . disvert_type,pressure_exner |
---|
10 | |
---|
11 | IMPLICIT NONE |
---|
12 | |
---|
13 | c======================================================================= |
---|
14 | c Ecriture du fichier de redemarrage sous format NetCDF (pour newstart) |
---|
15 | c======================================================================= |
---|
16 | c Declarations: |
---|
17 | c ------------- |
---|
18 | #include "dimensions.h" |
---|
19 | #include "paramet.h" |
---|
20 | #include "comgeom.h" |
---|
21 | #include "netcdf.inc" |
---|
22 | #include "description.h" |
---|
23 | |
---|
24 | c Arguments: |
---|
25 | c ---------- |
---|
26 | CHARACTER*(*) fichnom |
---|
27 | INTEGER length |
---|
28 | PARAMETER (length = 100) |
---|
29 | REAL tab_cntrl(length) ! tableau des parametres du run |
---|
30 | REAL phis(ip1jmp1) |
---|
31 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
32 | REAL teta(ip1jmp1,llm),q(ip1jmp1,llm,nqtot) |
---|
33 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
34 | |
---|
35 | c Local: |
---|
36 | c ------ |
---|
37 | INTEGER iq,l |
---|
38 | INTEGER ierr |
---|
39 | character*20 modname |
---|
40 | character*80 abort_message |
---|
41 | |
---|
42 | c Variables locales pour NetCDF: |
---|
43 | c |
---|
44 | INTEGER dims2(2), dims3(3), dims4(4) |
---|
45 | INTEGER idim_index |
---|
46 | INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv |
---|
47 | INTEGER idim_s, idim_sig |
---|
48 | INTEGER idim_tim |
---|
49 | INTEGER nid,nvarid |
---|
50 | |
---|
51 | character*30 unites |
---|
52 | |
---|
53 | |
---|
54 | c----------------------------------------------------------------------- |
---|
55 | c Creation du fichier: |
---|
56 | c----------------------------------------------------------------------- |
---|
57 | c |
---|
58 | modname='write_restart_ini' |
---|
59 | |
---|
60 | ierr = NF_CREATE(fichnom, NF_CLOBBER, nid) |
---|
61 | IF (ierr.NE.NF_NOERR) THEN |
---|
62 | WRITE(6,*)" Pb d ouverture du fichier "//fichnom |
---|
63 | WRITE(6,*)' ierr = ', ierr |
---|
64 | CALL ABORT |
---|
65 | ENDIF |
---|
66 | c |
---|
67 | c Preciser quelques attributs globaux: |
---|
68 | c |
---|
69 | ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 27, |
---|
70 | . "Fichier demarrage dynamique") |
---|
71 | c |
---|
72 | c Definir les dimensions du fichiers: |
---|
73 | c |
---|
74 | ierr = NF_DEF_DIM (nid, "index", length, idim_index) |
---|
75 | ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) |
---|
76 | ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) |
---|
77 | ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) |
---|
78 | ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) |
---|
79 | ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) |
---|
80 | ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) |
---|
81 | ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) |
---|
82 | c |
---|
83 | ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
---|
84 | c |
---|
85 | c Definir et enregistrer certains champs invariants: |
---|
86 | c |
---|
87 | ierr = NF_REDEF (nid) |
---|
88 | #ifdef NC_DOUBLE |
---|
89 | ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1,idim_index,nvarid) |
---|
90 | #else |
---|
91 | ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1,idim_index,nvarid) |
---|
92 | #endif |
---|
93 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
94 | . "Parametres de controle") |
---|
95 | ierr = NF_ENDDEF(nid) |
---|
96 | #ifdef NC_DOUBLE |
---|
97 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
98 | #else |
---|
99 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
100 | #endif |
---|
101 | c |
---|
102 | ierr = NF_REDEF (nid) |
---|
103 | #ifdef NC_DOUBLE |
---|
104 | ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1,idim_rlonu,nvarid) |
---|
105 | #else |
---|
106 | ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1,idim_rlonu,nvarid) |
---|
107 | #endif |
---|
108 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
109 | . "Longitudes des points U") |
---|
110 | ierr = NF_ENDDEF(nid) |
---|
111 | #ifdef NC_DOUBLE |
---|
112 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) |
---|
113 | #else |
---|
114 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) |
---|
115 | #endif |
---|
116 | c |
---|
117 | ierr = NF_REDEF (nid) |
---|
118 | #ifdef NC_DOUBLE |
---|
119 | ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1,idim_rlatu,nvarid) |
---|
120 | #else |
---|
121 | ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1,idim_rlatu,nvarid) |
---|
122 | #endif |
---|
123 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
124 | . "Latitudes des points U") |
---|
125 | ierr = NF_ENDDEF(nid) |
---|
126 | #ifdef NC_DOUBLE |
---|
127 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) |
---|
128 | #else |
---|
129 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) |
---|
130 | #endif |
---|
131 | c |
---|
132 | ierr = NF_REDEF (nid) |
---|
133 | #ifdef NC_DOUBLE |
---|
134 | ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1,idim_rlonv,nvarid) |
---|
135 | #else |
---|
136 | ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1,idim_rlonv,nvarid) |
---|
137 | #endif |
---|
138 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
139 | . "Longitudes des points V") |
---|
140 | ierr = NF_ENDDEF(nid) |
---|
141 | #ifdef NC_DOUBLE |
---|
142 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) |
---|
143 | #else |
---|
144 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) |
---|
145 | #endif |
---|
146 | c |
---|
147 | ierr = NF_REDEF (nid) |
---|
148 | #ifdef NC_DOUBLE |
---|
149 | ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1,idim_rlatv,nvarid) |
---|
150 | #else |
---|
151 | ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1,idim_rlatv,nvarid) |
---|
152 | #endif |
---|
153 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
154 | . "Latitudes des points V") |
---|
155 | ierr = NF_ENDDEF(nid) |
---|
156 | #ifdef NC_DOUBLE |
---|
157 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) |
---|
158 | #else |
---|
159 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) |
---|
160 | #endif |
---|
161 | c |
---|
162 | ierr = NF_REDEF (nid) |
---|
163 | #ifdef NC_DOUBLE |
---|
164 | ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) |
---|
165 | #else |
---|
166 | ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) |
---|
167 | #endif |
---|
168 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, |
---|
169 | . "Numero naturel des couches s") |
---|
170 | ierr = NF_ENDDEF(nid) |
---|
171 | #ifdef NC_DOUBLE |
---|
172 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) |
---|
173 | #else |
---|
174 | ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) |
---|
175 | #endif |
---|
176 | c |
---|
177 | ierr = NF_REDEF (nid) |
---|
178 | #ifdef NC_DOUBLE |
---|
179 | ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid) |
---|
180 | #else |
---|
181 | ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid) |
---|
182 | #endif |
---|
183 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, |
---|
184 | . "Numero naturel des couches sigma") |
---|
185 | ierr = NF_ENDDEF(nid) |
---|
186 | #ifdef NC_DOUBLE |
---|
187 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) |
---|
188 | #else |
---|
189 | ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) |
---|
190 | #endif |
---|
191 | c |
---|
192 | ierr = NF_REDEF (nid) |
---|
193 | #ifdef NC_DOUBLE |
---|
194 | ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1,idim_sig,nvarid) |
---|
195 | #else |
---|
196 | ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1,idim_sig,nvarid) |
---|
197 | #endif |
---|
198 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 26, |
---|
199 | . "Coefficient A pour hybride") |
---|
200 | ierr = NF_ENDDEF(nid) |
---|
201 | #ifdef NC_DOUBLE |
---|
202 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) |
---|
203 | #else |
---|
204 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) |
---|
205 | #endif |
---|
206 | c |
---|
207 | ierr = NF_REDEF (nid) |
---|
208 | #ifdef NC_DOUBLE |
---|
209 | ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1,idim_sig,nvarid) |
---|
210 | #else |
---|
211 | ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1,idim_sig,nvarid) |
---|
212 | #endif |
---|
213 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 26, |
---|
214 | . "Coefficient B pour hybride") |
---|
215 | ierr = NF_ENDDEF(nid) |
---|
216 | #ifdef NC_DOUBLE |
---|
217 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) |
---|
218 | #else |
---|
219 | ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) |
---|
220 | #endif |
---|
221 | c |
---|
222 | ierr = NF_REDEF (nid) |
---|
223 | #ifdef NC_DOUBLE |
---|
224 | ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1,idim_s,nvarid) |
---|
225 | #else |
---|
226 | ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1,idim_s,nvarid) |
---|
227 | #endif |
---|
228 | ierr = NF_ENDDEF(nid) |
---|
229 | #ifdef NC_DOUBLE |
---|
230 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) |
---|
231 | #else |
---|
232 | ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) |
---|
233 | #endif |
---|
234 | c |
---|
235 | c Coefficients de passage cov. <-> contra. <--> naturel |
---|
236 | c |
---|
237 | ierr = NF_REDEF (nid) |
---|
238 | dims2(1) = idim_rlonu |
---|
239 | dims2(2) = idim_rlatu |
---|
240 | #ifdef NC_DOUBLE |
---|
241 | ierr = NF_DEF_VAR (nid,"cu",NF_DOUBLE,2,dims2,nvarid) |
---|
242 | #else |
---|
243 | ierr = NF_DEF_VAR (nid,"cu",NF_FLOAT,2,dims2,nvarid) |
---|
244 | #endif |
---|
245 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
246 | . "Coefficient de passage pour U") |
---|
247 | ierr = NF_ENDDEF(nid) |
---|
248 | #ifdef NC_DOUBLE |
---|
249 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) |
---|
250 | #else |
---|
251 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) |
---|
252 | #endif |
---|
253 | c |
---|
254 | ierr = NF_REDEF (nid) |
---|
255 | dims2(1) = idim_rlonv |
---|
256 | dims2(2) = idim_rlatv |
---|
257 | #ifdef NC_DOUBLE |
---|
258 | ierr = NF_DEF_VAR (nid,"cv",NF_DOUBLE,2,dims2,nvarid) |
---|
259 | #else |
---|
260 | ierr = NF_DEF_VAR (nid,"cv",NF_FLOAT,2,dims2,nvarid) |
---|
261 | #endif |
---|
262 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
263 | . "Coefficient de passage pour V") |
---|
264 | ierr = NF_ENDDEF(nid) |
---|
265 | #ifdef NC_DOUBLE |
---|
266 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) |
---|
267 | #else |
---|
268 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) |
---|
269 | #endif |
---|
270 | c |
---|
271 | c Aire de chaque maille: |
---|
272 | c |
---|
273 | ierr = NF_REDEF (nid) |
---|
274 | dims2(1) = idim_rlonv |
---|
275 | dims2(2) = idim_rlatu |
---|
276 | #ifdef NC_DOUBLE |
---|
277 | ierr = NF_DEF_VAR (nid,"aire",NF_DOUBLE,2,dims2,nvarid) |
---|
278 | #else |
---|
279 | ierr = NF_DEF_VAR (nid,"aire",NF_FLOAT,2,dims2,nvarid) |
---|
280 | #endif |
---|
281 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
282 | . "Aires de chaque maille") |
---|
283 | ierr = NF_ENDDEF(nid) |
---|
284 | #ifdef NC_DOUBLE |
---|
285 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) |
---|
286 | #else |
---|
287 | ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) |
---|
288 | #endif |
---|
289 | c |
---|
290 | c Geopentiel au sol: |
---|
291 | c |
---|
292 | ierr = NF_REDEF (nid) |
---|
293 | dims2(1) = idim_rlonv |
---|
294 | dims2(2) = idim_rlatu |
---|
295 | #ifdef NC_DOUBLE |
---|
296 | ierr = NF_DEF_VAR (nid,"phisinit",NF_DOUBLE,2,dims2,nvarid) |
---|
297 | #else |
---|
298 | ierr = NF_DEF_VAR (nid,"phisinit",NF_FLOAT,2,dims2,nvarid) |
---|
299 | #endif |
---|
300 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, |
---|
301 | . "Geopotentiel au sol") |
---|
302 | ierr = NF_ENDDEF(nid) |
---|
303 | #ifdef NC_DOUBLE |
---|
304 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) |
---|
305 | #else |
---|
306 | ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) |
---|
307 | #endif |
---|
308 | c |
---|
309 | c Definir les variables pour pouvoir les enregistrer plus tard: |
---|
310 | c |
---|
311 | ierr = NF_REDEF (nid) ! entrer dans le mode de definition |
---|
312 | c |
---|
313 | #ifdef NC_DOUBLE |
---|
314 | ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) |
---|
315 | #else |
---|
316 | ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) |
---|
317 | #endif |
---|
318 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, |
---|
319 | . "Temps de simulation") |
---|
320 | write(unites,200) 1990,1,1 |
---|
321 | 200 format('days since ',i4,'-',i2.2,'-',i2.2,' 00:00:00') |
---|
322 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "units", 30, |
---|
323 | . unites) |
---|
324 | |
---|
325 | c |
---|
326 | dims4(1) = idim_rlonu |
---|
327 | dims4(2) = idim_rlatu |
---|
328 | dims4(3) = idim_s |
---|
329 | dims4(4) = idim_tim |
---|
330 | #ifdef NC_DOUBLE |
---|
331 | ierr = NF_DEF_VAR (nid,"ucov",NF_DOUBLE,4,dims4,nvarid) |
---|
332 | #else |
---|
333 | ierr = NF_DEF_VAR (nid,"ucov",NF_FLOAT,4,dims4,nvarid) |
---|
334 | #endif |
---|
335 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 9, |
---|
336 | . "Vitesse U") |
---|
337 | c |
---|
338 | dims4(1) = idim_rlonv |
---|
339 | dims4(2) = idim_rlatv |
---|
340 | dims4(3) = idim_s |
---|
341 | dims4(4) = idim_tim |
---|
342 | #ifdef NC_DOUBLE |
---|
343 | ierr = NF_DEF_VAR (nid,"vcov",NF_DOUBLE,4,dims4,nvarid) |
---|
344 | #else |
---|
345 | ierr = NF_DEF_VAR (nid,"vcov",NF_FLOAT,4,dims4,nvarid) |
---|
346 | #endif |
---|
347 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 9, |
---|
348 | . "Vitesse V") |
---|
349 | c |
---|
350 | dims4(1) = idim_rlonv |
---|
351 | dims4(2) = idim_rlatu |
---|
352 | dims4(3) = idim_s |
---|
353 | dims4(4) = idim_tim |
---|
354 | #ifdef NC_DOUBLE |
---|
355 | ierr = NF_DEF_VAR (nid,"teta",NF_DOUBLE,4,dims4,nvarid) |
---|
356 | #else |
---|
357 | ierr = NF_DEF_VAR (nid,"teta",NF_FLOAT,4,dims4,nvarid) |
---|
358 | #endif |
---|
359 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 11, |
---|
360 | . "Temperature") |
---|
361 | c |
---|
362 | dims4(1) = idim_rlonv |
---|
363 | dims4(2) = idim_rlatu |
---|
364 | dims4(3) = idim_s |
---|
365 | dims4(4) = idim_tim |
---|
366 | DO iq=1,nqtot |
---|
367 | #ifdef NC_DOUBLE |
---|
368 | ierr = NF_DEF_VAR (nid,tname(iq),NF_DOUBLE,4,dims4,nvarid) |
---|
369 | #else |
---|
370 | ierr = NF_DEF_VAR (nid,tname(iq),NF_FLOAT,4,dims4,nvarid) |
---|
371 | #endif |
---|
372 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 12,ttext(iq)) |
---|
373 | ENDDO |
---|
374 | c |
---|
375 | dims4(1) = idim_rlonv |
---|
376 | dims4(2) = idim_rlatu |
---|
377 | dims4(3) = idim_s |
---|
378 | dims4(4) = idim_tim |
---|
379 | #ifdef NC_DOUBLE |
---|
380 | ierr = NF_DEF_VAR (nid,"masse",NF_DOUBLE,4,dims4,nvarid) |
---|
381 | #else |
---|
382 | ierr = NF_DEF_VAR (nid,"masse",NF_FLOAT,4,dims4,nvarid) |
---|
383 | #endif |
---|
384 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 12, |
---|
385 | . "C est quoi ?") |
---|
386 | c |
---|
387 | dims3(1) = idim_rlonv |
---|
388 | dims3(2) = idim_rlatu |
---|
389 | dims3(3) = idim_tim |
---|
390 | #ifdef NC_DOUBLE |
---|
391 | ierr = NF_DEF_VAR (nid,"ps",NF_DOUBLE,3,dims3,nvarid) |
---|
392 | #else |
---|
393 | ierr = NF_DEF_VAR (nid,"ps",NF_FLOAT,3,dims3,nvarid) |
---|
394 | #endif |
---|
395 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 15, |
---|
396 | . "Pression au sol") |
---|
397 | c |
---|
398 | ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
---|
399 | |
---|
400 | c----------------------------------------------------------------------- |
---|
401 | c Ecriture des variables: |
---|
402 | c----------------------------------------------------------------------- |
---|
403 | c |
---|
404 | modname='write_restart' |
---|
405 | |
---|
406 | ierr = NF_INQ_VARID(nid, "temps", nvarid) |
---|
407 | IF (ierr .NE. NF_NOERR) THEN |
---|
408 | print *, NF_STRERROR(ierr) |
---|
409 | abort_message='Variable temps n est pas definie' |
---|
410 | CALL abort_gcm(modname,abort_message,ierr) |
---|
411 | ENDIF |
---|
412 | #ifdef NC_DOUBLE |
---|
413 | ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,1,0.) |
---|
414 | #else |
---|
415 | ierr = NF_PUT_VAR1_REAL (nid,nvarid,1,0.) |
---|
416 | #endif |
---|
417 | |
---|
418 | ierr = NF_INQ_VARID(nid, "ucov", nvarid) |
---|
419 | IF (ierr .NE. NF_NOERR) THEN |
---|
420 | PRINT*, "Variable ucov n est pas definie" |
---|
421 | CALL abort |
---|
422 | ENDIF |
---|
423 | #ifdef NC_DOUBLE |
---|
424 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) |
---|
425 | #else |
---|
426 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) |
---|
427 | #endif |
---|
428 | |
---|
429 | ierr = NF_INQ_VARID(nid, "vcov", nvarid) |
---|
430 | IF (ierr .NE. NF_NOERR) THEN |
---|
431 | PRINT*, "Variable vcov n est pas definie" |
---|
432 | CALL abort |
---|
433 | ENDIF |
---|
434 | #ifdef NC_DOUBLE |
---|
435 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) |
---|
436 | #else |
---|
437 | ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) |
---|
438 | #endif |
---|
439 | |
---|
440 | ierr = NF_INQ_VARID(nid, "teta", nvarid) |
---|
441 | IF (ierr .NE. NF_NOERR) THEN |
---|
442 | PRINT*, "Variable teta n est pas definie" |
---|
443 | CALL abort |
---|
444 | ENDIF |
---|
445 | #ifdef NC_DOUBLE |
---|
446 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) |
---|
447 | #else |
---|
448 | ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) |
---|
449 | #endif |
---|
450 | |
---|
451 | do iq=1,nqtot |
---|
452 | ierr = NF_INQ_VARID(nid, tname(iq), nvarid) |
---|
453 | IF (ierr .NE. NF_NOERR) THEN |
---|
454 | PRINT*, "Variable tname(iq) n est pas definie" |
---|
455 | CALL abort |
---|
456 | ENDIF |
---|
457 | #ifdef NC_DOUBLE |
---|
458 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) |
---|
459 | #else |
---|
460 | ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) |
---|
461 | #endif |
---|
462 | ENDDO |
---|
463 | c |
---|
464 | ierr = NF_INQ_VARID(nid, "masse", nvarid) |
---|
465 | IF (ierr .NE. NF_NOERR) THEN |
---|
466 | PRINT*, "Variable masse n est pas definie" |
---|
467 | CALL abort |
---|
468 | ENDIF |
---|
469 | #ifdef NC_DOUBLE |
---|
470 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) |
---|
471 | #else |
---|
472 | ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) |
---|
473 | #endif |
---|
474 | c |
---|
475 | ierr = NF_INQ_VARID(nid, "ps", nvarid) |
---|
476 | IF (ierr .NE. NF_NOERR) THEN |
---|
477 | PRINT*, "Variable ps n est pas definie" |
---|
478 | CALL abort |
---|
479 | ENDIF |
---|
480 | #ifdef NC_DOUBLE |
---|
481 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) |
---|
482 | #else |
---|
483 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) |
---|
484 | #endif |
---|
485 | |
---|
486 | ierr = NF_CLOSE(nid) ! fermer le fichier |
---|
487 | |
---|
488 | c PRINT*,'iim,jjm,llm,iday_end',iim,jjm,llm,iday_end |
---|
489 | c PRINT*,'rad,omeg,g,cpp,kappa', |
---|
490 | c , rad,omeg,g,cpp,kappa |
---|
491 | |
---|
492 | RETURN |
---|
493 | END |
---|
494 | |
---|