source: LMDZ.3.3/branches/rel-LF/libf/phylmd/initphysto.F @ 486

Last change on this file since 486 was 353, checked in by lmdzadmin, 22 years ago

2 changements pour les fichiers histoire:

  • utilisation de l'entree "rectilineaire" de IOIPSL pour ne plus avoir

a

lancer ncregular a chaque fois

  • le calendrier des fichiers histoire est maintenant base sur la date d'initialisation de la simulation plutot que sur la date de depart du

job

en cours

LF

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