Ignore:
Timestamp:
Oct 5, 2017, 12:15:17 PM (7 years ago)
Author:
jvatant
Message:

+ Found a bug for the limit cases in disr_haze leading to uninit. value.

Fixed by init to zero but should be relooked at.

+ Also added omp instructions in disr_haze
--JVO

Location:
trunk/LMDZ.TITAN/libf/phytitan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/phytitan/disr_haze.F90

    r1681 r1792  
    3232real*8              :: tmp_p, fact_t
    3333integer,parameter   :: nbwl_PL=328, nblev_PL=162
    34 real*8,save         :: ext_PL(nblev_PL,nbwl_PL), ssa_PL(nblev_PL,nbwl_PL)
    35 real*8,save         :: asf_PL(nblev_PL,nbwl_PL)
     34real*8,save         :: ext_PL(nblev_PL,nbwl_PL), ssa_PL(nblev_PL,nbwl_PL), asf_PL(nblev_PL,nbwl_PL)
    3635real*8,save         :: wl_PL(nbwl_PL), press_PL(nblev_PL)
    3736logical,save        :: firstcall=.true.
    3837character(len=15)   :: dummy
     38
     39!$OMP THREADPRIVATE(ext_PL,ssa_PL,asf_PL,wl_PL,press_PL,firstcall)
    3940
    4041if (firstcall) then
     
    130131     fact_t = log10( ( ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1)  *factw )   &
    131132           / ( ext_PL(ip-5,iw)*(1.-factw) + ext_PL(ip-5,iw+1)  *factw ) )
     133           
     134     taeros = ext_PL(ip,iw)*(1.-factw) + ext_PL(ip,iw+1)  *factw
    132135
    133136  else if (iw.eq.nbwl_PL) then
    134137
    135      fact_t = log10( ext_PL(ip,iw) / ext_PL(ip-5,iw) ) 
     138     fact_t = log10( ext_PL(ip,iw) / ext_PL(ip-5,iw) )
     139   
     140     taeros = ext_PL(ip,iw)
    136141
    137142  endif
  • trunk/LMDZ.TITAN/libf/phytitan/optci.F90

    r1788 r1792  
    8686  ENDIF
    8787
     88  ! Some initialisation beacause there's a pb with disr_haze at the limits (nw=1)
     89  ! I should check this - For now we set vars to zero : better than nans - JVO 2017
     90 
     91  dhaze_t(:,:) = 0.
     92  ssa_t(:,:) = 0.
     93  asf_t(:,:) = 0.
     94
    8895  !=======================================================================
    8996  !     Determine the total gas opacity throughout the column, for each
  • trunk/LMDZ.TITAN/libf/phytitan/optcv.F90

    r1788 r1792  
    9494      indv = -9999 ! this initial value means "to be calculated"
    9595  ENDIF
     96 
     97  ! Some initialisation beacause there's a pb with disr_haze at the limits (nw=1)
     98  ! I should check this - For now we set vars to zero : better than nans - JVO 2017
     99 
     100  dhaze_t(:,:) = 0.
     101  ssa_t(:,:) = 0.
     102  asf_t(:,:) = 0.
     103
    96104
    97105  !=======================================================================
     
    135143
    136144        !================= Titan customisation ========================================
    137         call disr_haze(dz(k),plev(k),wnov(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
     145        call disr_haze(dz(k),plev(k),wnov(nw),dhaze_T(k,nw),SSA_T(k,nw),ASF_T(k,nw))
    138146        ! =============================================================================
    139 
     147         
    140148        DRAYAER = TRAY(K,NW)
    141149        !     DRAYAER is Tau RAYleigh scattering, plus AERosol opacity
Note: See TracChangeset for help on using the changeset viewer.