[161] | 1 | ! |
---|
| 2 | ! AC 2011-01-05 |
---|
| 3 | ! |
---|
| 4 | SUBROUTINE calltherm_interface (ngrid,nlayer,firstcall, & |
---|
| 5 | & long,lati,zzlev,zzlay, & |
---|
| 6 | & ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, & |
---|
| 7 | & pplay,pplev,pphi,nq,zpopsk, & |
---|
| 8 | & pdu_th,pdv_th,pdt_th,pdq_th,lmax_th,pbl_dtke) |
---|
| 9 | |
---|
| 10 | USE ioipsl_getincom |
---|
| 11 | |
---|
| 12 | implicit none |
---|
| 13 | #include "callkeys.h" |
---|
| 14 | !-------------------------------------------------------- |
---|
| 15 | ! Variables d'entree |
---|
| 16 | !-------------------------------------------------------- |
---|
| 17 | |
---|
| 18 | INTEGER, INTENT(IN) :: ngrid,nlayer,nq |
---|
| 19 | REAL, INTENT(IN) :: ptimestep |
---|
| 20 | REAL, INTENT(IN) :: pplev(ngrid,nlayer+1),pplay(ngrid,nlayer) |
---|
| 21 | REAL, INTENT(IN) :: pphi(ngrid,nlayer) |
---|
| 22 | REAL, INTENT(IN) :: pu(ngrid,nlayer),pv(ngrid,nlayer) |
---|
| 23 | REAL, INTENT(IN) :: pt(ngrid,nlayer),pq(ngrid,nlayer,nq) |
---|
| 24 | REAL, INTENT(IN) :: zzlay(ngrid,nlayer) |
---|
| 25 | REAL, INTENT(IN) :: zzlev(ngrid,nlayer+1) |
---|
| 26 | LOGICAL, INTENT(IN) :: firstcall |
---|
| 27 | REAL, INTENT(IN) :: pdu(ngrid,nlayer),pdv(ngrid,nlayer) |
---|
| 28 | REAL, INTENT(IN) :: pdq(ngrid,nlayer,nq),pdt(ngrid,nlayer) |
---|
| 29 | REAL, INTENT(IN) :: q2(ngrid,nlayer+1) |
---|
| 30 | REAL, INTENT(IN) :: long(ngrid),lati(ngrid) |
---|
| 31 | REAL, INTENT(IN) :: zpopsk(ngrid,nlayer) |
---|
| 32 | |
---|
| 33 | !-------------------------------------------------------- |
---|
| 34 | ! Variables de sortie (ou entree/sortie) |
---|
| 35 | !-------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | REAL pdu_th(ngrid,nlayer),pdv_th(ngrid,nlayer) |
---|
| 38 | REAL pdt_th(ngrid,nlayer),pdq_th(ngrid,nlayer,nq) |
---|
| 39 | INTEGER lmax_th(ngrid) |
---|
| 40 | REAL pbl_dtke(ngrid,nlayer+1) |
---|
| 41 | |
---|
| 42 | !-------------------------------------------------------- |
---|
| 43 | ! Variables du thermique |
---|
| 44 | !-------------------------------------------------------- |
---|
| 45 | REAL u_seri(ngrid,nlayer), v_seri(ngrid,nlayer) |
---|
| 46 | REAL t_seri(ngrid,nlayer) |
---|
| 47 | REAL d_t_ajs(ngrid,nlayer) |
---|
| 48 | REAL d_u_ajs(ngrid,nlayer), d_q_ajs(ngrid,nlayer,nq) |
---|
| 49 | REAL d_v_ajs(ngrid,nlayer) |
---|
| 50 | REAL fm_therm(ngrid,nlayer+1), entr_therm(ngrid,nlayer) |
---|
| 51 | REAL detr_therm(ngrid,nlayer) |
---|
| 52 | REAL zw2(ngrid,nlayer+1) |
---|
| 53 | REAL fraca(ngrid,nlayer+1) |
---|
| 54 | REAL ztla(ngrid,nlayer) |
---|
| 55 | REAL q_therm(ngrid,nlayer), pq_therm(ngrid,nlayer,nq) |
---|
| 56 | REAL dq_therm(ngrid,nlayer), dq_thermdown(ngrid,nlayer) |
---|
| 57 | REAL q2_therm(ngrid,nlayer), dq2_therm(ngrid,nlayer) |
---|
| 58 | |
---|
| 59 | LOGICAL qtransport_thermals,dtke_thermals |
---|
| 60 | |
---|
| 61 | INTEGER l,ig,iq |
---|
| 62 | |
---|
| 63 | ! Variable de diagnostique : flux de chaleur vertical |
---|
| 64 | |
---|
| 65 | REAL heatFlux(ngrid,nlayer) |
---|
| 66 | REAL heatFlux_down(ngrid,nlayer) |
---|
| 67 | REAL buoyancyOut(ngrid,nlayer) |
---|
| 68 | REAL buoyancyEst(ngrid,nlayer) |
---|
| 69 | |
---|
| 70 | !--------------------------------------------------------- |
---|
| 71 | !--------------------------------------------------------- |
---|
| 72 | ! ********************************************************************** |
---|
| 73 | ! Thermique |
---|
| 74 | ! ********************************************************************** |
---|
| 75 | |
---|
| 76 | ! Initialisation des sorties |
---|
| 77 | |
---|
| 78 | lmax_th(:)=1 |
---|
| 79 | pdu_th(:,:)=0. |
---|
| 80 | pdv_th(:,:)=0. |
---|
| 81 | pdt_th(:,:)=0. |
---|
| 82 | entr_therm(:,:)=0. |
---|
| 83 | detr_therm(:,:)=0. |
---|
| 84 | q2_therm(:,:)=0. |
---|
| 85 | dq2_therm(:,:)=0. |
---|
| 86 | dq_therm(:,:)=0. |
---|
| 87 | dq_thermdown(:,:)=0. |
---|
| 88 | ztla(:,:)=0. |
---|
| 89 | pbl_dtke(:,:)=0. |
---|
| 90 | fm_therm(:,:)=0. |
---|
| 91 | zw2(:,:)=0. |
---|
| 92 | fraca(:,:)=0. |
---|
| 93 | if (tracer) then |
---|
| 94 | pdq_th(:,:,:)=0. |
---|
| 95 | end if |
---|
| 96 | |
---|
| 97 | ! Dans le model terrestres, les seri sont des q+dq tendances déja cumulées. Il n'y a donc pas de |
---|
| 98 | ! cumulage à l'intérieur de la routine comme dans le model martien. On le fait ici : |
---|
| 99 | |
---|
| 100 | u_seri(:,:)=pu(:,:)+pdu(:,:)*ptimestep |
---|
| 101 | v_seri(:,:)=pv(:,:)+pdv(:,:)*ptimestep |
---|
| 102 | t_seri(:,:)=pt(:,:)+pdt(:,:)*ptimestep |
---|
| 103 | |
---|
| 104 | pq_therm(:,:,:)=0. |
---|
[165] | 105 | qtransport_thermals=.true. |
---|
[161] | 106 | call getin("qtransport_thermals",qtransport_thermals) |
---|
| 107 | if(qtransport_thermals) then |
---|
| 108 | if(tracer) then |
---|
| 109 | pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep |
---|
| 110 | endif |
---|
| 111 | endif |
---|
| 112 | |
---|
| 113 | d_t_ajs(:,:)=0. |
---|
| 114 | d_u_ajs(:,:)=0. |
---|
| 115 | d_v_ajs(:,:)=0. |
---|
| 116 | d_q_ajs(:,:,:)=0. |
---|
| 117 | heatFlux(:,:)=0. |
---|
| 118 | heatFlux_down(:,:)=0. |
---|
| 119 | buoyancyOut(:,:)=0. |
---|
| 120 | buoyancyEst(:,:)=0. |
---|
| 121 | |
---|
[165] | 122 | dtke_thermals=.false. |
---|
[161] | 123 | call getin("dtke_thermals",dtke_thermals) |
---|
| 124 | if(dtke_thermals) then |
---|
| 125 | |
---|
| 126 | DO l=1,nlayer |
---|
| 127 | q2_therm(:,l)=0.5*(q2(:,l)+q2(:,l+1)) |
---|
| 128 | ENDDO |
---|
| 129 | endif |
---|
| 130 | |
---|
| 131 | CALL calltherm_mars(ngrid,nlayer,ptimestep,nq,zzlev,zzlay & |
---|
| 132 | & ,pplay,pplev,pphi & |
---|
| 133 | & ,u_seri,v_seri,t_seri,pq_therm, q2_therm & |
---|
| 134 | & ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs, dq2_therm & |
---|
| 135 | & ,fm_therm,entr_therm,detr_therm & |
---|
| 136 | & ,lmax_th & |
---|
| 137 | & ,zw2,fraca & |
---|
| 138 | & ,zpopsk,ztla,heatFlux,heatFlux_down & |
---|
| 139 | & ,buoyancyOut,buoyancyEst) |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | ! Accumulation des tendances. On n'accumule pas les quantités de traceurs car celle ci n'a pas du changer |
---|
| 143 | ! étant donné qu'on ne prends en compte que q_seri de la vap d'eau = 0 |
---|
| 144 | |
---|
| 145 | ! INCREMENTATION : les d_u_ sont des tendances alors que les pdu sont des dérivees, attention ! |
---|
| 146 | |
---|
| 147 | pdu_th(:,:)=d_u_ajs(:,:)/ptimestep |
---|
| 148 | pdv_th(:,:)=d_v_ajs(:,:)/ptimestep |
---|
| 149 | pdt_th(:,:)=d_t_ajs(:,:)/ptimestep |
---|
| 150 | if(qtransport_thermals) then |
---|
| 151 | if(tracer) then |
---|
| 152 | pdq_th(:,:,:)=d_q_ajs(:,:,:)/ptimestep |
---|
| 153 | endif |
---|
| 154 | endif |
---|
| 155 | |
---|
| 156 | |
---|
| 157 | DO l=2,nlayer |
---|
| 158 | pbl_dtke(:,l)=0.5*(dq2_therm(:,l-1)+dq2_therm(:,l))/ptimestep |
---|
| 159 | ENDDO |
---|
| 160 | |
---|
| 161 | pbl_dtke(:,1)=0.5*dq2_therm(:,1)/ptimestep |
---|
| 162 | pbl_dtke(:,nlayer+1)=0. |
---|
| 163 | !! DIAGNOSTICS |
---|
| 164 | |
---|
| 165 | if(outptherm) then |
---|
| 166 | if (ngrid .eq. 1) then |
---|
| 167 | call WRITEDIAGFI(ngrid,'entr_therm','entrainement thermique',& |
---|
| 168 | & 'kg/m-2',1,entr_therm) |
---|
| 169 | call WRITEDIAGFI(ngrid,'detr_therm','detrainement thermique',& |
---|
| 170 | & 'kg/m-2',1,detr_therm) |
---|
| 171 | call WRITEDIAGFI(ngrid,'fm_therm','flux masse thermique',& |
---|
| 172 | & 'kg/m-2',1,fm_therm) |
---|
| 173 | call WRITEDIAGFI(ngrid,'zw2','vitesse verticale thermique',& |
---|
| 174 | & 'm/s',1,zw2) |
---|
| 175 | call WRITEDIAGFI(ngrid,'heatFlux_up','heatFlux_updraft',& |
---|
| 176 | & 'SI',1,heatFlux) |
---|
| 177 | call WRITEDIAGFI(ngrid,'heatFlux_down','heatFlux_downdraft',& |
---|
| 178 | & 'SI',1,heatFlux_down) |
---|
| 179 | call WRITEDIAGFI(ngrid,'fraca','fraction coverage',& |
---|
| 180 | & 'percent',1,fraca) |
---|
| 181 | call WRITEDIAGFI(ngrid,'buoyancyOut','buoyancyOut',& |
---|
| 182 | & 'm.s-2',1,buoyancyOut) |
---|
| 183 | call WRITEDIAGFI(ngrid,'buoyancyEst','buoyancyEst',& |
---|
| 184 | & 'm.s-2',1,buoyancyEst) |
---|
| 185 | call WRITEDIAGFI(ngrid,'d_t_th', & |
---|
| 186 | & 'tendance temp TH','K',1,d_t_ajs) |
---|
| 187 | call WRITEDIAGFI(ngrid,'d_q_ajs', & |
---|
| 188 | & 'tendance q updraft','kg/kg',1,d_q_ajs(:,:,nq)) |
---|
| 189 | call WRITEDIAGFI(ngrid,'d_q_tke', & |
---|
| 190 | & 'tendance q updraft','q2/q2',1,pbl_dtke*ptimestep) |
---|
| 191 | else |
---|
| 192 | |
---|
| 193 | call WRITEDIAGFI(ngrid,'entr_therm','entrainement thermique',& |
---|
| 194 | & 'kg/m-2',3,entr_therm) |
---|
| 195 | call WRITEDIAGFI(ngrid,'detr_therm','detrainement thermique',& |
---|
| 196 | & 'kg/m-2',3,detr_therm) |
---|
| 197 | call WRITEDIAGFI(ngrid,'fm_therm','flux masse thermique',& |
---|
| 198 | & 'kg/m-2',3,fm_therm) |
---|
| 199 | call WRITEDIAGFI(ngrid,'zw2','vitesse verticale thermique',& |
---|
| 200 | & 'm/s',3,zw2) |
---|
| 201 | call WRITEDIAGFI(ngrid,'heatFlux','heatFlux',& |
---|
| 202 | & 'SI',3,heatFlux) |
---|
| 203 | call WRITEDIAGFI(ngrid,'buoyancyOut','buoyancyOut',& |
---|
| 204 | & 'SI',3,buoyancyOut) |
---|
| 205 | call WRITEDIAGFI(ngrid,'d_t_th', & |
---|
| 206 | & 'tendance temp TH','K',3,d_t_ajs) |
---|
| 207 | |
---|
| 208 | endif |
---|
| 209 | endif |
---|
| 210 | |
---|
| 211 | END |
---|