/[lmdze]/trunk/libf/bibio/writedynav.f90
ViewVC logotype

Diff of /trunk/libf/bibio/writedynav.f90

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

  ViewVC Help
Powered by ViewVC 1.1.21