source: LMDZ4/branches/V3_test/libf/dyn3dpar/initdynav_p.F @ 1417

Last change on this file since 1417 was 708, checked in by Laurent Fairhead, 18 years ago

Versions parallèlisées des routines YM
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1!
2! $Header$
3!
4c
5c
6      subroutine initdynav_p(infile,day0,anne0,tstep,t_ops,t_wrt
7     .                     ,nq,fileid)
8
9       USE IOIPSL
10       use parallel
11       use Write_field
12       use misc_mod
13      implicit none
14
15C
16C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
17C   au format IOIPSL. Initialisation du fichier histoire moyenne.
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 : frequence d'ecriture
30C      t_ops: frequence de l'operation pour IOIPSL
31C      t_wrt: frequence d'ecriture sur le fichier
32C      nq: nombre de traceurs
33C
34C   Sortie:
35C      fileid: ID du fichier netcdf cree
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#include "advtrac.h"
53
54C   Arguments
55C
56      character*(*) infile
57      integer*4 day0, anne0
58      real tstep, t_ops, t_wrt
59      integer fileid
60      integer nq
61      integer thoriid, zvertiid
62
63C   Variables locales
64C
65      integer tau0
66      real zjulian
67      integer iq
68      real rlong(iip1,jjp1), rlat(iip1,jjp1)
69      integer ii,jj
70      integer zan, dayref
71      integer :: jjb,jje,jjn
72     
73      if (adjust) return
74C
75C  Initialisations
76C
77      pi = 4. * atan (1.)
78C
79C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
80C         
81
82      zan = anne0
83      dayref = day0
84      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
85      tau0 = itau_dyn
86     
87      do jj = 1, jjp1
88        do ii = 1, iip1
89          rlong(ii,jj) = rlonv(ii) * 180. / pi
90          rlat(ii,jj)  = rlatu(jj) * 180. / pi
91        enddo
92      enddo
93
94      jjb=jj_begin
95      jje=jj_end
96      jjn=jj_nb
97             
98      call histbeg(trim(infile)//'_'//trim(int2str(mpi_rank))//'.nc',
99     .             iip1, rlong(:,1), jjn, rlat(1,jjb:jje),
100     .             1, iip1, 1, jjn,
101     .             tau0, zjulian, tstep, thoriid, fileid)
102
103C
104C  Appel a histvert pour la grille verticale
105C
106      call histvert(fileid, 'sigss', 'Niveaux sigma','Pa',
107     .              llm, nivsigs, zvertiid)
108C
109C  Appels a histdef pour la definition des variables a sauvegarder
110C
111C  Vents U
112C
113      write(6,*)'inithistave',tstep
114      call histdef(fileid, 'u', 'vents u scalaires moyennes',
115     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
116     .             32, 'ave(X)', t_ops, t_wrt)
117
118C
119C  Vents V
120C
121      call histdef(fileid, 'v', 'vents v scalaires moyennes',
122     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
123     .             32, 'ave(X)', t_ops, t_wrt)
124
125C
126C  Temperature
127C
128      call histdef(fileid, 'temp', 'temperature moyennee', 'K',
129     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
130     .             32, 'ave(X)', t_ops, t_wrt)
131C
132C  Temperature potentielle
133C
134      call histdef(fileid, 'theta', 'temperature potentielle', 'K',
135     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
136     .             32, 'ave(X)', t_ops, t_wrt)
137
138
139C
140C  Geopotentiel
141C
142      call histdef(fileid, 'phi', 'geopotentiel moyenne', '-',
143     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
144     .             32, 'ave(X)', t_ops, t_wrt)
145C
146C  Traceurs
147C
148        DO iq=1,nq
149          call histdef(fileid, ttext(iq), ttext(iq), '-',
150     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
151     .             32, 'ave(X)', t_ops, t_wrt)
152        enddo
153C
154C  Masse
155C
156      call histdef(fileid, 'masse', 'masse', 'kg',
157     .             iip1, jjn, thoriid, 1, 1, 1, -99,
158     .             32, 'ave(X)', t_ops, t_wrt)
159C
160C  Pression au sol
161C
162      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
163     .             iip1, jjn, thoriid, 1, 1, 1, -99,
164     .             32, 'ave(X)', t_ops, t_wrt)
165C
166C  Pression au sol
167C
168      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
169     .             iip1, jjn, thoriid, 1, 1, 1, -99,
170     .             32, 'ave(X)', t_ops, t_wrt)
171C
172C  Fin
173C
174      call histend(fileid)
175      return
176      end
Note: See TracBrowser for help on using the repository browser.