source: LMDZ5/trunk/libf/dyn3d_common/writedynav.F90 @ 2598

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

Cleanup in the dynamics: turn serre.h into module serre_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: 3.1 KB
Line 
1! $Id: writedynav.F90 2598 2016-07-22 09:28:39Z emillour $
2
3subroutine writedynav(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis)
4
5#ifdef CPP_IOIPSL
6  USE ioipsl
7#endif
8  USE infotrac, ONLY : nqtot, ttext
9  use com_io_dyn_mod, only : histaveid, histvaveid, histuaveid
10  USE comconst_mod, ONLY: cpp
11
12  implicit none
13
14  !   Ecriture du fichier histoire au format IOIPSL
15
16  !   Appels succesifs des routines: histwrite
17
18  !   Entree:
19  !      time: temps de l'ecriture
20  !      vcov: vents v covariants
21  !      ucov: vents u covariants
22  !      teta: temperature potentielle
23  !      phi : geopotentiel instantane
24  !      q   : traceurs
25  !      masse: masse
26  !      ps   :pression au sol
27  !      phis : geopotentiel au sol
28
29  !   L. Fairhead, LMD, 03/99
30
31  !   Declarations
32  include "dimensions.h"
33  include "paramet.h"
34  include "comvert.h"
35  include "comgeom.h"
36  include "temps.h"
37  include "ener.h"
38  include "logic.h"
39  include "description.h"
40  include "iniprint.h"
41
42  !   Arguments
43
44  REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm)
45  REAL teta(ip1jmp1*llm), phi(ip1jmp1, llm), ppk(ip1jmp1*llm)     
46  REAL ps(ip1jmp1), masse(ip1jmp1, llm)                   
47  REAL phis(ip1jmp1)                 
48  REAL q(ip1jmp1, llm, nqtot)
49  integer time
50
51#ifdef CPP_IOIPSL
52  ! This routine needs IOIPSL to work
53  !   Variables locales
54
55  integer ndex2d(ip1jmp1), ndexu(ip1jmp1*llm), ndexv(ip1jm*llm)
56  INTEGER iq, ii, ll
57  real tm(ip1jmp1*llm)
58  REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)
59  logical ok_sync
60  integer itau_w
61
62  !-----------------------------------------------------------------
63
64  !  Initialisations
65
66  ndexu = 0
67  ndexv = 0
68  ndex2d = 0
69  ok_sync = .TRUE.
70  tm = 999.999
71  vnat = 999.999
72  unat = 999.999
73  itau_w = itau_dyn + time
74
75  ! Passage aux composantes naturelles du vent
76  call covnat(llm, ucov, vcov, unat, vnat)
77
78  !  Appels a histwrite pour l'ecriture des variables a sauvegarder
79
80  !  Vents U
81
82  call histwrite(histuaveid, 'u', itau_w, unat,  &
83       iip1*jjp1*llm, ndexu)
84
85  !  Vents V
86
87  call histwrite(histvaveid, 'v', itau_w, vnat,  &
88       iip1*jjm*llm, ndexv)
89
90  !  Temperature potentielle moyennee
91
92  call histwrite(histaveid, 'theta', itau_w, teta,  &
93       iip1*jjp1*llm, ndexu)
94
95  !  Temperature moyennee
96
97  do ii = 1, ijp1llm
98     tm(ii) = teta(ii) * ppk(ii)/cpp
99  enddo
100  call histwrite(histaveid, 'temp', itau_w, tm,  &
101       iip1*jjp1*llm, ndexu)
102
103  !  Geopotentiel
104
105  call histwrite(histaveid, 'phi', itau_w, phi,  &
106       iip1*jjp1*llm, ndexu)
107
108  !  Traceurs
109
110  !  DO iq=1, nqtot
111  !       call histwrite(histaveid, ttext(iq), itau_w, q(:, :, iq), &
112  !                   iip1*jjp1*llm, ndexu)
113  ! enddo
114
115  !  Masse
116
117  call histwrite(histaveid, 'masse', itau_w, masse,  &
118       iip1*jjp1*llm, ndexu)
119
120  !  Pression au sol
121
122  call histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
123
124  ! Geopotentiel au sol
125
126  ! call histwrite(histaveid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
127
128  if (ok_sync) then
129     call histsync(histaveid)
130     call histsync(histvaveid)
131     call histsync(histuaveid)
132  ENDIF
133
134#else
135  write(lunout, *) "writedynav: Warning this routine should not be", &
136       " used without ioipsl"
137#endif
138  ! of #ifdef CPP_IOIPSL
139
140end subroutine writedynav
Note: See TracBrowser for help on using the repository browser.