From 710473c7278b3d86de7aca9ad0e8adfe3eb5cc1d Mon Sep 17 00:00:00 2001 From: Francisco Salas Date: Mon, 26 Jul 2021 16:07:39 +0200 Subject: [PATCH] removed fodder maize; if straw withdraw is checked results in 0 --- CarbonCalculation.cs | 6 +----- config/CropSets.json | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CarbonCalculation.cs b/CarbonCalculation.cs index 61ccda8..3c8a52f 100644 --- a/CarbonCalculation.cs +++ b/CarbonCalculation.cs @@ -500,10 +500,6 @@ namespace FarmMapsAPI.Carbon newValue = 0.024 * item.Value + 0.228; valueList.Add(new ColumnValue(item.Key, newValue)); break; - case "Fodder_maize": - newValue = 0.024 * item.Value + 0.228; - valueList.Add(new ColumnValue(item.Key, newValue)); - break; case "Corn_Cob_mix": newValue = 0.024 * item.Value + 0.228; valueList.Add(new ColumnValue(item.Key, newValue)); @@ -621,7 +617,7 @@ namespace FarmMapsAPI.Carbon var fracR = cropPropertyConfig.SingleOrDefault(x => x.Name.ToLower() == crop.Key.ToLower())?.FracR ?? 0.0; var field = farmInput.CropFields.SingleOrDefault(x => x.Name == cropArea.Key.Item1); - var crop_res = field.HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].CropRes ? 1 : 0; + var crop_res = field.HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].CropRes ? 0 : 1; //var result = belowGroundCarbon.Value + (stubble * dm_contentStraw * parameterSet.CarbonBiomass) + ((1 - fracR) * strawYld * dm_contentStraw * parameterSet.CarbonBiomass); var result = belowGroundCarbon.Value + (stubble * dm_contentStraw * parameterSet.CarbonBiomass) + (crop_res * strawYld * dm_contentStraw * parameterSet.CarbonBiomass); diff --git a/config/CropSets.json b/config/CropSets.json index 52b6d11..3bbc864 100644 --- a/config/CropSets.json +++ b/config/CropSets.json @@ -4,10 +4,6 @@ "StrawCrop": "Maize", "DM_Content": 0.7 }, - { - "StrawCrop": "Fodder_maize", - "DM_Content": 0.85 - }, { "StrawCrop": "Corn_cob_mix", "DM_Content": 0.7