Index: trunk/MagicSoft/Simulation/Detector/Reflector/attenu.f
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/attenu.f	(revision 397)
+++ trunk/MagicSoft/Simulation/Detector/Reflector/attenu.f	(revision 398)
@@ -39,4 +39,6 @@
       real trr, trm, tro
       REAL LONG(12)
+c fs define obervation level
+      double precision obslev      
       INTEGER I,CON_OZ,CON_MI J, ROW
 
@@ -275,5 +277,7 @@
       DATA BATM / 1222.6562D0,1144.9069D0,1305.5948D0,540.1778D0,0.D0  /
       DATA CATM / 994186.38D0,878153.55D0,636143.04D0,772170.16D0,1.D-9/
-      DATA LAHG / 2000.0D2,4.0D5,1.0D6,4.0D6,1.0D7 /
+c fs 190400 unterster Layer ist 2200.d0 (observation level)
+c      DATA LAHG / 2000.0D2,4.0D5,1.0D6,4.0D6,1.0D7 /  
+      DATA LAHG / 2200.0D2,4.0D5,1.0D6,4.0D6,1.0D7 /
       DATA Lm /3.70D5,3.85D5,4.0D5,4.17D5,4.17D5,4.35D5,5.0D5,5.56D5,
      + 5.99D5,6.33D5, 6.67D5,7.04D5 /
@@ -292,5 +296,7 @@
      +    650.0 /
       DATA PI / 3.141592654D0 /
-      PARAMETER (RT=6348.0D5)
+c fs 191999: take same Earth radius as in CORSIKA
+c      PARAMETER (RT=6348.0D5)
+      parameter (rt = 6371315.D2)
 
 ***********************************************************************
@@ -302,13 +308,19 @@
 ***********************************************************************
         
-
+c fs observation level at La Palma
+      parameter (obslev = 2200.d2)
+      
       T_Ray = 1.0
       T_Mie = 1.0
       T_Oz = 1.0
       
-      H = -RT + SQRT(RT**2 + (height/COS(theta))**2 +
-     +     (2.0D0*RT*height))
-
-      ROW = AINT(((H+1.)/1.0E5))
+c fs : hier fehler: hoehe mit obslev = 0. !!!!
+c      H = -RT + SQRT(RT**2 + (height/COS(theta))**2 +
+c     +     (2.0D0*RT*height))
+      h = -rt + sqrt((rt+obslev)**2 +
+     +     ((height-obslev)/cos(theta))**2 +
+     +     (2.0d0*(rt+obslev)*(height-obslev)))
+
+      ROW = AINT(((H+1.)/1.0E5))      
               
 ***********************************************************************
@@ -316,7 +328,9 @@
 *     LARGE ZENITH ANGLE FACTOR (AIR MASS):
       
-      
-      m= (1.D0/H)*(SQRT((RT*COS(theta))**2+(2*RT*H)+H**2)-
-     +     (RT*COS(theta)))
+c fs : Korrekturfaktor fuer falsche Hoehe richtig???
+c (H is hier 'wahre Hoehe'; oben: height: apparent height)
+c aber: fuer curved-version nicht noetig => raus      
+c      m= (1.D0/H)*(SQRT((RT*COS(theta))**2+(2*RT*H)+H**2)-
+c     +     (RT*COS(theta)))
 **********************************************************************   
           
@@ -341,6 +355,8 @@
         ENDIF
  91   CONTINUE
-
- 92   RHO_FI = m*RHOTOT
+ 
+c fs : curved-version => kein m-Faktor!
+c 92   RHO_FI = m*RHOTOT
+ 92   rho_fi = rhotot
 
       T_Ray = EXP(-(RHO_FI/XR)*(400.D0/wavelength)**4)
@@ -379,5 +395,7 @@
           GOTO 1001
         ENDIF
-        T_Mie =  EXP(-(m*TOT_AE))    
+c fs : curved-version => kein m-Faktor!
+c        T_Mie =  EXP(-(m*TOT_AE))
+        t_mie =  exp(-(tot_ae))           
 
 
@@ -404,6 +422,8 @@
         GOTO 2001
       ENDIF
-
-      T_Oz = EXP(-(m*TOT_OZ))         
+      
+c fs : curved-version => kein m-Faktor!
+c      T_Oz = EXP(-(m*TOT_OZ))
+      t_oz = exp(-(tot_oz))        
 
 ************************************************************************
