Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9219)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9220)
@@ -60,4 +60,12 @@
    * mraw/MRawRunHeader.h:
      - allow to validate the magic-number from outside (for MCs)
+
+   * datacenter/scripts/runcorsika:
+     - added a lot of comments
+     - reordered values in input card
+     - switched off a lot of obsolete output
+     - changed the Magnetic field to a value corresponding to the location of
+       MAGIC at 2200m height valid for January 2009. (The old value never took
+       place there?!) The value was taken from www.noaa.gov/geomagmodels
 
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/runcorsika
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcorsika	(revision 9219)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcorsika	(revision 9220)
@@ -35,41 +35,67 @@
 set -C
 
+export FLUPRO=$corsikapath'/fluka2008_3'
+
 # printing input card to stdout
 function printinputcard()
 {
+   # Run number
    echo "RUNNR "$corsikarunno
+   # Starting event number
+   echo "EVTNR 1"
+   # Number of simulated events
+   echo "NSHOW "$numevts
+   # Seed values for simulation
+   echo "SEED "$seed1" 0 0 "
+   echo "SEED "$seed2" 0 0 "
+   echo "SEED "$seed3" 0 0 "
+   # Primary particle
    echo "PRMPAR "$primparticle
    echo "ERANGE "$erange
-   echo "EVTNR 1"
-   echo "NSHOW "$numevts
    echo "ESLOPE "$slope
+   # Simulation range (theta, phi, view cone, starting altitude)
    echo "THETAP "$zdrange
    echo "PHIP "$azrange
    echo "VIEWCONE 0. "$viewconemax
-   echo "DIRECT "$outpath
-   echo "SEED "$seed1" 0 0 "
-   echo "SEED "$seed2" 0 0 "
-   echo "SEED "$seed3" 0 0 "
+   echo "FIXCHI "$startalt
+   # Observation level, magnetic field, atmosphere
    echo "OBSLEV 2200.E2"
+   # From www.noaa.gov/geomagmodels roughly for January 2009. (was 29.5 and 23.0)
+   echo "MAGNET 30.3 24.1"
+   # Atmosphere
+   echo "ATMOSPHERE 11 T"
+   # Other parameters
    echo "RADNKG 200.E2"
-   echo "MAGNET 29.5 23.0"
    echo "ECUTS 0.3 0.3 0.02 0.02"
-   echo "MUADDI F"
-   echo "MUMULT T"
-   echo "LONGI T 10. T F"
-   echo "MAXPRT 0"
    echo "ECTMAP 1.E4"
    echo "STEPFC 0.1"
-   echo "DEBUG F 6 F 1000000"
+   # Don't add muon particle data to output
+   echo "MUADDI F"
+   # Enable muon multiple scattering
+   echo "MUMULT T"
+   # Cherenkov telescope options
    echo "CWAVLG 290. 600."
    echo "CSCAT "$reuse" 0. "$impactmax
    echo "CERSIZ 1."
    echo "CERFIL T"
-   echo "FIXCHI "$startalt
-   echo "DATBAS F"
    echo "CERTEL 1"
    echo " 0. 0. 0. 0. 0. "$diameter" 1700."
+   # How the longitudinal shower development is sampled
+   # echo "LONGI T 10. T F"
+   echo "LONGI F 20 0 F F"
+   # Maximum number of detailed particles to print
+   echo "MAXPRT 0"
+   # Suppress file with partciles reaching ground (DATnnnnnn)
+   echo "PAROUT F F"
+   # Don't write a database file
+   echo "DATBAS F"
+   # Switch off all debugging output
+   echo "DEBUG F 6 F 1000000"
+   # Output path
+   echo "DIRECT "$outpath
+   # User and host (for convinience)
    echo "USER "`whoami`
-   echo "ATMOSPHERE 11 T"
+   echo "HOST "`hostname`
+   # End of input card
    echo "EXIT"
 }
@@ -111,4 +137,5 @@
 query="SELECT fZenithDistanceMin, fZenithDistanceMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno
 zdrange=`sendquery`
+# Change from the MARS definition (Az=90 -> East) to Corsika (Az=90 -> West)
 query="SELECT 180-fAzimuthMin, 180-fAzimuthMax FROM MCCorsikaRunData where fCorsikaRunNumber="$corsikarunno
 azrange=`sendquery`
