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

Last change on this file since 164 was 161, checked in by acolaitis, 14 years ago

================================================
======== IMPLEMENTATION OF THERMALS ============
================================================

Author: A. Colaitis (2011-06-16)

The main goal of this revision is to start including the thermals into the model
for development purposes. Users should not use the thermals yet, as
several major configuration changes still need to be done.

This version includes :

  • updraft and downdraft parametrizations
  • velocity in the thermal, including drag
  • plume height analysis
  • closure equation
  • updraft transport of heat, tracers and momentum
  • downdraft transport of heat

This model should not be used without upcoming developments, namely :

  • downdraft transport of tracers and momentum
  • updraft & downdraft transport of q2 (tke)
  • revision of vdif_kc to compute q2 for non-stratified cases

Thermals could also include in a later revision :

  • momentum loss during transport (horizontal drag)

Compilation of the thermals has been successfully tested on ifort, gfortran and pgf90

================================================
================================================

M libf/phymars/callkeys.h
M libf/phymars/inifis.F

Added new control flags to call the thermals :

  • calltherm (false by default) <- to call thermals
  • outptherm (false by default) <- to output thermal-related diagnostics (for dev purposes)

================================================

M libf/phymars/vdifc.F
------> added a temporary output for thermal-related diagnostics

M libf/phymars/testphys1d.F
------> added treatment for a initialization from a profile of neutral gas (ar)

-> will be transformed in a decaying tracer for thermal diagnostics

M libf/phymars/physiq.F
------> added a section to call the thermals

-> changed the call to convadj
-> added thermal-related outputs for diagnostics

M libf/phymars/convadj.F
------> takes now into account the height of thermals to execute convective adjustment

=> note : convective adjustment needs to be activated when using thermals, in case of a

second instable layer above the thermals

================================================

A libf/phymars/calltherm_interface.F90
------> Interface between physiq.F and the thermals

A libf/phymars/calltherm_mars.F90
------> Routine running the sub-timestep of the thermals

A libf/phymars/thermcell_main_mars.F90
------> Main thermals routine specific to Martian physics

A libf/phymars/thermcell_dqupdown.F90
------> Thermals subroutine computing transport of quantities by updrafts and downdrafts

A libf/phymars/thermcell.F90
------> Module including parameters from the Earth to Mars importation. Will disappear in future dev

================================================
================================================

