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

Last change on this file since 200 was 197, checked in by lmdz, 23 years ago

Chgts divers pour le offline/nudge FH
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.1 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 T
136C
137      call histdef(fileid, 't', 'Temperature', 'K',
138     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
139     .             32, 'inst(X)', t_ops, t_wrt)
140        write(*,*) 'apres t ds initphysto'
141C mfu
142C
143      call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',
144     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
145     .             32, 'inst(X)', t_ops, t_wrt)
146        write(*,*) 'apres mfu ds initphysto'
147C
148C mfd
149C
150      call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',
151     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
152     .             32, 'inst(X)', t_ops, t_wrt)
153
154C
155C en_u
156C
157      call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s',
158     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
159     .             32, 'inst(X)', t_ops, t_wrt)
160               write(*,*) 'apres en_u ds initphysto'
161C
162C de_u
163C
164      call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',
165     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
166     .             32, 'inst(X)', t_ops, t_wrt)
167
168C
169C en_d
170C
171      call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s',
172     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
173     .             32, 'inst(X)', t_ops, t_wrt)
174C
175
176C
177C de_d
178C
179      call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s',
180     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
181     .             32, 'inst(X)', t_ops, t_wrt)
182
183c coefh frac_impa,frac_nucl
184       
185        call histdef(fileid, 'coefh', ' ', ' ',
186     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
187     .             32, 'inst(X)', t_ops, t_wrt)
188       
189        write(*,*) 'apres coefh ds initphysto' 
190
191        call histdef(fileid, 'frac_impa', ' ', ' ',
192     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
193     .             32, 'inst(X)', t_ops, t_wrt)
194       
195        call histdef(fileid, 'frac_nucl', ' ', ' ',
196     .             iim, jjm+1, nhoriid, llm, 1, llm, zvertiid,
197     .             32, 'inst(X)', t_ops, t_wrt)
198
199c
200c pyu1
201c
202      CALL histdef(fileid, "pyu1", " ", " ",
203     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
204     .                "inst(X)", t_ops, t_wrt)
205
206c
207c pyv1
208c
209        CALL histdef(fileid, "pyv1", " ", " ",
210     .                iim,jjm+1,nhoriid, 1,1,1, -99, 32,
211     .                "inst(X)", t_ops, t_wrt)
212       
213        write(*,*) 'apres pyv1 ds initphysto'
214c
215c ftsol1
216c
217        call histdef(fileid, "ftsol1", " ", " ",
218     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
219     .             "inst(X)", t_ops, t_wrt)
220
221c
222c ftsol2
223c
224        call histdef(fileid, "ftsol2", " ", " ",
225     .             iim, jjm+1, nhoriid, 1, 1,1, -99,32,
226     .             "inst(X)", t_ops, t_wrt)
227
228c
229c ftsol3
230c
231        call histdef(fileid, "ftsol3", " ", " ",
232     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
233     .             32, "inst(X)", t_ops, t_wrt)
234
235c
236c ftsol4
237c
238        call histdef(fileid, "ftsol4", " ", " ",
239     .             iim, jjm+1, nhoriid, 1, 1,1, -99,
240     .             32, "inst(X)", t_ops, t_wrt)
241       
242       
243c
244c psrf1
245c
246        call histdef(fileid, "psrf1", " ", " ",
247     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
248     .             32, "inst(X)", t_ops, t_wrt)
249       
250c
251c psrf2
252c
253        call histdef(fileid, "psrf2", " ", " ",
254     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
255     .             32, "inst(X)", t_ops, t_wrt)
256
257c
258c psrf3
259c
260        call histdef(fileid, "psrf3", " ", " ",
261     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
262     .             32, "inst(X)", t_ops, t_wrt)
263
264c
265c psrf4
266c
267        call histdef(fileid, "psrf4", " ", " ",
268     .             iim, jjm+1, nhoriid, 1, 1, 1, -99,
269     .             32, "inst(X)", t_ops, t_wrt)
270       
271        write(*,*) 'avant histend ds initphysto'       
272
273      call histend(fileid)
274      if (ok_sync) call histsync(fileid)
275
276       
277
278      return
279      end
Note: See TracBrowser for help on using the repository browser.