!
! Input Parameter Description:
!
! MODE(Int) - 0 = Initialisation. This routine is called once with mode 0
! before the simulation. All parameters are as described
! below except for STAGE, which is undefined. FORCES and
! ADDMASS are assumed undefined on exit.
! IERR if set to > 0 on exit will cause
! the simulation to stop.
!
! 1 = Called during the simulation. FORCE/ADDMASS output expected.
!
! 99 = Termination. This routine is called once with mode 99
! at the end of the simulation.
!
! I_CONTROL(100)- User-defined integer control parameters input in .DAT file.
! R_CONTROL(100)- User-defined real control parameters input in .DAT file.
!
! NSTRUC(Int) - Number of structures in the simulation
!
! TIME - The current time (see STAGE below)
!
! TIMESTEP - The timestep size (DT, see STAGE below)
!
! STAGE(Int) - The stage of the integration scheme. AQWA time integration is
! based on a 2-stage predictor corrector method. This routine is
! therefore called twice at each timestep, once with STAGE=1 and
! once with STAGE=2. On stage 2 the position and velocity are
! predictions of the position and velocity at TIME+DT.
! e.g. if the initial time is 0.0 and the step 1.0 seconds then
! calls are as follows for the 1st 3 integration steps:
!
! CALL USER_FORCE(.....,TIME=0.0,TIMESTEP=1.0,STAGE=1 ...)
! CALL USER_FORCE(.....,TIME=0.0,TIMESTEP=1.0,STAGE=2 ...)
! CALL USER_FORCE(.....,TIME=1.0,TIMESTEP=1.0,STAGE=1 ...)
! CALL USER_FORCE(.....,TIME=1.0,TIMESTEP=1.0,STAGE=2 ...)
! CALL USER_FORCE(.....,TIME=2.0,TIMESTEP=1.0,STAGE=1 ...)
! CALL USER_FORCE(.....,TIME=2.0,TIMESTEP=1.0,STAGE=2 ...)
!
! COG(3,NSTRUC) - Position of the Centre of Gravity in the Definition axes.
!
! POSITION(6,NSTRUC) - Position of the structure in the FRA - angles in radians
!
! VELOCITY(6,NSTRUC) - Velocity of the structure in the FRA
! angular velocity in rad/s
!
!
! Output Parameter Description:
!
! FORCE(6,NSTRUC) - Force on the Centre of gravity of the structure. NB: these
! forces are applied in the Fixed Reference axis e.g.
! the surge(X) force is ALWAYS IN THE SAME DIRECTION i.e. in
! the direction of the X fixed reference axis.
!
! ADDMASS(6,6,NSTRUC)
! - Added mass matrix for each structure. As the value of the
! acceleration is dependent on FORCES, this matrix may be used
! to apply inertia type forces to the structure. This mass
! will be added to the total added mass of the structure at
! each timestep at each stage.
!
! ERRORFLAG - Error flag. The program will abort at any time if this
! error flag is non-zero. The values of the error flag will
! be output in the abort message.
!------------------------------------------------------------------------
! MODE=0 - Initialise any summing variables/open/create files.
! This mode is executed once before the simulation begins.
!------------------------------------------------------------------------
!------------------------------------------------------------------------
! MODE=1 - On-going - calculation of forces/mass
!------------------------------------------------------------------------
!------------------------------------------------------------------------
! MODE=99 - Termination - Output/print any summaries required/Close Files
! This mode is executed once at the end of the simulation
!------------------------------------------------------------------------