**------------------------------------------------ c c UAMP Sensor to stop analysis c Subroutine uamp( C passed in for information and state variables * ampName, time, ampValueOld, dt, nProps, props, * nSvars, svars, lFlagsInfo, nSensor, sensorValues, * sensorNames, jSensorLookUpTable, C to be defined * ampValueNew, * lFlagsDefine, * AmpDerivative, AmpSecDerivative, AmpIncIntegral, * AmpIncDoubleIntegral) include 'aba_param.inc' C svars - additional state variables, similar to (V)UEL dimension sensorValues(nSensor), svars(nSvars) character*80 sensorNames(nSensor) character*80 ampName C time indices parameter (iStepTime = 1, * iTotalTime = 2, * nTime = 2) C flags passed in for information parameter (iInitialization = 1, * iRegularInc = 2, * nFlagsInfo = 2) C optional flags to be defined parameter (iComputeDeriv = 1, * iComputeSecDeriv = 2, * iComputeInteg = 3, * iComputeDoubleInteg = 4, * iStopAnalysis = 5, * iConcludeStep = 6, * nFlagsDefine = 6) dimension time(nTime), lFlagsInfo(nFlagsInfo), * lFlagsDefine(nFlagsDefine) dimension jSensorLookUpTable(*),props(nProps) parameter(zero = 0.0d0) C User code to compute ampValue = F(sensors) timeStarSecStep = zero cutoffVoltage=zero if (nProps.gt.0) * cutoffVoltage = props(1) c get sensor values first; note that iR_EPot = iGetSensorID('VOLTAGECUTOFF', jSensorLookUpTable) valueR_EPot = sensorValues(iR_EPot) if (ampName(1:15) .eq. 'CUTOFFDETECTION' ) then if (lFlagsInfo(iInitialization).eq.1) then else C stop the analysis, if desired if (valueR_EPot.le.cutoffVoltage) lFlagsDefine(iConcludeStep)=1 end if end if return end