[161] | 1 | ! |
---|
| 2 | ! $Id: calltherm.F90 1428 2010-09-13 08:43:37Z fairhead $ |
---|
| 3 | ! |
---|
| 4 | subroutine calltherm_mars(ngrid,nlayer,dtime,nq,zzlev,zzlay & |
---|
| 5 | & ,pplay,paprs,pphi & |
---|
| 6 | & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & |
---|
| 7 | & ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,dq2_therm & |
---|
| 8 | & ,fm_therm,entr_therm,detr_therm,lmax,& |
---|
| 9 | & zw2,fraca,zpopsk,ztla,heatFlux,heatFlux_down,& |
---|
| 10 | & buoyancyOut,buoyancyEst) |
---|
| 11 | |
---|
| 12 | USE thermcell, only : nsplit_thermals,r_aspect_thermals |
---|
| 13 | USE ioipsl_getincom |
---|
| 14 | implicit none |
---|
| 15 | |
---|
| 16 | INTEGER, INTENT(IN) :: ngrid,nlayer |
---|
| 17 | REAL dtime |
---|
| 18 | LOGICAL logexpr0, logexpr2(ngrid,nlayer), logexpr1(ngrid) |
---|
| 19 | REAL fact |
---|
| 20 | INTEGER nbptspb,nq |
---|
| 21 | |
---|
| 22 | REAL, INTENT(IN) :: zzlay(ngrid,nlayer) |
---|
| 23 | REAL, INTENT(IN) :: zzlev(ngrid,nlayer+1) |
---|
| 24 | |
---|
| 25 | REAL u_seri(ngrid,nlayer),v_seri(ngrid,nlayer) |
---|
| 26 | REAL t_seri(ngrid,nlayer),pq_therm(ngrid,nlayer,nq) |
---|
| 27 | REAL q2_therm(ngrid,nlayer) |
---|
| 28 | REAL paprs(ngrid,nlayer+1) |
---|
| 29 | REAL pplay(ngrid,nlayer) |
---|
| 30 | REAL pphi(ngrid,nlayer) |
---|
| 31 | real zlev(ngrid,nlayer+1) |
---|
| 32 | !test: on sort lentr et a* pour alimenter KE |
---|
| 33 | REAL zw2(ngrid,nlayer+1),fraca(ngrid,nlayer+1) |
---|
| 34 | REAL zzw2(ngrid,nlayer+1) |
---|
| 35 | |
---|
| 36 | !FH Update Thermiques |
---|
| 37 | REAL d_t_ajs(ngrid,nlayer), d_q_ajs(ngrid,nlayer,nq) |
---|
| 38 | REAL d_u_ajs(ngrid,nlayer),d_v_ajs(ngrid,nlayer) |
---|
| 39 | REAL dq2_therm(ngrid,nlayer), dq2_the(ngrid,nlayer) |
---|
| 40 | real fm_therm(ngrid,nlayer+1) |
---|
| 41 | real entr_therm(ngrid,nlayer),detr_therm(ngrid,nlayer) |
---|
| 42 | |
---|
| 43 | !******************************************************** |
---|
| 44 | ! declarations |
---|
| 45 | LOGICAL flag_bidouille_stratocu |
---|
| 46 | real fmc_therm(ngrid,nlayer+1) |
---|
| 47 | real zqla(ngrid,nlayer) |
---|
| 48 | real zqta(ngrid,nlayer) |
---|
| 49 | real zpopsk(ngrid,nlayer) |
---|
| 50 | real ztla(ngrid,nlayer) |
---|
| 51 | real wmax_sec(ngrid) |
---|
| 52 | real zmax_sec(ngrid) |
---|
| 53 | real f_sec(ngrid) |
---|
| 54 | real detrc_therm(ngrid,nlayer) |
---|
| 55 | real zw_sec(ngrid,nlayer+1) |
---|
| 56 | integer lmix_sec(ngrid) |
---|
| 57 | integer lmax(ngrid) |
---|
| 58 | |
---|
| 59 | !nouvelles variables pour la convection |
---|
| 60 | !RC |
---|
| 61 | !on garde le zmax du pas de temps precedent |
---|
| 62 | !******************************************************** |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | ! variables locales |
---|
| 66 | REAL d_t_the(ngrid,nlayer), d_q_the(ngrid,nlayer,nq) |
---|
| 67 | REAL d_u_the(ngrid,nlayer),d_v_the(ngrid,nlayer) |
---|
| 68 | ! |
---|
| 69 | integer isplit |
---|
| 70 | real zfm_therm(ngrid,nlayer+1),zdt |
---|
| 71 | real zentr_therm(ngrid,nlayer),zdetr_therm(ngrid,nlayer) |
---|
| 72 | real heatFlux(ngrid,nlayer) |
---|
| 73 | real heatFlux_down(ngrid,nlayer) |
---|
| 74 | real buoyancyOut(ngrid,nlayer) |
---|
| 75 | real buoyancyEst(ngrid,nlayer) |
---|
| 76 | real zheatFlux(ngrid,nlayer) |
---|
| 77 | real zheatFlux_down(ngrid,nlayer) |
---|
| 78 | real zbuoyancyOut(ngrid,nlayer) |
---|
| 79 | real zbuoyancyEst(ngrid,nlayer) |
---|
| 80 | |
---|
| 81 | character (len=20) :: modname='calltherm' |
---|
| 82 | character (len=80) :: abort_message |
---|
| 83 | |
---|
| 84 | integer i,k |
---|
| 85 | logical, save :: first=.true. |
---|
| 86 | |
---|
| 87 | ! Modele du thermique |
---|
| 88 | ! =================== |
---|
| 89 | |
---|
| 90 | nsplit_thermals=20 |
---|
| 91 | call getin("nsplit_thermals",nsplit_thermals) |
---|
| 92 | |
---|
| 93 | fm_therm(:,:)=0. |
---|
| 94 | detr_therm(:,:)=0. |
---|
| 95 | entr_therm(:,:)=0. |
---|
| 96 | |
---|
| 97 | heatFlux(:,:)=0. |
---|
| 98 | heatFlux_down(:,:)=0. |
---|
| 99 | buoyancyOut(:,:)=0. |
---|
| 100 | buoyancyEst(:,:)=0. |
---|
| 101 | |
---|
| 102 | zw2(:,:)=0. |
---|
| 103 | |
---|
| 104 | zdt=dtime/REAL(nsplit_thermals) |
---|
| 105 | |
---|
| 106 | do isplit=1,nsplit_thermals |
---|
| 107 | |
---|
| 108 | ! On reinitialise les flux de masse a zero pour le cumul en |
---|
| 109 | ! cas de splitting |
---|
| 110 | |
---|
| 111 | zfm_therm(:,:)=0. |
---|
| 112 | zentr_therm(:,:)=0. |
---|
| 113 | zdetr_therm(:,:)=0. |
---|
| 114 | |
---|
| 115 | zheatFlux(:,:)=0. |
---|
| 116 | zheatFlux_down(:,:)=0. |
---|
| 117 | zbuoyancyOut(:,:)=0. |
---|
| 118 | zbuoyancyEst(:,:)=0. |
---|
| 119 | |
---|
| 120 | zzw2(:,:)=0. |
---|
| 121 | |
---|
| 122 | d_t_the(:,:)=0. |
---|
| 123 | d_u_the(:,:)=0. |
---|
| 124 | d_v_the(:,:)=0. |
---|
| 125 | dq2_the(:,:)=0. |
---|
| 126 | if (nq .ne. 0) then |
---|
| 127 | d_q_the(:,:,:)=0. |
---|
| 128 | endif |
---|
| 129 | |
---|
| 130 | CALL thermcell_main_mars(ngrid,nlayer,nq,zdt & |
---|
| 131 | & ,pplay,paprs,pphi,zzlev,zzlay & |
---|
| 132 | & ,u_seri,v_seri,t_seri,pq_therm,q2_therm & |
---|
| 133 | & ,d_u_the,d_v_the,d_t_the,d_q_the,dq2_the & |
---|
| 134 | & ,zfm_therm,zentr_therm,zdetr_therm,lmax & |
---|
| 135 | & ,r_aspect_thermals & |
---|
| 136 | & ,zzw2,fraca,zpopsk & |
---|
| 137 | & ,ztla,zheatFlux,zheatFlux_down & |
---|
| 138 | & ,zbuoyancyOut,zbuoyancyEst) |
---|
| 139 | |
---|
| 140 | fact=1./REAL(nsplit_thermals) |
---|
| 141 | ! transformation de la derivee en tendance |
---|
| 142 | |
---|
| 143 | d_t_the(:,:)=d_t_the(:,:)*dtime*fact |
---|
| 144 | d_u_the(:,:)=d_u_the(:,:)*fact |
---|
| 145 | d_v_the(:,:)=d_v_the(:,:)*fact |
---|
| 146 | dq2_the(:,:)=dq2_the(:,:)*fact |
---|
| 147 | |
---|
| 148 | if (nq .ne. 0) then |
---|
| 149 | d_q_the(:,:,:)=d_q_the(:,:,:)*fact |
---|
| 150 | endif |
---|
| 151 | |
---|
| 152 | fm_therm(:,:)=fm_therm(:,:) & |
---|
| 153 | & +zfm_therm(:,:)*fact |
---|
| 154 | entr_therm(:,:)=entr_therm(:,:) & |
---|
| 155 | & +zentr_therm(:,:)*fact |
---|
| 156 | detr_therm(:,:)=detr_therm(:,:) & |
---|
| 157 | & +zdetr_therm(:,:)*fact |
---|
| 158 | |
---|
| 159 | heatFlux(:,:)=heatFlux(:,:) & |
---|
| 160 | & +zheatFlux(:,:)*fact |
---|
| 161 | heatFlux_down(:,:)=heatFlux_down(:,:) & |
---|
| 162 | +zheatFlux_down(:,:)*fact |
---|
| 163 | buoyancyOut(:,:)=buoyancyOut(:,:) & |
---|
| 164 | & +zbuoyancyOut(:,:)*fact |
---|
| 165 | buoyancyEst(:,:)=buoyancyEst(:,:) & |
---|
| 166 | & +zbuoyancyEst(:,:)*fact |
---|
| 167 | |
---|
| 168 | zw2(:,:)=zw2(:,:) + zzw2(:,:)*fact |
---|
| 169 | |
---|
| 170 | ! accumulation de la tendance |
---|
| 171 | |
---|
| 172 | d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) |
---|
| 173 | d_u_ajs(:,:)=d_u_ajs(:,:)+d_u_the(:,:) |
---|
| 174 | d_v_ajs(:,:)=d_v_ajs(:,:)+d_v_the(:,:) |
---|
| 175 | d_q_ajs(:,:,:)=d_q_ajs(:,:,:)+d_q_the(:,:,:) |
---|
| 176 | dq2_therm(:,:)=dq2_therm(:,:)+dq2_the(:,:) |
---|
| 177 | ! incrementation des variables meteo |
---|
| 178 | |
---|
| 179 | t_seri(:,:) = t_seri(:,:) + d_t_the(:,:) |
---|
| 180 | u_seri(:,:) = u_seri(:,:) + d_u_the(:,:) |
---|
| 181 | v_seri(:,:) = v_seri(:,:) + d_v_the(:,:) |
---|
| 182 | pq_therm(:,:,:) = pq_therm(:,:,:) + d_q_the(:,:,:) |
---|
| 183 | q2_therm(:,:) = q2_therm(:,:) + dq2_therm(:,:) |
---|
| 184 | |
---|
| 185 | enddo ! isplit |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | !**************************************************************** |
---|
| 189 | |
---|
| 190 | ! do i=1,ngrid |
---|
| 191 | ! do k=1,nlayer |
---|
| 192 | ! if (ztla(i,k) .lt. 1.e-10) fraca(i,k) =0. |
---|
| 193 | ! print*,'youpi je sers a quelque chose !' |
---|
| 194 | ! enddo |
---|
| 195 | ! enddo |
---|
| 196 | |
---|
| 197 | return |
---|
| 198 | |
---|
| 199 | end |
---|