/[lmdze]/trunk/Sources/dyn3d/writedynav.f
ViewVC logotype

Diff of /trunk/Sources/dyn3d/writedynav.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 45 by guez, Wed Apr 27 13:00:12 2011 UTC revision 56 by guez, Tue Jan 10 19:02:02 2012 UTC
# Line 1  Line 1 
1  subroutine writedynav(histid, nq, time, vcov, ucov, teta, ppk, phi, q, masse, &  module writedynav_m
      ps, phis)  
2    
3    ! From LMDZ4/libf/bibio/writedynav.F, version 1.1.1.1 2004/05/19 12:53:05    implicit none
   ! Ecriture du fichier histoire au format IOIPSL  
4    
5    ! Appels successifs des routines histwrite  contains
6    
7    ! Entree:    subroutine writedynav(nq, time, vcov, ucov, teta, ppk, phi, q, masse, ps, &
8    ! histid: ID du fichier histoire         phis)
   ! time: temps de l'ecriture  
   ! vcov: vents v covariants  
   ! ucov: vents u covariants  
   ! phi : geopotentiel instantane  
   ! q : traceurs  
   ! ps :pression au sol  
   ! phis : geopotentiel au sol  
   
   ! L. Fairhead, LMD, 03/99  
   
   USE histwrite_m, ONLY : histwrite  
   USE histcom, ONLY : histsync  
   USE dimens_m, ONLY : llm  
   USE paramet_m, ONLY : iip1, ijp1llm, ip1jm, ip1jmp1, jjp1  
   USE comconst, ONLY : cpp  
   USE temps, ONLY : itau_dyn  
   USE iniadvtrac_m, ONLY : ttext  
