source: LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/inithist_p.F @ 1114

Last change on this file since 1114 was 1114, checked in by jghattas, 15 years ago

Creation du module infotrac:

  • contient les variables de advtrac.h
  • contient la subroutine iniadvtrac renommer en infotrac_init
  • le nombre des traceurs est lu dans tracer.def en dynamique (ou par default ou recu par INCA)
  • ce module est utilise dans la dynamique et la physique
  • contient aussi la variable nbtr qui avant etait stockee dans dimphy

Le fichier advtrac.h n'existe plus.
La compilation ne prend plus en compte le nombre de traceur.

/JG

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.2 KB
Line 
1!
2! $Header$
3!
4      subroutine inithist_p(infile,day0,anne0,tstep,t_ops,t_wrt,
5     .                      fileid,filevid)
6
7       USE IOIPSL
8       use parallel
9       use Write_field
10       use misc_mod
11       USE infotrac
12
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
33C   Sortie:
34C      fileid: ID du fichier netcdf cree
35C      filevid:ID du fichier netcdf pour la grille v
36C
37C   L. Fairhead, LMD, 03/99
38C
39C =====================================================================
40C
41C   Declarations
42#include "dimensions.h"
43#include "paramet.h"
44#include "comconst.h"
45#include "comvert.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
53C   Arguments
54C
55      character*(*) infile
56      integer*4 day0, anne0
57      real tstep, t_ops, t_wrt
58      integer fileid, filevid
59
60C   Variables locales
61C
62      integer tau0
63      real zjulian
64      integer iq
65      real rlong(iip1,jjp1), rlat(iip1,jjp1)
66      integer uhoriid, vhoriid, thoriid, zvertiid
67      integer ii,jj
68      integer zan, dayref
69      integer :: jjb,jje,jjn
70
71! definition du domaine d'ecriture pour le rebuild
72
73      INTEGER,DIMENSION(2) :: ddid
74      INTEGER,DIMENSION(2) :: dsg
75      INTEGER,DIMENSION(2) :: dsl
76      INTEGER,DIMENSION(2) :: dpf
77      INTEGER,DIMENSION(2) :: dpl
78      INTEGER,DIMENSION(2) :: dhs
79      INTEGER,DIMENSION(2) :: dhe
80     
81      INTEGER :: dynu_domain_id
82      INTEGER :: dynv_domain_id
83
84C
85C  Initialisations
86C
87      if (adjust) return
88       
89      pi = 4. * atan (1.)
90C
91C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
92C         
93
94      zan = anne0
95      dayref = day0
96      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
97      tau0 = itau_dyn
98     
99      do jj = 1, jjp1
100        do ii = 1, iip1
101          rlong(ii,jj) = rlonu(ii) * 180. / pi
102          rlat(ii,jj) = rlatu(jj) * 180. / pi
103        enddo
104      enddo
105     
106      jjb=jj_begin
107      jje=jj_end
108      jjn=jj_nb
109
110
111      ddid=(/ 1,2 /)
112      dsg=(/ iip1,jjp1 /)
113      dsl=(/ iip1,jjn /)
114      dpf=(/ 1,jjb /)
115      dpl=(/ iip1,jje /)
116      dhs=(/ 0,0 /)
117      dhe=(/ 0,0 /)
118
119      call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe,
120     .                 'box',dynu_domain_id)
121     
122       call histbeg(trim(infile),iip1, rlong(:,1), jjn,
123     .              rlat(1,jjb:jje), 1, iip1, 1, jjn, tau0,
124     .              zjulian, tstep, uhoriid, fileid,dynu_domain_id)
125C
126C  Creation du fichier histoire pour la grille en V (oblige pour l'instant,
127C  IOIPSL ne permet pas de grilles avec des nombres de point differents dans
128C  un meme fichier)
129
130      do jj = 1, jjm
131        do ii = 1, iip1
132          rlong(ii,jj) = rlonv(ii) * 180. / pi
133          rlat(ii,jj) = rlatv(jj) * 180. / pi
134        enddo
135      enddo
136
137      jjb=jj_begin
138      jje=jj_end
139      jjn=jj_nb
140      if (pole_sud) jje=jj_end-1
141      if (pole_sud) jjn=jj_nb-1
142
143      ddid=(/ 1,2 /)
144      dsg=(/ iip1,jjm /)
145      dsl=(/ iip1,jjn /)
146      dpf=(/ 1,jjb /)
147      dpl=(/ iip1,jje /)
148      dhs=(/ 0,0 /)
149      dhe=(/ 0,0 /)
150
151      call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe,
152     .                 'box',dynv_domain_id)
153     
154      call histbeg('dyn_histv', iip1, rlong(:,1), jjn, rlat(1,jjb:jje),
155     .             1, iip1, 1, jjn, tau0, zjulian, tstep, vhoriid,
156     .             filevid,dynv_domain_id)
157C
158C  Appel a histhori pour rajouter les autres grilles horizontales
159C
160     
161      do jj = 1, jjp1
162        do ii = 1, iip1
163          rlong(ii,jj) = rlonv(ii) * 180. / pi
164          rlat(ii,jj) = rlatu(jj) * 180. / pi
165        enddo
166      enddo
167
168      jjb=jj_begin
169      jje=jj_end
170      jjn=jj_nb
171
172      call histhori(fileid, iip1, rlong(:,jjb:jje),jjn,rlat(:,jjb:jje),
173     .              'scalar','Grille points scalaires', thoriid)
174C
175C  Appel a histvert pour la grille verticale
176C
177      call histvert(fileid, 'sig_s', 'Niveaux sigma','-',
178     .              llm, nivsigs, zvertiid)
179C Pour le fichier V
180      call histvert(filevid, 'sig_s', 'Niveaux sigma','-',
181     .              llm, nivsigs, zvertiid)
182C
183C  Appels a histdef pour la definition des variables a sauvegarder
184C
185C  Vents U
186C
187      jjn=jj_nb
188
189      call histdef(fileid, 'ucov', 'vents u covariants', 'm/s',
190     .             iip1, jjn, uhoriid, llm, 1, llm, zvertiid,
191     .             32, 'inst(X)', t_ops, t_wrt)
192C
193C  Vents V
194C
195      if (pole_sud) jjn=jj_nb-1
196     
197      call histdef(filevid, 'vcov', 'vents v covariants', 'm/s',
198     .             iip1, jjn, vhoriid, llm, 1, llm, zvertiid,
199     .             32, 'inst(X)', t_ops, t_wrt)
200
201C
202C  Temperature potentielle
203C
204      jjn=jj_nb
205     
206      call histdef(fileid, 'teta', 'temperature potentielle', '-',
207     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
208     .             32, 'inst(X)', t_ops, t_wrt)
209C
210C  Geopotentiel
211C
212      call histdef(fileid, 'phi', 'geopotentiel instantane', '-',
213     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
214     .             32, 'inst(X)', t_ops, t_wrt)
215C
216C  Traceurs
217C
218        DO iq=1,nqtot
219          call histdef(fileid, ttext(iq),  ttext(iq), '-',
220     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
221     .             32, 'inst(X)', t_ops, t_wrt)
222        enddo
223C
224C  Masse
225C
226      call histdef(fileid, 'masse', 'masse', 'kg',
227     .             iip1, jjn, thoriid, 1, 1, 1, -99,
228     .             32, 'inst(X)', t_ops, t_wrt)
229C
230C  Pression au sol
231C
232      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
233     .             iip1, jjn, thoriid, 1, 1, 1, -99,
234     .             32, 'inst(X)', t_ops, t_wrt)
235C
236C  Pression au sol
237C
238      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
239     .             iip1, jjn, thoriid, 1, 1, 1, -99,
240     .             32, 'inst(X)', t_ops, t_wrt)
241C
242C  Fin
243C
244      call histend(fileid)
245      call histend(filevid)
246      return
247      end
Note: See TracBrowser for help on using the repository browser.