source: LMDZ.3.3/branches/rel-1-0-patch/libf/bibio/inithist.F @ 488

Last change on this file since 488 was 349, checked in by lmdz, 22 years ago

Regle le probleme de decalage de 1 jour au debut de chaque simulation
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1C
2C $Header$
3C
4      subroutine inithist(infile,day0,anne0,tstep,t_ops,t_wrt,nq,fileid,
5     .                    filevid)
6
7       USE IOIPSL
8
9      implicit none
10
11C
12C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
13C   au format IOIPSL
14C
15C   Appels succesifs des routines: histbeg
16C                                  histhori
17C                                  histver
18C                                  histdef
19C                                  histend
20C
21C   Entree:
22C
23C      infile: nom du fichier histoire a creer
24C      day0,anne0: date de reference
25C      tstep: duree du pas de temps en seconde
26C      t_ops: frequence de l'operation pour IOIPSL
27C      t_wrt: frequence d'ecriture sur le fichier
28C      nq: nombre de traceurs
29C
30C   Sortie:
31C      fileid: ID du fichier netcdf cree
32C      filevid:ID du fichier netcdf pour la grille v
33C
34C   L. Fairhead, LMD, 03/99
35C
36C =====================================================================
37C
38C   Declarations
39#include "dimensions.h"
40#include "paramet.h"
41#include "comconst.h"
42#include "comvert.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
50C   Arguments
51C
52      character*(*) infile
53      integer*4 day0, anne0
54      real tstep, t_ops, t_wrt
55      integer fileid, filevid
56      integer nq
57
58C   Variables locales
59C
60      integer tau0
61      real zjulian
62      character*3 str
63      character*10 ctrac
64      integer iq
65      real rlong(iip1,jjp1), rlat(iip1,jjp1)
66      integer uhoriid, vhoriid, thoriid, zvertiid
67      integer ii,jj
68      integer zan, idayref
69C
70C  Initialisations
71C
72      pi = 4. * atan (1.)
73      str='q  '
74      ctrac = 'traceur   '
75C
76C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
77C         
78
79      zan = anne0
80      idayref = day0
81      CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
82      tau0 = 0
83     
84      do jj = 1, jjp1
85        do ii = 1, iip1
86          rlong(ii,jj) = rlonu(ii) * 180. / pi
87          rlat(ii,jj) = rlatu(jj) * 180. / pi
88        enddo
89      enddo
90       
91      call histbeg(infile, iip1, rlong, jjp1, rlat,
92     .             1, iip1, 1, jjp1,
93     .             tau0, zjulian, tstep, uhoriid, fileid)
94C
95C  Creation du fichier histoire pour la grille en V (oblige pour l'instant,
96C  IOIPSL ne permet pas de grilles avec des nombres de point differents dans
97C  un meme fichier)
98
99      do jj = 1, jjm
100        do ii = 1, iip1
101          rlong(ii,jj) = rlonv(ii) * 180. / pi
102          rlat(ii,jj) = rlatv(jj) * 180. / pi
103        enddo
104      enddo
105
106      call histbeg('dyn_histv.nc', iip1, rlong, jjm, rlat,
107     .             1, iip1, 1, jjm,
108     .             tau0, zjulian, tstep, vhoriid, filevid)
109C
110C  Appel a histhori pour rajouter les autres grilles horizontales
111C
112      do jj = 1, jjp1
113        do ii = 1, iip1
114          rlong(ii,jj) = rlonv(ii) * 180. / pi
115          rlat(ii,jj) = rlatu(jj) * 180. / pi
116        enddo
117      enddo
118
119      call histhori(fileid, iip1, rlong, jjp1, rlat, 'scalar',
120     .              'Grille points scalaires', thoriid)
121C
122C  Appel a histvert pour la grille verticale
123C
124      call histvert(fileid, 'sig_s', 'Niveaux sigma','-',
125     .              llm, nivsigs, zvertiid)
126C Pour le fichier V
127      call histvert(filevid, 'sig_s', 'Niveaux sigma','-',
128     .              llm, nivsigs, zvertiid)
129C
130C  Appels a histdef pour la definition des variables a sauvegarder
131C
132C  Vents U
133C
134      call histdef(fileid, 'ucov', 'vents u covariants', 'm/s',
135     .             iip1, jjp1, uhoriid, llm, 1, llm, zvertiid,
136     .             32, 'inst(X)', t_ops, t_wrt)
137C
138C  Vents V
139C
140      call histdef(filevid, 'vcov', 'vents v covariants', 'm/s',
141     .             iip1, jjm, vhoriid, llm, 1, llm, zvertiid,
142     .             32, 'inst(X)', t_ops, t_wrt)
143
144C
145C  Temperature potentielle
146C
147      call histdef(fileid, 'teta', 'temperature potentielle', '-',
148     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
149     .             32, 'inst(X)', t_ops, t_wrt)
150C
151C  Geopotentiel
152C
153      call histdef(fileid, 'phi', 'geopotentiel instantane', '-',
154     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
155     .             32, 'inst(X)', t_ops, t_wrt)
156C
157C  Traceurs
158C
159      IF(nq.GE.1) THEN
160        DO iq=1,nq
161          IF ( iq.LE.9 ) THEN
162            WRITE(str(2:2),'(i1.1)') iq
163            write(ctrac(9:9),'(i1.1)') iq
164          ELSE
165            WRITE(str(2:3),'(i2.2)') iq
166            write(ctrac(9:10),'(i2.2)') iq
167          ENDIF
168          call histdef(fileid, str, ctrac, '-',
169     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
170     .             32, 'inst(X)', t_ops, t_wrt)
171        enddo
172      endif
173C
174C  Masse
175C
176      call histdef(fileid, 'masse', 'masse', 'kg',
177     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
178     .             32, 'inst(X)', t_ops, t_wrt)
179C
180C  Pression au sol
181C
182      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
183     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
184     .             32, 'inst(X)', t_ops, t_wrt)
185C
186C  Pression au sol
187C
188      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
189     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
190     .             32, 'inst(X)', t_ops, t_wrt)
191C
192C  Fin
193C
194      call histend(fileid)
195      call histend(filevid)
196      return
197      end
Note: See TracBrowser for help on using the repository browser.