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

Diff of /trunk/dyn3d/writedynav.f

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

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

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

  ViewVC Help
Powered by ViewVC 1.1.21