#include <cassert>
#include <cmath>
#include "powerlaw.h"

extern "C"  // avoid name-mangling in the C code
 float soilPowerLawOutflow( float *store, float coef, float exp, float inputVol, float dt );


// PowerLaw Interface function for C code --------------------------------------------
float soilPowerLawOutflow( float *store, float coef, float exp, float inputVol, float dt )
{
  
  PowerLaw Route( *store, coef, exp );
  float outflow = Route.output( inputVol, dt );
  *store = Route.get_storage(); 
    
  return ( outflow );
}
