source: trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90 @ 2997

Last change on this file since 2997 was 2823, checked in by emillour, 2 years ago

Mars GCM:
Remove the "tracer" (logical) flag as we now always run with at least
one tracer.
EM

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