This page was automatically generated by NetLogo 4.1.3.

The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site.


WHAT IS IT?

This model tries to give a realistic demonstration how fire can spread. The research area is Ramlieh in Central Lebanon.


HOW IT WORKS

The model is based on a formula for the rate of spread of fire. The relevant parameters are either represented by the data loaded with the GIS-Extension or can be adjusted by the sliders in the interface. Due to the fact that NetLogo is not able to work with speed in the common sense, the programm implemented uses an inverse of the adjusted rate of spread and the wait function to give a realistic approach.


HOW TO USE IT

The use of the sliders is self-explanatory. The adjusted parameters influence the AROS (Adjusted Rate Of Spread) directly. You can read the AROS of each patch in the Command center. The Dead_Fuel_Moisture_Nighttime-Chooser is only relevant in the time period between 20.00 and 08.00.
The yellow lines in the Graphic Window show the different Fuel_Model_Types, it is also used to set the border of the research area (Ramlieh); fire can't spread across this border.


THINGS TO NOTICE

ATTENTION - Setup can last a while !!!
Due to the fact, that the wait- function is an observer own, the realistic approach of giving each turtle his own patch-related AROS doesn't work. That's why you will see straight lines of fire spread and simultaneaous movements.


THINGS TO TRY

The most worthwhile use of the models seems to activate the 'Take_same_positions'- Button and to adjust the Sliders at your own whim.


EXTENDING THE MODEL

The problems mentioned before could'nt be solved. By changing let_turtles_move to let_turtles_move_1 in the go_turtles procedures you see another try of giving a realistic fire spread character. So the most worthwhile way of extending the model seems to change relevant commands in the go_turtles and the let_turtles_move submodels to solve existing problems.


NETLOGO FEATURES

The model uses the Matrix-Extension to import and work with the relevant parameters in the mentioned ways.
Furthermore the GIS-Extension was used to load the relevant Raster- and Vectordata.


CREDITS AND REFERENCES

The model was written by Wolfgang Obermeier and Nora Schmid

The GIS-Data was provided by the Association for Forests, Development & Conservation (AFDC) in Lebanon
The base for the Fire-Behavement is given by Jenkins M. (2008): http://ocw.usu.edu/Forest__Range__and_Wildlife_Sciences/Wildland_Fire_ Management_and_Planning/Field_Guide.html


powered by NetLogo

view/download model file: fire.nlogo

PROCEDURES


;; ------------------------------------------
;; ------------------------------------------
;; ---- Modell zur Ausbreitung von Feuer ----
;; ------------------------------------------
;; ------------------------------------------





;; ------------------------------
;; ------------------------------
;; ----      Variablen       ----
;; ------------------------------
;; ------------------------------



extensions  [ gis matrix ]

breed       [ fires fire ]
breed       [ embers ember ]
breed       [ burneds burned ]

turtles-own [  ]                            ; ---> Ausbreitungsgeschwindigkeit

patches-own [ FuelModel                     ; ---> Fuel_Model (durch Vegetation klassifiziert)
              ausschluss                    ; ---> Ausschluss (durch Landnutzung klassifiziert)
              Slope_Percent                 ; ---> Slope_Percent (ausgehend von DGM in 5%-Klassen)
              windcorrection                ; ---> Korrekturfaktor f�r Windgeschwindigkeit (ausgehend von FuelModel)
              elevation                     ; ---> H�henmodell (DGM-Daten)
              aspect                        ; ---> H�henmodell (ausgehend von DGM-Daten - 0 = Nord, 1 = Ost, 2 = S�d, 3 = West)
              shade                         ; ---> Beschattung (ausgehend von Vegetationstypen klassifiziert)
              risiko                        ; ---> Feuerrisiko (ausgehend von historischen Daten �ber Brandh�ufigkeit)
              risikovalue                   ; ---> Hilfswert f�r Untersuchungsgebietausschluss
              Hintergrund                   ; ---> Wert des "Echtfarbenkomposits"
               ]                      
              
