   program VerificaInterVert
   
    PARAMETER (LM=50,LSM=39)
    PARAMETER (LMP1=LM+1)
    REAL, DIMENSION(LSM) :: SPL,ALSL
    REAL, DIMENSION(LMP1):: PINT,ALPINT
    REAL, DIMENSION(LM)  :: deta
    REAL, DIMENSION(LMP1):: eta, aeta
    REAL, DIMENSION(LMP1):: T
    


    DATA SPL/5000.,7500.,10000.,12500.,15000.,17500.,20000.,22500.,25000.,&
    &      27500.,30000.,32500.,35000.,37500.,40000.,42500.,45000.,&
    &      47500.,50000.,52500.,55000.,57500.,60000.,62500.,65000.,&
    &      67500.,70000.,72500.,75000.,77500.,80000.,82500.,85000.,&
    &      87500.,90000.,92500.,95000.,97500.,100000./

    DATA PINT/5000.00,7713.393,10479.19,13318.53,16196.39,19019.84,21678.06,24109.97,26346.11,28490.18,	&
    &         30664.55,32961.47,35417.10,38011.51,40694.04,43415.94,46146.71,48871.31,51581.95,54273.73,&	
    &         56943.17,59586.16,62193.09,64741.83,67196.20,69518.96,71693.60,73734.13,75672.07,77535.41,&
    &	      79338.59,81085.34,82774.88,84405.42,85975.26,87482.69,88926.02,90303.88,91615.39,92859.77,&
    &	      94035.88,95142.33,96178.83,97148.16,98054.84,98896.50,99652.51,100285.4,100763.4,101091.1,&
    &	      101591.1/
   data deta/ 0.201415E-01, 0.210907E-01, 0.219718E-01, 0.227857E-01, 0.235329E-01, 0.242142E-01, 0.248303E-01,&
 &	      0.226906E-01, 0.258698E-01, 0.262946E-01, 0.266570E-01, 0.269578E-01, 0.271976E-01, 0.273773E-01,&
 &	      0.274973E-01, 0.275588E-01, 0.275619E-01, 0.275078E-01, 0.273970E-01, 0.272303E-01, 0.270083E-01,&
 &	      0.267318E-01, 0.264013E-01, 0.260180E-01, 0.255821E-01, 0.250945E-01, 0.245560E-01, 0.239673E-01,&
 &	      0.233290E-01, 0.226418E-01, 0.219064E-01, 0.211238E-01, 0.202943E-01, 0.194189E-01, 0.184982E-01,&
 &	      0.175329E-01, 0.165238E-01, 0.154715E-01, 0.143768E-01, 0.132403E-01, 0.120628E-01, 0.108451E-01,&
 &	      0.958769E-02, 0.829146E-02, 0.695703E-02, 0.558521E-02, 0.417650E-02, 0.273187E-02, 0.125181E-02,&
 &	      0.242859E-02/

    T(LMP1)=300.
    do i=LMP1-1,1,-1
      T(i)=T(i+1)-2.
    enddo
    PDSL=1020.00
    LSL=LSM
    !*** COMPUTE ETA AND AETA
    ETA(1)=0.0
    DO L=2,LMP1
        if (L == 2) write(6,*) 'L, DETA(L-1), ETA(L-1): ',L, DETA(L-1), ETA(L-1)
        ETA(L)=ETA(L-1)+DETA(L-1)
    END DO
    DO L=1,LM
        AETA(L)=0.5*(ETA(L)+ETA(L+1))
    ENDDO
           LMA=LM
	
            LMAP1=LMA+1
	
            PPDSL=PDSL

        DO 310 L=1,LSL
	  ALSL(L) = ALOG(SPL(L))
	  print*,L,SPL(L),ALOG(SPL(L))
	  TRF=2*ALSL(L)
	
 		
            DO 170 IL=2,LMAP1
	       ALPINT(IL)=ALOG(PINT(IL))
!	       PRINT*,L,IL,(ALSL(L)-ALPINT(IL))
               IF((ALSL(L)-ALPINT(IL)).GT.0.)GO TO 170
               NL1X=IL
               GO TO 180
  170       CONTINUE
            NL1X=LMAP1
  180     CONTINUE
	   PRINT*,L,NL1X
       IF ((TRF-ALPINT(NL1X)-ALPINT(NL1X-1)).LE.0.) NL1X=NL1X-1
           		
           A=T(NL1X)*(((ALOG(PINT(NL1X-1)))**2)-((ALOG(SPL(L)))**2))
           B=T(NL1X-1) *(((ALOG(SPL(L)))**2)-((ALOG(PINT(NL1X)))**2))
           C=A+B
           D=((ALOG(PINT(NL1X-1)))**2)-((ALOG(PINT(NL1X)))**2)
           TSL=C/D      
        print*,"SPL(L):",SPL(L),"PINT(NL1X):",PINT(NL1X),T(NL1X),T(NL1X-1),"TSL: ",TSL
	
  310    CONTINUE	
	
  end program VerificaInterVert
	
	
	