9    
10    implicit none      ! From LMDZ4/libf/bibio/writedynav.F, version 1.1.1.1 2004/05/19 12:53:05
11        ! Ecriture du fichier histoire au format IOIPSL
12    
13        ! Appels successifs des routines histwrite
14    
15        ! Entree:
16        ! time: temps de l'ecriture
17        ! vcov: vents v covariants
18        ! ucov: vents u covariants
19        ! phi : geopotentiel instantane
20        ! q : traceurs
21        ! ps :pression au sol
22        ! phis : geopotentiel au sol
23    
24        ! L. Fairhead, LMD, 03/99
25    
26        USE histwrite_m, ONLY: histwrite
27        USE histcom, ONLY: histsync
28        USE dimens_m, ONLY: llm
29        USE paramet_m, ONLY: iip1, ijp1llm, ip1jm, ip1jmp1, jjp1
30        USE comconst, ONLY: cpp
31        USE temps, ONLY: itau_dyn
32        USE iniadvtrac_m, ONLY: ttext
33        use initdynav_m, only: histaveid
34    
35        INTEGER nq
36        REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm)
37        REAL, intent(in):: teta(ip1jmp1*llm) ! temperature potentielle
38        real phi(ip1jmp1, llm), ppk(ip1jmp1*llm)
39        REAL ps(ip1jmp1)
40        real, intent(in):: masse(ip1jmp1, llm)
41        REAL phis(ip1jmp1)
42        REAL q(ip1jmp1, llm, nq)
43        integer, intent(in):: time
44    
45        ! Variables locales
46        integer ndex2d(iip1*jjp1), ndex3d(iip1*jjp1*llm), iq, ii, ll
47        real us(ip1jmp1*llm), vs(ip1jmp1*llm)
48        real tm(ip1jmp1*llm)
49        REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)
50        logical ok_sync
51        integer itau_w
52    
53        !---------------------------------------------------------------
54    
55        ! Initialisations
56        ndex3d = 0
57        ndex2d = 0
58        ok_sync = .TRUE.
59        us = 999.999
60        vs = 999.999
61        tm = 999.999
62        vnat = 999.999
63        unat = 999.999
64        itau_w = itau_dyn + time
65    
66        ! Passage aux composantes naturelles du vent
67        call covnat(llm, ucov, vcov, unat, vnat)
68    
69        ! Appels a histwrite pour l'ecriture des variables a sauvegarder
70    
71        ! Vents U scalaire
72        call gr_u_scal(llm, unat, us)
73        call histwrite(histaveid, 'u', itau_w, us)
74    
75        ! Vents V scalaire
76        call gr_v_scal(llm, vnat, vs)
77        call histwrite(histaveid, 'v', itau_w, vs)
78    
79        ! Temperature potentielle moyennee
80        call histwrite(histaveid, 'theta', itau_w, teta)
81    
82        ! Temperature moyennee
83        do ii = 1, ijp1llm
84           tm(ii) = teta(ii) * ppk(ii)/cpp
85        enddo
86        call histwrite(histaveid, 'temp', itau_w, tm)
87    
88        ! Geopotentiel
89        call histwrite(histaveid, 'phi', itau_w, phi)
90    
91        ! Traceurs
92        DO iq=1, nq
93           call histwrite(histaveid, ttext(iq), itau_w, q(:, :, iq))
94        enddo
95    
96        ! Masse
97        call histwrite(histaveid, 'masse', itau_w, masse)
98    
99        ! Pression au sol
100        call histwrite(histaveid, 'ps', itau_w, ps)
101    
102    INTEGER histid, nq      ! Geopotentiel au sol
103    REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm)      call histwrite(histaveid, 'phis', itau_w, phis)
   REAL, intent(in):: teta(ip1jmp1*llm) ! temperature potentielle  
   real phi(ip1jmp1, llm), ppk(ip1jmp1*llm)  
   REAL ps(ip1jmp1)  
   real, intent(in):: masse(ip1jmp1, llm)  
   REAL phis(ip1jmp1)  
   REAL q(ip1jmp1, llm, nq)  
   integer, intent(in):: time  
   
   ! Variables locales  
   integer ndex2d(iip1*jjp1), ndex3d(iip1*jjp1*llm), iq, ii, ll  
   real us(ip1jmp1*llm), vs(ip1jmp1*llm)  
   real tm(ip1jmp1*llm)  
   REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)  
   logical ok_sync  
   integer itau_w  
   
   !---------------------------------------------------------------  
   
   ! Initialisations  
   ndex3d = 0  
   ndex2d = 0  
   ok_sync = .TRUE.  
   us = 999.999  
   vs = 999.999  
   tm = 999.999  
   vnat = 999.999  
   unat = 999.999  
   itau_w = itau_dyn + time  
   
   ! Passage aux composantes naturelles du vent  
   call covnat(llm, ucov, vcov, unat, vnat)  
   
   ! Appels a histwrite pour l'ecriture des variables a sauvegarder  
   
   ! Vents U scalaire  
   call gr_u_scal(llm, unat, us)  
   call histwrite(histid, 'u', itau_w, us)  
   
   ! Vents V scalaire  
   call gr_v_scal(llm, vnat, vs)  
   call histwrite(histid, 'v', itau_w, vs)  
   
   ! Temperature potentielle moyennee  
   call histwrite(histid, 'theta', itau_w, teta)  
   
   ! Temperature moyennee  
   do ii = 1, ijp1llm  
      tm(ii) = teta(ii) * ppk(ii)/cpp  
   enddo  
   call histwrite(histid, 'temp', itau_w, tm)  
   
   ! Geopotentiel  
   call histwrite(histid, 'phi', itau_w, phi)  
   
   ! Traceurs  
   DO iq=1, nq  
      call histwrite(histid, ttext(iq), itau_w, q(:, :, iq))  
   enddo  
   
   ! Masse  
   call histwrite(histid, 'masse', itau_w, masse)  
   
   ! Pression au sol  
   call histwrite(histid, 'ps', itau_w, ps)  
104    
105    ! Geopotentiel au sol      if (ok_sync) call histsync(histaveid)
   call histwrite(histid, 'phis', itau_w, phis)  
106    
107    if (ok_sync) call histsync(histid)    end subroutine writedynav
108    
109  end subroutine writedynav  end module writedynav_m

Legend:
Removed from v.45  
changed lines
  Added in v.56

  ViewVC Help
Powered by ViewVC 1.1.21