;;; log-old.dai --- Old log file parameterizations.
;;
;; This file contains log parameterizations we no longer want to
;; present to new users, but nonetheles may still be in use by old
;; setups.
;;
;; Use it if fixing the setups is too much work.

(input file "log.dai")

(deflog "Soil Content 0-10 cm" "Total Soil Content"
  (where "soil_content_00-10.dlf")
  (from   0)
  (to   -10))

(deflog "Soil Content 10-20 cm" "Total Soil Content"
  (where "soil_content_10-20.dlf")
  (from -10)
  (to   -20))

(deflog "Soil Content 20-30 cm" "Total Soil Content"
  (where "soil_content_20-30.dlf")
  (from -20)
  (to   -30))

(deflog "Soil Content 30-40 cm" "Total Soil Content"
  (where "soil_content_30-40.dlf")
  (from -30)
  (to   -40))

(deflog "Soil Content 40-50 cm" "Total Soil Content"
  (where "soil_content_40-50.dlf")
  (from -40)
  (to   -50))

(deflog "Soil Content 50-60 cm" "Total Soil Content"
  (where "soil_content_50-60.dlf")
  (from -50)
  (to   -60))

(deflog "Soil Content 60-70 cm" "Total Soil Content"
  (where "soil_content_60-70.dlf")
  (from -60)
  (to   -70))

(deflog "Soil Content 70-80 cm" "Total Soil Content"
  (where "soil_content_70-80.dlf")
  (from -70)
  (to   -80))

(deflog "Soil Content 80-90 cm" "Total Soil Content"
  (where "soil_content_80-90.dlf")
  (from -80)
  (to   -90))

(deflog "Soil Content 90-100 cm" "Total Soil Content"
  (where "soil_content_90-100.dlf")
  (from -90)
  (to  -100))

(deflog "Hourly Water Flux" "Matrix Water Flux")

(deflog "Daily Water Flux" "Hourly Water Flux"
  (where "daily_water_flux.dlf")
  (when daily)
  (entries Year Month MDay 
           (array (path column "${column}" SoilWater q)
                  (factor -10)          ;cm->mm
                  (handle sum)
                  (dimension "mm/&"))))

(deflog "Soil Nitrate Concentration" column
  (where "soil_nitrate_conc.dlf")
  (when daily)
  (entries Year Month MDay 
           (array (path column "${column}" SoilNO3 C)
                  (dimension "mg/l")
                  (factor 1.0e6))))     ;g/cm³ -> mg/l

(deflog "Soil Water NO3 Concentration" column
  (where "soil_NO3_conc.dlf")
  (when daily)
  (entries Year Month MDay 
           (array (path column "${column}" SoilNO3 C)
                  (dimension "mg/l")
                  (factor 4.43e6))))     ;g NO3-N/cm³ -> mg NO3/l

(deflog "Root Zone Water Balance 0-100 cm" "Root Zone Water Balance"
  (where "root_zone_water_balance_000-100.dlf")
  (from   0)
  (to   -100))

(deflog "N Balance 0-100 cm" "N Balance"
  (where "N_balance_000-100.dlf")
  (from   0)
  (to   -100))

(deflog "Monthly N Balance 100 cm" "N Balance 0-100 cm" 
  (where "Monthly_N_balance_100cm.dlf")
  (when monthly))

(deflog "Soil Chemical" "Soil Chemicals"
  "Summary information about all soil chemicals."
  (where "soil_chemical.dlf"))

(deflog "Soil Chemicals 0-100 cm" "Soil Chemicals"
  (where "soil_chemicals_000-100.dlf")
  (from   0)
  (to   -100))

(deflog "Soil Chemical 0-100 cm" "Soil Chemical"
  (where "soil_chemical_000-100.dlf")
  (from    0 [cm])
  (to   -100 [cm]))

(deflog "Harvest" harvest)

