source: LMDZ5/trunk/libf/phylmd/thermcell_closure.F90 @ 4273

Last change on this file since 4273 was 2311, checked in by Ehouarn Millour, 9 years ago

Further modifications to enforce physics/dynamics separation:

  • moved iniprint.h and misc_mod back to dyn3d_common, as these should only be used by dynamics.
  • created print_control_mod in the physics to store flags prt_level, lunout, debug to be local to physics (should be used rather than iniprint.h)
  • created abort_physic.F90 , which does the same job as abort_gcm() did, but should be used instead when in physics.
  • reactivated inifis (turned it into a module, inifis_mod.F90) to initialize physical constants and print_control_mod flags.

EM

  • 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.2 KB
Line 
1!
2! $Header$
3!
4      SUBROUTINE thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho,  &
5     &   zlev,lalim,alim_star,f_star,zmax,wmax,f,lev_out)
6
7!-------------------------------------------------------------------------
8!thermcell_closure: fermeture, determination de f
9!
10! Modification 7 septembre 2009
11! 1. On enleve alim_star_tot des arguments pour le recalculer et etre ainis
12! coherent avec l'integrale au numerateur.
13! 2. On ne garde qu'une version des couples wmax,zmax et wmax_sec,zmax_sec
14! l'idee etant que le choix se fasse a l'appel de thermcell_closure
15! 3. Vectorisation en mettant les boucles en l l'exterieur avec des if
16!-------------------------------------------------------------------------
17      IMPLICIT NONE
18
19#include "thermcell.h"
20INTEGER ngrid,nlay
21INTEGER ig,k       
22REAL r_aspect,ptimestep
23integer lev_out                           ! niveau pour les print
24
25INTEGER lalim(ngrid)
26REAL alim_star(ngrid,nlay)
27REAL f_star(ngrid,nlay+1)
28REAL rho(ngrid,nlay)
29REAL zlev(ngrid,nlay)
30REAL zmax(ngrid)
31REAL wmax(ngrid)
32REAL zdenom(ngrid)
33REAL alim_star2(ngrid)
34REAL f(ngrid)
35
36REAL alim_star_tot(ngrid)
37INTEGER llmax
38
39!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40!print*,'THERMCELL CLOSURE 26E'
41
42alim_star2(:)=0.
43alim_star_tot(:)=0.
44f(:)=0.
45
46! Indice vertical max (max de lalim) atteint par les thermiques sur le domaine
47llmax=1
48do ig=1,ngrid
49   if (lalim(ig)>llmax) llmax=lalim(ig)
50enddo
51
52
53! Calcul des integrales sur la verticale de alim_star et de
54!   alim_star^2/(rho dz)
55do k=1,llmax-1
56   do ig=1,ngrid
57      if (k<lalim(ig)) then
58         alim_star2(ig)=alim_star2(ig)+alim_star(ig,k)**2  &
59&                    /(rho(ig,k)*(zlev(ig,k+1)-zlev(ig,k)))
60         alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,k)
61      endif
62   enddo
63enddo
64
65
66do ig=1,ngrid
67   if (alim_star2(ig)>1.e-10) then
68      f(ig)=wmax(ig)*alim_star_tot(ig)/  &
69&     (max(500.,zmax(ig))*r_aspect*alim_star2(ig))
70   endif
71enddo
72
73
74!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75! TESTS POUR UNE NOUVELLE FERMETURE DANS LAQUELLE ALIM_STAR NE SERAIT
76! PAS NORMALISE
77!           f(ig)=f(ig)*f_star(ig,2)/(f_star(ig,lalim(ig)))
78!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79
80      return
81      end
Note: See TracBrowser for help on using the repository browser.