source: LMDZ4/tags/pre-merge-2009-12/libf/bibio/writedynav.F @ 1370

Last change on this file since 1370 was 1146, checked in by Laurent Fairhead, 15 years ago

Réintegration dans le tronc des modifications issues de la branche LMDZ-dev
comprises entre la révision 1074 et 1145
Validation: une simulation de 1 jour en séquentiel sur PC donne les mêmes
résultats entre la trunk et la dev
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1!
2! $Header$
3!
4      subroutine writedynav( histid, time, vcov,
5     ,                          ucov,teta,ppk,phi,q,masse,ps,phis)
6
7      USE ioipsl
8      USE infotrac, ONLY : nqtot, ttext
9      implicit none
10
11C
12C   Ecriture du fichier histoire au format IOIPSL
13C
14C   Appels succesifs des routines: histwrite
15C
16C   Entree:
17C      histid: ID du fichier histoire
18C      time: temps de l'ecriture
19C      vcov: vents v covariants
20C      ucov: vents u covariants
21C      teta: temperature potentielle
22C      phi : geopotentiel instantane
23C      q   : traceurs
24C      masse: masse
25C      ps   :pression au sol
26C      phis : geopotentiel au sol
27C     
28C
29C   Sortie:
30C      fileid: ID du fichier netcdf cree
31C
32C   L. Fairhead, LMD, 03/99
33C
34C =====================================================================
35C
36C   Declarations
37#include "dimensions.h"
38#include "paramet.h"
39#include "comconst.h"
40#include "comvert.h"
41#include "comgeom.h"
42#include "temps.h"
43#include "ener.h"
44#include "logic.h"
45#include "description.h"
46#include "serre.h"
47
48C
49C   Arguments
50C
51
52      INTEGER histid
53      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
54      REAL teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm)                 
55      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
56      REAL phis(ip1jmp1)                 
57      REAL q(ip1jmp1,llm,nqtot)
58      integer time
59
60
61C   Variables locales
62C
63      integer ndex2d(iip1*jjp1),ndex3d(iip1*jjp1*llm),iq, ii, ll
64      real us(ip1jmp1*llm), vs(ip1jmp1*llm)
65      real tm(ip1jmp1*llm)
66      REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
67      logical ok_sync
68      integer itau_w
69C
70C  Initialisations
71C
72      ndex3d = 0
73      ndex2d = 0
74      ok_sync = .TRUE.
75      us = 999.999
76      vs = 999.999
77      tm = 999.999
78      vnat = 999.999
79      unat = 999.999
80      itau_w = itau_dyn + time
81
82C Passage aux composantes naturelles du vent
83      call covnat(llm, ucov, vcov, unat, vnat)
84
85C
86C  Appels a histwrite pour l'ecriture des variables a sauvegarder
87C
88C  Vents U scalaire
89C
90      call gr_u_scal(llm, unat, us)
91      call histwrite(histid, 'u', itau_w, us,
92     .               iip1*jjp1*llm, ndex3d)
93C
94C  Vents V scalaire
95C
96      call gr_v_scal(llm, vnat, vs)
97      call histwrite(histid, 'v', itau_w, vs,
98     .               iip1*jjp1*llm, ndex3d)
99C
100C  Temperature potentielle moyennee
101C
102      call histwrite(histid, 'theta', itau_w, teta,
103     .                iip1*jjp1*llm, ndex3d)
104C
105C  Temperature moyennee
106C
107      do ii = 1, ijp1llm
108        tm(ii) = teta(ii) * ppk(ii)/cpp
109      enddo
110      call histwrite(histid, 'temp', itau_w, tm,
111     .                iip1*jjp1*llm, ndex3d)
112C
113C  Geopotentiel
114C
115      call histwrite(histid, 'phi', itau_w, phi,
116     .                iip1*jjp1*llm, ndex3d)
117C
118C  Traceurs
119C
120        DO iq=1,nqtot
121          call histwrite(histid, ttext(iq), itau_w, q(:,:,iq),
122     .                   iip1*jjp1*llm, ndex3d)
123        enddo
124C
125C  Masse
126C
127       call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d)
128C
129C  Pression au sol
130C
131       call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
132C
133C  Geopotentiel au sol
134C
135       call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
136C
137C  Fin
138C
139      if (ok_sync) call histsync(histid)
140      return
141      end
Note: See TracBrowser for help on using the repository browser.