source: LMDZ4/branches/LMDZ4_AR5/libf/phylmd/initphysto.F @ 1483

Last change on this file since 1483 was 1279, checked in by Laurent Fairhead, 14 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

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