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

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

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 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       
194        write(*,*) 'apres coefh ds initphysto' 
195
196        call histdef(fileid, 'frac_impa', ' ', ' ',
197     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
198     .             32, 'inst(X)', t_ops, t_wrt)
199       
200        call histdef(fileid, 'frac_nucl', ' ', ' ',
201     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
202     .             32, 'inst(X)', t_ops, t_wrt)
203
204c
205c pyu1
206c
207      CALL histdef(fileid, "pyu1", " ", " ",
208     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
209     .                "inst(X)", t_ops, t_wrt)
210
211c
212c pyv1
213c
214        CALL histdef(fileid, "pyv1", " ", " ",
215     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
216     .                "inst(X)", t_ops, t_wrt)
217       
218        write(*,*) 'apres pyv1 ds initphysto'
219c
220c ftsol1
221c
222        call histdef(fileid, "ftsol1", " ", " ",
223     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
224     .             "inst(X)", t_ops, t_wrt)
225
226c
227c ftsol2
228c
229        call histdef(fileid, "ftsol2", " ", " ",
230     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
231     .             "inst(X)", t_ops, t_wrt)
232
233c
234c ftsol3
235c
236        call histdef(fileid, "ftsol3", " ", " ",
237     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
238     .             32, "inst(X)", t_ops, t_wrt)
239
240c
241c ftsol4
242c
243        call histdef(fileid, "ftsol4", " ", " ",
244     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
245     .             32, "inst(X)", t_ops, t_wrt)
246       
247c
248c rain
249c
250        call histdef(fileid, "rain", " ", " ",
251     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
252     .             32, "inst(X)", t_ops, t_wrt)
253
254c
255c psrf1
256c
257        call histdef(fileid, "psrf1", " ", " ",
258     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
259     .             32, "inst(X)", t_ops, t_wrt)
260       
261c
262c psrf2
263c
264        call histdef(fileid, "psrf2", " ", " ",
265     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
266     .             32, "inst(X)", t_ops, t_wrt)
267
268c
269c psrf3
270c
271        call histdef(fileid, "psrf3", " ", " ",
272     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
273     .             32, "inst(X)", t_ops, t_wrt)
274
275c
276c psrf4
277c
278        call histdef(fileid, "psrf4", " ", " ",
279     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
280     .             32, "inst(X)", t_ops, t_wrt)
281       
282        write(*,*) 'avant histend ds initphysto'       
283
284      call histend(fileid)
285      if (ok_sync) call histsync(fileid)
286
287       
288
289      return
290      end
Note: See TracBrowser for help on using the repository browser.