source: LMDZ5/trunk/libf/dyn3dmem/writedynav_p.F @ 1632

Last change on this file since 1632 was 1632, checked in by Laurent Fairhead, 12 years ago

Import initial du répertoire dyn3dmem

Attention! ceci n'est qu'une version préliminaire du code "basse mémoire":
le code contenu dans ce répertoire est basé sur la r1320 et a donc besoin
d'être mis à jour par rapport à la dynamique parallèle d'aujourd'hui.
Ce code est toutefois mis à disposition pour circonvenir à des problèmes
de mémoire que certaines configurations du modèle pourraient rencontrer.
Dans l'état, il compile et tourne sur vargas et au CCRT


Initial import of dyn3dmem

Warning! this is just a preliminary version of the memory light code:
it is based on r1320 of the code and thus needs to be updated before
it can replace the present dyn3dpar code. It is nevertheless put at your
disposal to circumvent some memory problems some LMDZ configurations may
encounter. In its present state, it will compile and run on vargas and CCRT

File size: 3.8 KB
Line 
1!
2! $Id: writedynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
3!
4      subroutine writedynav_p( histid, time, vcov,
5     ,                          ucov,teta,ppk,phi,q,masse,ps,phis)
6
7#ifdef CPP_IOIPSL
8! This routine needs IOIPSL
9      USE ioipsl
10#endif
11      USE parallel
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      time: temps de l'ecriture
24C      vcov: vents v covariants
25C      ucov: vents u covariants
26C      teta: temperature potentielle
27C      phi : geopotentiel instantane
28C      q   : traceurs
29C      masse: masse
30C      ps   :pression au sol
31C      phis : geopotentiel au sol
32C     
33C
34C   Sortie:
35C      fileid: ID du fichier netcdf cree
36C
37C   L. Fairhead, LMD, 03/99
38C
39C =====================================================================
40C
41C   Declarations
42#include "dimensions.h"
43#include "paramet.h"
44#include "comconst.h"
45#include "comvert.h"
46#include "comgeom.h"
47#include "temps.h"
48#include "ener.h"
49#include "logic.h"
50#include "description.h"
51#include "serre.h"
52#include "iniprint.h"
53
54C
55C   Arguments
56C
57
58      INTEGER histid
59      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm)
60      REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm),ppk(ip1jmp1,llm)                 
61      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
62      REAL phis(ip1jmp1)                 
63      REAL q(ip1jmp1,llm,nqtot)
64      integer time
65
66
67#ifdef CPP_IOIPSL
68! This routine needs IOIPSL
69C   Variables locales
70C
71      integer ndex2d(iip1*jjp1),ndex3d(iip1*jjp1*llm),iq, ii, ll
72      real us(ip1jmp1,llm), vs(ip1jmp1,llm)
73      real tm(ip1jmp1,llm)
74      REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
75      logical ok_sync
76      integer itau_w
77      integer :: ijb,ije,jjn
78C
79C  Initialisations
80C
81      if (adjust) return
82     
83      ndex3d = 0
84      ndex2d = 0
85      ok_sync = .TRUE.
86      us = 999.999
87      vs = 999.999
88      tm = 999.999
89      vnat = 999.999
90      unat = 999.999
91      itau_w = itau_dyn + time
92
93C Passage aux composantes naturelles du vent
94      call covnat_p(llm, ucov, vcov, unat, vnat)
95
96C
97C  Appels a histwrite pour l'ecriture des variables a sauvegarder
98C
99C  Vents U scalaire
100C
101      call gr_u_scal_p(llm, unat, us)
102     
103      ijb=ij_begin
104      ije=ij_end
105      jjn=jj_nb
106     
107      call histwrite(histid, 'u', itau_w, us(ijb:ije,:),
108     .               iip1*jjn*llm, ndex3d)
109C
110C  Vents V scalaire
111C
112     
113      call gr_v_scal_p(llm, vnat, vs)
114      call histwrite(histid, 'v', itau_w, vs(ijb:ije,:),
115     .               iip1*jjn*llm, ndex3d)
116C
117C  Temperature potentielle moyennee
118C
119     
120      call histwrite(histid, 'theta', itau_w, teta(ijb:ije,:),
121     .                iip1*jjn*llm, ndex3d)
122C
123C  Temperature moyennee
124C
125      do ll=1,llm
126        do ii = ijb, ije
127          tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
128        enddo
129      enddo
130     
131      call histwrite(histid, 'temp', itau_w, tm(ijb:ije,:),
132     .                iip1*jjn*llm, ndex3d)
133C
134C  Geopotentiel
135C
136      call histwrite(histid, 'phi', itau_w, phi(ijb:ije,:),
137     .                iip1*jjn*llm, ndex3d)
138C
139C  Traceurs
140C
141        DO iq=1,nqtot
142          call histwrite(histid, ttext(iq), itau_w, q(ijb:ije,:,iq),
143     .                   iip1*jjn*llm, ndex3d)
144        enddo
145C
146C  Masse
147C
148       call histwrite(histid, 'masse', itau_w, masse(ijb:ije,1),
149     .                iip1*jjn, ndex2d)
150C
151C  Pression au sol
152C
153       call histwrite(histid, 'ps', itau_w, ps(ijb:ije),
154     .                 iip1*jjn, ndex2d)
155C
156C  Geopotentiel au sol
157C
158       call histwrite(histid, 'phis', itau_w, phis(ijb:ije),
159     .                 iip1*jjn, ndex2d)
160C
161C  Fin
162C
163      if (ok_sync) call histsync(histid)
164#else
165      write(lunout,*)'writedynav_p: Needs IOIPSL to function'
166#endif
167! #endif of #ifdef CPP_IOIPSL
168      return
169      end
Note: See TracBrowser for help on using the repository browser.