moja-global / FLINT.Module.Agricultural_Soil_Model

Code repository for FLINT agricultural soils module.
Mozilla Public License 2.0
1 stars 6 forks source link

OutputerStreamFlux not showing any output #5

Closed sulays closed 4 years ago

sulays commented 4 years ago

Describe the bug OutputerStreamFlux not showing any output for the NFertEvent.

To Reproduce Steps to reproduce the behavior:

  1. Debug the solution created byt following the steps in README.md

Expected behavior No output of the operations in the csv file - "Example_Point_Agri_Flux.csv"

leitchy commented 4 years ago

Hi Sulay, an interesting problem. You can see in the stock reporting that the event (stock move) has been applied. It just doesn't get reported by the flux outputter.

notification,step,stepDate,fracOfStep,stepLenInYears,atmosphere,initial_values,
onTimingPostInit,0,1919-12-31:23:59:59.998999,1,0.0846995,0,0,
onOutputStep,1,1920-01-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,2,1920-02-29:23:59:59.999999,1,0.0792349726775956,0,0,
onOutputStep,3,1920-03-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,4,1920-04-30:23:59:59.999999,1,0.0819672131147541,0,0,
onOutputStep,5,1920-05-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,6,1920-06-30:23:59:59.999999,1,0.0819672131147541,0,0,
onOutputStep,7,1920-07-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,8,1920-08-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,9,1920-09-30:23:59:59.999999,1,0.0819672131147541,0,0,
onOutputStep,10,1920-10-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,11,1920-11-30:23:59:59.999999,1,0.0819672131147541,0,0,
onOutputStep,12,1920-12-31:23:59:59.999999,1,0.0846994535519126,0,0,
onOutputStep,13,1921-01-31:23:59:59.999999,1,0.0849315068493151,0,0,
onPostDisturbanceEvent,14,1921-02-01:11:59:59.999999,1,0.0767123287671233,0.5,-0.5,
onOutputStep,14,1921-02-28:23:59:59.999999,0.982142857142857,0.0767123287671233,0.5,-0.5,
onOutputStep,15,1921-03-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,16,1921-04-30:23:59:59.999999,1,0.0821917808219178,0.5,-0.5,
onOutputStep,17,1921-05-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,18,1921-06-30:23:59:59.999999,1,0.0821917808219178,0.5,-0.5,
onOutputStep,19,1921-07-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,20,1921-08-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,21,1921-09-30:23:59:59.999999,1,0.0821917808219178,0.5,-0.5,
onOutputStep,22,1921-10-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,23,1921-11-30:23:59:59.999999,1,0.0821917808219178,0.5,-0.5,
onOutputStep,24,1921-12-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,25,1922-01-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,26,1922-02-28:23:59:59.999999,1,0.0767123287671233,0.5,-0.5,
onOutputStep,27,1922-03-31:23:59:59.999999,1,0.0849315068493151,0.5,-0.5,
onOutputStep,28,1922-04-30:23:59:59.999999,1,0.0821917808219178,0.5,-0.5,
onPostDisturbanceEvent,29,1922-05-01:11:59:59.999999,1,0.0849315068493151,1.5,-1.5,
onOutputStep,29,1922-05-31:23:59:59.999999,0.983870967741935,0.0849315068493151,1.5,-1.5,
onOutputStep,30,1922-06-30:23:59:59.999999,1,0.0821917808219178,1.5,-1.5,
leitchy commented 4 years ago

Because you don't have another module making moves in normal time steps it's very obvious, and in general in oether projects users have written custom aggregators for fluxes that do capture these.

leitchy commented 4 years ago

I'm making a small fix for moja flint that will resolve the issue, and a few minor changes to your config. I put the fix in FLINT here and have run your code to test.

OutputerStreamFlux
==========================================================================
Started:2020-06-18:02:42:03.213997
==========================================================================
step,step date,module name,disturbance_type,source pool,sink pool,value
<2020-06-18 12:42:03.253277> (debug) - moja::flint::example::agri::DisturbanceEventModule::simulate(54) - Synthetic fertilizer Event Occured
14,1921-02-01:12:00:00.000000,DisturbanceEventModule,soil,atmosphere,0.5
<2020-06-18 12:42:03.269276> (debug) - moja::flint::example::agri::DisturbanceEventModule::simulate(54) - Organic fertilizer Event Occured
29,1922-05-01:12:00:00.000000,DisturbanceEventModule,soil,atmosphere,1
==========================================================================
Finished:2020-06-18:02:42:03.278845
==========================================================================
leitchy commented 4 years ago

You will need to pull the latest of FLINT develop for the fix