// infiltration.h
#ifndef INFILTRATION_H
#define INFILTRATION_H

#include <iostream>
#include <cstring>
#include <fstream>
#include <cassert>
#include "powerlaw.h"
using namespace std;

// Interface function for C code 
extern "C" {
  float CalcInfiltration( float store, float coef, float exp, float max_store, 
                          float fc_store, float final, float Dt, float InFluxVol, float *DeepPerc, 
                          float *RunoffVol  );
}


// class 
class Infiltration: public PowerLaw
{
public:
  // constructors 
  Infiltration();

  Infiltration::Infiltration(  float store, float coef, float exp, float max_store, 
                             float fc_store, float final  );

  // funtions 
void  Infiltration::get_parameters(  float store, float coef, float exp, float max_store, 
                               float fc_store, float final  );

  float Infiltration::CalcRunoff( float InputVol, float Dt, float *DeepPerc );     
  float get_storage() { return Storage; }


private:
  float FinalRate;
  float MaxStorage;
  float FieldCapStorage;

  float Infiltration::NoInput( float Dt );

  float Infiltration::FillSoilToFC( float InFlux, float Dt );
  float Infiltration::DrainSoilToTarget( float TargetStorage, float InFlux, float Dt, 
                                         float *Perc );     

};

#endif