globals     [ RealImage-dataset
              Elevation-dataset
              FuelModel-dataset
              Shaded-dataset
              Firerisk-dataset
              Ausschluss-dataset
              Aspect-dataset
              Slope-dataset
              Slope_Factor
              Wind_Factor 
              midflame_windspeed
              Dead_Fuel_Correction
              Uhrzeit1
              aspect1
              FuelModel1
              Dead_Fuel_Moisture
              Live_Fuel_Moisture
              AROS
              ROS
              turtle-data
              fire-count
              burneds-count
              ember-count
               ]
          


 
;; ------------------------------
;; ------------------------------
;; ----    Setup-Prozedur    ----
;; ------------------------------
;; ------------------------------ 
         

to setup
 
  clear-all                                                                                          ; l�scht s�mtliche Inhalte
 
  write "This model tries to give a realistic demonstration how fire can spread. The research area is Ramlieh in Central Lebanon."
 
  load-and-paint-data                                                                                ; ruft die 'load-and-paint-data' - Prozedur auf 
  
  
end



;; --------------------------------
;; ----  load-and-paint-data   ----
;; --------------------------------


to load-and-paint-data
    
    gis:load-coordinate-system "data/fireriskmap_Ramlieh_Project.prj"                                ; l�dt das Projektionssystem der Feuerrisikokarte als Referenzsystem ein
    
    set FireRisk-dataset   gis:load-dataset "data/fireriskmap_Ramlieh_Project.shp"                   ; l�dt die Feuerrisikokarte und schafft Dataset f�r Daten
       gis:apply-coverage Firerisk-dataset  "RISK"         risiko                                    ; weist RISK - Variable aus Firerisk-dataset der risiko - Variable der NetLogowelt zu
       gis:apply-coverage FireRisk-dataset  "MIN_GRIDCO"   risikovalue
    
    set FuelModel-dataset  gis:load-dataset "data/vegetation_Ramlieh_WGS84.shp"                      ; l�dt die Vegetationskarte und schafft Dataset f�r Daten
       gis:apply-coverage FuelModel-dataset "AREA"         FuelModel
       gis:apply-coverage FuelModel-dataset "PERIMETER"    windcorrection
         gis:set-drawing-color yellow
         gis:draw           FuelModel-dataset 1
     
    set Shaded-dataset     gis:load-dataset "data/shaded.shp"                                        ; l�dt die Shadedkarte und schafft Dataset f�r Daten
       gis:apply-coverage Shaded-dataset    "PERIMETER"    shade   
   
    set RealImage-dataset  gis:load-dataset "data/ramlieh.asc"                                       ; l�dt die Echtfarbenkarte und schafft Dataset f�r Daten
       gis:apply-raster   RealImage-dataset                Hintergrund
         gis:paint          RealImage-dataset 80

    set Ausschluss-dataset gis:load-dataset "data/Ausschluss_neu.asc"                                ; l�dt die Ausschlusskarte und schafft Dataset f�r Daten
       gis:apply-raster   Ausschluss-dataset               ausschluss
 
    set Aspect-dataset     gis:load-dataset "data/ASTGTM_N33E035_dem_utm_cut_aspect_reclass.asc"     ; l�dt die Aspectkarte und schafft Dataset f�r Daten
       gis:apply-raster   Aspect-dataset                   aspect
    
    set Slope-dataset      gis:load-dataset "data/ASTGTM_N33E035_dem_utm_cut_slope_reclass.asc"      ; l�dt die Slopekarte und schafft Dataset f�r Daten
       gis:apply-raster   Slope-dataset                    Slope_Percent
               
    set Elevation-dataset  gis:load-dataset "data/DGM.asc"                                           ; l�dt das Digitale Gel�nde Modell und schafft Dataset f�r Daten
       gis:apply-raster   Elevation-dataset                elevation
         gis:paint          elevation-dataset 200  
    
