source: LMDZ4/branches/V3_test/libf/phylmd/initphysto.F @ 1413

Last change on this file since 1413 was 704, checked in by Laurent Fairhead, 18 years ago

Inclusion des modifs de Y. Meurdesoif pour la version V3
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
RevLine 
[524]1!
2! $Header$
3!
4C
5C
6      subroutine initphysto
7     .  (infile,
8     .  rlon, rlat, tstep,t_ops,t_wrt,nq,fileid)
[704]9       
10       USE dimphy
[524]11       USE IOIPSL
[704]12       USE iophy
[524]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"
[704]54cym#include "dimphy.h"
[524]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       
[704]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)
[524]100
101
[704]102      call histbeg_phy(infile,tau0, zjulian, tstep,
103     .                 nhoriid, fileid)
[524]104
[704]105c$OMP MASTER   
[524]106C  Appel a histvert pour la grille verticale
107C
108        DO l=1,llm
109            nivsigs(l)=float(l)
110         ENDDO
[704]111
[524]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", "-",
[704]123     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]124     .                "once", t_ops, t_wrt)
125c
126        write(*,*) 'apres phis ds initphysto'
127
128         CALL histdef(fileid, "aire", "Grid area", "-",
[704]129     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]130     .                "once", t_ops, t_wrt)
131         write(*,*) 'apres aire ds initphysto'
132
[704]133cym     Attention dtime et istphy ne sont pas �rit ---> a �iminer ?
[524]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',
[704]145     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]151     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]158     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]165     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]172     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]179     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]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',
[704]187     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]188     .             32, 'inst(X)', t_ops, t_wrt)
189
190c coefh frac_impa,frac_nucl
191       
[541]192        call histdef(fileid, "coefh", " ", " ",
[704]193     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]194     .             32, "inst(X)", t_ops, t_wrt)
195
196c abderrahmane le 16 09 02
197        call histdef(fileid, "fm_th", " ", " ",
[704]198     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]199     .             32, "inst(X)", t_ops, t_wrt)
200
201        call histdef(fileid, "en_th", " ", " ",
[704]202     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]203     .             32, "inst(X)", t_ops, t_wrt)
204c fin aj
[524]205       
206        write(*,*) 'apres coefh ds initphysto' 
207
208        call histdef(fileid, 'frac_impa', ' ', ' ',
[704]209     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]210     .             32, 'inst(X)', t_ops, t_wrt)
211       
212        call histdef(fileid, 'frac_nucl', ' ', ' ',
[704]213     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]214     .             32, 'inst(X)', t_ops, t_wrt)
215
216c
217c pyu1
218c
219      CALL histdef(fileid, "pyu1", " ", " ",
[704]220     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]221     .                "inst(X)", t_ops, t_wrt)
222
223c
224c pyv1
225c
226        CALL histdef(fileid, "pyv1", " ", " ",
[704]227     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]228     .                "inst(X)", t_ops, t_wrt)
229       
230        write(*,*) 'apres pyv1 ds initphysto'
231c
232c ftsol1
233c
234        call histdef(fileid, "ftsol1", " ", " ",
[704]235     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
[524]236     .             "inst(X)", t_ops, t_wrt)
237
238c
239c ftsol2
240c
241        call histdef(fileid, "ftsol2", " ", " ",
[704]242     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
[524]243     .             "inst(X)", t_ops, t_wrt)
244
245c
246c ftsol3
247c
248        call histdef(fileid, "ftsol3", " ", " ",
[704]249     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]250     .             32, "inst(X)", t_ops, t_wrt)
251
252c
253c ftsol4
254c
255        call histdef(fileid, "ftsol4", " ", " ",
[704]256     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]257     .             32, "inst(X)", t_ops, t_wrt)
258       
259c
260c rain
261c
262        call histdef(fileid, "rain", " ", " ",
[704]263     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]264     .             32, "inst(X)", t_ops, t_wrt)
265
266c
267c psrf1
268c
269        call histdef(fileid, "psrf1", " ", " ",
[704]270     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]271     .             32, "inst(X)", t_ops, t_wrt)
272       
273c
274c psrf2
275c
276        call histdef(fileid, "psrf2", " ", " ",
[704]277     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]278     .             32, "inst(X)", t_ops, t_wrt)
279
280c
281c psrf3
282c
283        call histdef(fileid, "psrf3", " ", " ",
[704]284     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]285     .             32, "inst(X)", t_ops, t_wrt)
286
287c
288c psrf4
289c
290        call histdef(fileid, "psrf4", " ", " ",
[704]291     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]292     .             32, "inst(X)", t_ops, t_wrt)
293       
294        write(*,*) 'avant histend ds initphysto'       
295
296      call histend(fileid)
[541]297c     if (ok_sync) call histsync(fileid)
298      if (ok_sync) call histsync
[704]299c$OMP END MASTER
[524]300       
301
302      return
303      end
Note: See TracBrowser for help on using the repository browser.