(defsummary "Evapotranspiration" simple
  "Summary of evapotranspiration."
  (precision 1)
  (fetch ("Reference evapotranspiration (dry)"
          (name "Evapotranspiration, reference, dry"))
         ("Reference evapotranspiration (wet)"
          (name "Evapotranspiration, reference, wet"))
         ("Potential evapotranspiration (dry)"
          (name "Evapotranspiration, potential, dry"))
         ("Potential evapotranspiration (wet)"
          (name "Evapotranspiration, potential, wet"))
         ("Potential evapotranspiration"
          (name "Evapotranspiration, potential"))
         ("Actual Evapotranspiration"
          (name "Evapotranspiration, actual"))
         ("Potential transpiration"
          (name "Transpiration, potential"))
         ("Actual transpiration" 
          (name "Transpiration, actual"))
         ("Evaporation from snow")
         ("Evaporation from canopy")
         ("Evaporation from litter")
         ("Evaporation from ponded water")
         ("Evaporation of soil water"))
  (print_sum false))

(deflog "Surface Water Balance" column
  "Not enough information to create a water balance for the soil surface."
  (summary "Evapotranspiration")
  (where "${colfid}surface_water_balance.dlf")
  (when hourly)
  (entries (number (path weather "*" rain)
                   (handle sum)
                   (dimension "mm"))
           (number (path weather "*" snow)
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" irrigation_overhead)
                   (tag "Overhead irrigation")
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" irrigation_surface)
                   (tag "Surface irrigation")
                  (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate default pet component
                         reference_evapotranspiration)
                   (tag "Reference evapotranspiration (dry)")
                   (handle sum)
                   (spec pet component reference_evapotranspiration))
           (number (path column "${column}" Bioclimate default pet component
                         reference_evapotranspiration_wet)
                   (tag "Reference evapotranspiration (wet)")
                   (handle sum)
                   (spec pet FAO_PM reference_evapotranspiration_wet))
           (number (path column "${column}" Bioclimate default pet component
                         wet)
                   (tag "Potential evapotranspiration (wet)")
                   (handle sum)
                   (spec pet component wet))
           (number (path column "${column}" Bioclimate default pet component
                         dry)
                   (tag "Potential evapotranspiration (dry)")
                   (handle sum)
                   (spec pet component dry))
           (number (path column "${column}" Bioclimate "*" total_ep)
                   (tag "Potential evapotranspiration")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" total_ea)
                   (tag "Actual Evapotranspiration")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" crop_ep)
                   (tag "Potential transpiration")            
                   (handle sum)
                   (spec bioclimate default crop_ep))
           (number (path column "${column}" Bioclimate "*" crop_ea)
                   (tag "Actual transpiration")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" canopy_ea)
                   (tag "Evaporation from canopy")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" snow_ea)
                   (tag "Evaporation from snow")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" litter_ea)
                   (tag "Evaporation from litter")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" pond_ea)
                   (tag "Evaporation from ponded water")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" soil_ea)
                   (tag "Evaporation of soil water")            
                   (handle sum)
                   (dimension "mm"))
           (flux_top (path column "${column}" SoilWater q)
                     (tag "Matrix infiltration")
                     (handle sum)
                     (dimension "mm")
                     (factor -10))      ;cm -> mm
           (flux_top (path column "${column}" SoilWater q_p)
                     (tag "Macropore infiltration")
                     (handle sum)
                     (dimension "mm")
                     (factor -10))      ;cm -> mm
           (number (path column "${column}" Surface pond)
                   (tag "Surface ponding")            
                   (dimension "mm"))
           (number (path column "${column}" Surface runoff)
                   (tag "Surface runoff")            
                   (handle sum)
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" canopy_water_storage)
                   (tag "Interception storage")            
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" Snow Ssnow)
                   (tag "Snow storage")
                   (dimension "mm"))
           (number (path column "${column}" Bioclimate "*" production_stress))))

;;; log-old.dai ends here.
