source: LMDZ5/trunk/libf/dyn3dpar/writehist_p.F @ 2600

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

Cleanup in the dynamics: turn comvert.h into module comvert_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.3 KB
Line 
1!
2! $Id: writehist_p.F 2600 2016-07-23 05:45:38Z emillour $
3!
4      subroutine writehist_p( histid, histvid, time, vcov,
5     ,                          ucov,teta,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      implicit none
15
16C
17C   Ecriture du fichier histoire au format IOIPSL
18C
19C   Appels succesifs des routines: histwrite
20C
21C   Entree:
22C      histid: ID du fichier histoire
23C      histvid:ID du fichier histoire pour les vents V (appele a disparaitre)
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 "comgeom.h"
46#include "temps.h"
47#include "ener.h"
48#include "logic.h"
49#include "description.h"
50#include "iniprint.h"
51
52C
53C   Arguments
54C
55
56      INTEGER histid, histvid
57      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
58      REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm)                   
59      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
60      REAL phis(ip1jmp1)                 
61      REAL q(ip1jmp1,llm,nqtot)
62      integer time
63
64#ifdef CPP_IOIPSL
65! This routine needs IOIPSL
66C   Variables locales
67C
68      integer iq, ii, ll
69      integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1)
70      logical ok_sync
71      integer itau_w
72      integer :: ijb,ije,jjn
73C
74C  Initialisations
75C
76      if (adjust) return
77     
78   
79      ndexu = 0
80      ndexv = 0
81      ndex2d = 0
82      ok_sync =.TRUE.
83      itau_w = itau_dyn + time
84C
85C  Appels a histwrite pour l'ecriture des variables a sauvegarder
86C
87C  Vents U
88C
89      ijb=ij_begin
90      ije=ij_end
91      jjn=jj_nb
92         
93      call histwrite(histid, 'ucov', itau_w, ucov(ijb:ije,:),
94     .               iip1*jjn*llm, ndexu)
95
96C
97C  Vents V
98C
99      if (pole_sud) ije=ij_end-iip1
100      if (pole_sud) jjn=jj_nb-1
101     
102      call histwrite(histvid, 'vcov', itau_w, vcov(ijb:ije,:),
103     .               iip1*jjn*llm, ndexv)
104
105C
106C  Temperature potentielle
107C
108      ijb=ij_begin
109      ije=ij_end
110      jjn=jj_nb
111
112      call histwrite(histid, 'teta', itau_w, teta(ijb:ije,:),
113     .                iip1*jjn*llm, ndexu)
114C
115C  Geopotentiel
116C
117      call histwrite(histid, 'phi', itau_w, phi(ijb:ije,:),
118     .                iip1*jjn*llm, ndexu)
119C
120C  Traceurs
121C
122        DO iq=1,nqtot
123          call histwrite(histid, ttext(iq), itau_w, q(ijb:ije,:,iq),
124     .                   iip1*jjn*llm, ndexu)
125        enddo
126C
127C  Masse
128C
129      call histwrite(histid, 'masse', itau_w, masse(ijb:ije,1),
130     .               iip1*jjn, ndex2d)
131C
132C  Pression au sol
133C
134      call histwrite(histid, 'ps', itau_w, ps(ijb:ije),
135     .               iip1*jjn, ndex2d)
136C
137C  Geopotentiel au sol
138C
139      call histwrite(histid, 'phis', itau_w, phis(ijb:ije),
140     .               iip1*jjn, ndex2d)
141C
142C  Fin
143C
144      if (ok_sync) then
145        call histsync(histid)
146        call histsync(histvid)
147      endif
148#else
149      write(lunout,*)'writehist_p: Needs IOIPSL to function'
150#endif
151! #endif of #ifdef CPP_IOIPSL
152      return
153      end
Note: See TracBrowser for help on using the repository browser.