source: LMDZ5/branches/IPSLCM5A2.1/libf/dyn3dpar/initdynav_p.F @ 3663

Last change on this file since 3663 was 2603, checked in by Ehouarn Millour, 8 years ago

Cleanup in the dynamics: turn logic.h into module logic_mod.F90
EM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
1!
2! $Id: initdynav_p.F 2603 2016-07-25 09:31:56Z oboucher $
3!
4      subroutine initdynav_p(infile,day0,anne0,tstep,t_ops,t_wrt,fileid)
5
6#ifdef CPP_IOIPSL
7! This routine needs IOIPSL
8       USE IOIPSL
9#endif
10       USE parallel_lmdz
11       use Write_field
12       use misc_mod
13       USE infotrac
14       USE comconst_mod, ONLY: pi
15       USE comvert_mod, ONLY: nivsigs
16       USE temps_mod, ONLY: itau_dyn
17
18      implicit none
19
20C
21C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
22C   au format IOIPSL. Initialisation du fichier histoire moyenne.
23C
24C   Appels succesifs des routines: histbeg
25C                                  histhori
26C                                  histver
27C                                  histdef
28C                                  histend
29C
30C   Entree:
31C
32C      infile: nom du fichier histoire a creer
33C      day0,anne0: date de reference
34C      tstep : frequence d'ecriture
35C      t_ops: frequence de l'operation pour IOIPSL
36C      t_wrt: frequence d'ecriture sur le fichier
37C
38C   Sortie:
39C      fileid: ID du fichier netcdf cree
40C
41C   L. Fairhead, LMD, 03/99
42C
43C =====================================================================
44C
45C   Declarations
46#include "dimensions.h"
47#include "paramet.h"
48#include "comgeom.h"
49#include "ener.h"
50#include "description.h"
51#include "iniprint.h"
52
53C   Arguments
54C
55      character*(*) infile
56      integer*4 day0, anne0
57      real tstep, t_ops, t_wrt
58      integer fileid
59
60#ifdef CPP_IOIPSL
61! This routine needs IOIPSL
62C   Variables locales
63C
64      integer thoriid, zvertiid
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! definition du domaine d'ecriture pour le rebuild
74
75      INTEGER,DIMENSION(2) :: ddid
76      INTEGER,DIMENSION(2) :: dsg
77      INTEGER,DIMENSION(2) :: dsl
78      INTEGER,DIMENSION(2) :: dpf
79      INTEGER,DIMENSION(2) :: dpl
80      INTEGER,DIMENSION(2) :: dhs
81      INTEGER,DIMENSION(2) :: dhe
82     
83      INTEGER :: dynave_domain_id
84     
85      if (adjust) return
86C
87C  Initialisations
88C
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) = rlonv(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      ddid=(/ 1,2 /)
111      dsg=(/ iip1,jjp1 /)
112      dsl=(/ iip1,jjn /)
113      dpf=(/ 1,jjb /)
114      dpl=(/ iip1,jje /)
115      dhs=(/ 0,0 /)
116      dhe=(/ 0,0 /)
117
118      call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe,
119     .                 'box',dynave_domain_id)
120             
121      call histbeg(trim(infile),iip1, rlong(:,1), jjn, rlat(1,jjb:jje),
122     .             1, iip1, 1, jjn,tau0, zjulian, tstep, thoriid,
123     .             fileid,dynave_domain_id)
124
125C
126C  Appel a histvert pour la grille verticale
127C
128      call histvert(fileid, 'sigss', 'Niveaux sigma','Pa',
129     .              llm, nivsigs, zvertiid)
130C
131C  Appels a histdef pour la definition des variables a sauvegarder
132C
133C  Vents U
134C
135      write(6,*)'inithistave',tstep
136      call histdef(fileid, 'u', 'vents u scalaires moyennes',
137     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
138     .             32, 'ave(X)', t_ops, t_wrt)
139
140C
141C  Vents V
142C
143      call histdef(fileid, 'v', 'vents v scalaires moyennes',
144     .             'm/s', iip1, jjn, thoriid, llm, 1, llm, zvertiid,
145     .             32, 'ave(X)', t_ops, t_wrt)
146
147C
148C  Temperature
149C
150      call histdef(fileid, 'temp', 'temperature moyennee', 'K',
151     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
152     .             32, 'ave(X)', t_ops, t_wrt)
153C
154C  Temperature potentielle
155C
156      call histdef(fileid, 'theta', 'temperature potentielle', 'K',
157     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
158     .             32, 'ave(X)', t_ops, t_wrt)
159
160
161C
162C  Geopotentiel
163C
164      call histdef(fileid, 'phi', 'geopotentiel moyenne', '-',
165     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
166     .             32, 'ave(X)', t_ops, t_wrt)
167C
168C  Traceurs
169C
170        DO iq=1,nqtot
171          call histdef(fileid, ttext(iq), ttext(iq), '-',
172     .             iip1, jjn, thoriid, llm, 1, llm, zvertiid,
173     .             32, 'ave(X)', t_ops, t_wrt)
174        enddo
175C
176C  Masse
177C
178      call histdef(fileid, 'masse', 'masse', 'kg',
179     .             iip1, jjn, thoriid, 1, 1, 1, -99,
180     .             32, 'ave(X)', t_ops, t_wrt)
181C
182C  Pression au sol
183C
184      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
185     .             iip1, jjn, thoriid, 1, 1, 1, -99,
186     .             32, 'ave(X)', t_ops, t_wrt)
187C
188C  Pression au sol
189C
190      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
191     .             iip1, jjn, thoriid, 1, 1, 1, -99,
192     .             32, 'ave(X)', t_ops, t_wrt)
193C
194C  Fin
195C
196      call histend(fileid)
197#else
198      write(lunout,*)'initdynav_p: Needs IOIPSL to function'
199#endif
200! #endif of #ifdef CPP_IOIPSL
201      return
202      end
Note: See TracBrowser for help on using the repository browser.