source: LMDZ6/trunk/libf/phylmd/lmdz_thermcell_closure.f90 @ 5456

Last change on this file since 5456 was 5390, checked in by yann meurdesoif, 3 weeks ago
  • Remove UTF8 character that inihibit fortran parsing with GPU morphosis
  • Add missing END SUBROUTINE instead of simple END, that inhibit correct parsing with regulat expression parser (quick and dirty parsing)

YM

  • 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
RevLine 
[4590]1MODULE lmdz_thermcell_closure
[1403]2!
3! $Header$
4!
[4590]5CONTAINS
6
[878]7      SUBROUTINE thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho,  &
[4094]8     &   zlev,lalim,alim_star,zmax,wmax,f)
[878]9
10!-------------------------------------------------------------------------
11!thermcell_closure: fermeture, determination de f
[1403]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
[878]19!-------------------------------------------------------------------------
20      IMPLICIT NONE
21
[4094]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
[878]28
[4094]29real, intent(out), dimension(ngrid) :: f
[878]30
[4094]31
32! --- local ------------------------------------------
33real, dimension(ngrid) :: zdenom,alim_star2,alim_star_tot
[1403]34INTEGER llmax
[4094]35INTEGER ig,k       
[878]36
[1403]37!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38!print*,'THERMCELL CLOSURE 26E'
[878]39
[1403]40alim_star2(:)=0.
41alim_star_tot(:)=0.
42f(:)=0.
[878]43
[1403]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
[4094]73 RETURN
[5390]74END SUBROUTINE thermcell_closure
[4590]75END MODULE lmdz_thermcell_closure
Note: See TracBrowser for help on using the repository browser.