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

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

  ViewVC Help
Powered by ViewVC 1.1.21