forked whamp.f90 for matlab mex interface version