end




;; -------------------------------
;; -------------------------------
;; ---- set-starting-position ----
;; -------------------------------
;; -------------------------------


to set-starting-position                                                                          ; wird durch Import Fire - Button aufgerufen

   clear-turtles                                                                                  ; l�scht alle Turtles
   
   clear-plot                                                                                     ; l�scht Inhalt des Ausgabefensters

   write "Wait while data is loading. ( Tip: When using the Fire by Mouse-option you can do it as long as the button appears black )" ; Zeit ver�nderbar �ber repeat-Befehl in mouse-down procedures
   
   reset-ticks                                                                                    ; setzt den Tick-Counter = 0
     
   ifelse Take_same_position [ import-startingposition ] [ set-starting-position1 ]               ; ruft import-startingposition-Prozedur auf wenn Take_same_position ON ist, und set-starting-position1 - Prozedur wenn OFF

end



;; ---------------------------------
;; ---- import-startingposition ----
;; ---------------------------------


to import-startingposition

   set turtle-data []                                                                             ; definiert leere Liste

    file-open "data/firstposition.txt"                                                            ; �ffnet Datei

    while [ not file-at-end? ]                                                                    ; wartet bis Datei komplett ausgelesen ist
      [ set turtle-data sentence turtle-data (list (list file-read file-read)) ]                  ; liest die Variablen in diesem Fall Koordinaten in die TurtleData ein ( in  Doppellistenformat (z.B. [[1 1] [1 2] ...])

    file-close                                                                                    ; schliesst Datei

    clear-turtles                                                                                 ; l�scht die alten Turtles

    foreach turtle-data [ ask patch first ? item 1 ? [ sprout-fires 1                             ; l�dt die alten Positionen ein und erstellt jeweils einen Turtle
                                                          [ set shape  "fire"                     ; weist Turtle das Symbol zu
                                                            set size 3                            ; legt Gr��e fest
                                                            wait 0.1                              ; wartet 0.1 Sekunden
                                                            set size 2                            ; legt Gr��e fest
                                                            wait 0.1                              ; wartet 0.1 Sekunden
                                                            set shape "square"                    ; weist neues Symbol zu
                                                            set size 1                            ; legt Gr��e fest
                                                            set color red           ] ] ]         ; f�rbt Turtles ein

end



;; --------------------------------
;; ---- set-starting-position1 ----
;; --------------------------------


to set-starting-position1

    ifelse only_high_risk  [ ask n-of (N_of_Fires) patches with [ risiko = "very high" and Ausschluss = 0 ] ; setzt Feuer nur dort wo Risiko als very high klassifiziert ist und im Untersuchungsgebiet liegt
                                [ sprout-fires 1  [
                                     set shape "Fire"                                                      ; legt Symbol fest
                                     set size 10                                                           ; legt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 4                                                            ; legt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 3                                                            ; setzt Gr��e fest  
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 2                                                            ; setzt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 1                                                            ; setzt Gr��e fest
                                     set shape "square"                                                    ; weist Symbol zu
                                     set color red              ]   ]  ]                                   ; legt Farbe fest
  
                           [ ask n-of (N_of_Fires) patches with [ risikovalue >= 1 and Ausschluss = 0 ]     ; setzt Feuer beliebig im Untersuchungsgebiet
                                [ sprout-fires 1  [
                                     set shape "Fire"                                                      ; legt Symbol fest
                                     set size 10                                                           ; legt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 4                                                            ; legt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 3                                                            ; setzt Gr��e fest  
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 2                                                            ; setzt Gr��e fest
                                     wait 0.1                                                              ; wartet 0.1 Sekunden
                                     set size 1                                                            ; setzt Gr��e fest
                                     set shape "square"                                                    ; weist Symbol zu
                                     set color red              ]   ]  ]                                   ; legt Farbe fest
                                                                    
     export-startingposition                                          
  
end



;; ---------------------------------
;; ---- export-startingposition ----
;; ---------------------------------
  
  
To export-startingposition                                                                     ; exportiert automatisch die Startpositionen der Brandherde

    if file-exists? "data/firstposition.txt" [ file-delete "data/firstposition.txt" ]          ; l�scht die Inhalte der Datei falls sie existiert

    file-open       "data/firstposition.txt"                                                   ; �ffnet die Datei

    ask turtles [ file-write xcor file-write ycor ]                                            ; l�sst Turtles ihre X- und Y- Koordinate in die Datei schreiben

    file-close                                                                                 ; schliesst die Datei

end
  


;; ------------------------
;; ------------------------
;; ----   go-turtles   ----
;; ------------------------
;; ------------------------


to go-turtles
  
  ask fires [ ask neighbors  [if  FuelModel <= 12 and Ausschluss = 0 and elevation >= [elevation] of myself and not any? fires-on self and not any? embers-on self [ Matrizen ] ] ] ;( ( count turtles-on myself ) <= 1 ) [ Matrizen ] ] ]
  
  let-turtle-move
 
  if not any? embers [ stop ]   
  
  plots
 
  tick
  while [ mouse-down? ] [ Stop ]
  
  
