source: trunk/LMDZ.MARS/libf/phymars/thermcell_dqup.F90 @ 339

Last change on this file since 339 was 337, checked in by acolaitis, 14 years ago

10/10/2011 == AC

*
This commit aims at increasing the thermals speed, especially for large tracer number configurations. The idea behind this commit is to advect non-active conserved variables outside of the sub-timestep of the thermals. Because these variables are not used in thermals computation, we can decouple them:

momentum: can be decoupled because we assume a constant ratio between horizontal velocity in alimentation layer and maximum vertical velocity in the thermals.

tracer: can be decoupled because we do not take condensation of any tracer into account and hence do not liberate latent heat nor form clouds in the thermals.

temperature: cannot be decoupled (of course)
*

D 336 libf/phymars/thermcell_dqupdown.F90
---------------- Deleted and replaced by a simpler version. Notes about downdraft advection are still available from revision 336 of SVN in thermcell_dqupdown.

A 0 libf/phymars/thermcell_dqup.F90
---------------- New upward advection for tracers and momentum in thermals. Several changes are done compared to the old approach:

  • Updraft quantities are not longer computed by making hypothesis on the amount of advected air.
    • In general, the formalism for updraft computation is much simpler and clearer.
  • Tracer tendancies are no longer computed using the conservation equation. Instead, we use the divergence of an approximated turbulent flux of the concerned quantity, where downdraft are also neglected.

M 336 libf/phymars/thermcell_main_mars.F90
---------------- The Main does not call anymore thermcell_dqupdown, which it was doing 2+tracer_number times per subtimestep (140 times per physical step for a 2 tracer config)

M 336 libf/phymars/calltherm_mars.F90
---------------- Entrainment, detrainment and mass-fluxes are recomputed in the sub-timestep loop. Their final value after iterations is used by the new advection routine to compute tracer and momentum fluxes.

* Results

  • Conservation of tracers has been assessed over 1 yr in 1D and found to be comparable to that obtained with the simple convective adjustment. (it actually seems to be better by a factor of 10%!)
  • GCM speed-up is of about 20% compared to the old thermal configuration, for a 2 tracer case.
  • Advection of sharp tracer profiles has been successfully observed, similar to the old method.
  • Property svn:executable set to *
File size: 3.1 KB
Line 
1      subroutine thermcell_dqup(ngrid,nlayer,ptimestep,fm0,entr0,  &
2     &    detr0,masse0,q_therm,dq_therm,charvar,zdz)
3      implicit none
4
5! #include "iniprint.h"
6!=======================================================================
7!
8!   Calcul du transport verticale dans la couche limite en presence
9!   de "thermiques" explicitement representes
10!   calcul du dq/dt une fois qu'on connait les ascendances
11!   Version modifiee pour prendre les downdrafts a la place de la
12!   subsidence compensatoire
13!=======================================================================
14
15#include "dimensions.h"
16#include "dimphys.h"
17
18! ============================ INPUTS ============================
19
20      INTEGER, INTENT(IN) :: ngrid,nlayer
21      REAL, INTENT(IN) :: ptimestep
22      REAL, INTENT(IN) :: fm0(ngridmx,nlayermx+1)
23      REAL, INTENT(IN) ::entr0(ngridmx,nlayermx),detr0(ngridmx,nlayermx)
24      REAL, INTENT(IN) :: q_therm(ngridmx,nlayermx)
25      CHARACTER (LEN=20), INTENT(IN) :: charvar
26      REAL, INTENT(IN) :: masse0(ngridmx,nlayermx)
27      REAL, INTENT(IN) :: zdz(ngridmx,nlayermx)
28
29! ============================ OUTPUTS ===========================
30
31      REAL, INTENT(OUT) :: dq_therm(ngridmx,nlayermx)
32
33! ============================ LOCAL =============================
34
35      REAL q(ngridmx,nlayermx)
36      REAL qa(ngridmx,nlayermx)
37      REAL qd(ngridmx,nlayermx)
38      INTEGER ig,k
39      REAL gammaf(ngridmx,nlayermx)
40
41! =========== Init ==============================================
42
43      qa(:,:)=q_therm(:,:)
44      q(:,:)=q_therm(:,:)
45
46      do ig=1,ngridmx
47         do k=1, nlayermx
48            if (fm0(ig,k)+entr0(ig,k) .gt. 0.) then
49              gammaf(ig,k)=fm0(ig,k)/(fm0(ig,k)+entr0(ig,k))
50            else
51              gammaf(ig,k)=0.
52            endif
53         enddo
54      enddo
55
56
57! =========== Updraft ============================================
58
59!      qa(:,1)=q(:,1)
60
61      do ig=1,ngridmx
62         do k=2, nlayermx
63 
64             qa(ig,k)=gammaf(ig,k)*qa(ig,k-1) +(1.-gammaf(ig,k))*q(ig,k)
65
66         enddo
67      enddo
68
69
70
71! ====== dq ======================================================
72
73!      do ig=1,ngridmx
74!         dq_therm(ig,1)=(detr0(ig,1)*qa(ig,1)+fm0(ig,2)*q(ig,2) &
75!      &               -entr0(ig,1)*q(ig,1)) &
76!      &               *ptimestep/masse0(ig,1)
77!       enddo
78!       do k=2,nlayermx-1
79!         do ig=1, ngridmx
80!         dq_therm(ig,k)=(detr0(ig,k)*qa(ig,k)+fm0(ig,k+1)*q(ig,k+1) &
81!      &               -entr0(ig,k)*q(ig,k)-fm0(ig,k)*q(ig,k))  &
82!      &               *ptimestep/masse0(ig,k)
83!         enddo
84!      enddo
85!
86!         do ig=1, ngridmx
87!         dq_therm(ig,nlayermx)=(detr0(ig,nlayermx)*qa(ig,nlayermx) &
88!      &             -entr0(ig,nlayermx)*q(ig,nlayermx)  &
89!      &               -fm0(ig,nlayermx)*q(ig,nlayermx)) &
90!      &               *ptimestep/masse0(ig,nlayermx)
91!         
92!         enddo
93
94        do ig=1, ngridmx
95           do k=1,nlayermx-1
96              dq_therm(ig,k)=-(ptimestep/masse0(ig,k))*(  &
97     &           fm0(ig,k+1)*(qa(ig,k+1)-q(ig,k+1)) -   &
98     &           fm0(ig,k)*(qa(ig,k)-q(ig,k))          ) &
99     &       /zdz(ig,k)
100
101           enddo
102        enddo
103
104      return
105      end
Note: See TracBrowser for help on using the repository browser.