source: LMDZ4/trunk/libf/phylmd/initphysto.F @ 594

Last change on this file since 594 was 541, checked in by lmdzadmin, 20 years ago

Convergence avec la version d'Olivia Coindreau incluant:

  • le offline
  • les thermiques
  • mellor & yamada dans la couche limite

LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.7 KB
Line 
1!
2! $Header$
3!
4C
5C
6      subroutine initphysto
7     .  (infile,
8     .  rlon, rlat, tstep,t_ops,t_wrt,nq,fileid)
9
10       USE IOIPSL
11
12      implicit none
13
14C
15C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
16C   au format IOIPSL
17C
18C   Appels succesifs des routines: histbeg
19C                                  histhori
20C                                  histver
21C                                  histdef
22C                                  histend
23C
24C   Entree:
25C
26C      infile: nom du fichier histoire a creer
27C      day0,anne0: date de reference
28C      tstep: duree du pas de temps en seconde
29C      t_ops: frequence de l'operation pour IOIPSL
30C      t_wrt: frequence d'ecriture sur le fichier
31C      nq: nombre de traceurs
32C
33C   Sortie:
34C      fileid: ID du fichier netcdf cree
35C      filevid:ID du fichier netcdf pour la grille v
36C
37C   L. Fairhead, LMD, 03/99
38C
39C =====================================================================
40C
41C   Declarations
42#include "dimensions.h"
43#include "paramet.h"
44#include "comconst.h"
45#include "comgeom.h"
46#include "temps.h"
47#include "ener.h"
48#include "logic.h"
49#include "description.h"
50#include "serre.h"
51#include "indicesol.h"
52#include "control.h"
53#include "dimphy.h"
54
55C   Arguments
56      character*(*) infile
57      integer*4 nhoriid, i
58      real tstep, t_ops, t_wrt
59      integer fileid, filevid
60      integer nq,l
61      real nivsigs(llm)
62
63C   Variables locales
64C
65      integer tau0
66      real zjulian
67      character*3 str
68      character*10 ctrac
69      integer iq
70      integer uhoriid, vhoriid, thoriid, zvertiid
71      integer ii,jj
72      integer zan, idayref
73      logical ok_sync
74      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
75C
76      REAL rlon(klon), rlat(klon)
77
78C  Initialisations
79C
80      pi = 4. * atan (1.)
81      str='q  '
82      ctrac = 'traceur   '
83      ok_sync= .true.
84C
85C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
86C         
87
88      zan = annee_ref
89      idayref = day_ref
90      CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
91      tau0 = 0
92       
93        CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon)
94         DO i = 1, iim
95            zx_lon(i,1) = rlon(i+1)
96            zx_lon(i,jjm+1) = rlon(i+1)
97         ENDDO
98         CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat)
99
100
101      call histbeg(infile, iim, zx_lon(:,1), jjm+1, zx_lat(1,:),
102     .             1, iim, 1, jjm+1,
103     .             tau0, zjulian, tstep, nhoriid, fileid)
104
105C  Appel a histvert pour la grille verticale
106C
107        DO l=1,llm
108            nivsigs(l)=float(l)
109         ENDDO
110       
111        write(*,*) 'avant histvert ds initphysto'
112
113      call histvert(fileid, 'sig_s', 'Niveaux sigma',
114     . 'sigma_level',
115     .              llm, nivsigs, zvertiid)
116C
117C  Appels a histdef pour la definition des variables a sauvegarder
118C
119        write(*,*) 'apres histvert ds initphysto'
120
121       CALL histdef(fileid, "phis", "Surface geop. height", "-",
122     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
123     .                "once", t_ops, t_wrt)
124c
125        write(*,*) 'apres phis ds initphysto'
126
127         CALL histdef(fileid, "aire", "Grid area", "-",
128     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
129     .                "once", t_ops, t_wrt)
130         write(*,*) 'apres aire ds initphysto'
131
132         CALL histdef(fileid, "dtime", "tps phys ", "s",
133     .                1,1,nhoriid, 1,1,1, -99, 32,
134     .                "once", t_ops, t_wrt)
135       
136         CALL histdef(fileid, "istphy", "tps stock", "s",
137     .                1,1,nhoriid, 1,1,1, -99, 32,
138     .                "once", t_ops, t_wrt)
139
140C T
141C
142      call histdef(fileid, 't', 'Temperature', 'K',
143     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
144     .             32, 'inst(X)', t_ops, t_wrt)
145        write(*,*) 'apres t ds initphysto'
146C mfu
147C
148      call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',
149     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
150     .             32, 'inst(X)', t_ops, t_wrt)
151        write(*,*) 'apres mfu ds initphysto'
152C
153C mfd
154C
155      call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',
156     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
157     .             32, 'inst(X)', t_ops, t_wrt)
158
159C
160C en_u
161C
162      call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s',
163     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
164     .             32, 'inst(X)', t_ops, t_wrt)
165               write(*,*) 'apres en_u ds initphysto'
166C
167C de_u
168C
169      call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',
170     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
171     .             32, 'inst(X)', t_ops, t_wrt)
172
173C
174C en_d
175C
176      call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s',
177     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
178     .             32, 'inst(X)', t_ops, t_wrt)
179C
180
181C
182C de_d
183C
184      call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s',
185     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
186     .             32, 'inst(X)', t_ops, t_wrt)
187
188c coefh frac_impa,frac_nucl
189       
190        call histdef(fileid, "coefh", " ", " ",
191     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
192     .             32, "inst(X)", t_ops, t_wrt)
193
194c abderrahmane le 16 09 02
195        call histdef(fileid, "fm_th", " ", " ",
196     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
197     .             32, "inst(X)", t_ops, t_wrt)
198
199        call histdef(fileid, "en_th", " ", " ",
200     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
201     .             32, "inst(X)", t_ops, t_wrt)
202c fin aj
203       
204        write(*,*) 'apres coefh ds initphysto' 
205
206        call histdef(fileid, 'frac_impa', ' ', ' ',
207     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
208     .             32, 'inst(X)', t_ops, t_wrt)
209       
210        call histdef(fileid, 'frac_nucl', ' ', ' ',
211     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
212     .             32, 'inst(X)', t_ops, t_wrt)
213
214c
215c pyu1
216c
217      CALL histdef(fileid, "pyu1", " ", " ",
218     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
219     .                "inst(X)", t_ops, t_wrt)
220
221c
222c pyv1
223c
224        CALL histdef(fileid, "pyv1", " ", " ",
225     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
226     .                "inst(X)", t_ops, t_wrt)
227       
228        write(*,*) 'apres pyv1 ds initphysto'
229c
230c ftsol1
231c
232        call histdef(fileid, "ftsol1", " ", " ",
233     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
234     .             "inst(X)", t_ops, t_wrt)
235
236c
237c ftsol2
238c
239        call histdef(fileid, "ftsol2", " ", " ",
240     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
241     .             "inst(X)", t_ops, t_wrt)
242
243c
244c ftsol3
245c
246        call histdef(fileid, "ftsol3", " ", " ",
247     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
248     .             32, "inst(X)", t_ops, t_wrt)
249
250c
251c ftsol4
252c
253        call histdef(fileid, "ftsol4", " ", " ",
254     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
255     .             32, "inst(X)", t_ops, t_wrt)
256       
257c
258c rain
259c
260        call histdef(fileid, "rain", " ", " ",
261     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
262     .             32, "inst(X)", t_ops, t_wrt)
263
264c
265c psrf1
266c
267        call histdef(fileid, "psrf1", " ", " ",
268     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
269     .             32, "inst(X)", t_ops, t_wrt)
270       
271c
272c psrf2
273c
274        call histdef(fileid, "psrf2", " ", " ",
275     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
276     .             32, "inst(X)", t_ops, t_wrt)
277
278c
279c psrf3
280c
281        call histdef(fileid, "psrf3", " ", " ",
282     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
283     .             32, "inst(X)", t_ops, t_wrt)
284
285c
286c psrf4
287c
288        call histdef(fileid, "psrf4", " ", " ",
289     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
290     .             32, "inst(X)", t_ops, t_wrt)
291       
292        write(*,*) 'avant histend ds initphysto'       
293
294      call histend(fileid)
295c     if (ok_sync) call histsync(fileid)
296      if (ok_sync) call histsync
297
298       
299
300      return
301      end
Note: See TracBrowser for help on using the repository browser.