[541] | 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 | |
---|
[634] | 10 | USE dimphy |
---|
[541] | 11 | implicit none |
---|
[634] | 12 | cym#include "dimensions.h" |
---|
| 13 | cym#include "dimphy.h" |
---|
[541] | 14 | #include "thermcell.h" |
---|
| 15 | |
---|
| 16 | c 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 | |
---|
| 28 | CFH 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 | |
---|
| 34 | c 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) |
---|
| 37 | c |
---|
[634] | 38 | cym real zfm_therm(klon,klev+1),zentr_therm(klon,klev),zdt |
---|
| 39 | cym save zentr_therm,zfm_therm |
---|
| 40 | real,allocatable,dimension(:,:),save :: zfm_therm,zentr_therm |
---|
| 41 | real :: zdt |
---|
| 42 | logical,save :: first=.true. |
---|
[541] | 43 | integer i,k |
---|
| 44 | |
---|
| 45 | ********************************************************* |
---|
| 46 | |
---|
| 47 | c Modele du thermique |
---|
| 48 | c =================== |
---|
| 49 | c print*,'thermiques: WARNING on passe t au lieu de t_seri' |
---|
| 50 | print*,'avant isplit ',nsplit_thermals |
---|
| 51 | |
---|
[634] | 52 | cym 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 | |
---|
[541] | 60 | fm_therm(:,:)=0. |
---|
| 61 | entr_therm(:,:)=0. |
---|
| 62 | |
---|
| 63 | c 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 | |
---|
[566] | 78 | cym CALL thermcell(klon,klev,zdt |
---|
| 79 | cym s ,pplay,paprs,pphi |
---|
| 80 | cym s ,u_seri,v_seri,t_seri,q_seri |
---|
| 81 | cym s ,d_u_the,d_v_the,d_t_the,d_q_the |
---|
| 82 | cym s ,zfm_therm,zentr_therm |
---|
| 83 | cym s ,r_aspect_thermals,l_mix_thermals,w2di_thermals |
---|
| 84 | cym s ,tho_thermals,3) |
---|
| 85 | |
---|
[541] | 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 |
---|
[566] | 92 | s ,tho_thermals) |
---|
[541] | 93 | |
---|
| 94 | c 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 | |
---|
| 107 | c 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 | |
---|
| 113 | c 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 | |
---|
| 119 | c 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 |
---|