end



to let-turtle-move

  
  wait ( 5 /  AROS )  ask fires [ without-interruption [
  
                             ifelse [ AROS ] of patch-here < 5 
                             [  set breed embers ] [
                                ask neighbors [ if FuelModel <= 12 and Ausschluss = 0 and elevation >= [elevation] of myself and not any? fires-on self and not any? embers-on self and not any? burneds-on self
                                 [  sprout-fires 1  
                                   [  set shape "square"                                                    ; weist Symbol zu
                                      set size 1                                                            ; setzt Gr��e fest
                                      set color red  ]  ]                                                   ; legt Farbe fest
                                                           ] ] ]
                                      set breed embers set shape "square" ] 
                         
   ask-concurrent embers [  set shape "square"                                                              ; l�sst Farbe ausfaden und ab einem bestimmten Punkt zu burneds breed werden
                            set color color - 0.7
                            if color < red - 3.5 
                            [  set breed burneds  ]   ]
   
   ask-concurrent burneds [  set shape "square"                                                             ; l�sst breed schwarz werden um verbrannte Fl�chen darzustellen
                             set color black     ]
   
   display 
  
  
end  
  
;; -------------------------
;; ---  let-turtle-move  ---
;; -------------------------


to let-turtle-move_1

every ( 7 / AROS ) [   ask-concurrent fires [ without-interruption 
                          [ ifelse AROS <= 0  
                            [ set color color - 0.3 
                              if color < red - 3.5 [  set breed burneds ] ]
    [  
                               ask neighbors [ if FuelModel <= 12 and Ausschluss = 0 and elevation >= [elevation] of myself and not any? fires-on self and not any? embers-on self and not any? burneds-on self
                                [   sprout-fires 1  
                                  [   set shape "square"                                                    ; weist Symbol zu
                                      set size 1                                                            ; setzt Gr��e fest
                                      set color red  ]  ]                                                   ; legt Farbe fest
                                                           ] ] ]
                                      set breed embers set shape "square"] ] 
                         
   ask-concurrent embers [  set shape "square"
                 set color color - 0.3
                 if color < red - 3.5 [ 
                    set breed burneds                                       ]   ]
   
   ask-concurrent burneds [  set shape "square"
                
                  set color black]
   
   display
   
end



;; ------------------------
;; ------------------------
;; ----   mouse-down   ----
;; ------------------------
;; ------------------------


