source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writedynav.F90 @ 5114

Last change on this file since 5114 was 5114, checked in by abarral, 8 weeks ago

Rename modules in misc from *_mod > lmdz_*
Turn description.h into lmdz_description.f90

  • 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: 2.9 KB
RevLine 
[1279]1! $Id: writedynav.F90 5114 2024-07-24 11:27:51Z abarral $
[524]2
[5103]3SUBROUTINE writedynav(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis)
[1612]4
5  USE ioipsl
[5101]6  USE infotrac, ONLY: nqtot
7  use com_io_dyn_mod, ONLY: histaveid, histvaveid, histuaveid
[2597]8  USE comconst_mod, ONLY: cpp
[2601]9  USE temps_mod, ONLY: itau_dyn
[5114]10  USE lmdz_description, ONLY: descript
[524]11
[5113]12  IMPLICIT NONE
[524]13
[1612]14  !   Ecriture du fichier histoire au format IOIPSL
[524]15
[1612]16  !   Appels succesifs des routines: histwrite
[524]17
[1612]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
[524]28
[1612]29  !   L. Fairhead, LMD, 03/99
30
31  !   Declarations
32  include "dimensions.h"
33  include "paramet.h"
34  include "comgeom.h"
35  include "iniprint.h"
36
37  !   Arguments
38
39  REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm)
40  REAL teta(ip1jmp1*llm), phi(ip1jmp1, llm), ppk(ip1jmp1*llm)     
41  REAL ps(ip1jmp1), masse(ip1jmp1, llm)                   
42  REAL phis(ip1jmp1)                 
43  REAL q(ip1jmp1, llm, nqtot)
[5114]44  INTEGER time
[1612]45
46  ! This routine needs IOIPSL to work
47  !   Variables locales
[524]48
[1612]49  integer ndex2d(ip1jmp1), ndexu(ip1jmp1*llm), ndexv(ip1jm*llm)
50  INTEGER iq, ii, ll
51  real tm(ip1jmp1*llm)
[5103]52  REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)
[1612]53  logical ok_sync
54  integer itau_w
[524]55
[1612]56  !-----------------------------------------------------------------
[1279]57
[1612]58  !  Initialisations
59
60  ndexu = 0
61  ndexv = 0
62  ndex2d = 0
63  ok_sync = .TRUE.
64  tm = 999.999
65  vnat = 999.999
66  unat = 999.999
67  itau_w = itau_dyn + time
68
69  ! Passage aux composantes naturelles du vent
[5101]70  CALL covnat(llm, ucov, vcov, unat, vnat)
[1612]71
72  !  Appels a histwrite pour l'ecriture des variables a sauvegarder
73
[5103]74  !  Vents U
[1612]75
[5101]76  CALL histwrite(histuaveid, 'u', itau_w, unat,  &
[1612]77       iip1*jjp1*llm, ndexu)
78
79  !  Vents V
80
[5101]81  CALL histwrite(histvaveid, 'v', itau_w, vnat,  &
[1612]82       iip1*jjm*llm, ndexv)
83
84  !  Temperature potentielle moyennee
85
[5101]86  CALL histwrite(histaveid, 'theta', itau_w, teta,  &
[1612]87       iip1*jjp1*llm, ndexu)
88
89  !  Temperature moyennee
90
91  do ii = 1, ijp1llm
92     tm(ii) = teta(ii) * ppk(ii)/cpp
93  enddo
[5101]94  CALL histwrite(histaveid, 'temp', itau_w, tm,  &
[1612]95       iip1*jjp1*llm, ndexu)
96
97  !  Geopotentiel
98
[5101]99  CALL histwrite(histaveid, 'phi', itau_w, phi,  &
[1612]100       iip1*jjp1*llm, ndexu)
101
102  !  Traceurs
103
104  !  DO iq=1, nqtot
[5101]105  !       CALL histwrite(histaveid, tracers(iq)%longName, itau_w, &
[4046]106  !                   q(:, :, iq), iip1*jjp1*llm, ndexu)
[1612]107  ! enddo
108
109  !  Masse
110
[5101]111  CALL histwrite(histaveid, 'masse', itau_w, masse,  &
[1612]112       iip1*jjp1*llm, ndexu)
113
114  !  Pression au sol
115
[5101]116  CALL histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
[1612]117
118  ! Geopotentiel au sol
119
[5101]120  ! CALL histwrite(histaveid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
[1612]121
122  if (ok_sync) then
[5101]123     CALL histsync(histaveid)
124     CALL histsync(histvaveid)
125     CALL histsync(histuaveid)
[1612]126  ENDIF
127
[5103]128END SUBROUTINE  writedynav
Note: See TracBrowser for help on using the repository browser.