source: LMDZ4/branches/LMDZ4_par_0/libf/phylmd/calltherm.F @ 634

Last change on this file since 634 was 634, checked in by Laurent Fairhead, 19 years ago

Modifications faites à la physique pour la rendre parallele YM
Une branche de travail LMDZ4_par_0 a été créée provisoirement afin de tester
les modifs pleinement avant leurs inclusions dans le tronc principal
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1!
2! $Header$
3!
4      subroutine calltherm(dtime
5     s      ,pplay,paprs,pphi
6     s      ,u_seri,v_seri,t_seri,q_seri
7     s      ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs
8     s      ,fm_therm,entr_therm)
9
10      USE dimphy
11      implicit none
12cym#include "dimensions.h"
13cym#include "dimphy.h"
14#include "thermcell.h"
15
16c  A inclure eventuellement dans les fichiers de configuration
17      data r_aspect_thermals,l_mix_thermals,tho_thermals/4.,10.,0./
18      data w2di_thermals/0/
19
20      REAL dtime
21
22      REAL u_seri(klon,klev),v_seri(klon,klev)
23      REAL t_seri(klon,klev),q_seri(klon,klev)
24      REAL paprs(klon,klev+1)
25      REAL pplay(klon,klev)
26      REAL pphi(klon,klev)
27
28CFH Update Thermiques
29      REAL d_t_ajs(klon,klev), d_q_ajs(klon,klev)
30      REAL d_u_ajs(klon,klev),d_v_ajs(klon,klev)
31      real fm_therm(klon,klev+1),entr_therm(klon,klev)
32
33
34c variables locales
35      REAL d_t_the(klon,klev), d_q_the(klon,klev)
36      REAL d_u_the(klon,klev),d_v_the(klon,klev)
37c
38cym      real zfm_therm(klon,klev+1),zentr_therm(klon,klev),zdt
39cym      save zentr_therm,zfm_therm
40      real,allocatable,dimension(:,:),save :: zfm_therm,zentr_therm
41      real :: zdt
42      logical,save :: first=.true.
43      integer i,k
44
45*********************************************************
46
47c  Modele du thermique
48c  ===================
49c         print*,'thermiques: WARNING on passe t au lieu de t_seri'
50       print*,'avant isplit ',nsplit_thermals
51
52cym initialisation dynamique
53         if (first) then
54           allocate(zfm_therm(klon,klev+1),zentr_therm(klon,klev))
55           zfm_therm(:,:)=0.
56           zentr_therm(:,:)=0.
57           first=.false.
58         endif
59         
60         fm_therm(:,:)=0.
61         entr_therm(:,:)=0.
62
63c   tests sur les valeurs negatives de l'eau
64         do k=1,klev
65            do i=1,klon
66               if (.not.q_seri(i,k).ge.0.) then
67                   print*,'WARN eau<0 avant therm i=',i,'  k=',k
68     s         ,' dq,q',d_q_the(i,k),q_seri(i,k)
69                  q_seri(i,k)=1.e-15
70               endif
71            enddo
72         enddo
73
74
75         zdt=dtime/float(nsplit_thermals)
76         do isplit=1,nsplit_thermals
77
78cym            CALL thermcell(klon,klev,zdt
79cym     s      ,pplay,paprs,pphi
80cym     s      ,u_seri,v_seri,t_seri,q_seri
81cym     s      ,d_u_the,d_v_the,d_t_the,d_q_the
82cym     s      ,zfm_therm,zentr_therm
83cym     s      ,r_aspect_thermals,l_mix_thermals,w2di_thermals
84cym     s      ,tho_thermals,3)
85
86            CALL thermcell(klon,klev,zdt
87     s      ,pplay,paprs,pphi
88     s      ,u_seri,v_seri,t_seri,q_seri
89     s      ,d_u_the,d_v_the,d_t_the,d_q_the
90     s      ,zfm_therm,zentr_therm
91     s      ,r_aspect_thermals,l_mix_thermals,w2di_thermals
92     s      ,tho_thermals)
93
94c  transformation de la derivee en tendance
95            d_t_the(:,:)=d_t_the(:,:)*dtime/float(nsplit_thermals)
96            d_u_the(:,:)=d_u_the(:,:)*dtime/float(nsplit_thermals)
97            d_v_the(:,:)=d_v_the(:,:)*dtime/float(nsplit_thermals)
98            d_q_the(:,:)=d_q_the(:,:)*dtime/float(nsplit_thermals)
99            fm_therm(:,:)=fm_therm(:,:)
100     s      +zfm_therm(:,:)/float(nsplit_thermals)
101            entr_therm(:,:)=entr_therm(:,:)
102     s       +zentr_therm(:,:)/float(nsplit_thermals)
103            fm_therm(:,klev+1)=0.
104
105
106
107c  accumulation de la tendance
108            d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:)
109            d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:)
110            d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:)
111            d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_the(:,:)
112
113c  incrementation des variables meteo
114            t_seri(:,:) = t_seri(:,:) + d_t_the(:,:)
115            u_seri(:,:) = u_seri(:,:) + d_u_the(:,:)
116            v_seri(:,:) = v_seri(:,:) + d_v_the(:,:)
117            q_seri(:,:) = q_seri(:,:) + d_q_the(:,:)
118
119c   tests sur les valeurs negatives de l'eau
120            DO k = 1, klev
121            DO i = 1, klon
122               if (.not.q_seri(i,k).ge.0.) then
123                   print*,'WARN eau<0 apres therm i=',i,'  k=',k
124     s         ,' dq,q',d_q_the(i,k),q_seri(i,k)
125                  q_seri(i,k)=1.e-15
126               endif
127            ENDDO
128            ENDDO
129
130         enddo ! isplit
131
132      return
133
134      end
Note: See TracBrowser for help on using the repository browser.