source: LMDZ4/branches/LMDZ4_par_0/libf/phylmd/initphysto.F @ 634

Last change on this file since 634 was 634, checked in by Laurent Fairhead, 19 years ago

Modifications faites à la physique pour la rendre parallele YM
Une branche de travail LMDZ4_par_0 a été créée provisoirement afin de tester
les modifs pleinement avant leurs inclusions dans le tronc principal
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)
[634]9       
10       USE dimphy
[524]11       USE IOIPSL
[634]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"
[634]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       
[634]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
[634]102      call histbeg_phy(infile,tau0, zjulian, tstep,
103     .                 nhoriid, fileid)
[524]104
105C  Appel a histvert pour la grille verticale
106C
107        DO l=1,llm
108            nivsigs(l)=float(l)
109         ENDDO
110       
111        write(*,*) 'avant histvert ds initphysto'
112
113      call histvert(fileid, 'sig_s', 'Niveaux sigma',
114     . 'sigma_level',
115     .              llm, nivsigs, zvertiid)
116C
117C  Appels a histdef pour la definition des variables a sauvegarder
118C
119        write(*,*) 'apres histvert ds initphysto'
120
121       CALL histdef(fileid, "phis", "Surface geop. height", "-",
[634]122     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]123     .                "once", t_ops, t_wrt)
124c
125        write(*,*) 'apres phis ds initphysto'
126
127         CALL histdef(fileid, "aire", "Grid area", "-",
[634]128     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]129     .                "once", t_ops, t_wrt)
130         write(*,*) 'apres aire ds initphysto'
131
[634]132cym     Attention dtime et istphy ne sont pas écrit ---> a éliminer ?
[524]133         CALL histdef(fileid, "dtime", "tps phys ", "s",
134     .                1,1,nhoriid, 1,1,1, -99, 32,
135     .                "once", t_ops, t_wrt)
136       
137         CALL histdef(fileid, "istphy", "tps stock", "s",
138     .                1,1,nhoriid, 1,1,1, -99, 32,
139     .                "once", t_ops, t_wrt)
140
141C T
142C
143      call histdef(fileid, 't', 'Temperature', 'K',
[634]144     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]145     .             32, 'inst(X)', t_ops, t_wrt)
146        write(*,*) 'apres t ds initphysto'
147C mfu
148C
149      call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',
[634]150     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]151     .             32, 'inst(X)', t_ops, t_wrt)
152        write(*,*) 'apres mfu ds initphysto'
153C
154C mfd
155C
156      call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',
[634]157     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]158     .             32, 'inst(X)', t_ops, t_wrt)
159
160C
161C en_u
162C
163      call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s',
[634]164     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]165     .             32, 'inst(X)', t_ops, t_wrt)
166               write(*,*) 'apres en_u ds initphysto'
167C
168C de_u
169C
170      call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',
[634]171     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]172     .             32, 'inst(X)', t_ops, t_wrt)
173
174C
175C en_d
176C
177      call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s',
[634]178     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]179     .             32, 'inst(X)', t_ops, t_wrt)
180C
181
182C
183C de_d
184C
185      call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s',
[634]186     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]187     .             32, 'inst(X)', t_ops, t_wrt)
188
189c coefh frac_impa,frac_nucl
190       
[541]191        call histdef(fileid, "coefh", " ", " ",
[634]192     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]193     .             32, "inst(X)", t_ops, t_wrt)
194
195c abderrahmane le 16 09 02
196        call histdef(fileid, "fm_th", " ", " ",
[634]197     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]198     .             32, "inst(X)", t_ops, t_wrt)
199
200        call histdef(fileid, "en_th", " ", " ",
[634]201     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[541]202     .             32, "inst(X)", t_ops, t_wrt)
203c fin aj
[524]204       
205        write(*,*) 'apres coefh ds initphysto' 
206
207        call histdef(fileid, 'frac_impa', ' ', ' ',
[634]208     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]209     .             32, 'inst(X)', t_ops, t_wrt)
210       
211        call histdef(fileid, 'frac_nucl', ' ', ' ',
[634]212     .             iim, jjphy_nb, nhoriid, llm, 1, llm, zvertiid,
[524]213     .             32, 'inst(X)', t_ops, t_wrt)
214
215c
216c pyu1
217c
218      CALL histdef(fileid, "pyu1", " ", " ",
[634]219     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]220     .                "inst(X)", t_ops, t_wrt)
221
222c
223c pyv1
224c
225        CALL histdef(fileid, "pyv1", " ", " ",
[634]226     .                iim,jjphy_nb,nhoriid, 1,1,1, -99, 32,
[524]227     .                "inst(X)", t_ops, t_wrt)
228       
229        write(*,*) 'apres pyv1 ds initphysto'
230c
231c ftsol1
232c
233        call histdef(fileid, "ftsol1", " ", " ",
[634]234     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
[524]235     .             "inst(X)", t_ops, t_wrt)
236
237c
238c ftsol2
239c
240        call histdef(fileid, "ftsol2", " ", " ",
[634]241     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,32,
[524]242     .             "inst(X)", t_ops, t_wrt)
243
244c
245c ftsol3
246c
247        call histdef(fileid, "ftsol3", " ", " ",
[634]248     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]249     .             32, "inst(X)", t_ops, t_wrt)
250
251c
252c ftsol4
253c
254        call histdef(fileid, "ftsol4", " ", " ",
[634]255     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]256     .             32, "inst(X)", t_ops, t_wrt)
257       
258c
259c rain
260c
261        call histdef(fileid, "rain", " ", " ",
[634]262     .             iim, jjphy_nb, nhoriid, 1, 1,1, -99,
[524]263     .             32, "inst(X)", t_ops, t_wrt)
264
265c
266c psrf1
267c
268        call histdef(fileid, "psrf1", " ", " ",
[634]269     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]270     .             32, "inst(X)", t_ops, t_wrt)
271       
272c
273c psrf2
274c
275        call histdef(fileid, "psrf2", " ", " ",
[634]276     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]277     .             32, "inst(X)", t_ops, t_wrt)
278
279c
280c psrf3
281c
282        call histdef(fileid, "psrf3", " ", " ",
[634]283     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]284     .             32, "inst(X)", t_ops, t_wrt)
285
286c
287c psrf4
288c
289        call histdef(fileid, "psrf4", " ", " ",
[634]290     .             iim, jjphy_nb, nhoriid, 1, 1, 1, -99,
[524]291     .             32, "inst(X)", t_ops, t_wrt)
292       
293        write(*,*) 'avant histend ds initphysto'       
294
295      call histend(fileid)
[541]296c     if (ok_sync) call histsync(fileid)
297      if (ok_sync) call histsync
[524]298
299       
300
301      return
302      end
Note: See TracBrowser for help on using the repository browser.