source: LMDZ.3.3/trunk/libf/phylmd/initphysto.F @ 72

Last change on this file since 72 was 52, checked in by lmdzadmin, 24 years ago

Ecriture des fluxs dans des fichiers Netcdf utilisant IOIPSL. M.Bonazzola
LF

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