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

Last change on this file since 278 was 185, checked in by acolaitis, 14 years ago

17/06/2011 == AC

  • Added new settings for the Martian thermals from new LES observations
  • Revamped thermcell's module variables to allow it's removal
  • Minor changes in physiq and meso_physiq for the call to thermals
  • Switched from dynamic to static memory allocation for all thermals variable

to gain computation speed

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