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