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

Last change on this file since 2687 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
RevLine 
[524]1!
[1279]2! $Id: writedynav.F 1357 2010-04-14 14:03:19Z musat $
[524]3!
[1357]4      subroutine writedynav(time, vcov,
5     ,                ucov,teta,ppk,phi,q,masse,ps,phis)
[524]6
[1279]7#ifdef CPP_IOIPSL
[524]8      USE ioipsl
[1279]9#endif
[1146]10      USE infotrac, ONLY : nqtot, ttext
[1357]11      use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid
[524]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"
[1279]47#include "iniprint.h"
[524]48
49C
50C   Arguments
51C
52
53      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
[1357]54      REAL teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm)     
[524]55      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
56      REAL phis(ip1jmp1)                 
[1146]57      REAL q(ip1jmp1,llm,nqtot)
[524]58      integer time
59
60
[1279]61#ifdef CPP_IOIPSL
62! This routine needs IOIPSL to work
[524]63C   Variables locales
64C
[1357]65      integer ndex2d(ip1jmp1),ndexu(ip1jmp1*llm),ndexv(ip1jm*llm)
66      INTEGER iq, ii, ll
[524]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
[1357]74      ndexu = 0
75      ndexv = 0
[524]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
[1357]89C  Vents U
[524]90C
[1357]91      call histwrite(histuaveid, 'u', itau_w, unat,
92     .               iip1*jjp1*llm, ndexu)
[524]93C
[1357]94C  Vents V
[524]95C
[1357]96      call histwrite(histvaveid, 'v', itau_w, vnat,
97     .               iip1*jjm*llm, ndexv)
[524]98C
99C  Temperature potentielle moyennee
100C
[1357]101      call histwrite(histaveid, 'theta', itau_w, teta,
102     .                iip1*jjp1*llm, ndexu)
[524]103C
104C  Temperature moyennee
105C
106      do ii = 1, ijp1llm
107        tm(ii) = teta(ii) * ppk(ii)/cpp
108      enddo
[1357]109      call histwrite(histaveid, 'temp', itau_w, tm,
110     .                iip1*jjp1*llm, ndexu)
[524]111C
112C  Geopotentiel
113C
[1357]114      call histwrite(histaveid, 'phi', itau_w, phi,
115     .                iip1*jjp1*llm, ndexu)
[524]116C
117C  Traceurs
118C
[1357]119!        DO iq=1,nqtot
120!          call histwrite(histaveid, ttext(iq), itau_w, q(:,:,iq),
121!     .                   iip1*jjp1*llm, ndexu)
122!        enddo
[524]123C
124C  Masse
125C
[1357]126       call histwrite(histaveid, 'masse', itau_w, masse,
127     $                   iip1*jjp1*llm, ndexu)
[524]128C
129C  Pression au sol
130C
[1357]131       call histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
[524]132C
133C  Geopotentiel au sol
134C
[1357]135!       call histwrite(histaveid,'phis',itau_w, phis,iip1*jjp1, ndex2d)
[524]136C
137C  Fin
138C
[1357]139      if (ok_sync) then
140          call histsync(histaveid)
141          call histsync(histvaveid)
142          call histsync(histuaveid)
143      ENDIF
[1279]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
[524]151      return
152      end
Note: See TracBrowser for help on using the repository browser.