source: LMDZ6/trunk/libf/phylmd/lmdz_thermcell_closure.F90 @ 4678

Last change on this file since 4678 was 4590, checked in by fhourdin, 11 months ago

Passage des thermiques a la nouvelle norme.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1MODULE lmdz_thermcell_closure
2!
3! $Header$
4!
5CONTAINS
6
7      SUBROUTINE thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho,  &
8     &   zlev,lalim,alim_star,zmax,wmax,f)
9
10!-------------------------------------------------------------------------
11!thermcell_closure: fermeture, determination de f
12!
13! Modification 7 septembre 2009
14! 1. On enleve alim_star_tot des arguments pour le recalculer et etre ainis
15! coherent avec l'integrale au numerateur.
16! 2. On ne garde qu'une version des couples wmax,zmax et wmax_sec,zmax_sec
17! l'idee etant que le choix se fasse a l'appel de thermcell_closure
18! 3. Vectorisation en mettant les boucles en l l'exterieur avec des if
19!-------------------------------------------------------------------------
20      IMPLICIT NONE
21
22! --- arguments ------------------------------------------
23integer, intent(in) :: ngrid,nlay
24real, intent(in) :: r_aspect,ptimestep
25real, intent(in), dimension(ngrid,nlay) :: alim_star,rho,zlev
26integer, intent(in), dimension(ngrid) :: lalim
27real, intent(in), dimension(ngrid) :: zmax,wmax
28
29real, intent(out), dimension(ngrid) :: f
30
31
32! --- local ------------------------------------------
33real, dimension(ngrid) :: zdenom,alim_star2,alim_star_tot
34INTEGER llmax
35INTEGER ig,k       
36
37!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38!print*,'THERMCELL CLOSURE 26E'
39
40alim_star2(:)=0.
41alim_star_tot(:)=0.
42f(:)=0.
43
44! Indice vertical max (max de lalim) atteint par les thermiques sur le domaine
45llmax=1
46do ig=1,ngrid
47   if (lalim(ig)>llmax) llmax=lalim(ig)
48enddo
49
50
51! Calcul des integrales sur la verticale de alim_star et de
52!   alim_star^2/(rho dz)
53do k=1,llmax-1
54   do ig=1,ngrid
55      if (k<lalim(ig)) then
56         alim_star2(ig)=alim_star2(ig)+alim_star(ig,k)**2  &
57&                    /(rho(ig,k)*(zlev(ig,k+1)-zlev(ig,k)))
58         alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,k)
59      endif
60   enddo
61enddo
62
63
64do ig=1,ngrid
65   if (alim_star2(ig)>1.e-10) then
66      f(ig)=wmax(ig)*alim_star_tot(ig)/  &
67&     (max(500.,zmax(ig))*r_aspect*alim_star2(ig))
68   endif
69enddo
70
71
72
73 RETURN
74      end
75END MODULE lmdz_thermcell_closure
Note: See TracBrowser for help on using the repository browser.