to mouse-down                                                                                       ; l�sst Turtles mittels Mouse-Klick entstehen

 repeat 5 [
   ask patches [ if mouse-down?                                                                     ; fragt Patch ob auf ihm ein Mausklick ist
                     [ sprout-fires 1                                                               ; l�sst jeweils 1 Turtle entstehen
                           [  setxy mouse-xcor mouse-ycor                                           ; setzt Koordinaten fest
                              set shape "Fire"                                                      ; legt Symbol fest
                              set size 10                                                            ; legt Gr��e fest
                              wait 0.1                                                              ; wartet 0.1 Sekunden
                              set size 3                                                            ; setzt Gr��e fest  
                              wait 0.1                                                              ; wartet 0.1 Sekunden
                              set size 2                                                            ; setzt Gr��e fest
                              wait 0.1                                                              ; wartet 0.1 Sekunden
                              set size 1                                                            ; setzt Gr��e fest
                              set shape "square"                                                    ; weist Symbol zu
                              set color red              ]   ]  ]     ]                              ; legt Farbe fest
                   
   ask turtles [ if ( risikovalue <= 1 or Ausschluss = 1 ) [ die set color black  ]  ]                               ; l�sst Turtles sterben wenn sie sich auf Ausschlussfl�chen oder au�erhalb des Untersuchungsgebietes befinden

end


;; ---------------------
;; -----   Plots   -----
;; ---------------------


to plots 

  set-current-plot "Output"
  
  set fire-count     ( count fires * 14.53 * 3 )                               ; Pixelgr��e 14,529695 m� und Patchgr��e 3 (in Pixel)
  set-current-plot-pen "Fires"
  plot fire-count

  set ember-count    ( count embers * 14.53 * 3 )                              ; Pixelgr��e 14,529695 m� und Patchgr��e 3 (in Pixel)
  set-current-plot-pen "embers"
  plot ember-count
  
  set burneds-count  ( count burneds * 14.53 * 3 + count embers * 14.5 * 3 )   ; Pixelgr��e 14,529695 m� und Patchgr��e 3 (in Pixel)
  set-current-plot-pen "Burned"
  plot burneds-count
  
  

end


;; ------------------------
;; ----    Matrizen    ----
;; ------------------------


