call CalcOutput and UpdateStates from Fortran