/[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

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

  ViewVC Help
Powered by ViewVC 1.1.21