source: LMDZ5/branches/IPSLCM5A2.1/libf/dyn3dpar/writehist_p.F @ 2866

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

Cleanup in the dynamics: turn logic.h into module logic_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 2603 2016-07-25 09:31:56Z fairhead $
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      USE temps_mod, ONLY: itau_dyn
15     
16      implicit none
17
18C
19C   Ecriture du fichier histoire au format IOIPSL
20C
21C   Appels succesifs des routines: histwrite
22C
23C   Entree:
24C      histid: ID du fichier histoire
25C      histvid:ID du fichier histoire pour les vents V (appele a disparaitre)
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 "ener.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.