/[lmdze]/trunk/dyn3d/writehist.f
ViewVC logotype

Diff of /trunk/dyn3d/writehist.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 254 by guez, Mon Feb 5 10:39:38 2018 UTC revision 261 by guez, Wed Mar 7 13:33:15 2018 UTC
# Line 4  module writehist_m Line 4  module writehist_m
4    
5  contains  contains
6    
7    subroutine writehist(time, vcov, ucov, teta, phi, masse, ps)    subroutine writehist(vcov, ucov, teta, pk, phi, q, masse, ps, time)
8    
9      ! From writehist.F , revision 1403, 2010-07-01 09:02:53Z      ! From writehist.F, revision 1403, 2010-07-01 09:02:53
10      ! Écriture du fichier histoire      ! Écriture du fichier histoire au format IOIPSL
11      ! L. Fairhead, LMD, 03/99      ! L. Fairhead, LMD, 03/99
12    
13        USE comconst, ONLY: cpp
14      use covnat_m, only: covnat      use covnat_m, only: covnat
15      use dimens_m, only: llm      use dimens_m, only: llm
16      use histsync_m, only: histsync      use histsync_m, only: histsync
17      use histwrite_m, only: histwrite      use histwrite_m, only: histwrite
18        use iniadvtrac_m, only: ttext
19      use inithist_m, only: histid, histvid, histuid      use inithist_m, only: histid, histvid, histuid
20        use nr_util, only: assert
21      use paramet_m, only: ip1jm, ip1jmp1      use paramet_m, only: ip1jm, ip1jmp1
22      use temps, only: itau_dyn      use temps, only: itau_dyn
23    
24        ! Vent covariant :
25        REAL, intent(in):: vcov(:, :, :) ! (iim + 1, jjm, llm)
26        REAL, intent(in):: ucov(:, :, :) ! (iim + 1, jjm + 1, llm)
27    
28        REAL, intent(in):: teta(:, :, :) ! (iim + 1, jjm + 1, llm)
29        ! temperature potentielle
30    
31        real, intent(in):: pk(:, :, :) ! (iim + 1, jjm + 1, llm)
32        real, intent(in):: phi(:, :, :) ! (iim + 1, jjm + 1, llm) ! geopotential
33        REAL, intent(in):: q(:, :, :, :) ! (iim + 1, jjm + 1, llm, nqmx) traceurs
34        real, intent(in):: masse(:, :, :) ! (iim + 1, jjm + 1, llm)
35        REAL, intent(in):: ps(:, :) ! (iim + 1, jjm + 1) pression au sol
36      integer, intent(in):: time ! temps de l'ecriture      integer, intent(in):: time ! temps de l'ecriture
     REAL, intent(in):: vcov(ip1jm, llm), ucov(ip1jmp1, llm) ! vent covariant  
     REAL, intent(in):: teta(ip1jmp1, llm) ! temperature potentielle  
     REAL, intent(in):: phi(ip1jmp1, llm) ! geopotentiel instantane  
     REAL, intent(in):: masse(ip1jmp1, llm)  
     REAL, intent(in):: ps(ip1jmp1) ! pression au sol  
37    
38      ! Local:      ! Local:
39      logical ok_sync      integer iq, itau_w
     integer itau_w  
40      REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)      REAL vnat(ip1jm, llm), unat(ip1jmp1, llm)
41    
42      !---------------------------------------------------------------------      !---------------------------------------------------------------------
43    
44      ! Initialisations      call assert([size(vcov, 1), size(ucov, 1), size(teta, 1), size(phi, 1), &
45             size(pk, 1), size(ps, 1), size(masse, 1)] == size(q, 1), &
46             "writedynav iim")
47        call assert([size(vcov, 2) + 1, size(ucov, 2), size(teta, 2), &
48             size(phi, 2), size(pk, 2), size(ps, 2), size(masse, 2)] &
49             == size(q, 2), "writedynav jjm")
50        call assert([size(vcov, 3), size(ucov, 3), size(teta, 3), size(phi, 3), &
51             size(pk, 3), size(masse, 3), size(q, 3)] == llm, "writedynav llm")
52    
     ok_sync =.TRUE.  
53      itau_w = itau_dyn + time      itau_w = itau_dyn + time
     ! Passage aux composantes naturelles du vent  
54      call covnat(llm, ucov, vcov, unat, vnat)      call covnat(llm, ucov, vcov, unat, vnat)
55    
     ! Appels a histwrite pour l'ecriture des variables a sauvegarder  
   
     ! Vents U  
   
56      call histwrite(histuid, 'u', itau_w, unat)      call histwrite(histuid, 'u', itau_w, unat)
   
     ! Vents V  
   
57      call histwrite(histvid, 'v', itau_w, vnat)      call histwrite(histvid, 'v', itau_w, vnat)
58        call histwrite(histid, 'theta', itau_w, teta)
59      ! Temperature potentielle      call histwrite(histid, 'temp', itau_w, teta * pk / cpp)
   
     call histwrite(histid, 'teta', itau_w, teta)  
   
     ! Geopotentiel  
   
60      call histwrite(histid, 'phi', itau_w, phi)      call histwrite(histid, 'phi', itau_w, phi)
61    
62      ! Masse      DO iq = 1, size(q, 4)
63           call histwrite(histid, ttext(iq), itau_w, q(:, :, :, iq))
64        enddo
65    
66      call histwrite(histid, 'masse', itau_w, masse)      call histwrite(histid, 'masse', itau_w, masse)
   
     ! Pression au sol  
67      call histwrite(histid, 'ps', itau_w, ps)      call histwrite(histid, 'ps', itau_w, ps)
68    
69      if (ok_sync) then      call histsync(histid)
70         call histsync(histid)      call histsync(histvid)
71         call histsync(histvid)      call histsync(histuid)
        call histsync(histuid)  
     endif  
72    
73    end subroutine writehist    end subroutine writehist
74    

Legend:
Removed from v.254  
changed lines
  Added in v.261

  ViewVC Help
Powered by ViewVC 1.1.21