source: LMDZ4/trunk/libf/phylmd/initphysto.F @ 1400

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