        subroutine SOLFCT(TIME,YTEMP,GLOLIT)
        real TIME, GLOLIT, YTEMP, BEAM, XTES, REFANG, TEMANG
        real S1,S2,T1,T2,REFLEC,EXPARG,EXPAR2,SKYLIT
        real XMU, XMU2, XMUI(3), ZENANG, SLAMTH, PHI
      include 'SOLAR.INC'
        data XTES/87.0/
      XMU = SLSD+CLCD*cos(TIME/13751.)
      if (XMU.lt.0.0) XMU = 0.0
      ZENANG = acos(XMU)
      REFANG = asin(sin(ZENANG)/REFIND(LAMBDA))
      if (ZENANG.lt.0.0017) go to 100
      TEMANG = abs(1.571-(ZENANG+REFANG))
      if (TEMANG.lt.0.0017) go to 110
      S1 = sin(ZENANG-REFANG)
      S2 = sin(ZENANG+REFANG)
      T1 = tan(ZENANG-REFANG)
      T2 = tan(ZENANG+REFANG)
      REFLEC = (abs(((S1*S1)/(S2*S2))+((T1*T1)/(T2*T2))))/2.
      go to 120
100   continue
      REFLEC = REFRAT
      go to 120
110   continue
      REFLEC = BREW
120   continue
      XMU2 = XMU*XMU
      XMUI(1) = sqrt((XMU2+1.8E-03)/1.0018)
      XMUI(2) = sqrt((XMU2+3.0E-04)/1.0003)
      XMUI(3) = sqrt((XMU2+7.4E-03)/1.0074)
      EXPARG = RAYDEP(LAMBDA)/XMUI(1)+AERDEP(LAMBDA)/XMUI(2)+
     &   OZDEP(LAMBDA)/XMUI(3)
      if (EXPARG.le.XTES) then
         BEAM = XMU*HLAM(LAMBDA)*exp(-EXPARG)
      else
         BEAM = 0.0
      endif
      BEAM = BEAM*(1.0-REFLEC)
      PHI = sqrt((1.+TTEE)/(XMU2+TTEE))-1.0
      EXPARG = abs(G3T3*PHI)
      EXPAR2 = abs(GT1GT2*PHI)
      if (EXPAR2.gt.XTES) then
         SLAMTH = 0.0
      elseif (EXPARG.gt.XTES) then
         SLAMTH = EFF*exp(GT1GT2*PHI)
      else
         SLAMTH = (EFF+ONEFF*exp(G3T3*PHI))*exp(GT1GT2*PHI)
      endif
      SKYLIT = (0.934/(1.0-0.066*AIREFL))*EMMHI*SLAMTH
      GLOLIT = BEAM+SKYLIT
      return
      end
