/[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 30 by guez, Thu Apr 1 09:07:28 2010 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 teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm)                      ok_sync = .TRUE.
55        REAL ps(ip1jmp1),masse(ip1jmp1,llm)                      us = 999.999
56        REAL phis(ip1jmp1)                      vs = 999.999
57        REAL q(ip1jmp1,llm,nq)    tm = 999.999
58        integer, intent(in):: time    vnat = 999.999
59      unat = 999.999
60      itau_w = itau_dyn + time
61  C   Variables locales  
62  C    ! Passage aux composantes naturelles du vent
63        integer ndex2d(iip1*jjp1),ndex3d(iip1*jjp1*llm),iq, ii, ll    call covnat(llm, ucov, vcov, unat, vnat)
64        real us(ip1jmp1*llm), vs(ip1jmp1*llm)  
65        real tm(ip1jmp1*llm)    ! Appels a histwrite pour l'ecriture des variables a sauvegarder
66        REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)  
67        logical ok_sync    ! Vents U scalaire
68        integer itau_w    call gr_u_scal(llm, unat, us)
69  C    call histwrite(histid, 'u', itau_w, us)
70  C  Initialisations  
71  C    ! Vents V scalaire
72        ndex3d = 0    call gr_v_scal(llm, vnat, vs)
73        ndex2d = 0    call histwrite(histid, 'v', itau_w, vs)
74        ok_sync = .TRUE.  
75        us = 999.999    ! Temperature potentielle moyennee
76        vs = 999.999    call histwrite(histid, 'theta', itau_w, teta)
77        tm = 999.999  
78        vnat = 999.999    ! Temperature moyennee
79        unat = 999.999    do ii = 1, ijp1llm
80        itau_w = itau_dyn + time       tm(ii) = teta(ii) * ppk(ii)/cpp
81      enddo
82  C Passage aux composantes naturelles du vent    call histwrite(histid, 'temp', itau_w, tm)
83        call covnat(llm, ucov, vcov, unat, vnat)  
84      ! Geopotentiel
85  C    call histwrite(histid, 'phi', itau_w, phi)
86  C  Appels a histwrite pour l'ecriture des variables a sauvegarder  
87  C    ! Traceurs
88  C  Vents U scalaire    DO iq=1, nq
89  C       call histwrite(histid, ttext(iq), itau_w, q(:, :, iq))
90        call gr_u_scal(llm, unat, us)    enddo
91        call histwrite(histid, 'u', itau_w, us)  
92  C    ! Masse
93  C  Vents V scalaire    call histwrite(histid, 'masse', itau_w, masse)
94  C  
95        call gr_v_scal(llm, vnat, vs)    ! Pression au sol
96        call histwrite(histid, 'v', itau_w, vs)    call histwrite(histid, 'ps', itau_w, ps)
97  C  
98  C  Temperature potentielle moyennee    ! Geopotentiel au sol
99  C    call histwrite(histid, 'phis', itau_w, phis)
100        call histwrite(histid, 'theta', itau_w, teta)  
101  C    if (ok_sync) call histsync(histid)
102  C  Temperature moyennee  
103  C  end subroutine writedynav
       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.30  
changed lines
  Added in v.45

  ViewVC Help
Powered by ViewVC 1.1.21