[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 | |
---|
[704] | 10 | USE dimphy |
---|
[541] | 11 | implicit none |
---|
[704] | 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 |
---|
[704] | 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 | c$OMP THREADPRIVATE(zfm_therm,zentr_therm) |
---|
| 42 | real :: zdt |
---|
| 43 | logical,save :: first=.true. |
---|
| 44 | c$OMP THREADPRIVATE(first) |
---|
[541] | 45 | integer i,k |
---|
| 46 | |
---|
| 47 | ********************************************************* |
---|
| 48 | |
---|
| 49 | c Modele du thermique |
---|
| 50 | c =================== |
---|
| 51 | c print*,'thermiques: WARNING on passe t au lieu de t_seri' |
---|
| 52 | print*,'avant isplit ',nsplit_thermals |
---|
| 53 | |
---|
[704] | 54 | cym initialisation dynamique |
---|
| 55 | if (first) then |
---|
| 56 | allocate(zfm_therm(klon,klev+1),zentr_therm(klon,klev)) |
---|
| 57 | zfm_therm(:,:)=0. |
---|
| 58 | zentr_therm(:,:)=0. |
---|
| 59 | first=.false. |
---|
| 60 | endif |
---|
| 61 | |
---|
[541] | 62 | fm_therm(:,:)=0. |
---|
| 63 | entr_therm(:,:)=0. |
---|
| 64 | |
---|
| 65 | c tests sur les valeurs negatives de l'eau |
---|
| 66 | do k=1,klev |
---|
| 67 | do i=1,klon |
---|
| 68 | if (.not.q_seri(i,k).ge.0.) then |
---|
| 69 | print*,'WARN eau<0 avant therm i=',i,' k=',k |
---|
| 70 | s ,' dq,q',d_q_the(i,k),q_seri(i,k) |
---|
| 71 | q_seri(i,k)=1.e-15 |
---|
| 72 | endif |
---|
| 73 | enddo |
---|
| 74 | enddo |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | zdt=dtime/float(nsplit_thermals) |
---|
| 78 | do isplit=1,nsplit_thermals |
---|
| 79 | |
---|
[566] | 80 | cym CALL thermcell(klon,klev,zdt |
---|
| 81 | cym s ,pplay,paprs,pphi |
---|
| 82 | cym s ,u_seri,v_seri,t_seri,q_seri |
---|
| 83 | cym s ,d_u_the,d_v_the,d_t_the,d_q_the |
---|
| 84 | cym s ,zfm_therm,zentr_therm |
---|
| 85 | cym s ,r_aspect_thermals,l_mix_thermals,w2di_thermals |
---|
| 86 | cym s ,tho_thermals,3) |
---|
| 87 | |
---|
[541] | 88 | CALL thermcell(klon,klev,zdt |
---|
| 89 | s ,pplay,paprs,pphi |
---|
| 90 | s ,u_seri,v_seri,t_seri,q_seri |
---|
| 91 | s ,d_u_the,d_v_the,d_t_the,d_q_the |
---|
| 92 | s ,zfm_therm,zentr_therm |
---|
| 93 | s ,r_aspect_thermals,l_mix_thermals,w2di_thermals |
---|
[566] | 94 | s ,tho_thermals) |
---|
[541] | 95 | |
---|
| 96 | c transformation de la derivee en tendance |
---|
| 97 | d_t_the(:,:)=d_t_the(:,:)*dtime/float(nsplit_thermals) |
---|
| 98 | d_u_the(:,:)=d_u_the(:,:)*dtime/float(nsplit_thermals) |
---|
| 99 | d_v_the(:,:)=d_v_the(:,:)*dtime/float(nsplit_thermals) |
---|
| 100 | d_q_the(:,:)=d_q_the(:,:)*dtime/float(nsplit_thermals) |
---|
| 101 | fm_therm(:,:)=fm_therm(:,:) |
---|
| 102 | s +zfm_therm(:,:)/float(nsplit_thermals) |
---|
| 103 | entr_therm(:,:)=entr_therm(:,:) |
---|
| 104 | s +zentr_therm(:,:)/float(nsplit_thermals) |
---|
| 105 | fm_therm(:,klev+1)=0. |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | c accumulation de la tendance |
---|
| 110 | d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) |
---|
| 111 | d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:) |
---|
| 112 | d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) |
---|
| 113 | d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_the(:,:) |
---|
| 114 | |
---|
| 115 | c incrementation des variables meteo |
---|
| 116 | t_seri(:,:) = t_seri(:,:) + d_t_the(:,:) |
---|
| 117 | u_seri(:,:) = u_seri(:,:) + d_u_the(:,:) |
---|
| 118 | v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) |
---|
| 119 | q_seri(:,:) = q_seri(:,:) + d_q_the(:,:) |
---|
| 120 | |
---|
| 121 | c tests sur les valeurs negatives de l'eau |
---|
| 122 | DO k = 1, klev |
---|
| 123 | DO i = 1, klon |
---|
| 124 | if (.not.q_seri(i,k).ge.0.) then |
---|
| 125 | print*,'WARN eau<0 apres therm i=',i,' k=',k |
---|
| 126 | s ,' dq,q',d_q_the(i,k),q_seri(i,k) |
---|
| 127 | q_seri(i,k)=1.e-15 |
---|
| 128 | endif |
---|
| 129 | ENDDO |
---|
| 130 | ENDDO |
---|
| 131 | |
---|
| 132 | enddo ! isplit |
---|
| 133 | |
---|
| 134 | return |
---|
| 135 | |
---|
| 136 | end |
---|