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