source: LMDZ6/trunk/libf/dyn3dpar/writedynav_p.F @ 3981

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

Some code tidying: turn ener.h into ener_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.7 KB
Line 
1!
2! $Id: writedynav_p.F 2622 2016-09-04 06:12:02Z fairhead $
3!
4      subroutine writedynav_p( histid, time, vcov,
5     ,                          ucov,teta,ppk,phi,q,masse,ps,phis)
6
7#ifdef CPP_IOIPSL
8! This routine needs IOIPSL
9      USE ioipsl
10#endif
11      USE parallel_lmdz
12      USE misc_mod
13      USE infotrac
14      USE comconst_mod, ONLY: cpp
15      USE temps_mod, ONLY: itau_dyn
16     
17      implicit none
18
19C
20C   Ecriture du fichier histoire au format IOIPSL
21C
22C   Appels succesifs des routines: histwrite
23C
24C   Entree:
25C      histid: ID du fichier histoire
26C      time: temps de l'ecriture
27C      vcov: vents v covariants
28C      ucov: vents u covariants
29C      teta: temperature potentielle
30C      phi : geopotentiel instantane
31C      q   : traceurs
32C      masse: masse
33C      ps   :pression au sol
34C      phis : geopotentiel au sol
35C     
36C
37C   Sortie:
38C      fileid: ID du fichier netcdf cree
39C
40C   L. Fairhead, LMD, 03/99
41C
42C =====================================================================
43C
44C   Declarations
45#include "dimensions.h"
46#include "paramet.h"
47#include "comgeom.h"
48#include "description.h"
49#include "iniprint.h"
50
51C
52C   Arguments
53C
54
55      INTEGER histid
56      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
57      REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm),ppk(ip1jmp1,llm)                 
58      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
59      REAL phis(ip1jmp1)                 
60      REAL q(ip1jmp1,llm,nqtot)
61      integer time
62
63
64#ifdef CPP_IOIPSL
65! This routine needs IOIPSL
66C   Variables locales
67C
68      integer ndex2d(iip1*jjp1),ndex3d(iip1*jjp1*llm),iq, ii, ll
69      real us(ip1jmp1,llm), vs(ip1jmp1,llm)
70      real tm(ip1jmp1,llm)
71      REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
72      logical ok_sync
73      integer itau_w
74      integer :: ijb,ije,jjn
75C
76C  Initialisations
77C
78      if (adjust) return
79     
80      ndex3d = 0
81      ndex2d = 0
82      ok_sync = .TRUE.
83      us = 999.999
84      vs = 999.999
85      tm = 999.999
86      vnat = 999.999
87      unat = 999.999
88      itau_w = itau_dyn + time
89
90C Passage aux composantes naturelles du vent
91      call covnat_p(llm, ucov, vcov, unat, vnat)
92
93C
94C  Appels a histwrite pour l'ecriture des variables a sauvegarder
95C
96C  Vents U scalaire
97C
98      call gr_u_scal_p(llm, unat, us)
99     
100      ijb=ij_begin
101      ije=ij_end
102      jjn=jj_nb
103     
104      call histwrite(histid, 'u', itau_w, us(ijb:ije,:),
105     .               iip1*jjn*llm, ndex3d)
106C
107C  Vents V scalaire
108C
109     
110      call gr_v_scal_p(llm, vnat, vs)
111      call histwrite(histid, 'v', itau_w, vs(ijb:ije,:),
112     .               iip1*jjn*llm, ndex3d)
113C
114C  Temperature potentielle moyennee
115C
116     
117      call histwrite(histid, 'theta', itau_w, teta(ijb:ije,:),
118     .                iip1*jjn*llm, ndex3d)
119C
120C  Temperature moyennee
121C
122      do ll=1,llm
123        do ii = ijb, ije
124          tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
125        enddo
126      enddo
127     
128      call histwrite(histid, 'temp', itau_w, tm(ijb:ije,:),
129     .                iip1*jjn*llm, ndex3d)
130C
131C  Geopotentiel
132C
133      call histwrite(histid, 'phi', itau_w, phi(ijb:ije,:),
134     .                iip1*jjn*llm, ndex3d)
135C
136C  Traceurs
137C
138        DO iq=1,nqtot
139          call histwrite(histid, ttext(iq), itau_w, q(ijb:ije,:,iq),
140     .                   iip1*jjn*llm, ndex3d)
141        enddo
142C
143C  Masse
144C
145       call histwrite(histid, 'masse', itau_w, masse(ijb:ije,1),
146     .                iip1*jjn, ndex2d)
147C
148C  Pression au sol
149C
150       call histwrite(histid, 'ps', itau_w, ps(ijb:ije),
151     .                 iip1*jjn, ndex2d)
152C
153C  Geopotentiel au sol
154C
155       call histwrite(histid, 'phis', itau_w, phis(ijb:ije),
156     .                 iip1*jjn, ndex2d)
157C
158C  Fin
159C
160      if (ok_sync) call histsync(histid)
161#else
162      write(lunout,*)'writedynav_p: Needs IOIPSL to function'
163#endif
164! #endif of #ifdef CPP_IOIPSL
165      return
166      end
Note: See TracBrowser for help on using the repository browser.