Ignore:
Timestamp:
Jul 1, 2010, 11:02:53 AM (14 years ago)
Author:
Laurent Fairhead
Message:

Merged LMDZ4V5.0-dev branch changes r1292:r1399 to trunk.

Validation:
Validation consisted in compiling the HEAD revision of the trunk,
LMDZ4V5.0-dev branch and the merged sources and running different
configurations on local and SX8 machines comparing results.

Local machine: bench configuration, 32x24x11, gfortran

  • IPSLCM5A configuration (comparison between trunk and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent
  • MH07 configuration, new physics package (comparison between LMDZ4V5.0-dev branch and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent

SX8 machine (brodie), 96x95x39 on 4 processors:

  • IPSLCM5A configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent
  • MH07 configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent

Changes to the makegcm and create_make_gcm scripts to take into account
main programs in F90 files


Fusion de la branche LMDZ4V5.0-dev (r1292:r1399) au tronc principal

Validation:
La validation a consisté à compiler la HEAD de le trunk et de la banche
LMDZ4V5.0-dev et les sources fusionnées et de faire tourner le modéle selon
différentes configurations en local et sur SX8 et de comparer les résultats

En local: 32x24x11, config bench/gfortran

  • pour une config IPSLCM5A (comparaison tronc/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux (à part sur RN et Pb)
    • fichiers histoire égaux
  • pour une config nlle physique (MH07) (comparaison LMDZ4v5.0-dev/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux
    • fichiers histoire équivalents

Sur brodie, 96x95x39 sur 4 proc:

  • pour une config IPSLCM5A:
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc
  • pour une config MH07
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc

Changement sur makegcm et create_make-gcm pour pouvoir prendre en compte des
programmes principaux en *F90

Location:
LMDZ4/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/trunk

  • LMDZ4/trunk/libf/phylmd/thermcell_main.F90

    r1146 r1403  
    11!
    2 ! $Header$
     2! $Id$
    33!
    44      SUBROUTINE thermcell_main(itap,ngrid,nlay,ptimestep  &
     
    88     &                  ,fm0,entr0,detr0,zqta,zqla,lmax  &
    99     &                  ,ratqscth,ratqsdiff,zqsatth  &
    10      &                  ,r_aspect,l_mix,tau_thermals &
     10     &                  ,r_aspect,l_mix,tau_thermals,iflag_thermals_ed &
    1111     &                  ,Ale_bl,Alp_bl,lalim_conv,wght_th &
    12      &                  ,zmax0, f0,zw2,fraca)
     12     &                  ,zmax0, f0,zw2,fraca,ztv &
     13     &                  ,zpspsk,ztla,zthl)
    1314
    1415      USE dimphy
     
    2223!   de "thermiques" explicitement representes avec processus nuageux
    2324!
    24 !   Réécriture à partir d'un listing papier à Habas, le 14/02/00
    25 !
    26 !   le thermique est supposé homogène et dissipé par mélange avec
    27 !   son environnement. la longueur l_mix contrôle l'efficacité du
    28 !   mélange
    29 !
    30 !   Le calcul du transport des différentes espèces se fait en prenant
     25!   Reecriture a partir d'un listing papier a Habas, le 14/02/00
     26!
     27!   le thermique est suppose homogene et dissipe par melange avec
     28!   son environnement. la longueur l_mix controle l'efficacite du
     29!   melange
     30!
     31!   Le calcul du transport des differentes especes se fait en prenant
    3132!   en compte:
    3233!     1. un flux de masse montant
     
    5556      INTEGER ngrid,nlay,w2di
    5657      real tau_thermals
     58      integer iflag_thermals_ed
    5759      real ptimestep,l_mix,r_aspect
    5860      REAL pt(ngrid,nlay),pdtadj(ngrid,nlay)
     
    8587      real linter(klon)
    8688      real zmix(klon)
    87       real zmax(klon),zw2(klon,klev+1),ztva(klon,klev),zw_est(klon,klev+1)
     89      real zmax(klon),zw2(klon,klev+1),ztva(klon,klev),zw_est(klon,klev+1),ztva_est(klon,klev)
    8890!      real fraca(klon,klev)
    8991
     
    115117! FH probleme de dimensionnement avec l'allocation dynamique
    116118!     common/comtherm/thetath2,wth2
     119      real wq(klon,klev)
     120      real wthl(klon,klev)
     121      real wthv(klon,klev)
    117122   
    118123      real ratqscth(klon,klev)
     
    126131
    127132      real wmax(klon)
     133      real wmax_tmp(klon)
    128134      real wmax_sec(klon)
    129135      real fm0(klon,klev+1),entr0(klon,klev),detr0(klon,klev)
     
    142148      real f_star(klon,klev+1),entr_star(klon,klev)
    143149      real detr_star(klon,klev)
    144       real alim_star_tot(klon),alim_star2(klon)
     150      real alim_star_tot(klon)
    145151      real alim_star(klon,klev)
     152      real alim_star_clos(klon,klev)
    146153      real f(klon), f0(klon)
    147154!FH/IM     save f0
     
    149156      logical debut
    150157       real seuil
     158      real csc(klon,klev)
    151159
    152160!
     
    166174      character*10 str10
    167175
     176      character (len=20) :: modname='thermcell_main'
     177      character (len=80) :: abort_message
     178
    168179      EXTERNAL SCOPY
    169180!
     
    182193
    183194
    184 ! #define wrgrads_thermcell
    185195#undef wrgrads_thermcell
    186196#ifdef wrgrads_thermcell
     
    200210      fm=0. ; entr=0. ; detr=0.
    201211
     212
    202213      icount=icount+1
    203214
     
    220231      ENDIF
    221232!
    222 !Initialisation
    223 !
    224 !    IF (1.eq.0) THEN
    225 !     do ig=1,klon     
    226 !FH/IM 130308     if ((debut).or.((.not.debut).and.(f0(ig).lt.1.e-10))) then
    227 !     if ((.not.debut).and.(f0(ig).lt.1.e-10)) then
    228 !           f0(ig)=1.e-5
    229 !           zmax0(ig)=40.
    230 !v1d        therm=.false.
    231 !     endif
    232 !     enddo
    233 !    ENDIF !(1.eq.0) THEN
    234      if (prt_level.ge.10)write(lunout,*)                                &
    235     &     'WARNING thermcell_main f0=max(f0,1.e-2)'
     233!     write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)'
    236234     do ig=1,klon
    237235      if (prt_level.ge.20) then
     
    239237      endif
    240238         f0(ig)=max(f0(ig),1.e-2)
     239         zmax0(ig)=max(zmax0(ig),40.)
    241240!IMmarche pas ?!       if (f0(ig)<1.e-2) f0(ig)=1.e-2
    242241     enddo
     
    364363
    365364!------------------------------------------------------------------
    366 !  1. alim_star est le profil vertical de l'alimentation à la base du
    367 !     panache thermique, calculé à partir de la flotabilité de l'air sec
     365!  1. alim_star est le profil vertical de l'alimentation a la base du
     366!     panache thermique, calcule a partir de la flotabilite de l'air sec
    368367!  2. lmin et lalim sont les indices inferieurs et superieurs de alim_star
    369368!------------------------------------------------------------------
    370369!
    371370      entr_star=0. ; detr_star=0. ; alim_star=0. ; alim_star_tot=0.
    372       CALL thermcell_init(ngrid,nlay,ztv,zlay,zlev,  &
    373      &                    lalim,lmin,alim_star,alim_star_tot,lev_out)
    374 
    375 call test_ltherm(ngrid,nlay,pplev,pplay,lmin,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_init lmin  ')
    376 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_init lalim ')
    377 
    378 
    379       if (prt_level.ge.1) print*,'thermcell_main apres thermcell_init'
    380       if (prt_level.ge.10) then
    381          write(lunout1,*) 'Dans thermcell_main 1'
    382          write(lunout1,*) 'lmin ',lmin(igout)
    383          write(lunout1,*) 'lalim ',lalim(igout)
    384          write(lunout1,*) ' ig l alim_star thetav'
    385          write(lunout1,'(i6,i4,2e15.5)') (igout,l,alim_star(igout,l) &
    386      &   ,ztv(igout,l),l=1,lalim(igout)+4)
    387       endif
    388 
    389 !v1d      do ig=1,klon
    390 !v1d     if (alim_star(ig,1).gt.1.e-10) then
    391 !v1d     therm=.true.
    392 !v1d     endif
    393 !v1d      enddo
     371      lmin=1
     372
    394373!-----------------------------------------------------------------------------
    395374!  3. wmax_sec et zmax_sec sont les vitesses et altitudes maximum d'un
    396375!     panache sec conservatif (e=d=0) alimente selon alim_star
    397376!     Il s'agit d'un calcul de type CAPE
    398 !     zmax_sec est utilisé pour déterminer la géométrie du thermique.
     377!     zmax_sec est utilise pour determiner la geometrie du thermique.
    399378!------------------------------------------------------------------------------
    400 !
     379!---------------------------------------------------------------------------------
     380!calcul du melange et des variables dans le thermique
     381!--------------------------------------------------------------------------------
     382!
     383      if (prt_level.ge.1) print*,'avant thermcell_plume ',lev_out
     384!IM 140508   CALL thermcell_plume(ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz,  &
     385
     386! Gestion temporaire de plusieurs appels à thermcell_plume au travers
     387! de la variable iflag_thermals
     388
     389!      print*,'THERM thermcell_main iflag_thermals_ed=',iflag_thermals_ed
     390      if (iflag_thermals_ed<=9) then
     391!         print*,'THERM NOUVELLE/NOUVELLE Arnaud'
     392         CALL thermcell_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz,&
     393     &    zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot,  &
     394     &    lalim,f0,detr_star,entr_star,f_star,csc,ztva,  &
     395     &    ztla,zqla,zqta,zha,zw2,zw_est,ztva_est,zqsatth,lmix,lmix_bis,linter &
     396     &    ,lev_out,lunout1,igout)
     397
     398      elseif (iflag_thermals_ed>9) then
     399!        print*,'THERM RIO et al 2010, version d Arnaud'
     400         CALL thermcellV1_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz,&
     401     &    zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot,  &
     402     &    lalim,f0,detr_star,entr_star,f_star,csc,ztva,  &
     403     &    ztla,zqla,zqta,zha,zw2,zw_est,ztva_est,zqsatth,lmix,lmix_bis,linter &
     404     &    ,lev_out,lunout1,igout)
     405
     406      endif
     407
     408      if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out
     409
     410      call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')
     411      call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix  ')
     412
     413      if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume'
     414      if (prt_level.ge.10) then
     415         write(lunout1,*) 'Dans thermcell_main 2'
     416         write(lunout1,*) 'lmin ',lmin(igout)
     417         write(lunout1,*) 'lalim ',lalim(igout)
     418         write(lunout1,*) ' ig l alim_star entr_star detr_star f_star '
     419         write(lunout1,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) &
     420     &    ,f_star(igout,l+1),l=1,nint(linter(igout))+5)
     421      endif
     422
     423!-------------------------------------------------------------------------------
     424! Calcul des caracteristiques du thermique:zmax,zmix,wmax
     425!-------------------------------------------------------------------------------
     426!
     427      CALL thermcell_height(ngrid,nlay,lalim,lmin,linter,lmix,zw2,  &
     428     &           zlev,lmax,zmax,zmax0,zmix,wmax,lev_out)
     429! Attention, w2 est transforme en sa racine carree dans cette routine
     430! Le probleme vient du fait que linter et lmix sont souvent égaux à 1.
     431      wmax_tmp=0.
     432      do  l=1,nlay
     433         wmax_tmp(:)=max(wmax_tmp(:),zw2(:,l))
     434      enddo
     435!     print*,"ZMAX ",lalim,lmin,linter,lmix,lmax,zmax,zmax0,zmix,wmax
     436
     437
     438
     439      call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')
     440      call test_ltherm(ngrid,nlay,pplev,pplay,lmin ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin  ')
     441      call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix  ')
     442      call test_ltherm(ngrid,nlay,pplev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax  ')
     443
     444      if (prt_level.ge.1) print*,'thermcell_main apres thermcell_height'
     445
     446!-------------------------------------------------------------------------------
     447! Fermeture,determination de f
     448!-------------------------------------------------------------------------------
     449!
     450!
     451!!      write(lunout,*)'THERM NOUVEAU XXXXX'
    401452      CALL thermcell_dry(ngrid,nlay,zlev,pphi,ztv,alim_star,  &
    402      &                      lalim,lmin,zmax_sec,wmax_sec,lev_out)
     453    &                      lalim,lmin,zmax_sec,wmax_sec,lev_out)
    403454
    404455call test_ltherm(ngrid,nlay,pplev,pplay,lmin,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry  lmin  ')
     
    417468
    418469
    419 !---------------------------------------------------------------------------------
    420 !calcul du melange et des variables dans le thermique
    421 !--------------------------------------------------------------------------------
    422 !
    423       if (prt_level.ge.1) print*,'avant thermcell_plume ',lev_out
    424 !IM 140508   CALL thermcell_plume(ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz,  &
    425       CALL thermcell_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz,  &
    426      &           zlev,pplev,pphi,zpspsk,l_mix,r_aspect,alim_star,alim_star_tot,  &
    427      &           lalim,zmax_sec,f0,detr_star,entr_star,f_star,ztva,  &
    428      &           ztla,zqla,zqta,zha,zw2,zw_est,zqsatth,lmix,lmix_bis,linter &
    429      &            ,lev_out,lunout1,igout)
    430       if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out
    431 
    432       call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')
    433       call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix  ')
    434 
    435       if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume'
    436       if (prt_level.ge.10) then
    437          write(lunout1,*) 'Dans thermcell_main 2'
    438          write(lunout1,*) 'lmin ',lmin(igout)
    439          write(lunout1,*) 'lalim ',lalim(igout)
    440          write(lunout1,*) ' ig l alim_star entr_star detr_star f_star '
    441          write(lunout1,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) &
    442      &    ,f_star(igout,l+1),l=1,nint(linter(igout))+5)
    443       endif
    444 
    445 !-------------------------------------------------------------------------------
    446 ! Calcul des caracteristiques du thermique:zmax,zmix,wmax
    447 !-------------------------------------------------------------------------------
    448 !
    449       CALL thermcell_height(ngrid,nlay,lalim,lmin,linter,lmix,zw2,  &
    450      &           zlev,lmax,zmax,zmax0,zmix,wmax,lev_out)
    451 
    452 
    453       call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')
    454       call test_ltherm(ngrid,nlay,pplev,pplay,lmin ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin  ')
    455       call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix  ')
    456       call test_ltherm(ngrid,nlay,pplev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax  ')
    457 
    458       if (prt_level.ge.1) print*,'thermcell_main apres thermcell_height'
    459 
    460 !-------------------------------------------------------------------------------
    461 ! Fermeture,determination de f
    462 !-------------------------------------------------------------------------------
    463 !
    464 !avant closure: on redéfinit lalim, alim_star_tot et alim_star
    465 !       do ig=1,klon
    466 !       do l=2,lalim(ig)
    467 !       alim_star(ig,l)=entr_star(ig,l)
    468 !       entr_star(ig,l)=0.
    469 !       enddo
    470 !       enddo
    471 
     470
     471! Choix de la fonction d'alimentation utilisee pour la fermeture.
     472! Apparemment sans importance
     473      alim_star_clos(:,:)=alim_star(:,:)
     474      alim_star_clos(:,:)=entr_star(:,:)+alim_star(:,:)
     475
     476! Appel avec la version seche
    472477      CALL thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho,  &
    473      &   zlev,lalim,alim_star,alim_star_tot,zmax_sec,wmax_sec,zmax,wmax,f,lev_out)
     478     &   zlev,lalim,alim_star_clos,f_star,zmax_sec,wmax_sec,f,lev_out)
     479
     480!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     481! Appel avec les zmax et wmax tenant compte de la condensation
     482! Semble moins bien marcher
     483!     CALL thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho,  &
     484!    &   zlev,lalim,alim_star,f_star,zmax,wmax,f,lev_out)
     485!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    474486
    475487      if(prt_level.ge.1)print*,'thermcell_closure apres thermcell_closure'
     
    484496! Test valable seulement en 1D mais pas genant
    485497      if (.not. (f0(1).ge.0.) ) then
    486            stop 'Dans thermcell_main'
     498              abort_message = '.not. (f0(1).ge.0.)'
     499              CALL abort_gcm (modname,abort_message,1)
    487500      endif
    488501
     
    511524         fm0=(1.-lambda)*fm+lambda*fm0
    512525         entr0=(1.-lambda)*entr+lambda*entr0
    513 !        detr0=(1.-lambda)*detr+lambda*detr0
     526         detr0=(1.-lambda)*detr+lambda*detr0
    514527      else
    515528         fm0=fm
     
    560573     &    ,fraca,zmax  &
    561574     &    ,zu,zv,pduadj,pdvadj,zua,zva,lev_out)
    562 !IM 050508    &    ,zu,zv,pduadj,pdvadj,zua,zva,igout,lev_out)
     575
    563576      else
    564577
     
    596609      pcon(ig)=pplay(ig,1)*(zo(ig,1)/zqsat(ig,1))**CHI
    597610      enddo
    598       do k=1,nlay
     611!IM   do k=1,nlay
     612      do k=1,nlay-1
    599613         do ig=1,ngrid
    600614         if ((pcon(ig).le.pplay(ig,k))  &
     
    603617         endif
    604618         enddo
     619      enddo
     620!IM
     621      do ig=1,ngrid
     622        if (pcon(ig).le.pplay(ig,nlay)) then
     623           zcon2(ig)=zlay(ig,nlay)-(pcon(ig)-pplay(ig,nlay))/(RG*rho(ig,nlay))/100.
     624           abort_message = 'thermcellV0_main: les thermiques vont trop haut '
     625           CALL abort_gcm (modname,abort_message,1)
     626        endif
    605627      enddo
    606628      if (prt_level.ge.1) print*,'14b OK convect8'
     
    636658!
    637659      if (prt_level.ge.10) print*,'14f OK convect8 ig,l,zha zh zpspsk ',ig,l,zha(ig,l),zh(ig,l),zpspsk(ig,l)
    638             thetath2(ig,l)=zf2*(zha(ig,l)-zh(ig,l)/zpspsk(ig,l))**2
     660            thetath2(ig,l)=zf2*(ztla(ig,l)-zthl(ig,l))**2
    639661            if(zw2(ig,l).gt.1.e-10) then
    640662             wth2(ig,l)=zf2*(zw2(ig,l))**2
     
    651673         enddo
    652674      enddo
    653 !calcul de ale_bl et alp_bl
    654 !pour le calcul d'une valeur intégrée entre la surface et lmax
    655       do ig=1,ngrid
    656       alp_int(ig)=0.
    657       ale_int(ig)=0.
    658       n_int(ig)=0
    659       enddo
    660 !
    661       do l=1,nlay
    662       do ig=1,ngrid
    663        if(l.LE.lmax(ig)) THEN
    664         alp_int(ig)=alp_int(ig)+0.5*rhobarz(ig,l)*wth3(ig,l)
    665         ale_int(ig)=ale_int(ig)+0.5*zw2(ig,l)**2
    666         n_int(ig)=n_int(ig)+1
    667        endif
    668       enddo
    669       enddo
     675!calcul des flux: q, thetal et thetav
     676      do l=1,nlay
     677         do ig=1,ngrid
     678      wq(ig,l)=fraca(ig,l)*zw2(ig,l)*(zqta(ig,l)*1000.-po(ig,l)*1000.)
     679      wthl(ig,l)=fraca(ig,l)*zw2(ig,l)*(ztla(ig,l)-zthl(ig,l))
     680      wthv(ig,l)=fraca(ig,l)*zw2(ig,l)*(ztva(ig,l)-ztv(ig,l))
     681         enddo
     682      enddo
     683!
    670684!      print*,'avant calcul ale et alp'
    671685!calcul de ALE et ALP pour la convection
    672       do ig=1,ngrid
    673 !      Alp_bl(ig)=0.5*rhobarz(ig,lmix_bis(ig))*wth3(ig,lmix(ig))
    674 !          Alp_bl(ig)=0.5*rhobarz(ig,nivcon(ig))*wth3(ig,nivcon(ig))
    675 !      Alp_bl(ig)=0.5*rhobarz(ig,lmix(ig))*wth3(ig,lmix(ig))
    676 !     &           *0.1
    677 !valeur integree de alp_bl * 0.5:
    678        if (n_int(ig).gt.0) then
    679        Alp_bl(ig)=0.5*alp_int(ig)/n_int(ig)
    680 !       if (Alp_bl(ig).lt.0.) then
    681 !       Alp_bl(ig)=0.
    682        endif
    683 !       endif
    684 !         write(18,*),'rhobarz,wth3,Alp',rhobarz(ig,nivcon(ig)),
    685 !     s               wth3(ig,nivcon(ig)),Alp_bl(ig)
    686 !            write(18,*),'ALP_BL',Alp_bl(ig),lmix(ig)
    687 !      Ale_bl(ig)=0.5*zw2(ig,lmix_bis(ig))**2
    688 !      if (nivcon(ig).eq.1) then
    689 !       Ale_bl(ig)=0.
    690 !       else
    691 !valeur max de ale_bl:
    692        Ale_bl(ig)=0.5*zw2(ig,lmix(ig))**2
    693 !     & /2.
    694 !     & *0.1
    695 !        Ale_bl(ig)=0.5*zw2(ig,lmix_bis(ig))**2
    696 !       if (n_int(ig).gt.0) then
    697 !       Ale_bl(ig)=ale_int(ig)/n_int(ig)
    698 !        Ale_bl(ig)=4.
    699 !       endif
    700 !       endif
    701 !            Ale_bl(ig)=0.5*wth2(ig,lmix_bis(ig))
    702 !          Ale_bl(ig)=wth2(ig,nivcon(ig))
    703 !          write(19,*),'wth2,ALE_BL',wth2(ig,nivcon(ig)),Ale_bl(ig)
    704       enddo
     686      Alp_bl(:)=0.
     687      Ale_bl(:)=0.
     688!          print*,'ALE,ALP ,l,zw2(ig,l),Ale_bl(ig),Alp_bl(ig)'
     689      do l=1,nlay
     690      do ig=1,ngrid
     691           Alp_bl(ig)=max(Alp_bl(ig),0.5*rhobarz(ig,l)*wth3(ig,l) )
     692           Ale_bl(ig)=max(Ale_bl(ig),0.5*zw2(ig,l)**2)
     693!          print*,'ALE,ALP',l,zw2(ig,l),Ale_bl(ig),Alp_bl(ig)
     694      enddo
     695      enddo
     696
     697!     print*,'AAAAAAA ',Alp_bl,Ale_bl,lmix
     698
     699
     700! TEST. IL FAUT REECRIRE LES ALE et ALP
     701!     Ale_bl(:)=0.5*wmax(:)*wmax(:)
     702!     Alp_bl(:)=0.1*wmax(:)*wmax(:)*wmax(:)
     703
    705704!test:calcul de la ponderation des couches pour KE
    706705!initialisations
     
    782781!     print*,'15 OK convect8'
    783782
     783#ifdef wrgrads_thermcell
    784784      if (prt_level.ge.1) print*,'thermcell_main sorties 3D'
    785 #ifdef wrgrads_thermcell
    786785#include "thermcell_out3d.h"
    787786#endif
     
    791790      if (prt_level.ge.1) print*,'thermcell_main FIN  OK'
    792791
    793 !     if(icount.eq.501) stop'au pas 301 dans thermcell_main'
    794792      return
    795793      end
     
    827825                  write(6,'(i3,7f10.3)') k,pplay(i,k),ztv(i,k),1000*po(i,k),ztva(i,k),1000*zqla(i,k),f_star(i,k),zw2(i,k)
    828826               enddo
    829 !              stop
    830827           endif
    831828         enddo
Note: See TracChangeset for help on using the changeset viewer.