[1033] | 1 | !======================================================================= |
---|
[1032] | 2 | ! CALLTHERM_INTERFACE |
---|
[1033] | 3 | !======================================================================= |
---|
[1032] | 4 | ! Main interface to the Martian thermal plume model |
---|
| 5 | ! This interface handles sub-timesteps for this model |
---|
| 6 | ! A call to this interface must be inserted in the main 'physics' routine |
---|
| 7 | ! NB: for information: |
---|
| 8 | ! In the Mars LMD-GCM, the thermal plume model is called after |
---|
| 9 | ! the vertical turbulent mixing scheme (Mellor and Yamada) |
---|
| 10 | ! and the surface layer scheme (Richardson-based surface layer + subgrid gustiness) |
---|
| 11 | ! Other routines called before the thermals model are |
---|
| 12 | ! radiative transfer and (orographic) gravity wave drag. |
---|
| 13 | ! ----------------------------------------------------------------------- |
---|
[1033] | 14 | ! Author : A. Colaitis 2011-01-05 (with updates 2011-2013) |
---|
| 15 | ! after C. Rio and F. Hourdin |
---|
| 16 | ! Institution : Laboratoire de Meteorologie Dynamique (LMD) Paris, France |
---|
| 17 | ! ----------------------------------------------------------------------- |
---|
| 18 | ! Corresponding author : A. Spiga aymeric.spiga_AT_upmc.fr |
---|
| 19 | ! ----------------------------------------------------------------------- |
---|
[1032] | 20 | ! ASSOCIATED FILES |
---|
[1033] | 21 | ! --> thermcell_main_mars.F90 |
---|
[1032] | 22 | ! --> thermcell_dqup.F90 |
---|
| 23 | ! --> comtherm_h.F90 |
---|
| 24 | ! ----------------------------------------------------------------------- |
---|
| 25 | ! Reference paper: |
---|
| 26 | ! A. Colaïtis, A. Spiga, F. Hourdin, C. Rio, F. Forget, and E. Millour. |
---|
| 27 | ! A thermal plume model for the Martian convective boundary layer. |
---|
| 28 | ! Journal of Geophysical Research (Planets), 118:1468-1487, July 2013. |
---|
[1033] | 29 | ! http://dx.doi.org/10.1002/jgre.20104 |
---|
| 30 | ! http://arxiv.org/abs/1306.6215 |
---|
[1032] | 31 | ! ----------------------------------------------------------------------- |
---|
| 32 | ! Reference paper for terrestrial plume model: |
---|
| 33 | ! C. Rio and F. Hourdin. |
---|
| 34 | ! A thermal plume model for the convective boundary layer : Representation of cumulus clouds. |
---|
| 35 | ! Journal of the Atmospheric Sciences, 65:407-425, 2008. |
---|
| 36 | ! ----------------------------------------------------------------------- |
---|
| 37 | |
---|
| 38 | SUBROUTINE calltherm_interface (ngrid,nlayer,nq, & |
---|
| 39 | & tracer,igcm_co2, & |
---|
[652] | 40 | & zzlev,zzlay, & |
---|
[161] | 41 | & ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, & |
---|
[185] | 42 | & pplay,pplev,pphi,zpopsk, & |
---|
[660] | 43 | & pdu_th,pdv_th,pdt_th,pdq_th,lmax,zmaxth,pbl_dtke, & |
---|
| 44 | & pdhdif,hfmax,wstar,sensibFlux) |
---|
[161] | 45 | |
---|
[1032] | 46 | use comtherm_h |
---|
[1036] | 47 | use tracer_mod, only: nqmx,noms |
---|
[1226] | 48 | |
---|
| 49 | ! SHARED VARIABLES. This needs adaptations in another climate model. |
---|
| 50 | ! contains physical constant values such as |
---|
| 51 | ! "g" : gravitational acceleration (m.s-2) |
---|
| 52 | ! "r" : recuced gas constant (J.K-1.mol-1) |
---|
| 53 | ! "cpp" : specific heat of the atmosphere (J.kg-1.K-1) |
---|
| 54 | USE comcstfi_h |
---|
| 55 | |
---|
[1032] | 56 | implicit none |
---|
[161] | 57 | |
---|
| 58 | !-------------------------------------------------------- |
---|
[342] | 59 | ! Input Variables |
---|
[161] | 60 | !-------------------------------------------------------- |
---|
| 61 | |
---|
[1032] | 62 | INTEGER, INTENT(IN) :: ngrid ! number of horizontal grid points |
---|
| 63 | INTEGER, INTENT(IN) :: nlayer ! number of vertical grid points |
---|
| 64 | INTEGER, INTENT(IN) :: nq ! number of tracer species |
---|
[1028] | 65 | REAL, INTENT(IN) :: ptimestep !timestep (s) |
---|
[1032] | 66 | REAL, INTENT(IN) :: pplev(ngrid,nlayer+1) !intermediate pressure levels (Pa) |
---|
| 67 | REAL, INTENT(IN) :: pplay(ngrid,nlayer) !Pressure at the middle of the layers (Pa) |
---|
| 68 | REAL, INTENT(IN) :: pphi(ngrid,nlayer) !Geopotential at the middle of the layers (m2s-2) |
---|
| 69 | REAL, INTENT(IN) :: pu(ngrid,nlayer),pv(ngrid,nlayer) !u,v components of the wind (ms-1) |
---|
| 70 | REAL, INTENT(IN) :: pt(ngrid,nlayer),pq(ngrid,nlayer,nq)!temperature (K) and tracer concentration (kg/kg) |
---|
| 71 | REAL, INTENT(IN) :: zzlay(ngrid,nlayer) ! altitude at the middle of the layers |
---|
| 72 | REAL, INTENT(IN) :: zzlev(ngrid,nlayer+1) ! altitude at layer boundaries |
---|
| 73 | LOGICAL, INTENT(IN) :: tracer ! =.true. if tracers are present and to be transported |
---|
| 74 | INTEGER, INTENT(IN) :: igcm_co2 ! index of the CO2 tracer in mixing ratio array |
---|
| 75 | ! --> 0 if no tracer is CO2 (or no tracer at all) |
---|
| 76 | ! --> this prepares special treatment for polar night mixing |
---|
| 77 | ! (see thermcell_main_mars) |
---|
| 78 | REAL, INTENT(IN) :: pdu(ngrid,nlayer),pdv(ngrid,nlayer) ! wind velocity change from routines called |
---|
[1028] | 79 | ! before thermals du/dt (m/s/s) |
---|
[1032] | 80 | REAL, INTENT(IN) :: pdq(ngrid,nlayer,nq) ! tracer concentration change from routines called |
---|
[1028] | 81 | ! before thermals dq/dt (kg/kg/s) |
---|
[1032] | 82 | REAL, INTENT(IN) :: pdt(ngrid,nlayer) ! temperature change from routines called before thermals dT/dt (K/s) |
---|
| 83 | REAL, INTENT(IN) :: q2(ngrid,nlayer+1) ! turbulent kinetic energy |
---|
| 84 | REAL, INTENT(IN) :: zpopsk(ngrid,nlayer) ! ratio of pressure at middle of layer to surface pressure, |
---|
[1028] | 85 | ! to the power r/cp, i.e. zpopsk=(pplay(ig,l)/pplev(ig,1))**rcp |
---|
[1032] | 86 | REAL, INTENT(IN) :: pdhdif(ngrid,nlayer) ! potential temperature change from turbulent diffusion scheme dT/dt (K/s) |
---|
| 87 | REAL, INTENT(IN) :: sensibFlux(ngrid) ! sensible heat flux computed from surface layer scheme |
---|
[161] | 88 | |
---|
| 89 | !-------------------------------------------------------- |
---|
[342] | 90 | ! Output Variables |
---|
[161] | 91 | !-------------------------------------------------------- |
---|
| 92 | |
---|
[1032] | 93 | REAL, INTENT(OUT) :: pdu_th(ngrid,nlayer) ! wind velocity change from thermals du/dt (m/s/s) |
---|
| 94 | REAL, INTENT(OUT) :: pdv_th(ngrid,nlayer) ! wind velocity change from thermals dv/dt (m/s/s) |
---|
| 95 | REAL, INTENT(OUT) :: pdt_th(ngrid,nlayer) ! temperature change from thermals dT/dt (K/s) |
---|
| 96 | REAL, INTENT(OUT) :: pdq_th(ngrid,nlayer,nq) ! tracer change from thermals dq/dt (kg/kg/s) |
---|
| 97 | INTEGER, INTENT(OUT) :: lmax(ngrid) ! layer number reacher by thermals in grid point |
---|
| 98 | REAL, INTENT(OUT) :: zmaxth(ngrid) ! equivalent to lmax, but in (m), interpolated |
---|
| 99 | REAL, INTENT(OUT) :: pbl_dtke(ngrid,nlayer+1) ! turbulent kinetic energy change from thermals dtke/dt |
---|
| 100 | REAL, INTENT(OUT) :: wstar(ngrid) ! free convection velocity (m/s) |
---|
[161] | 101 | |
---|
| 102 | !-------------------------------------------------------- |
---|
[342] | 103 | ! Thermals local variables |
---|
[161] | 104 | !-------------------------------------------------------- |
---|
[1032] | 105 | REAL zu(ngrid,nlayer), zv(ngrid,nlayer) |
---|
| 106 | REAL zt(ngrid,nlayer) |
---|
| 107 | REAL d_t_ajs(ngrid,nlayer) |
---|
| 108 | REAL d_u_ajs(ngrid,nlayer), d_q_ajs(ngrid,nlayer,nq) |
---|
| 109 | REAL d_v_ajs(ngrid,nlayer) |
---|
| 110 | REAL fm_therm(ngrid,nlayer+1), entr_therm(ngrid,nlayer) |
---|
| 111 | REAL detr_therm(ngrid,nlayer),detrmod(ngrid,nlayer) |
---|
| 112 | REAL zw2(ngrid,nlayer+1) |
---|
| 113 | REAL fraca(ngrid,nlayer+1),zfraca(ngrid,nlayer+1) |
---|
| 114 | REAL q_therm(ngrid,nlayer), pq_therm(ngrid,nlayer,nq) |
---|
| 115 | REAL q2_therm(ngrid,nlayer), dq2_therm(ngrid,nlayer) |
---|
| 116 | REAL lmax_real(ngrid) |
---|
| 117 | REAL masse(ngrid,nlayer) |
---|
[1028] | 118 | |
---|
[660] | 119 | INTEGER l,ig,iq,ii(1),k |
---|
[628] | 120 | CHARACTER (LEN=20) modname |
---|
[161] | 121 | |
---|
[342] | 122 | !-------------------------------------------------------- |
---|
| 123 | ! Local variables for sub-timestep |
---|
| 124 | !-------------------------------------------------------- |
---|
[161] | 125 | |
---|
[1032] | 126 | REAL d_t_the(ngrid,nlayer), d_q_the(ngrid,nlayer,nq) |
---|
[561] | 127 | INTEGER isplit |
---|
[342] | 128 | REAL fact |
---|
[1032] | 129 | REAL zfm_therm(ngrid,nlayer+1),zdt |
---|
| 130 | REAL zentr_therm(ngrid,nlayer),zdetr_therm(ngrid,nlayer) |
---|
| 131 | REAL zheatFlux(ngrid,nlayer) |
---|
| 132 | REAL zheatFlux_down(ngrid,nlayer) |
---|
| 133 | REAL zbuoyancyOut(ngrid,nlayer) |
---|
| 134 | REAL zbuoyancyEst(ngrid,nlayer) |
---|
| 135 | REAL zzw2(ngrid,nlayer+1) |
---|
| 136 | REAL zmax(ngrid) |
---|
[1212] | 137 | INTEGER ndt,limz |
---|
[342] | 138 | |
---|
| 139 | !-------------------------------------------------------- |
---|
| 140 | ! Diagnostics |
---|
| 141 | !-------------------------------------------------------- |
---|
| 142 | |
---|
[1032] | 143 | REAL heatFlux(ngrid,nlayer) |
---|
| 144 | REAL heatFlux_down(ngrid,nlayer) |
---|
| 145 | REAL buoyancyOut(ngrid,nlayer) |
---|
| 146 | REAL buoyancyEst(ngrid,nlayer) |
---|
| 147 | REAL hfmax(ngrid),wmax(ngrid) |
---|
| 148 | REAL pbl_teta(ngrid),dteta(ngrid,nlayer) |
---|
| 149 | REAL rpdhd(ngrid,nlayer) |
---|
| 150 | REAL wtdif(ngrid,nlayer),rho(ngrid,nlayer) |
---|
| 151 | REAL wtth(ngrid,nlayer) |
---|
[161] | 152 | |
---|
| 153 | ! ********************************************************************** |
---|
[1028] | 154 | ! Initializations |
---|
| 155 | ! ********************************************************************** |
---|
| 156 | |
---|
[621] | 157 | lmax(:)=0 |
---|
[161] | 158 | pdu_th(:,:)=0. |
---|
| 159 | pdv_th(:,:)=0. |
---|
| 160 | pdt_th(:,:)=0. |
---|
| 161 | entr_therm(:,:)=0. |
---|
| 162 | detr_therm(:,:)=0. |
---|
| 163 | q2_therm(:,:)=0. |
---|
| 164 | dq2_therm(:,:)=0. |
---|
| 165 | pbl_dtke(:,:)=0. |
---|
| 166 | fm_therm(:,:)=0. |
---|
| 167 | zw2(:,:)=0. |
---|
| 168 | fraca(:,:)=0. |
---|
[512] | 169 | zfraca(:,:)=0. |
---|
[161] | 170 | if (tracer) then |
---|
| 171 | pdq_th(:,:,:)=0. |
---|
| 172 | end if |
---|
[342] | 173 | d_t_ajs(:,:)=0. |
---|
| 174 | d_u_ajs(:,:)=0. |
---|
| 175 | d_v_ajs(:,:)=0. |
---|
| 176 | d_q_ajs(:,:,:)=0. |
---|
| 177 | heatFlux(:,:)=0. |
---|
| 178 | heatFlux_down(:,:)=0. |
---|
| 179 | buoyancyOut(:,:)=0. |
---|
| 180 | buoyancyEst(:,:)=0. |
---|
| 181 | zmaxth(:)=0. |
---|
| 182 | lmax_real(:)=0. |
---|
[161] | 183 | |
---|
| 184 | |
---|
[342] | 185 | ! ********************************************************************** |
---|
[1028] | 186 | ! Preparing inputs for the thermals: increment tendancies |
---|
| 187 | ! from other subroutines called before the thermals model |
---|
[342] | 188 | ! ********************************************************************** |
---|
[161] | 189 | |
---|
[1028] | 190 | zu(:,:)=pu(:,:)+pdu(:,:)*ptimestep ! u-component of wind velocity |
---|
| 191 | zv(:,:)=pv(:,:)+pdv(:,:)*ptimestep ! v-component of wind velocity |
---|
| 192 | zt(:,:)=pt(:,:)+pdt(:,:)*ptimestep ! temperature |
---|
[161] | 193 | |
---|
[1028] | 194 | pq_therm(:,:,:)=0. ! tracer concentration |
---|
[161] | 195 | |
---|
[342] | 196 | if(qtransport_thermals) then |
---|
[1028] | 197 | if(tracer) then ! tracer is a logical that is true if tracer must be transported in the GCM physics |
---|
| 198 | pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep ! tracer concentration |
---|
[342] | 199 | endif |
---|
| 200 | endif |
---|
[161] | 201 | |
---|
[1028] | 202 | |
---|
[544] | 203 | IF(dtke_thermals) THEN |
---|
[1032] | 204 | DO l=1,nlayer |
---|
[544] | 205 | q2_therm(:,l)=0.5*(q2(:,l)+q2(:,l+1)) |
---|
| 206 | ENDDO |
---|
| 207 | ENDIF |
---|
[342] | 208 | |
---|
| 209 | ! ********************************************************************** |
---|
[1032] | 210 | ! --> CALLTHERM |
---|
[342] | 211 | ! SUB-TIMESTEP LOOP |
---|
| 212 | ! ********************************************************************** |
---|
| 213 | |
---|
[1028] | 214 | zdt=ptimestep/REAL(nsplit_thermals) !subtimestep |
---|
[342] | 215 | |
---|
[1028] | 216 | DO isplit=1,nsplit_thermals !temporal loop on the subtimestep |
---|
[342] | 217 | |
---|
| 218 | ! Initialization of intermediary variables |
---|
| 219 | |
---|
| 220 | zzw2(:,:)=0. |
---|
| 221 | zmax(:)=0. |
---|
[621] | 222 | lmax(:)=0 |
---|
[628] | 223 | |
---|
[1032] | 224 | if (nq .ne. 0 .and. igcm_co2 .ne. 0) then !initialize co2 tracer tendancy |
---|
| 225 | d_q_the(:,:,igcm_co2)=0. |
---|
[161] | 226 | endif |
---|
| 227 | |
---|
[1028] | 228 | ! CALL to main thermal routine |
---|
[1032] | 229 | CALL thermcell_main_mars(ngrid,nlayer,nq & |
---|
| 230 | & ,tracer,igcm_co2 & |
---|
| 231 | & ,zdt & |
---|
[342] | 232 | & ,pplay,pplev,pphi,zzlev,zzlay & |
---|
| 233 | & ,zu,zv,zt,pq_therm,q2_therm & |
---|
[1028] | 234 | & ,d_t_the,d_q_the & |
---|
[1212] | 235 | & ,zfm_therm,zentr_therm,zdetr_therm,lmax,zmax,limz & |
---|
[342] | 236 | & ,zzw2,fraca,zpopsk & |
---|
[1028] | 237 | & ,zheatFlux,zheatFlux_down & |
---|
[342] | 238 | & ,zbuoyancyOut,zbuoyancyEst) |
---|
[161] | 239 | |
---|
[342] | 240 | fact=1./REAL(nsplit_thermals) |
---|
[161] | 241 | |
---|
[1028] | 242 | ! Update thermals tendancies |
---|
| 243 | d_t_the(:,:)=d_t_the(:,:)*ptimestep*fact !temperature |
---|
[1032] | 244 | if (igcm_co2 .ne. 0) then |
---|
| 245 | d_q_the(:,:,igcm_co2)=d_q_the(:,:,igcm_co2)*ptimestep*fact !co2 mass mixing ratio |
---|
[508] | 246 | endif |
---|
[1028] | 247 | zmaxth(:)=zmaxth(:)+zmax(:)*fact !thermals height |
---|
| 248 | lmax_real(:)=lmax_real(:)+float(lmax(:))*fact !thermals height index |
---|
| 249 | fm_therm(:,:)=fm_therm(:,:) & !upward mass flux |
---|
[342] | 250 | & +zfm_therm(:,:)*fact |
---|
[1028] | 251 | entr_therm(:,:)=entr_therm(:,:) & !entrainment mass flux |
---|
[342] | 252 | & +zentr_therm(:,:)*fact |
---|
[1028] | 253 | detr_therm(:,:)=detr_therm(:,:) & !detrainment mass flux |
---|
[342] | 254 | & +zdetr_therm(:,:)*fact |
---|
[1028] | 255 | zfraca(:,:)=zfraca(:,:) + fraca(:,:)*fact !updraft fractional coverage |
---|
| 256 | heatFlux(:,:)=heatFlux(:,:) & !upward heat flux |
---|
[342] | 257 | & +zheatFlux(:,:)*fact |
---|
[1028] | 258 | heatFlux_down(:,:)=heatFlux_down(:,:) & !downward heat flux |
---|
[342] | 259 | & +zheatFlux_down(:,:)*fact |
---|
[1028] | 260 | buoyancyOut(:,:)=buoyancyOut(:,:) & !plume final buoyancy |
---|
[508] | 261 | & +zbuoyancyOut(:,:)*fact |
---|
[1028] | 262 | buoyancyEst(:,:)=buoyancyEst(:,:) & !plume estimated buoyancy used for vertical velocity computation |
---|
[508] | 263 | & +zbuoyancyEst(:,:)*fact |
---|
[1028] | 264 | zw2(:,:)=zw2(:,:) + zzw2(:,:)*fact !vertical velocity |
---|
[342] | 265 | |
---|
[1028] | 266 | ! Save tendancies |
---|
| 267 | d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_the(:,:) !temperature tendancy (delta T) |
---|
[1032] | 268 | if (igcm_co2 .ne. 0) then |
---|
| 269 | d_q_ajs(:,:,igcm_co2)=d_q_ajs(:,:,igcm_co2)+d_q_the(:,:,igcm_co2) !tracer tendancy (delta q) |
---|
[508] | 270 | endif |
---|
[342] | 271 | |
---|
[1028] | 272 | ! Increment temperature and co2 concentration for next pass in subtimestep loop |
---|
| 273 | zt(:,:) = zt(:,:) + d_t_the(:,:) !temperature |
---|
[1032] | 274 | if (igcm_co2 .ne. 0) then |
---|
| 275 | pq_therm(:,:,igcm_co2) = & |
---|
| 276 | & pq_therm(:,:,igcm_co2) + d_q_the(:,:,igcm_co2) !co2 tracer |
---|
[508] | 277 | endif |
---|
[342] | 278 | |
---|
| 279 | |
---|
| 280 | ENDDO ! isplit |
---|
| 281 | !**************************************************************** |
---|
| 282 | |
---|
| 283 | ! Now that we have computed total entrainment and detrainment, we can |
---|
[1028] | 284 | ! advect u, v, and q in thermals. (potential temperature and co2 MMR |
---|
| 285 | ! have already been advected in thermcell_main because they are coupled |
---|
| 286 | ! to the determination of the thermals caracteristics). This is done |
---|
| 287 | ! separatly because u,v, and q are not used in thermcell_main for |
---|
[342] | 288 | ! any thermals-related computation : they are purely passive. |
---|
| 289 | |
---|
| 290 | ! mass of cells |
---|
[1032] | 291 | do l=1,nlayer |
---|
[342] | 292 | masse(:,l)=(pplev(:,l)-pplev(:,l+1))/g |
---|
| 293 | enddo |
---|
| 294 | |
---|
[1028] | 295 | ! recompute detrainment mass flux from entrainment and upward mass flux |
---|
| 296 | ! this ensure mass flux conservation |
---|
[628] | 297 | detrmod(:,:)=0. |
---|
[1212] | 298 | do l=1,limz |
---|
[1032] | 299 | do ig=1,ngrid |
---|
[628] | 300 | detrmod(ig,l)=fm_therm(ig,l)-fm_therm(ig,l+1) & |
---|
| 301 | & +entr_therm(ig,l) |
---|
| 302 | if (detrmod(ig,l).lt.0.) then |
---|
| 303 | entr_therm(ig,l)=entr_therm(ig,l)-detrmod(ig,l) |
---|
| 304 | detrmod(ig,l)=0. |
---|
| 305 | endif |
---|
| 306 | enddo |
---|
| 307 | enddo |
---|
[1028] | 308 | |
---|
| 309 | ! u component of wind velocity advection in thermals |
---|
| 310 | ! result is a derivative (d_u_ajs in m/s/s) |
---|
[628] | 311 | ndt=10 |
---|
[1032] | 312 | call thermcell_dqup(ngrid,nlayer,ptimestep & |
---|
[628] | 313 | & ,fm_therm,entr_therm,detrmod, & |
---|
[1212] | 314 | & masse,zu,d_u_ajs,ndt,limz) |
---|
[342] | 315 | |
---|
[1028] | 316 | ! v component of wind velocity advection in thermals |
---|
| 317 | ! result is a derivative (d_v_ajs in m/s/s) |
---|
[1032] | 318 | call thermcell_dqup(ngrid,nlayer,ptimestep & |
---|
[628] | 319 | & ,fm_therm,entr_therm,detrmod, & |
---|
[1212] | 320 | & masse,zv,d_v_ajs,ndt,limz) |
---|
[628] | 321 | |
---|
[1028] | 322 | ! non co2 tracers advection in thermals |
---|
| 323 | ! result is a derivative (d_q_ajs in kg/kg/s) |
---|
| 324 | |
---|
[1032] | 325 | if (nq .ne. 0.) then |
---|
| 326 | DO iq=1,nq |
---|
| 327 | if (iq .ne. igcm_co2) then |
---|
| 328 | call thermcell_dqup(ngrid,nlayer,ptimestep & |
---|
[628] | 329 | & ,fm_therm,entr_therm,detrmod, & |
---|
[1212] | 330 | & masse,pq_therm(:,:,iq),d_q_ajs(:,:,iq),ndt,limz) |
---|
[508] | 331 | endif |
---|
[342] | 332 | ENDDO |
---|
| 333 | endif |
---|
| 334 | |
---|
[1028] | 335 | ! tke advection in thermals |
---|
| 336 | ! result is a tendancy (d_u_ajs in J) |
---|
[544] | 337 | if (dtke_thermals) then |
---|
[1032] | 338 | call thermcell_dqup(ngrid,nlayer,ptimestep & |
---|
[628] | 339 | & ,fm_therm,entr_therm,detrmod, & |
---|
[1212] | 340 | & masse,q2_therm,dq2_therm,ndt,limz) |
---|
[544] | 341 | endif |
---|
| 342 | |
---|
[1028] | 343 | ! compute wmax for diagnostics |
---|
[1032] | 344 | DO ig=1,ngrid |
---|
[342] | 345 | wmax(ig)=MAXVAL(zw2(ig,:)) |
---|
| 346 | ENDDO |
---|
| 347 | |
---|
| 348 | ! ********************************************************************** |
---|
| 349 | ! ********************************************************************** |
---|
| 350 | ! ********************************************************************** |
---|
| 351 | ! CALLTHERM END |
---|
| 352 | ! ********************************************************************** |
---|
| 353 | ! ********************************************************************** |
---|
| 354 | ! ********************************************************************** |
---|
| 355 | |
---|
| 356 | |
---|
| 357 | ! ********************************************************************** |
---|
| 358 | ! Preparing outputs |
---|
| 359 | ! ********************************************************************** |
---|
| 360 | |
---|
[1212] | 361 | do l=1,limz |
---|
[628] | 362 | pdu_th(:,l)=d_u_ajs(:,l) |
---|
| 363 | pdv_th(:,l)=d_v_ajs(:,l) |
---|
| 364 | enddo |
---|
[342] | 365 | |
---|
[1028] | 366 | ! if tracers are transported in thermals, update output variables, else these are 0. |
---|
[161] | 367 | if(qtransport_thermals) then |
---|
[342] | 368 | if(tracer) then |
---|
[1032] | 369 | do iq=1,nq |
---|
| 370 | if (iq .ne. igcm_co2) then |
---|
[1212] | 371 | do l=1,limz |
---|
[1028] | 372 | pdq_th(:,l,iq)=d_q_ajs(:,l,iq) !non-co2 tracers d_q_ajs are dq/dt (kg/kg/s) |
---|
[628] | 373 | enddo |
---|
[625] | 374 | else |
---|
[1212] | 375 | do l=1,limz |
---|
[1028] | 376 | pdq_th(:,l,iq)=d_q_ajs(:,l,iq)/ptimestep !co2 tracer d_q_ajs is dq (kg/kg) |
---|
[628] | 377 | enddo |
---|
[625] | 378 | endif |
---|
| 379 | enddo |
---|
[342] | 380 | endif |
---|
[161] | 381 | endif |
---|
| 382 | |
---|
[1028] | 383 | ! if tke is transported in thermals, update output variable, else this is 0. |
---|
[544] | 384 | IF(dtke_thermals) THEN |
---|
[1032] | 385 | DO l=2,nlayer |
---|
[544] | 386 | pbl_dtke(:,l)=0.5*(dq2_therm(:,l-1)+dq2_therm(:,l)) |
---|
| 387 | ENDDO |
---|
| 388 | |
---|
| 389 | pbl_dtke(:,1)=0.5*dq2_therm(:,1) |
---|
[1032] | 390 | pbl_dtke(:,nlayer+1)=0. |
---|
[544] | 391 | ENDIF |
---|
[161] | 392 | |
---|
[1028] | 393 | ! update output variable for temperature. d_t_ajs is delta T in (K), pdt_th is dT/dt in (K/s) |
---|
[1212] | 394 | do l=1,limz |
---|
[628] | 395 | pdt_th(:,l)=d_t_ajs(:,l)/ptimestep |
---|
| 396 | enddo |
---|
[342] | 397 | |
---|
[499] | 398 | |
---|
[342] | 399 | ! ********************************************************************** |
---|
[1028] | 400 | ! SURFACE LAYER INTERFACE |
---|
| 401 | ! Compute the free convection velocity w* scale for surface layer gustiness |
---|
| 402 | ! speed parameterization. The computed value of w* will be used at the next |
---|
| 403 | ! timestep to modify surface-atmosphere exchange fluxes, because the surface |
---|
| 404 | ! layer scheme and diffusion are called BEFORE the thermals. (outside of these |
---|
| 405 | ! routines) |
---|
[499] | 406 | ! ********************************************************************** |
---|
| 407 | |
---|
| 408 | ! Potential temperature gradient |
---|
| 409 | |
---|
[1032] | 410 | dteta(:,nlayer)=0. |
---|
| 411 | DO l=1,nlayer-1 |
---|
| 412 | DO ig=1, ngrid |
---|
[499] | 413 | dteta(ig,l) = ((zt(ig,l+1)-zt(ig,l))/zpopsk(ig,l)) & |
---|
| 414 | & /(zzlay(ig,l+1)-zzlay(ig,l)) |
---|
| 415 | ENDDO |
---|
| 416 | ENDDO |
---|
| 417 | |
---|
[1028] | 418 | ! Computation of the PBL mixed layer temperature |
---|
[499] | 419 | |
---|
[1032] | 420 | DO ig=1, ngrid |
---|
[499] | 421 | ii=MINLOC(abs(dteta(ig,1:lmax(ig)))) |
---|
| 422 | pbl_teta(ig) = zt(ig,ii(1))/zpopsk(ig,ii(1)) |
---|
| 423 | ENDDO |
---|
| 424 | |
---|
[1028] | 425 | ! In order to have an accurate w*, we must add the heat flux from the |
---|
| 426 | ! diffusion scheme to the computation of the maximum heat flux hfmax |
---|
| 427 | ! Here pdhdif is the potential temperature change from the diffusion |
---|
| 428 | ! scheme (Mellor and Yamada, see paper section 6, paragraph 57) |
---|
[660] | 429 | |
---|
| 430 | ! compute rho as it is after the diffusion |
---|
| 431 | |
---|
| 432 | rho(:,:)=pplay(:,:) & |
---|
| 433 | & /(r*(pt(:,:)+pdhdif(:,:)*zpopsk(:,:)*ptimestep)) |
---|
| 434 | |
---|
| 435 | ! integrate -rho*pdhdif |
---|
| 436 | |
---|
| 437 | rpdhd(:,:)=0. |
---|
| 438 | |
---|
[1032] | 439 | DO ig=1,ngrid |
---|
[660] | 440 | DO l=1,lmax(ig) |
---|
| 441 | rpdhd(ig,l)=0. |
---|
| 442 | DO k=1,l |
---|
| 443 | rpdhd(ig,l)=rpdhd(ig,l)-rho(ig,k)*pdhdif(ig,k)* & |
---|
| 444 | & (zzlev(ig,k+1)-zzlev(ig,k)) |
---|
| 445 | ENDDO |
---|
| 446 | rpdhd(ig,l)=rpdhd(ig,l)-sensibFlux(ig)/cpp |
---|
| 447 | ENDDO |
---|
| 448 | ENDDO |
---|
| 449 | |
---|
[1028] | 450 | ! compute w'theta' (vertical turbulent flux of temperature) from |
---|
| 451 | ! the diffusion scheme |
---|
[660] | 452 | |
---|
| 453 | wtdif(:,:)=rpdhd(:,:)/rho(:,:) |
---|
| 454 | |
---|
[1028] | 455 | ! Now we compute the contribution of the thermals to w'theta': |
---|
[660] | 456 | ! compute rho as it is after the thermals |
---|
| 457 | |
---|
| 458 | rho(:,:)=pplay(:,:)/(r*(zt(:,:))) |
---|
[1028] | 459 | |
---|
[660] | 460 | ! integrate -rho*pdhdif |
---|
| 461 | |
---|
[1032] | 462 | DO ig=1,ngrid |
---|
[660] | 463 | DO l=1,lmax(ig) |
---|
| 464 | rpdhd(ig,l)=0. |
---|
| 465 | DO k=1,l |
---|
| 466 | rpdhd(ig,l)=rpdhd(ig,l)-rho(ig,k)*(pdt_th(ig,k)/zpopsk(ig,k))* & |
---|
| 467 | & (zzlev(ig,k+1)-zzlev(ig,k)) |
---|
| 468 | ENDDO |
---|
| 469 | rpdhd(ig,l)=rpdhd(ig,l)+ & |
---|
| 470 | & rho(ig,1)*(heatFlux(ig,1)+heatFlux_down(ig,1)) |
---|
| 471 | ENDDO |
---|
| 472 | ENDDO |
---|
[1032] | 473 | rpdhd(:,nlayer)=0. |
---|
[660] | 474 | |
---|
| 475 | ! compute w'teta' from thermals |
---|
| 476 | |
---|
| 477 | wtth(:,:)=rpdhd(:,:)/rho(:,:) |
---|
| 478 | |
---|
[1028] | 479 | ! Add vertical turbulent heat fluxes from the thermals and the diffusion scheme |
---|
| 480 | ! and compute the maximum |
---|
[660] | 481 | |
---|
[1032] | 482 | DO ig=1,ngrid |
---|
[660] | 483 | hfmax(ig)=MAXVAL(wtth(ig,:)+wtdif(ig,:)) |
---|
| 484 | ENDDO |
---|
[1028] | 485 | |
---|
| 486 | ! Finally we can compute the free convection velocity scale |
---|
[499] | 487 | ! We follow Spiga et. al 2010 (QJRMS) |
---|
| 488 | ! ------------ |
---|
| 489 | |
---|
[1032] | 490 | DO ig=1, ngrid |
---|
[499] | 491 | IF (zmax(ig) .gt. 0.) THEN |
---|
| 492 | wstar(ig)=(g*zmaxth(ig)*hfmax(ig)/pbl_teta(ig))**(1./3.) |
---|
| 493 | ELSE |
---|
| 494 | wstar(ig)=0. |
---|
| 495 | ENDIF |
---|
| 496 | ENDDO |
---|
| 497 | |
---|
[161] | 498 | END |
---|