source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F90

Last change on this file was 5195, checked in by abarral, 4 days ago

Correct r5192, some lmdz_description cases were missing

  • 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
RevLine 
[1279]1! $Id: inithist.F90 5195 2024-09-16 13:18:00Z fairhead $
[5099]2
[5103]3SUBROUTINE inithist(day0, anne0, tstep, t_ops, t_wrt)
[524]4
[5114]5  USE IOIPSL
[5182]6  USE lmdz_infotrac, ONLY: nqtot
[5114]7  USE com_io_dyn_mod, ONLY: histid, histvid, histuid, &
[5101]8          dynhist_file, dynhistv_file, dynhistu_file
9  USE comconst_mod, ONLY: pi
10  USE comvert_mod, ONLY: presnivs
11  USE temps_mod, ONLY: itau_dyn
[5118]12  USE lmdz_iniprint, ONLY: lunout, prt_level
[5136]13  USE lmdz_comgeom
[524]14
[5159]15  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
16  USE lmdz_paramet
[5113]17  IMPLICIT NONE
[524]18
[5159]19
[5101]20  !   Routine d'initialisation des ecritures des fichiers histoires LMDZ
21  !   au format IOIPSL
[5159]22
[5101]23  !   Appels succesifs des routines: histbeg
24  !                              histhori
25  !                              histver
26  !                              histdef
27  !                              histend
[5159]28
[5101]29  !   Entree:
[5159]30
[5101]31  !  infile: nom du fichier histoire a creer
32  !  day0,anne0: date de reference
33  !  tstep: duree du pas de temps en seconde
34  !  t_ops: frequence de l'operation pour IOIPSL
35  !  t_wrt: frequence d'ecriture sur le fichier
36  !  nq: nombre de traceurs
[5159]37
38
[5101]39  !   L. Fairhead, LMD, 03/99
[5159]40
[5101]41  ! =====================================================================
[5159]42
[5101]43  !   Declarations
[524]44
[5159]45
46
[5101]47  !   Arguments
[5159]48
[5116]49  INTEGER :: day0, anne0
50  REAL :: tstep, t_ops, t_wrt
[5101]51
52  ! This routine needs IOIPSL to work
53  !   Variables locales
[5159]54
[5116]55  INTEGER :: tau0
56  REAL :: zjulian
57  INTEGER :: iq
58  REAL :: rlong(iip1, jjp1), rlat(iip1, jjp1)
59  INTEGER :: uhoriid, vhoriid, thoriid, zvertiid
60  INTEGER :: ii, jj
61  INTEGER :: zan, dayref
[5159]62
[5101]63  !  Initialisations
[5159]64
[5101]65  pi = 4. * atan (1.)
[5159]66
[5101]67  !  Appel a histbeg: creation du fichier netcdf et initialisations diverses
68  !
[524]69
[5101]70  zan = anne0
71  dayref = day0
72  CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
73  tau0 = itau_dyn
[524]74
[5101]75  ! -------------------------------------------------------------
76  ! Creation des 3 fichiers pour les grilles horizontales U,V,Scal
77  ! -------------------------------------------------------------
78  !Grille U
[5158]79  DO jj = 1, jjp1
80    DO ii = 1, iip1
[5114]81      rlong(ii, jj) = rlonu(ii) * 180. / pi
82      rlat(ii, jj) = rlatu(jj) * 180. / pi
[5101]83    enddo
84  enddo
[524]85
[5114]86  CALL histbeg(dynhistu_file, iip1, rlong(:, 1), jjp1, rlat(1, :), &
87          1, iip1, 1, jjp1, &
88          tau0, zjulian, tstep, uhoriid, histuid)
[1403]89
[5101]90  ! Grille V
[5158]91  DO jj = 1, jjm
92    DO ii = 1, iip1
[5114]93      rlong(ii, jj) = rlonv(ii) * 180. / pi
94      rlat(ii, jj) = rlatv(jj) * 180. / pi
[5101]95    enddo
96  enddo
[524]97
[5114]98  CALL histbeg(dynhistv_file, iip1, rlong(:, 1), jjm, rlat(1, :), &
99          1, iip1, 1, jjm, &
100          tau0, zjulian, tstep, vhoriid, histvid)
[524]101
[5101]102  !Grille Scalaire
[5158]103  DO jj = 1, jjp1
104    DO ii = 1, iip1
[5114]105      rlong(ii, jj) = rlonv(ii) * 180. / pi
106      rlat(ii, jj) = rlatu(jj) * 180. / pi
[5101]107    enddo
108  enddo
[5099]109
[5114]110  CALL histbeg(dynhist_file, iip1, rlong(:, 1), jjp1, rlat(1, :), &
111          1, iip1, 1, jjp1, &
112          tau0, zjulian, tstep, thoriid, histid)
[5101]113  ! -------------------------------------------------------------
114  !  Appel a histvert pour la grille verticale
115  ! -------------------------------------------------------------
[5114]116  CALL histvert(histid, 'presnivs', 'Niveaux pression', 'mb', &
117          llm, presnivs / 100., zvertiid, 'down')
118  CALL histvert(histvid, 'presnivs', 'Niveaux pression', 'mb', &
119          llm, presnivs / 100., zvertiid, 'down')
120  CALL histvert(histuid, 'presnivs', 'Niveaux pression', 'mb', &
121          llm, presnivs / 100., zvertiid, 'down')
[5159]122
[5101]123  ! -------------------------------------------------------------
124  !  Appels a histdef pour la definition des variables a sauvegarder
125  ! -------------------------------------------------------------
[5159]126
[5101]127  !  Vents U
[5159]128
[5101]129  CALL histdef(histuid, 'u', 'vent u', 'm/s', &
[5114]130          iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, &
131          32, 'inst(X)', t_ops, t_wrt)
[5159]132
[5101]133  !  Vents V
[5159]134
[5101]135  CALL histdef(histvid, 'v', 'vent v', 'm/s', &
[5114]136          iip1, jjm, vhoriid, llm, 1, llm, zvertiid, &
137          32, 'inst(X)', t_ops, t_wrt)
[5101]138
[5159]139
[5101]140  !  Temperature potentielle
[5159]141
[5101]142  CALL histdef(histid, 'teta', 'temperature potentielle', '-', &
[5114]143          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
144          32, 'inst(X)', t_ops, t_wrt)
[5159]145
[5101]146  !  Geopotentiel
[5159]147
[5101]148  CALL histdef(histid, 'phi', 'geopotentiel', '-', &
[5114]149          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
150          32, 'inst(X)', t_ops, t_wrt)
[5159]151
[5101]152  !  Traceurs
153  !
154
155  !    DO iq=1,nqtot
156  !      CALL histdef(histid, tracers(iq)%name,
157  !                           tracers(iq)%longName, '-',
158  ! .             iip1, jjp1, thoriid, llm, 1, llm, zvertiid,
159  ! .             32, 'inst(X)', t_ops, t_wrt)
160  !    enddo
161  !C
162  !  Masse
[5159]163
[5101]164  CALL histdef(histid, 'masse', 'masse', 'kg', &
[5114]165          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &
166          32, 'inst(X)', t_ops, t_wrt)
[5159]167
[5101]168  !  Pression au sol
[5159]169
[5101]170  CALL histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', &
[5114]171          iip1, jjp1, thoriid, 1, 1, 1, -99, &
172          32, 'inst(X)', t_ops, t_wrt)
[5159]173
[5101]174  !  Geopotentiel au sol
175  !C
176  !  CALL histdef(histid, 'phis', 'geopotentiel au sol', '-',
177  ! .             iip1, jjp1, thoriid, 1, 1, 1, -99,
178  ! .             32, 'inst(X)', t_ops, t_wrt)
179  !C
180  !  Fin
[5159]181
[5101]182  CALL histend(histid)
183  CALL histend(histuid)
184  CALL histend(histvid)
[5103]185END SUBROUTINE  inithist
Note: See TracBrowser for help on using the repository browser.