to Matrizen                                                                                         ; l�dt die Tabellen f�r die Berechnung der Ausbreitungsgeschwindigkeit in die NetlogoWelt ein
  
   let Slope_Correction_Matrix matrix:from-row-list [                                               ; definiert die Slope_Correction_Matrix (Werte aus Tabelle 5 B; Keys: FuelModel und SlopePercent), erste Zeile f�r Wert 0 eingef�gt, da NetLogo-Extension immer mit 0 beginnt
    [ 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.0 0.0 0.0 0.0 0.0 ]
    [ 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.0 0.0 0.0 0.0 0.0 ]
    [ 0.4 0.3 0.4 0.3 0.3 0.3 0.3 0.1 0.2 0.2 0.2 0.2 0.2 ]
    [ 0.9 0.6 0.8 0.6 0.7 0.7 0.7 0.3 0.4 0.4 0.4 0.4 0.4 ]
    [ 1.6 1.0 1.4 1.1 1.3 1.2 1.2 0.6 0.6 0.7 0.7 0.7 0.6 ]
    [ 2.6 1.6 2.2 1.8 2.0 1.8 1.9 0.9 1.0 1.1 1.1 1.0 1.0 ]
    [ 3.7 2.2 3.2 2.5 2.9 2.6 2.8 1.3 1.4 1.6 1.6 1.5 1.4 ]
    [ 5.1 3.0 4.4 3.4 3.9 3.5 3.8 1.8 2.0 2.2 2.2 2.1 1.9 ]
    [ 6.6 4.0 5.7 4.5 5.1 4.6 4.9 2.3 2.6 2.9 2.9 2.7 2.5 ]
    [ 8.3 5.0 7.2 5.7 6.4 5.6 6.2 2.9 3.2 3.6 3.7 3.4 3.1 ]
    [ 10 6.2 8.9 7.0 8.0 7.2 7.7 3.6 4.0 4.5 4.5 4.2 3.9 ]
    [ 12 7.5 11 8.5 9.6 8.7 9.3 4.3 4.8 5.4 5.5 5.1 4.7 ]
    [ 15 8.9 13 10 11 10 11 5.2 5.8 6.4 6.5 6.0 5.6 ]
    [ 17 11 15 12 13 12 13 6.0 6.8 7.5 7.7 7.1 6.6 ]
    [ 20 12 17 14 16 14 15 7.0 7.8 8.7 8.9 8.2 7.6 ]
    [ 23 14 20 16 18 16 17 8.0 9.0 10 10 9.4 8.7 ]
    [ 26 16 23 17 20 19 20 9.2 10 11 12 11 9.9 ]
    [ 30 18 26 20 23 21 22 10 12 13 13 12 11 ]
    [ 33 20 29 23 26 23 25 12 13 14 15 14 13 ]
    [ 37 22 32 25 29 26 28 13 14 16 16 15 14 ]
    [ 41 25 36 28 32 29 31 14 16 18 18 17 16 ]  ] 
  
  set Slope_Factor matrix:get Slope_correction_Matrix (( Slope_Percent / 5 )) ( FuelModel - 1) 


   let Wind_Correction_Matrix matrix:from-row-list [                                               ; Tab. 7 A - Effective Windspeed Factors
    [ 1 1 3 2 2 2 2 1 1 1 2 1 1 ] 
    [ 3 3 8 5 6 5 6 2 2 3 3 3 3 ] 
    [ 7 6 13 8 10 9 10 4 4 5 6 5 4 ]
    [ 13 10 19 13 15 14 15 5 6 7 8 7 6 ] 
    [ 21 15 25 17 21 19 20 8 10 10 10 9 8 ] 
    [ 31 21 32 22 27 24 26 10 13 13 12 11 10 ] 
    [ 43 27 39 28 33 29 32 12 17 16 15 13 11 ]
    [ 57 35 47 34 40 35 38 15 21 19 17 15 13 ]
    [ 72 43 54 40 47 41 45 18 26 23 19 17 15 ]
    [ 95 51 63 46 52 47 51 21 31 27 22 19 17 ]
    [ 109 62 71 53 62 54 58 24 36 30 24 21 19 ]
    [ 125 73 79 69 79 61 62 27 42 34 27 24 21 ]
    [ 155 84 88 67 78 67 73 31 49 39 30 26 23 ]
    [ 170 96 99 74 80 75 80 35 44 43 32 28 25 ]
    [ 208 109 109 82 95 81 88 39 63 47 35 30 27]
    [ 239 124 117 90 105 88 96 39 70 52 37 32 29 ]
    [ 270 138 125 99 114 96 104 39 78 57 40 35 31 ]
    [ 305 153 135 107 124 104 112 39 86 62 43 37 33 ]
    [ 340 169 144 115 133 111 121 39 94 67 46 40 35 ]
    [ 340 186 155 126 142 119 129 39 103 72 49 42 37 ]
    [ 340 203 165 133 152 127 139 39 112 77 51 44 40 ]
    [ 340 216 175 142 163 135 147 39 122 83 54 47 42 ]
    [ 340 223 181 147 168 140 151 39 127 85 56 48 42 ]
    [ 340 230 186 151 173 144 156 39 132 88 57 49 44 ]
    [ 340 230 196 160 173 153 156 39 132 94 60 52 46 ]
    [ 340 230 207 170 173 161 156 39 132 99 63 54 48 ]
    [ 340 230 218 180 173 169 156 39 132 99 66 56 50 ]
    [ 340 230 229 190 173 178 156 39 132 99 69 59 52 ]
    [ 340 230 235 200 173 187 156 39 132 99 72 61 55 ]   
    [ 340 230 252 210 173 196 156 39 132 99 75 64 57 ]   ]

 ifelse ( windspeed * windcorrection ) >= 1 [ set midflame_windspeed ( ( round ( windspeed * windcorrection ) ) - 1) ] [ set midflame_windspeed (0) ]
    set Wind_Factor matrix:get Wind_Correction_Matrix ( midflame_windspeed ) ( FuelModel - 1 )

    
 if Time = "08.00 -> 10.00" [ set Uhrzeit1 0 ]
 if Time = "10.00 -> 12.00" [ set Uhrzeit1 1 ]
 if Time = "12.00 -> 14.00" [ set Uhrzeit1 2 ]
 if Time = "14.00 -> 16.00" [ set Uhrzeit1 3 ]
 if Time = "16.00 -> 18.00" [ set Uhrzeit1 4 ]
 if Time = "18.00 -> 20.00" [ set Uhrzeit1 5 ]
 
 if aspect = 0  [ set aspect1 0 ]
 if aspect >= 1 [ set aspect1 aspect - 1 ]


   let Dead_Fuel_Correction_MJJ_unshaded_Matrix matrix:from-row-list [                                     ; Tab. 3 B - Part 1 ( less than 50% shaded )
 [ 3 1 0 0 1 3 ] 
 [ 2 0 0 0 2 4 ]
 [ 3 1 0 0 1 3 ] 
 [ 4 2 0 0 0 2 ] ]
 
   let Dead_Fuel_Correction_MJJ_shaded_Matrix matrix:from-row-list [                                       ; Tab. 3 B - Part 2 ( more than 50% shaded )
 [ 5 4 3 3 4 5 ]
 [ 4 4 3 4 4 5 ]
 [ 4 4 3 3 4 5 ]
 [ 5 4 3 3 4 4 ] ]

   let Dead_Fuel_Correction_ASO_unshaded_Matrix matrix:from-row-list [                                     ; Tab. 3 C - Part 1 ( less than 50% shaded )
 [ 4 2 2 2 2 4 ]
 [ 3 1 1 1 3 4 ]
 [ 4 2 1 1 2 4 ]
 [ 4 3 1 1 1 3 ] ]

   let Dead_Fuel_Correction_ASO_shaded_Matrix matrix:from-row-list [                                       ; Tab. 3 C - Part 2 ( more than 50% shaded )
 [ 5 5 4 4 5 5 ]
 [ 5 4 4 4 5 5 ]
 [ 5 4 4 4 4 5 ]
 [ 5 5 4 4 4 5 ]  ]
   
 
 if Month = "May" or Month = "June" or Month = "July" and shade = 1 [  
    set Dead_Fuel_Correction matrix:get Dead_Fuel_Correction_MJJ_unshaded_Matrix ( aspect1 ) ( Uhrzeit1 ) ]
  
 if Month = "May" or Month = "June" or Month = "July" and shade = 2 [  
    set Dead_Fuel_Correction matrix:get Dead_Fuel_Correction_MJJ_shaded_Matrix ( aspect1 ) ( Uhrzeit1 ) ]
 
 if Month = "August" or Month = "September" or Month = "October" and shade = 1 [ 
    set Dead_Fuel_Correction matrix:get Dead_Fuel_Correction_ASO_unshaded_Matrix ( aspect1 ) ( Uhrzeit1 ) ]
 
 if Month = "August" or Month = "September" or Month = "October" and shade = 2 [ 
    set Dead_Fuel_Correction matrix:get Dead_Fuel_Correction_ASO_shaded_Matrix ( aspect1 ) ( Uhrzeit1 ) ]
 
