source: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_closure.F90 @ 5155

Last change on this file since 5155 was 5119, checked in by abarral, 16 months ago

enforce PRIVATE by default in several modules, expose PUBLIC as needed
move eigen.f90 to obsolete/
(lint) aslong the way

  • 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)
48END DO
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
61END DO
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
69END DO
70
71
72
73 RETURN
74      END
75END MODULE lmdz_thermcell_closure
Note: See TracBrowser for help on using the repository browser.