MODULE lmdz_thermcell_closure ! $Header$ CONTAINS SUBROUTINE thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho, & zlev,lalim,alim_star,zmax,wmax,f) !------------------------------------------------------------------------- !thermcell_closure: fermeture, determination de f ! Modification 7 septembre 2009 ! 1. On enleve alim_star_tot des arguments pour le recalculer et etre ainis ! coherent avec l'integrale au numerateur. ! 2. On ne garde qu'une version des couples wmax,zmax et wmax_sec,zmax_sec ! l'idee etant que le choix se fasse a l'appel de thermcell_closure ! 3. Vectorisation en mettant les boucles en l l'exterieur avec des if !------------------------------------------------------------------------- IMPLICIT NONE ! --- arguments ------------------------------------------ INTEGER, INTENT(IN) :: ngrid,nlay REAL, INTENT(IN) :: r_aspect,ptimestep REAL, INTENT(IN), DIMENSION(ngrid,nlay) :: alim_star,rho,zlev INTEGER, INTENT(IN), DIMENSION(ngrid) :: lalim REAL, INTENT(IN), DIMENSION(ngrid) :: zmax,wmax REAL, INTENT(OUT), DIMENSION(ngrid) :: f ! --- local ------------------------------------------ REAL, DIMENSION(ngrid) :: zdenom,alim_star2,alim_star_tot INTEGER llmax INTEGER ig,k !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !PRINT*,'THERMCELL CLOSURE 26E' alim_star2(:)=0. alim_star_tot(:)=0. f(:)=0. ! Indice vertical max (max de lalim) atteint par les thermiques sur le domaine llmax=1 DO ig=1,ngrid IF (lalim(ig)>llmax) llmax=lalim(ig) END DO ! Calcul des integrales sur la verticale de alim_star et de ! alim_star^2/(rho dz) DO k=1,llmax-1 do ig=1,ngrid IF (k1.e-10) THEN f(ig)=wmax(ig)*alim_star_tot(ig)/ & & (max(500.,zmax(ig))*r_aspect*alim_star2(ig)) endif END DO RETURN END END MODULE lmdz_thermcell_closure