File size: 7.5 KB
Line 
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.
105            call getin("qtransport_thermals",qtransport_thermals)
106            if(qtransport_thermals) then
107            if(tracer) then
108            pq_therm(:,:,:)=pq(:,:,:)+pdq(:,:,:)*ptimestep
109            endif
110            endif
111
112            d_t_ajs(:,:)=0.
113            d_u_ajs(:,:)=0.
114            d_v_ajs(:,:)=0.
115            d_q_ajs(:,:,:)=0.
116            heatFlux(:,:)=0.
117            heatFlux_down(:,:)=0.
118            buoyancyOut(:,:)=0.
119            buoyancyEst(:,:)=0.
120
121       call getin("dtke_thermals",dtke_thermals)
122         if(dtke_thermals) then
123
124         DO l=1,nlayer
125              q2_therm(:,l)=0.5*(q2(:,l)+q2(:,l+1))
126         ENDDO
127         endif
128
129         CALL calltherm_mars(ngrid,nlayer,ptimestep,nq,zzlev,zzlay &
130     &      ,pplay,pplev,pphi &
131     &      ,u_seri,v_seri,t_seri,pq_therm, q2_therm &
132     &      ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs, dq2_therm &
133     &      ,fm_therm,entr_therm,detr_therm &
134     &      ,lmax_th &
135     &      ,zw2,fraca &
136     &      ,zpopsk,ztla,heatFlux,heatFlux_down &
137     &      ,buoyancyOut,buoyancyEst)
138
139
140! Accumulation des  tendances. On n'accumule pas les quantités de traceurs car celle ci n'a pas du changer
141! étant donné qu'on ne prends en compte que q_seri de la vap d'eau = 0
142
143! INCREMENTATION : les d_u_ sont des tendances alors que les pdu sont des dérivees, attention !
144
145           pdu_th(:,:)=d_u_ajs(:,:)/ptimestep
146           pdv_th(:,:)=d_v_ajs(:,:)/ptimestep
147           pdt_th(:,:)=d_t_ajs(:,:)/ptimestep
148           if(qtransport_thermals) then
149           if(tracer) then
150           pdq_th(:,:,:)=d_q_ajs(:,:,:)/ptimestep
151           endif
152           endif
153
154
155         DO l=2,nlayer
156              pbl_dtke(:,l)=0.5*(dq2_therm(:,l-1)+dq2_therm(:,l))/ptimestep
157         ENDDO
158
159         pbl_dtke(:,1)=0.5*dq2_therm(:,1)/ptimestep
160         pbl_dtke(:,nlayer+1)=0.
161!! DIAGNOSTICS
162       
163        if(outptherm) then
164        if (ngrid .eq. 1) then
165        call WRITEDIAGFI(ngrid,'entr_therm','entrainement thermique',&
166     &                       'kg/m-2',1,entr_therm)
167        call WRITEDIAGFI(ngrid,'detr_therm','detrainement thermique',&
168     &                       'kg/m-2',1,detr_therm)
169        call WRITEDIAGFI(ngrid,'fm_therm','flux masse thermique',&
170     &                       'kg/m-2',1,fm_therm)
171        call WRITEDIAGFI(ngrid,'zw2','vitesse verticale thermique',&
172     &                       'm/s',1,zw2)
173        call WRITEDIAGFI(ngrid,'heatFlux_up','heatFlux_updraft',&
174     &                       'SI',1,heatFlux)
175       call WRITEDIAGFI(ngrid,'heatFlux_down','heatFlux_downdraft',&
176     &                       'SI',1,heatFlux_down)
177        call WRITEDIAGFI(ngrid,'fraca','fraction coverage',&
178     &                       'percent',1,fraca)
179        call WRITEDIAGFI(ngrid,'buoyancyOut','buoyancyOut',&
180     &                       'm.s-2',1,buoyancyOut)
181        call WRITEDIAGFI(ngrid,'buoyancyEst','buoyancyEst',&
182     &                       'm.s-2',1,buoyancyEst)
183        call WRITEDIAGFI(ngrid,'d_t_th',  &
184     &         'tendance temp TH','K',1,d_t_ajs)
185        call WRITEDIAGFI(ngrid,'d_q_ajs',  &
186     &         'tendance q updraft','kg/kg',1,d_q_ajs(:,:,nq))
187        call WRITEDIAGFI(ngrid,'d_q_tke',  &
188     &         'tendance q updraft','q2/q2',1,pbl_dtke*ptimestep)
189      else
190
191        call WRITEDIAGFI(ngrid,'entr_therm','entrainement thermique',&
192     &                       'kg/m-2',3,entr_therm)
193        call WRITEDIAGFI(ngrid,'detr_therm','detrainement thermique',&
194     &                       'kg/m-2',3,detr_therm)
195        call WRITEDIAGFI(ngrid,'fm_therm','flux masse thermique',&
196     &                       'kg/m-2',3,fm_therm)
197        call WRITEDIAGFI(ngrid,'zw2','vitesse verticale thermique',&
198     &                       'm/s',3,zw2)
199        call WRITEDIAGFI(ngrid,'heatFlux','heatFlux',&
200     &                       'SI',3,heatFlux)
201        call WRITEDIAGFI(ngrid,'buoyancyOut','buoyancyOut',&
202     &                       'SI',3,buoyancyOut)
203        call WRITEDIAGFI(ngrid,'d_t_th',  &
204     &         'tendance temp TH','K',3,d_t_ajs)
205
206      endif
207      endif
208
209       END
Note: See TracBrowser for help on using the repository browser.