ifelse Time = "20.00 -> 08.00" [ set Dead_Fuel_Moisture ( Dead_Fuel_Moisture_Nighttime - 1) ] [ set Dead_Fuel_Moisture ( Dead_Fuel_Moisture_Daytime + Dead_Fuel_Correction - 1 ) ]

if FuelModel = "1"  [ set FuelModel1 0 ] 
if FuelModel = "3"  [ set FuelModel1 1 ]
if FuelModel = "6"  [ set FuelModel1 2 ]
if FuelModel = "8"  [ set FuelModel1 3 ]
if FuelModel = "9"  [ set FuelModel1 4 ]
if FuelModel = "11" [ set FuelModel1 5 ]
if FuelModel = "12" [ set FuelModel1 6 ]
if FuelModel = "13" [ set FuelModel1 7 ]

if Live_Fuel_Moisture_Content = "60"  [ set Live_Fuel_Moisture 0 ] 
if Live_Fuel_Moisture_Content = "90"  [ set Live_Fuel_Moisture 1 ] 
if Live_Fuel_Moisture_Content = "120" [ set Live_Fuel_Moisture 2 ] 
if Live_Fuel_Moisture_Content = "150" [ set Live_Fuel_Moisture 3 ] 
if Live_Fuel_Moisture_Content = "200" [ set Live_Fuel_Moisture 4 ] 
if Live_Fuel_Moisture_Content = "300" [ set Live_Fuel_Moisture 5 ] 


