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

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

  ViewVC Help
Powered by ViewVC 1.1.21