source: LMDZ4/branches/LMDZ4V5.0-dev/libf/bibio/writedynav.F @ 2529

Last change on this file since 2529 was 1357, checked in by Ehouarn Millour, 15 years ago

Some cleanup and fixing the possibility to output fields in the dynamics, on the dynamical grids.

CLEANUPS:

  • arch-PW6_VARGAS.fcm : add potentially benefic compiling options
  • removed obsolete "control.h" in dyn3d/dyn3dpar (module control_mod.F90 is used instead)

OUTPUTS in the dynamics (3 sets of files, one for each grid: scalar, u, v):

  • removed "com_io_dyn.h" common; use module "com_io_dyn_mod.F90" instead
  • updated "initdynav.F","inithist.F","writehist.F" and "writedynav.F" in bibio: which field will be written is hard coded there.
  • flags "ok_dyn_ins" and "ok_dyn_ave" (loaded via conf_gcm.F) trigger output of fields in the dynamics: if ok_dyn_ins is true, then files "dyn_hist.nc", "dyn_histu.nc" and "dyn_histv.nc" are written (the frequency of the outputs is given by 'iecri' in run.def; values are written every 'iecri' dynamical step). if ok_dyn_ave is true then files "dyn_hist_ave.nc", "dyn_histu_ave.nc" and "dyn_histv_ave.nc" are written (the rate at which averages and made/written, in days, is given by 'periodav' in run.def).

EM

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1!
2! $Id: writedynav.F 1357 2010-04-14 14:03:19Z oboucher $
3!
4      subroutine writedynav(time, vcov,
5     ,                ucov,teta,ppk,phi,q,masse,ps,phis)
6
7#ifdef CPP_IOIPSL
8      USE ioipsl
9#endif
10      USE infotrac, ONLY : nqtot, ttext
11      use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid
12      implicit none
13
14C
15C   Ecriture du fichier histoire au format IOIPSL
16C
17C   Appels succesifs des routines: histwrite
18C
19C   Entree:
20C      time: temps de l'ecriture
21C      vcov: vents v covariants
22C      ucov: vents u covariants
23C      teta: temperature potentielle
24C      phi : geopotentiel instantane
25C      q   : traceurs
26C      masse: masse
27C      ps   :pression au sol
28C      phis : geopotentiel au sol
29C     
30C
31C
32C   L. Fairhead, LMD, 03/99
33C
34C =====================================================================
35C
36C   Declarations
37#include "dimensions.h"
38#include "paramet.h"
39#include "comconst.h"
40#include "comvert.h"
41#include "comgeom.h"
42#include "temps.h"
43#include "ener.h"
44#include "logic.h"
45#include "description.h"
46#include "serre.h"
47#include "iniprint.h"
48
49C
50C   Arguments
51C
52
53      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
54      REAL teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm)     
55      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
56      REAL phis(ip1jmp1)                 
57      REAL q(ip1jmp1,llm,nqtot)
58      integer time
59
60
61#ifdef CPP_IOIPSL
62! This routine needs IOIPSL to work
63C   Variables locales
64C
65      integer ndex2d(ip1jmp1),ndexu(ip1jmp1*llm),ndexv(ip1jm*llm)
66      INTEGER iq, ii, ll
67      real tm(ip1jmp1*llm)
68      REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
69      logical ok_sync
70      integer itau_w
71C
72C  Initialisations
73C
74      ndexu = 0
75      ndexv = 0
76      ndex2d = 0
77      ok_sync = .TRUE.
78      tm = 999.999
79      vnat = 999.999
80      unat = 999.999
81      itau_w = itau_dyn + time
82
83C Passage aux composantes naturelles du vent
84      call covnat(llm, ucov, vcov, unat, vnat)
85
86C
87C  Appels a histwrite pour l'ecriture des variables a sauvegarder
88C
89C  Vents U
90C
91      call histwrite(histuaveid, 'u', itau_w, unat,
92     .               iip1*jjp1*llm, ndexu)
93C
94C  Vents V
95C
96      call histwrite(histvaveid, 'v', itau_w, vnat,
97     .               iip1*jjm*llm, ndexv)
98C
99C  Temperature potentielle moyennee
100C
101      call histwrite(histaveid, 'theta', itau_w, teta,
102     .                iip1*jjp1*llm, ndexu)
103C
104C  Temperature moyennee
105C
106      do ii = 1, ijp1llm
107        tm(ii) = teta(ii) * ppk(ii)/cpp
108      enddo
109      call histwrite(histaveid, 'temp', itau_w, tm,
110     .                iip1*jjp1*llm, ndexu)
111C
112C  Geopotentiel
113C
114      call histwrite(histaveid, 'phi', itau_w, phi,
115     .                iip1*jjp1*llm, ndexu)
116C
117C  Traceurs
118C
119!        DO iq=1,nqtot
120!          call histwrite(histaveid, ttext(iq), itau_w, q(:,:,iq),
121!     .                   iip1*jjp1*llm, ndexu)
122!        enddo
123C
124C  Masse
125C
126       call histwrite(histaveid, 'masse', itau_w, masse,
127     $                   iip1*jjp1*llm, ndexu)
128C
129C  Pression au sol
130C
131       call histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
132C
133C  Geopotentiel au sol
134C
135!       call histwrite(histaveid,'phis',itau_w, phis,iip1*jjp1, ndex2d)
136C
137C  Fin
138C
139      if (ok_sync) then
140          call histsync(histaveid)
141          call histsync(histvaveid)
142          call histsync(histuaveid)
143      ENDIF
144
145#else
146! tell the user this routine should be run with ioipsl
147      write(lunout,*)"writedynav: Warning this routine should not be",
148     &               " used without ioipsl"
149#endif
150! of #ifdef CPP_IOIPSL
151      return
152      end
Note: See TracBrowser for help on using the repository browser.