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

Last change on this file since 766 was 766, checked in by Laurent Fairhead, 17 years ago

Merge entre la version V3_conv et le HEAD
YM, JG, LF

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