source: LMDZ4/branches/LMDZ4-dev/libf/bibio/initdynav.F @ 1220

Last change on this file since 1220 was 1220, checked in by lguez, 15 years ago

-- Replaced "integer*4" declarations by "integer", "real*8" by

"real(kind=8)" and "real*4" by "real". Note that these are the only
modifications in the files "radiation_AR4.F" and "sw_aeroAR4.F90".

-- Corrected the kind of arguments to "max" and "min".

-- Replaced "nH" edit descriptors, which is a deleted feature in

Fortran 95, by character strings.

-- "regr_lat_time_climoz" now allows the pressure coordinate in the

input file to be in descending order.

-- Replaced call to not standard function "float" by call to intrinsic

function "real".

-- Included file "radepsi.h" in "physiq" was not used. Removed it.

The following set of modifications is related to the management of time.

-- In "gcm", "leapfrog" and "sortvarc0", "day_ini" was defined as 1

plus number of days between the reference date "(annee_ref,
day_ref)" and the first day of the current simulation. Changed
definition: "(annee_ref, day_ini)" is the first day of the current
simulation. There is an accompanying modification for "day_end".

-- Corrected bug in call to "ioconf_startdate" in "gcm".

-- Added call to "ioconf_calendar" in "create_etat0_limit".

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1!
2! $Id: initdynav.F 1220 2009-08-05 14:38:34Z lguez $
3!
4      subroutine initdynav(infile,day0,anne0,tstep,t_ops,t_wrt
5     .                     ,fileid)
6
7#ifdef CPP_IOIPSL
8       USE IOIPSL
9#endif
10       USE infotrac, ONLY : nqtot, ttext
11
12      implicit none
13
14C
15C   Routine d'initialisation des ecritures des fichiers histoires LMDZ
16C   au format IOIPSL. Initialisation du fichier histoire moyenne.
17C
18C   Appels succesifs des routines: histbeg
19C                                  histhori
20C                                  histver
21C                                  histdef
22C                                  histend
23C
24C   Entree:
25C
26C      infile: nom du fichier histoire a creer
27C      day0,anne0: date de reference
28C      tstep : frequence d'ecriture
29C      t_ops: frequence de l'operation pour IOIPSL
30C      t_wrt: frequence d'ecriture sur le fichier
31C
32C   Sortie:
33C      fileid: ID du fichier netcdf cree
34C
35C   L. Fairhead, LMD, 03/99
36C
37C =====================================================================
38C
39C   Declarations
40#include "dimensions.h"
41#include "paramet.h"
42#include "comconst.h"
43#include "comvert.h"
44#include "comgeom.h"
45#include "temps.h"
46#include "ener.h"
47#include "logic.h"
48#include "description.h"
49#include "serre.h"
50#include "iniprint.h"
51
52C   Arguments
53C
54      character*(*) infile
55      integer day0, anne0
56      real tstep, t_ops, t_wrt
57      integer fileid
58
59#ifdef CPP_IOIPSL
60! This routine needs IOIPSL to work
61C   Variables locales
62C
63      integer thoriid, zvertiid
64      integer tau0
65      real zjulian
66      integer iq
67      real rlong(iip1,jjp1), rlat(iip1,jjp1)
68      integer ii,jj
69      integer zan, dayref
70C
71C  Initialisations
72C
73      pi = 4. * atan (1.)
74C
75C  Appel a histbeg: creation du fichier netcdf et initialisations diverses
76C         
77
78      zan = anne0
79      dayref = day0
80      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
81      tau0 = itau_dyn
82     
83      do jj = 1, jjp1
84        do ii = 1, iip1
85          rlong(ii,jj) = rlonv(ii) * 180. / pi
86          rlat(ii,jj)  = rlatu(jj) * 180. / pi
87        enddo
88      enddo
89       
90      call histbeg(infile, iip1, rlong(:,1), jjp1, rlat(1,:),
91     .             1, iip1, 1, jjp1,
92     .             tau0, zjulian, tstep, thoriid, fileid)
93
94C
95C  Appel a histvert pour la grille verticale
96C
97      call histvert(fileid, 'sigss', 'Niveaux sigma','Pa',
98     .              llm, nivsigs, zvertiid)
99C
100C  Appels a histdef pour la definition des variables a sauvegarder
101C
102C  Vents U
103C
104      write(6,*)'inithistave',tstep
105      call histdef(fileid, 'u', 'vents u scalaires moyennes',
106     .             'm/s', iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
107     .             32, 'ave(X)', t_ops, t_wrt)
108
109C
110C  Vents V
111C
112      call histdef(fileid, 'v', 'vents v scalaires moyennes',
113     .             'm/s', iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
114     .             32, 'ave(X)', t_ops, t_wrt)
115
116C
117C  Temperature
118C
119      call histdef(fileid, 'temp', 'temperature moyennee', 'K',
120     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
121     .             32, 'ave(X)', t_ops, t_wrt)
122C
123C  Temperature potentielle
124C
125      call histdef(fileid, 'theta', 'temperature potentielle', 'K',
126     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
127     .             32, 'ave(X)', t_ops, t_wrt)
128
129
130C
131C  Geopotentiel
132C
133      call histdef(fileid, 'phi', 'geopotentiel moyenne', '-',
134     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
135     .             32, 'ave(X)', t_ops, t_wrt)
136C
137C  Traceurs
138C
139        DO iq=1,nqtot
140          call histdef(fileid, ttext(iq), ttext(iq), '-',
141     .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
142     .             32, 'ave(X)', t_ops, t_wrt)
143        enddo
144C
145C  Masse
146C
147      call histdef(fileid, 'masse', 'masse', 'kg',
148     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
149     .             32, 'ave(X)', t_ops, t_wrt)
150C
151C  Pression au sol
152C
153      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa',
154     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
155     .             32, 'ave(X)', t_ops, t_wrt)
156C
157C  Pression au sol
158C
159      call histdef(fileid, 'phis', 'geopotentiel au sol', '-',
160     .             iip1, jjp1, thoriid, 1, 1, 1, -99,
161     .             32, 'ave(X)', t_ops, t_wrt)
162C
163C  Fin
164C
165      call histend(fileid)
166#else
167! tell the user this routine should be run with ioipsl
168      write(lunout,*)"initdynav: Warning this routine should not be",
169     &               " used without ioipsl"
170#endif
171! of #ifdef CPP_IOIPSL
172      return
173      end
Note: See TracBrowser for help on using the repository browser.