Ignore:
Timestamp:
Mar 24, 2010, 1:41:35 PM (14 years ago)
Author:
idelkadi
Message:

Optimisation des thermiques

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/thermcell_flux2.F90

    r1299 r1330  
    4141      REAL zfm
    4242
    43       integer igout
     43      integer igout,lout
    4444      integer lev_out
    4545      integer lunout1
     
    4949      REAL fomass_max,alphamax
    5050      save fomass_max,alphamax
     51
     52      logical check_debug,labort_gcm
    5153
    5254      character (len=20) :: modname='thermcell_flux2'
     
    8486! Verification de la nullite des entrainement et detrainement au dessus
    8587! de lmax(ig)
    86 !-------------------------------------------------------------------------
    87 
     88! Active uniquement si check_debug=.true. ou prt_level>=10
     89!-------------------------------------------------------------------------
     90
     91      check_debug=.false..or.prt_level>=10
     92
     93      if (check_debug) then
    8894      do l=1,klev
    8995         do ig=1,ngrid
     
    102108                    print*,'detr_star(ig,l)',detr_star(ig,l)
    103109                    abort_message = ''
     110                    labort_gcm=.true.
    104111                    CALL abort_gcm (modname,abort_message,1)
    105112               endif
     
    107114         enddo
    108115      enddo
     116      endif
    109117
    110118!-------------------------------------------------------------------------
     
    259267
    260268!     do l=1,klev
     269
     270
     271
     272         labort_gcm=.false.
    261273         do ig=1,ngrid
    262274            if (entr(ig,l)<0.) then
    263                print*,'N1 ig,l,entr',ig,l,entr(ig,l)
    264                abort_message = 'entr negatif'
    265                CALL abort_gcm (modname,abort_message,1)
    266             endif
     275               labort_gcm=.true.
     276               igout=ig
     277               lout=l
     278            endif
     279         enddo
     280
     281         if (labort_gcm) then
     282            print*,'N1 ig,l,entr',igout,lout,entr(igout,lout)
     283            abort_message = 'entr negatif'
     284            CALL abort_gcm (modname,abort_message,1)
     285         endif
     286
     287         do ig=1,ngrid
    267288            if (detr(ig,l).gt.fm(ig,l)) then
    268289               ncorecfm6=ncorecfm6+1
     
    287308               entr(ig,l)=0.
    288309            endif
    289 
     310         enddo
     311
     312         labort_gcm=.false.
     313         do ig=1,ngrid
    290314            if (entr(ig,l).lt.0.) then
    291                print*,'ig,l,lmax(ig)',ig,l,lmax(ig)
    292                print*,'entr(ig,l)',entr(ig,l)
    293                print*,'fm(ig,l)',fm(ig,l)
    294                abort_message = 'probleme dans thermcell flux'
    295                CALL abort_gcm (modname,abort_message,1)
    296             endif
    297          enddo
     315               labort_gcm=.true.
     316               igout=ig
     317            endif
     318         enddo
     319         if (labort_gcm) then
     320            ig=igout
     321            print*,'ig,l,lmax(ig)',ig,l,lmax(ig)
     322            print*,'entr(ig,l)',entr(ig,l)
     323            print*,'fm(ig,l)',fm(ig,l)
     324            abort_message = 'probleme dans thermcell flux'
     325            CALL abort_gcm (modname,abort_message,1)
     326         endif
     327
     328
    298329!     enddo
    299330      endif
     
    313344               detr(ig,l)=detr(ig,l)+fm(ig,l+1)
    314345               fm(ig,l+1)=0.
    315 !              print*,'fm2<0',l+1,lmax(ig)
    316346               ncorecfm2=ncorecfm2+1
    317347            endif
     348         enddo
     349
     350         labort_gcm=.false.
     351         do ig=1,ngrid
    318352            if (detr(ig,l).lt.0.) then
     353               labort_gcm=.true.
     354               igout=ig
     355            endif
     356        enddo
     357        if (labort_gcm) then
     358               ig=igout
    319359               print*,'cas 2 : ig,l,lmax(ig)',ig,l,lmax(ig)
    320360               print*,'detr(ig,l)',detr(ig,l)
     
    322362               abort_message = 'probleme dans thermcell flux'
    323363               CALL abort_gcm (modname,abort_message,1)
    324             endif
    325         enddo
     364        endif
    326365!    enddo
    327366
     
    388427
    389428      if (1.eq.1) then
     429      labort_gcm=.false.
    390430      do l=1,klev-1
    391431         do ig=1,ngrid
     
    408448                   else
    409449                      if(l.ge.lmax(ig).and.0.eq.1) then
     450                         igout=ig
     451                         lout=l
     452                         labort_gcm=.true.
     453                      endif
     454                      entr(ig,l+1)=entr(ig,l+1)-ddd
     455                      detr(ig,l)=0.
     456                      fm(ig,l+1)=fm(ig,l)+entr(ig,l)
     457                      detr(ig,l)=0.
     458                   endif
     459                endif
     460            endif
     461         enddo
     462      enddo
     463      if (labort_gcm) then
     464                         ig=igout
     465                         l=lout
    410466                         print*,'ig,l',ig,l
    411467                         print*,'eee0',eee0
     
    424480                         abort_message = 'probleme dans thermcell_flux'
    425481                         CALL abort_gcm (modname,abort_message,1)
    426                       endif
    427                       entr(ig,l+1)=entr(ig,l+1)-ddd
    428                       detr(ig,l)=0.
    429                       fm(ig,l+1)=fm(ig,l)+entr(ig,l)
    430                       detr(ig,l)=0.
    431                    endif
    432                 endif
    433             endif
    434          enddo
    435       enddo
     482      endif
    436483      endif
    437484!                 
Note: See TracChangeset for help on using the changeset viewer.