let ROS_Matrix_1_3_13 matrix:from-row-list [                                              ; Tab. 6 A - 1 - Rate of Spread for no wind and slope ( Fuel Model 1,3,6,8,9,11,12,13 )
  [ 7.7 7.9 3.1 0.4 1.5 1.1 2.5 3.3 ]
  [ 6.2 6.9 2.7 0.4 1.3 0.9 2.2 2.9 ]
  [ 5.3 6.1 2.4 0.3 1.1 0.8 1.9 2.5 ]
  [ 4.8 5.5 2.1 0.3 1.0 0.7 1.7 2.3 ]
  [ 4.4 4.9 1.9 0.3 0.9 0.6 1.5 2.1 ]
  [ 4.2 4.5 1.7 0.2 0.8 0.6 1.4 1.9 ]
  [ 3.9 4.2 1.6 0.2 0.8 0.5 1.3 1.7 ]
  [ 3.6 3.9 1.5 0.2 0.7 0.5 1.2 1.6 ]
  [ 3.1 3.7 1.4 0.2 0.7 0.5 1.2 1.5 ]
  [ 2.4 3.5 1.4 0.2 0.7 0.5 1.1 1.5 ]
  [ 1.4 3.4 1.3 0.2 0.6 0.4 1.1 1.4 ]
  [ 1.4 3.3 1.3 0.2 0.6 0.3 1.0 1.4 ]
  [ 1.4 3.1 1.2 0.2 0.6 0.3 1.0 1.3 ]
  [ 1.4 3.0 1.2 0.2 0.6 0.1 0.9 1.3 ]
  [ 1.4 2.9 1.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0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ]
  [ 0.1 0.1 0.1 0.1 0.1 0.0 ] ]

if FuelModel = 1                         [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 3                         [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 6                         [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 8                         [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 9                         [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 11                        [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 12                        [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 13                        [ set ROS matrix:get ROS_Matrix_1_3_13 ( Dead_Fuel_Moisture ) ( FuelModel1 ) ]
if FuelModel = 4                         [ set ROS matrix:get ROS_Matrix_4 ( Dead_Fuel_Moisture ) ( Live_Fuel_Moisture ) ]
if FuelModel = 5                         [ set ROS matrix:get ROS_Matrix_5 ( Dead_Fuel_Moisture ) ( Live_Fuel_Moisture ) ]

 if Month = "January" or Month = "February" or Month = "March" or Month = "November" or Month = "December"  [ set ROS 0 ]
      
       set AROS (( ROS ) * ( Wind_Factor + Slope_Factor + 1 ) )
       if AROS = 0 [ set AROS 1 ]
       print AROS
       
end