source: LMDZ.3.3/tags/IPSL-CM4_CMIP/libf/bibio/initfluxsto.F @ 575

Last change on this file since 575 was 353, checked in by lmdzadmin, 22 years ago

2 changements pour les fichiers histoire:

  • utilisation de l'entree "rectilineaire" de IOIPSL pour ne plus avoir

a

lancer ncregular a chaque fois

  • le calendrier des fichiers histoire est maintenant base sur la date d'initialisation de la simulation plutot que sur la date de depart du

job

en cours

LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1      subroutine initfluxsto
2     .  (infile,tstep,t_ops,t_wrt,nq,
3     .                    fileid,filevid,filedid)
4
5       USE IOIPSL
6       USE histcom
7
8      implicit none
9
10C
11C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
12C   au format IOIPSL
13C
14C   Appels succesifs des routines: histbeg
15C                                  histhori
16C                                  histver
17C                                  histdef
18C                                  histend
19C
20C   Entree:
21C
22C      infile: nom du fichier histoire a creer
23C      day0,anne0: date de reference
24C      tstep: duree du pas de temps en seconde
25C      t_ops: frequence de l'operation pour IOIPSL
26C      t_wrt: frequence d'ecriture sur le fichier
27C      nq: nombre de traceurs
28C
29C   Sortie:
30C      fileid: ID du fichier netcdf cree
31C      filevid:ID du fichier netcdf pour la grille v
32C
33C   L. Fairhead, LMD, 03/99
34C
35C =====================================================================
36C
37C   Declarations
38#include "dimensions.h"
39#include "paramet.h"
40#include "comconst.h"
41#include "comvert.h"
42#include "comgeom.h"
43#include "temps.h"
44#include "ener.h"
45#include "logic.h"
46#include "description.h"
47#include "serre.h"
48
49C   Arguments
50C
51      character*(*) infile
52      integer*4 itau
53      real tstep, t_ops, t_wrt
54      integer fileid, filevid,filedid
55      integer nq,ndex(1)
56      real nivd(1)
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),rl(1,1)
66      integer uhoriid, vhoriid, thoriid, zvertiid,dhoriid,dvertiid
67      integer ii,jj
68      integer zan, idayref
69      logical ok_sync
70C
71C  Initialisations
72C
73      pi = 4. * atan (1.)
74      str='q  '
75      ctrac = 'traceur   '
76      ok_sync = .true.
77C
78C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
79C         
80
81      zan = annee_ref
82      idayref = day_ref
83      CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
84      tau0 = itau_dyn
85       
86        do jj = 1, jjp1
87        do ii = 1, iip1
88          rlong(ii,jj) = rlonu(ii) * 180. / pi
89          rlat(ii,jj) = rlatu(jj) * 180. / pi
90        enddo
91      enddo
92 
93      call histbeg(infile, iip1, rlong(:,1), jjp1, rlat(1,:),
94     .             1, iip1, 1, jjp1,
95     .             tau0, zjulian, tstep, uhoriid, fileid)
96C
97C  Creation du fichier histoire pour la grille en V (oblige pour l'instant,
98C  IOIPSL ne permet pas de grilles avec des nombres de point differents dans
99C  un meme fichier)
100
101
102      do jj = 1, jjm
103        do ii = 1, iip1
104          rlong(ii,jj) = rlonv(ii) * 180. / pi
105          rlat(ii,jj) = rlatv(jj) * 180. / pi
106        enddo
107      enddo
108
109      call histbeg('fluxstokev.nc', iip1, rlong(:,1), jjm, rlat(1,:),
110     .             1, iip1, 1, jjm,
111     .             tau0, zjulian, tstep, vhoriid, filevid)
112       
113        rl(1,1) = 1.   
114      call histbeg('defstoke.nc', 1, rl, 1, rl,
115     .             1, 1, 1, 1,
116     .             tau0, zjulian, tstep, dhoriid, filedid)
117
118C
119C  Appel a histhori pour rajouter les autres grilles horizontales
120C
121      do jj = 1, jjp1
122        do ii = 1, iip1
123          rlong(ii,jj) = rlonv(ii) * 180. / pi
124          rlat(ii,jj) = rlatu(jj) * 180. / pi
125        enddo
126      enddo
127
128      call histhori(fileid, iip1, rlong, jjp1, rlat, 'scalar',
129     .              'Grille points scalaires', thoriid)
130       
131C
132C  Appel a histvert pour la grille verticale
133C
134      call histvert(fileid, 'sig_s', 'Niveaux sigma',
135     . 'sigma_level',
136     .              llm, nivsigs, zvertiid)
137C Pour le fichier V
138      call histvert(filevid, 'sig_s', 'Niveaux sigma',
139     .  'sigma_level',
140     .              llm, nivsigs, zvertiid)
141c pour le fichier def
142      nivd(1) = 1
143      call histvert(filedid, 'sig_s', 'Niveaux sigma',
144     .  'sigma_level',
145     .              1, nivd, dvertiid)
146
147C
148C  Appels a histdef pour la definition des variables a sauvegarder
149       
150        CALL histdef(fileid, "phis", "Surface geop. height", "-",
151     .                iip1,jjp1,thoriid, 1,1,1, -99, 32,
152     .                "once", t_ops, t_wrt)
153
154         CALL histdef(fileid, "aire", "Grid area", "-",
155     .                iip1,jjp1,thoriid, 1,1,1, -99, 32,
156     .                "once", t_ops, t_wrt)
157       
158        CALL histdef(filedid, "dtvr", "tps dyn", "s",
159     .                1,1,dhoriid, 1,1,1, -99, 32,
160     .                "once", t_ops, t_wrt)
161       
162         CALL histdef(filedid, "istdyn", "tps stock", "s",
163     .                1,1,dhoriid, 1,1,1, -99, 32,
164     .                "once", t_ops, t_wrt)
165         
166         CALL histdef(filedid, "istphy", "tps stock phy", "s",
167     .                1,1,dhoriid, 1,1,1, -99, 32,
168     .                "once", t_ops, t_wrt)
169
170
171C
172C Masse
173C
174      call histdef(fileid, 'masse', 'Masse', 'kg',
175     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
176     .             32, 'inst(X)', t_ops, t_wrt)
177C
178C  Pbaru
179C
180      call histdef(fileid, 'pbaru', 'flx de masse zonal', 'kg m/s',
181     .             iip1, jjp1, uhoriid, llm, 1, llm, zvertiid,
182     .             32, 'inst(X)', t_ops, t_wrt)
183
184C
185C  Pbarv
186C
187      call histdef(filevid, 'pbarv', 'flx de masse mer', 'kg m/s',
188     .             iip1, jjm, vhoriid, llm, 1, llm, zvertiid,
189     .             32, 'inst(X)', t_ops, t_wrt)
190C
191C  w
192C
193      call histdef(fileid, 'w', 'flx de masse vert', 'kg m/s',
194     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
195     .             32, 'inst(X)', t_ops, t_wrt)
196
197C
198C  Temperature potentielle
199C
200      call histdef(fileid, 'teta', 'temperature potentielle', '-',
201     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
202     .             32, 'inst(X)', t_ops, t_wrt)
203C
204
205C
206C Geopotentiel
207C
208      call histdef(fileid, 'phi', 'geopotentiel instantane', '-',
209     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
210     .             32, 'inst(X)', t_ops, t_wrt)
211C
212C  Fin
213C
214      call histend(fileid)
215      call histend(filevid)
216      call histend(filedid)
217      if (ok_sync) then
218        call histsync(fileid)
219        call histsync(filevid)
220        call histsync(filedid)
221      endif
222       
223      return
224      end
Note: See TracBrowser for help on using the repository browser.