source: LMDZ.3.3/tags/IPSL-CM4_CMIP/libf/bibio/writedynav.F @ 575

Last change on this file since 575 was 353, checked in by lmdzadmin, 22 years ago

2 changements pour les fichiers histoire:

  • utilisation de l'entree "rectilineaire" de IOIPSL pour ne plus avoir

a

lancer ncregular a chaque fois

  • le calendrier des fichiers histoire est maintenant base sur la date d'initialisation de la simulation plutot que sur la date de depart du

job

en cours

LF

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