source: trunk/LMDZ.GENERIC/libf/dyn3d/ini_archive.F @ 832

Last change on this file since 832 was 787, checked in by aslmd, 12 years ago

LMDZ.GENERIC. (Sorry for long text but this is a quite major commit)

Paving the path for parallel computations. And moving towards a more flexible code.

Automatic allocation is used within all routines in phystd. No further mention to ngridmx and nqmx.

  1. ngridmx and nqmx are still used in LMDZ.GENERIC in the dyn3d part
  2. if the LMDZ4/LMDZ5 dynamical core is used, there is no more fixed dimensions ngridmx and nqmx --> a fully flexible parallel implementation is now possible (e.g. no need to recompile when changing numbers of processors)

The important stuff :

  • Compilation checked with ifort. OK with and without debug mode. No errors. Checked for: gcm, newstart, rcm1d, kcm1d
  • RUN GCM: Running an Earth test case. Comparison with previous revision --> debug mode : perfect match. bit by bit (diff command). checked with plots --> O1 mode : close match (checked with plots) --> O2 mode : sometimes up to 0.5 K departure.... BUT in this new version O2 and O1 are quite close while in previous version O1 and O2 differed by about, well, typically 0.5 K (pictures available on request)
  • RUN NEWSTART : perfect match (bit-by-bit) in either debug or normal mode.
  • RUN RCM1D : perfect match in normal mode.
  • RUN KCM1D : not tested (I don't know what is the use of kcm1d)

List of main changes :

  • Additional arguments to some subroutines (ngrid and nq)
  • F77 include strategy is obsolete and replaced by F90 module strategy In this new strategy arrays are allocatable and allocated once at first use This has to be done for all common featuring arrays defined with ngridmx or nqmx

surfdat.h >> surfdat_h.F90
tracer.h >> tracer_h.F90
comsaison.h >> comsaison_h.F90
comgeomfi.h >> comgeomfi_h.F90
comsoil.h >> comsoil_h.F90
comdiurn.h >> comdiurn_h.F90
fisice.h >> DELETED. was not used. probably a fossil.
watercap.h >> DELETED. variable put in surfdat_h.F90

  • F77 'save' strategy is obsolete and replaced by F90 'allocatable save' strategy (see previous point and e.g. new version of physiq.F90)
  • Suppressing any mention to advtrac.h which is a common in the dynamics and needs nqmx This was easily solved by adding an argument with tracer names, coming from the dynamics This is probably not a definitive solution, ... but this allows for generic physics to work easily with either LMDZ.GENERIC or LMDZ dynamical cores
  • Removing consistency tests between nq and nqmx ; and ngrid and ngridmx. No use now!
  • Adaptation of rcm1d, kcm1d, newstart given above-mentioned changes

A note on phyetat0 and soil_setting:

  • Now written so that a slice of horizontal size 'ngrid' starting at grid point 'cursor' is read in startfi.nc 'cursor' is defined in dimphys.h and initialized by inifis (or in newstart) this is useful for parallel computations. default behavior is the usual one : sequential runs, cursor is 1, size ngrid is the whole global domain

A note on an additional change :

  • nueffrad is now an argument to callcorrk as is the case for reffrad both are saved in physiq this is for consistency and lisibility (previously nueffrad was saved in callcorrk) ... but there is a call to a function which modifies nueffrad in physiq ... previously this was not modifying nueffrad (although it was quite cumbersome to detect this) ... to be conservative I kept this behaviour and highlighted it with an array nueffrad_dummy ... I added a comment because someone might want to change this
File size: 17.1 KB
Line 
1c=======================================================================
2      subroutine ini_archive(nid,idayref,phis,ith,tab_cntrl_fi,
3     &                       tab_cntrl_dyn)
4c=======================================================================
5c
6c
7c   Date:    01/1997
8c   ----
9c
10c   Objet:  ecriture de l'entete du fichier "start_archive"
11c   -----
12c
13c        Proche de iniwrite.F
14c
15c        On ajoute dans le tableau "tab_cntrl" (dynamique), a partir de 51,
16c        les valeurs de tab_cntrl_fi (les 38 parametres de controle physiques
17c        du RUN + ptotal et cotoicetotal)
18c
19c                       tab_cntrl(50+l)=tab_cntrl_fi(l)
20c
21c   Arguments:
22c   ---------
23c
24c       Inputs:
25c   ------
26c
27c       nid            unite logique du fichier "start_archive"
28c       idayref        Valeur du jour initial a mettre dans
29c                      l'entete du fichier "start_archive"
30c       phis           geopotentiel au sol
31c       ith            soil thermal inertia
32c       tab_cntrl_fi   tableau des param physiques
33c
34
35c=======================================================================
36
37      USE comsoil_h
38 
39      implicit none
40
41#include "dimensions.h"
42#include "dimphys.h"
43#include "paramet.h"
44#include "comconst.h"
45#include "comvert.h"
46#include "comgeom.h"
47#include "temps.h"
48#include "ener.h"
49#include "logic.h"
50#include "description.h"
51#include "serre.h"
52#include "control.h"
53
54#include "netcdf.inc"
55
56c-----------------------------------------------------------------------
57c   Declarations
58c-----------------------------------------------------------------------
59
60c   Local:
61c   ------
62      INTEGER   length,l
63      parameter (length = 100)
64      REAL              tab_cntrl(length) ! tableau des parametres du run
65      INTEGER   loop
66      INTEGER   ierr, setvdim, putvdim, putdat, setname,cluvdb
67      INTEGER   setdim
68      INTEGER   ind1,indlast
69
70c   Arguments:
71c   ----------
72      INTEGER*4 idayref
73      REAL              phis(ip1jmp1)
74      real ith(ip1jmp1,nsoilmx)
75      REAL              tab_cntrl_fi(length)
76      REAL tab_cntrl_dyn(length)
77
78!Mars --------Ajouts-----------
79c   Variables locales pour NetCDF:
80c
81      INTEGER dims2(2), dims3(3) !, dims4(4)
82      INTEGER idim_index
83      INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv
84      INTEGER idim_llmp1,idim_llm
85      INTEGER idim_tim
86      INTEGER idim_nsoilmx ! "subsurface_layers" dimension ID #
87      INTEGER nid,nvarid
88      real sig_s(llm),s(llm)
89
90      pi  = 2. * ASIN(1.)
91
92
93c-----------------------------------------------------------------------
94c   Remplissage du tableau des parametres de controle du RUN  (dynamique)
95c-----------------------------------------------------------------------
96
97      DO l=1,length
98         tab_cntrl(l)=0.
99      ENDDO
100     
101      tab_cntrl(1:50)=tab_cntrl_dyn(1:50)
102
103ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
104!      tab_cntrl(1)  = FLOAT(iim) ! nombre de points en longitude
105!      tab_cntrl(2)  = FLOAT(jjm) ! nombre de points en latitude
106!      tab_cntrl(3)  = FLOAT(llm) ! nombre de couches
107!      tab_cntrl(4)  = FLOAT(idayref) ! jour 0
108!      tab_cntrl(5)  = rad ! rayon de mars(m) ~3397200
109!      tab_cntrl(6)  = omeg ! vitesse de rotation (rad.s-1)
110!      tab_cntrl(7)  = g   ! gravite (m.s-2) ~3.72
111!      tab_cntrl(8)  = cpp
112!      tab_cntrl(8)  = 43.49 !mars temporaire Masse molaire de l''atm (g.mol-1) ~43.49
113!      tab_cntrl(9)  = kappa ! = r/cp  ~0.256793 (=rcp dans physique)
114!      tab_cntrl(10) = daysec ! duree du sol (s)  ~88775
115!      tab_cntrl(11) = dtvr ! pas de temps de la dynamique (s)
116!      tab_cntrl(12) = etot0 ! energie totale    !
117!      tab_cntrl(13) = ptot0 ! pression totalei   !    variables
118!      tab_cntrl(14) = ztot0 ! enstrophie totale   !  de controle
119!      tab_cntrl(15) = stot0 ! enthalpie totale   !    globales
120!      tab_cntrl(16) = ang0 ! moment cinetique  !
121!      tab_cntrl(17) = pa
122!      tab_cntrl(18) = preff
123
124c    .....    parametres  pour le zoom      ......   
125
126!      tab_cntrl(19)  = clon ! longitude en degres du centre du zoom
127!      tab_cntrl(20)  = clat ! latitude en degres du centre du zoom
128!      tab_cntrl(21)  = grossismx ! facteur de grossissement du zoom,selon longitude
129!      tab_cntrl(22)  = grossismy ! facteur de grossissement du zoom ,selon latitude
130
131!      IF ( fxyhypb )   THEN
132!       tab_cntrl(23) = 1.
133!       tab_cntrl(24) = dzoomx ! extension en longitude  de la zone du zoom
134!       tab_cntrl(25) = dzoomy ! extension en latitude  de la zone du zoom
135!      ELSE
136!       tab_cntrl(23) = 0.
137!       tab_cntrl(24) = dzoomx ! extension en longitude  de la zone du zoom
138!       tab_cntrl(25) = dzoomy ! extension en latitude  de la zone du zoom
139!       tab_cntrl(26) = 0.
140!       IF ( ysinus)  tab_cntrl(26) = 1.
141!      ENDIF
142
143c-----------------------------------------------------------------------
144c   Copie du tableau des parametres de controle du RUN  (physique)
145c               dans le tableau tab_cntrl
146c-----------------------------------------------------------------------
147
148      DO l=1,50
149         tab_cntrl(50+l)=tab_cntrl_fi(l)
150      ENDDO
151
152c=======================================================================
153c       Ecriture NetCDF de l''entete du fichier "start_archive"
154c=======================================================================
155
156c
157c Preciser quelques attributs globaux:
158c
159      ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 21,
160     &                       "Fichier start_archive")
161c
162c Definir les dimensions du fichiers:
163c
164c     CHAMPS AJOUTES POUR LA VISUALISATION T,ps, etc... avec Grads ou ferret:
165      ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu)
166      ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv)
167      ierr = NF_DEF_DIM (nid, "altitude", llm, idim_llm)
168      ierr = NF_DEF_DIM (nid,"subsurface_layers",nsoilmx,idim_nsoilmx)
169
170      ierr = NF_DEF_DIM (nid,"index", length, idim_index)
171      ierr = NF_DEF_DIM (nid,"rlonu", iip1, idim_rlonu)
172      ierr = NF_DEF_DIM (nid,"rlatv", jjm, idim_rlatv)
173      ierr = NF_DEF_DIM (nid,"interlayer", llmp1, idim_llmp1)
174      ierr = NF_DEF_DIM (nid,"Time", NF_UNLIMITED, idim_tim)
175
176c
177      ierr = NF_ENDDEF(nid) ! sortir du mode de definition
178
179c-----------------------------------------------------------------------
180c  Ecriture du tableau des parametres du run
181c-----------------------------------------------------------------------
182
183      call def_var(nid,"Time","Time","days since 00:00:00",1,
184     .            idim_tim,nvarid,ierr)
185
186      ierr = NF_REDEF (nid)
187#ifdef NC_DOUBLE
188      ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1,idim_index,nvarid)
189#else
190      ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1,idim_index,nvarid)
191#endif
192      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22,
193     .                       "Parametres de controle")
194      ierr = NF_ENDDEF(nid)
195#ifdef NC_DOUBLE
196      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl)
197#else
198      ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl)
199#endif
200
201c-----------------------------------------------------------------------
202c  Ecriture des longitudes et latitudes
203c-----------------------------------------------------------------------
204
205      ierr = NF_REDEF (nid)
206#ifdef NC_DOUBLE
207      ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1,idim_rlonu,nvarid)
208#else
209      ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1,idim_rlonu,nvarid)
210#endif
211      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23,
212     .                       "Longitudes des points U")
213      ierr = NF_ENDDEF(nid)
214#ifdef NC_DOUBLE
215      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu)
216#else
217      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu)
218#endif
219c
220      ierr = NF_REDEF (nid)
221#ifdef NC_DOUBLE
222      ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1,idim_rlatu,nvarid)
223#else
224      ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1,idim_rlatu,nvarid)
225#endif
226      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22,
227     .                       "Latitudes des points U")
228      ierr = NF_ENDDEF(nid)
229#ifdef NC_DOUBLE
230      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu)
231#else
232      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu)
233#endif
234c
235      ierr = NF_REDEF (nid)
236#ifdef NC_DOUBLE
237      ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1,idim_rlonv,nvarid)
238#else
239      ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1,idim_rlonv,nvarid)
240#endif
241      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23,
242     .                       "Longitudes des points V")
243      ierr = NF_ENDDEF(nid)
244#ifdef NC_DOUBLE
245      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv)
246#else
247      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv)
248#endif
249c
250      ierr = NF_REDEF (nid)
251#ifdef NC_DOUBLE
252      ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1,idim_rlatv,nvarid)
253#else
254      ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1,idim_rlatv,nvarid)
255#endif
256      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22,
257     .                       "Latitudes des points V")
258      ierr = NF_ENDDEF(nid)
259#ifdef NC_DOUBLE
260      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv)
261#else
262      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv)
263#endif
264
265c-----------------------------------------------------------------------
266c  Ecriture des niveaux verticaux
267c-----------------------------------------------------------------------
268
269c
270      ierr = NF_REDEF (nid)
271#ifdef NC_DOUBLE
272      ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1,idim_llmp1,nvarid)
273#else
274      ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1,idim_llmp1,nvarid)
275#endif
276      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,
277     .                       "Coef A: niveaux pression hybride")
278      ierr = NF_ENDDEF(nid)
279#ifdef NC_DOUBLE
280      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap)
281#else
282      ierr = NF_PUT_VAR_REAL (nid,nvarid,ap)
283#endif
284c
285      ierr = NF_REDEF (nid)
286#ifdef NC_DOUBLE
287      ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1,idim_llmp1,nvarid)
288#else
289      ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1,idim_llmp1,nvarid)
290#endif
291      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 35,
292     .                       "Coefficient B niveaux sigma hybride")
293      ierr = NF_ENDDEF(nid)
294#ifdef NC_DOUBLE
295      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp)
296#else
297      ierr = NF_PUT_VAR_REAL (nid,nvarid,bp)
298#endif
299c
300c ----------------------
301      ierr = NF_REDEF (nid)
302#ifdef NC_DOUBLE
303      ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_llm,nvarid)
304#else
305      ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_llm,nvarid)
306#endif
307      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 36,
308     .      "Coef AS: hybrid pressure in midlayers")
309      ierr = NF_ENDDEF(nid)
310#ifdef NC_DOUBLE
311      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aps)
312#else
313      ierr = NF_PUT_VAR_REAL (nid,nvarid,aps)
314#endif
315c
316c ----------------------
317      ierr = NF_REDEF (nid)
318#ifdef NC_DOUBLE
319      ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_llm,nvarid)
320#else
321      ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_llm,nvarid)
322#endif
323      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 30,
324     .      "Coef BS: hybrid sigma midlayers")
325      ierr = NF_ENDDEF(nid)
326#ifdef NC_DOUBLE
327      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bps)
328#else
329      ierr = NF_PUT_VAR_REAL (nid,nvarid,bps)
330#endif
331c
332c ----------------------
333
334      ierr = NF_REDEF (nid)
335#ifdef NC_DOUBLE
336      ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1,idim_llm,nvarid)
337#else
338      ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1,idim_llm,nvarid)
339#endif
340      ierr = NF_ENDDEF(nid)
341#ifdef NC_DOUBLE
342      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs)
343#else
344      ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs)
345#endif
346c ------------------------------------------------------------------
347c  Variable uniquement pour visualisation avec Grads ou Ferret
348c ------------------------------------------------------------------
349      ierr = NF_REDEF (nid)
350#ifdef NC_DOUBLE
351      ierr = NF_DEF_VAR (nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid)
352#else
353      ierr = NF_DEF_VAR (nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid)
354#endif
355      ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")
356      ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
357     .      "North latitude")
358      ierr = NF_ENDDEF(nid)
359#ifdef NC_DOUBLE
360      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu/pi*180)
361#else
362      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu/pi*180)
363#endif
364c----------------------
365       ierr = NF_REDEF (nid)
366#ifdef NC_DOUBLE
367      ierr =NF_DEF_VAR(nid,"longitude", NF_DOUBLE, 1, idim_rlonv,nvarid)
368#else
369      ierr = NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, idim_rlonv,nvarid)
370#endif
371      ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14,
372     .      "East longitude")
373      ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east")
374      ierr = NF_ENDDEF(nid)
375#ifdef NC_DOUBLE
376      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv/pi*180)
377#else
378      ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv/pi*180)
379#endif
380c--------------------------
381      ierr = NF_REDEF (nid)
382#ifdef NC_DOUBLE
383      ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1,
384     .       idim_llm,nvarid)
385#else
386      ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1,
387     .       idim_llm,nvarid)
388#endif
389      ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",10,"pseudo-alt")
390      ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km")
391      ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up")
392
393      ierr = NF_ENDDEF(nid)
394#ifdef NC_DOUBLE
395      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pseudoalt)
396#else
397      ierr = NF_PUT_VAR_REAL (nid,nvarid,pseudoalt)
398#endif
399
400!-------------------------------
401! (soil) depth variable mlayer() (known from comsoil.h)
402!-------------------------------
403      ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode
404      ! define variable
405#ifdef NC_DOUBLE
406      ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1,idim_nsoilmx,nvarid)
407#else
408      ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1,idim_nsoilmx,nvarid)
409#endif
410      ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20,
411     .                        "Soil mid-layer depth")
412      ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",1,"m")
413      ierr=NF_PUT_ATT_TEXT (nid,nvarid,"positive",4,"down")
414      ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode
415      ! write variable
416#ifdef NC_DOUBLE
417      ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,mlayer)
418#else
419      ierr=NF_PUT_VAR_REAL (nid,nvarid,mlayer)
420#endif
421
422!---------------------
423! soil thermal inertia
424!---------------------
425      ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode
426      dims3(1)=idim_rlonv
427      dims3(2)=idim_rlatu
428      dims3(3)=idim_nsoilmx
429      ! define variable
430#ifdef NC_DOUBLE
431      ierr=NF_DEF_VAR(nid,"inertiedat",NF_DOUBLE,3,dims3,nvarid)
432#else
433      ierr=NF_DEF_VAR(nid,"inertiedat",NF_FLOAT,3,dims3,nvarid)
434#endif
435      ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20,
436     &                        "Soil thermal inertia")
437      ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",15,
438     &                        "J.s-1/2.m-2.K-1")
439      ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode
440      ! write variable
441#ifdef NC_DOUBLE
442      ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,ith)
443#else
444      ierr=NF_PUT_VAR_REAL (nid,nvarid,ith)
445#endif
446
447c-----------------------------------------------------------------------
448c  Ecriture aire et coefficients de passage cov. <-> contra. <--> naturel
449c-----------------------------------------------------------------------
450
451      ierr = NF_REDEF (nid)
452      dims2(1) = idim_rlonu
453      dims2(2) = idim_rlatu
454#ifdef NC_DOUBLE
455      ierr = NF_DEF_VAR (nid,"cu",NF_DOUBLE,2,dims2,nvarid)
456#else
457      ierr = NF_DEF_VAR (nid,"cu",NF_FLOAT,2,dims2,nvarid)
458#endif
459      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29,
460     .                       "Coefficient de passage pour U")
461      ierr = NF_ENDDEF(nid)
462#ifdef NC_DOUBLE
463      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu)
464#else
465      ierr = NF_PUT_VAR_REAL (nid,nvarid,cu)
466#endif
467c
468      ierr = NF_REDEF (nid)
469      dims2(1) = idim_rlonv
470      dims2(2) = idim_rlatv
471#ifdef NC_DOUBLE
472      ierr = NF_DEF_VAR (nid,"cv",NF_DOUBLE,2,dims2,nvarid)
473#else
474      ierr = NF_DEF_VAR (nid,"cv",NF_FLOAT,2,dims2,nvarid)
475#endif
476      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29,
477     .                       "Coefficient de passage pour V")
478      ierr = NF_ENDDEF(nid)
479#ifdef NC_DOUBLE
480      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv)
481#else
482      ierr = NF_PUT_VAR_REAL (nid,nvarid,cv)
483#endif
484c
485c Aire de chaque maille:
486c
487      ierr = NF_REDEF (nid)
488      dims2(1) = idim_rlonv
489      dims2(2) = idim_rlatu
490#ifdef NC_DOUBLE
491      ierr = NF_DEF_VAR (nid,"aire",NF_DOUBLE,2,dims2,nvarid)
492#else
493      ierr = NF_DEF_VAR (nid,"aire",NF_FLOAT,2,dims2,nvarid)
494#endif
495      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22,
496     .                       "Aires de chaque maille")
497      ierr = NF_ENDDEF(nid)
498#ifdef NC_DOUBLE
499      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire)
500#else
501      ierr = NF_PUT_VAR_REAL (nid,nvarid,aire)
502#endif
503
504c-----------------------------------------------------------------------
505c  Ecriture du geopentiel au sol
506c-----------------------------------------------------------------------
507
508      ierr = NF_REDEF (nid)
509      dims2(1) = idim_rlonv
510      dims2(2) = idim_rlatu
511#ifdef NC_DOUBLE
512      ierr = NF_DEF_VAR (nid,"phisinit",NF_DOUBLE,2,dims2,nvarid)
513#else
514      ierr = NF_DEF_VAR (nid,"phisinit",NF_FLOAT,2,dims2,nvarid)
515#endif
516      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19,
517     .                       "Geopotentiel au sol")
518      ierr = NF_ENDDEF(nid)
519#ifdef NC_DOUBLE
520      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis)
521#else
522      ierr = NF_PUT_VAR_REAL (nid,nvarid,phis)
523#endif
524
525      PRINT*,'ini_archive: iim,jjm,llm,idayref',iim,jjm,llm,idayref
526      PRINT*,'ini_archive: rad,omeg,g,mugaz,kappa',
527     s rad,omeg,g,tab_cntrl_fi(8),kappa
528      PRINT*,'ini_archive: daysec,dtvr',daysec,dtvr
529
530      RETURN
531      END
Note: See TracBrowser for help on using the repository browser.