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

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

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