From 1b9bbf34d325d05e69740e86f42e946ed4fd9209 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Wed, 18 Feb 2026 22:27:52 +0000 Subject: [PATCH 1/5] Use finite differencing for ServoDyn Jacobians --- modules/openfast-library/src/FAST_Funcs.f90 | 4 +- modules/servodyn/src/ServoDyn.f90 | 217 +++++++++++++++++--- 2 files changed, 190 insertions(+), 31 deletions(-) diff --git a/modules/openfast-library/src/FAST_Funcs.f90 b/modules/openfast-library/src/FAST_Funcs.f90 index e43ec8e7a..3cc145581 100644 --- a/modules/openfast-library/src/FAST_Funcs.f90 +++ b/modules/openfast-library/src/FAST_Funcs.f90 @@ -1440,7 +1440,7 @@ subroutine FAST_JacobianPInput(ModData, ThisTime, iInput, iState, T, ErrStat, Er dYdu=dYdu, dXdu=dXdu) case (Module_SrvD) - call SrvD_JacobianPInput(ThisTime, T%SrvD%Input(iInput, ModData%Ins), T%SrvD%p(ModData%Ins), & + call SrvD_JacobianPInput(ModData%Vars, ThisTime, T%SrvD%Input(iInput, ModData%Ins), T%SrvD%p(ModData%Ins), & T%SrvD%x(ModData%Ins, iState), T%SrvD%xd(ModData%Ins, iState), & T%SrvD%z(ModData%Ins, iState), T%SrvD%OtherSt(ModData%Ins, iState), & T%SrvD%y(ModData%Ins), T%SrvD%m(ModData%Ins), & @@ -1563,7 +1563,7 @@ subroutine FAST_JacobianPContState(ModData, ThisTime, iInput, iState, T, ErrStat dYdx=dYdx, dXdx=dXdx) case (Module_SrvD) - call SrvD_JacobianPContState(ThisTime, T%SrvD%Input(iInput, ModData%Ins), T%SrvD%p(ModData%Ins), & + call SrvD_JacobianPContState(ModData%Vars, ThisTime, T%SrvD%Input(iInput, ModData%Ins), T%SrvD%p(ModData%Ins), & T%SrvD%x(ModData%Ins, iState), T%SrvD%xd(ModData%Ins, iState), & T%SrvD%z(ModData%Ins, iState), T%SrvD%OtherSt(ModData%Ins, iState), & T%SrvD%y(ModData%Ins), T%SrvD%m(ModData%Ins), ErrStat2, ErrMsg2, & diff --git a/modules/servodyn/src/ServoDyn.f90 b/modules/servodyn/src/ServoDyn.f90 index ecf953e3e..1fcd729fd 100644 --- a/modules/servodyn/src/ServoDyn.f90 +++ b/modules/servodyn/src/ServoDyn.f90 @@ -129,6 +129,7 @@ SUBROUTINE SrvD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO INTEGER(IntKi) :: K ! loop counter INTEGER(IntKi) :: nPts ! number of linear wind-speed points INTEGER(IntKi) :: UnSum ! Summary file unit + LOGICAL :: Linearize INTEGER(IntKi) :: ErrStat2 ! temporary Error status of the operation CHARACTER(ErrMsgLen) :: ErrMsg2 ! temporary Error message if ErrStat /= ErrID_None @@ -565,7 +566,8 @@ SUBROUTINE SrvD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO !............................................................................................ ! Initialize module variables !............................................................................................ - call SrvD_InitVars( InitInp, u, p, x, y, m, InitOut, InitInp%Linearize, ErrStat2, ErrMsg2 ) + Linearize = InitInp%Linearize .or. ((p%NumBStC + p%NumNStC + p%NumTStC + p%NumSStC) > 0) + call SrvD_InitVars( InitInp, u, p, x, y, m, InitOut, Linearize, ErrStat2, ErrMsg2 ) call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) !............................................................................................ @@ -698,19 +700,31 @@ subroutine SrvD_InitVars(InitInp, u, p, x, y, m, InitOut, Linearize, ErrStat, Er DatLoc(SrvD_u_BlPitch), & Flags=VF_RotFrame + VF_2PI, & Num=size(u%BlPitch), & + Perturb=uPerturbAng, & LinNames=[('BlPitch('//trim(Num2LStr(i))//'), rad', i = 1, size(u%BlPitch))]) call MV_AddVar(InitOut%Vars%u, "BlPRate", FieldScalar, & DatLoc(SrvD_u_BlPRate), & Flags=VF_RotFrame, & Num=size(u%BlPRate), & + Perturb=uPerturbAng, & LinNames=[('BlPRate('//trim(Num2LStr(i))//'), rad/s', i = 1, size(u%BlPRate))]) - call MV_AddVar(InitOut%Vars%u, "Yaw", FieldScalar, DatLoc(SrvD_u_Yaw), Flags=VF_2PI, LinNames=['Yaw, rad']) + call MV_AddVar(InitOut%Vars%u, "Yaw", FieldScalar, & + DatLoc(SrvD_u_Yaw), & + Flags=VF_2PI, & + Perturb=uPerturbAng, & + LinNames=['Yaw, rad']) - call MV_AddVar(InitOut%Vars%u, "YawRate", FieldScalar, DatLoc(SrvD_u_YawRate), LinNames=['YawRate, rad/s']) + call MV_AddVar(InitOut%Vars%u, "YawRate", FieldScalar, & + DatLoc(SrvD_u_YawRate), & + Perturb=uPerturbAng, & + LinNames=['YawRate, rad/s']) - call MV_AddVar(InitOut%Vars%u, "HSS_Spd", FieldScalar, DatLoc(SrvD_u_HSS_Spd), LinNames=['HSS_Spd, rad/s']) + call MV_AddVar(InitOut%Vars%u, "HSS_Spd", FieldScalar, & + DatLoc(SrvD_u_HSS_Spd), & + Perturb=0.1_R8Ki, & + LinNames=['HSS_Spd, rad/s']) ! Structural controllers do j = 1, p%NumBStC @@ -2845,7 +2859,8 @@ END SUBROUTINE SrvD_CalcConstrStateResidual !---------------------------------------------------------------------------------------------------------------------------------- !> Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions !! with respect to the inputs (u). The partial derivatives dY/du and dX/du are returned. -SUBROUTINE SrvD_JacobianPInput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu, dXdu, dXddu, dZdu ) +SUBROUTINE SrvD_JacobianPInput(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu, dXdu, dXddu, dZdu ) + type(ModVarsType), intent(in ) :: Vars !< Module vars real(DbKi), intent(in ) :: t !< Time in seconds at operating point type(SrvD_InputType), intent(inout) :: u !< Inputs at operating point (may change to inout if a mesh copy is required) type(SrvD_ParameterType), intent(in ) :: p !< Parameters @@ -2869,33 +2884,106 @@ SUBROUTINE SrvD_JacobianPInput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, Er real(R8Ki), allocatable, optional, intent(inout) :: dZdu(:,:) !< Partial derivatives of constraint state !! functions (Z) with respect to inputs (u) [intent in to avoid deallocation] - ! local variables - integer(IntKi) :: ErrStat2 ! Error status of the operation - character(ErrMsgLen) :: ErrMsg2 ! Error message if ErrStat /= ErrID_None - character(*), parameter :: RoutineName = 'SrvD_JacobianPInput' + character(*), parameter :: RoutineName = 'SrvD_JacobianPInput' + integer(IntKi) :: ErrStat2 ! Error status of the operation + character(ErrMsgLen) :: ErrMsg2 ! Error message if ErrStat /= ErrID_None + integer(IntKi) :: i, j, iCol ! Loop indices - ! Initialize ErrStat + ! Initialize ErrStat ErrStat = ErrID_None ErrMsg = '' + ! Update copy of the inputs to perturb + call SrvD_CopyInput(u, m%u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackInput(Vars, u, m%Jac%u) + ! Calculate the partial derivative of the output functions (Y) with respect to the inputs (u) here: - IF ( PRESENT( dYdu ) ) THEN - call Jac_dYdu( t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdu ) - if (Failed()) return + if (present(dYdu)) then + + if (.not. allocated(dYdu)) then + call AllocAry(dYdu, Vars%Ny, Vars%Nu, 'dYdu', ErrStat2, ErrMsg2) + if (Failed()) return + end if + + ! Update copy of the inputs to perturb + call SrvD_CopyInput(u, m%u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackInput(Vars, u, m%Jac%u) + + ! Loop through input variables + do i = 1, size(Vars%u) + + ! Loop through number of linearization perturbations in variable + do j = 1, Vars%u(i)%Num + + ! Calculate column index + iCol = Vars%u(i)%iLoc(1) + j - 1 + + ! Calculate positive perturbation + call MV_Perturb(Vars%u(i), j, 1, m%Jac%u, m%Jac%u_perturb) + call SrvD_VarsUnpackInput(Vars, m%Jac%u_perturb, m%u_perturb) + call SrvD_CalcOutput(t, m%u_perturb, p, x, xd, z, OtherState, m%y_lin, m, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackOutput(Vars, m%y_lin, m%Jac%y_pos) + + ! Calculate negative perturbation + call MV_Perturb(Vars%u(i), j, -1, m%Jac%u, m%Jac%u_perturb) + call SrvD_VarsUnpackInput(Vars, m%Jac%u_perturb, m%u_perturb) + call SrvD_CalcOutput(t, m%u_perturb, p, x, xd, z, OtherState, m%y_lin, m, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackOutput(Vars, m%y_lin, m%Jac%y_neg) + + ! Get partial derivative via central difference and store in full linearization array + call MV_ComputeCentralDiff(Vars%y, Vars%u(i)%Perturb, m%Jac%y_pos, m%Jac%y_neg, dYdu(:,iCol)) + end do + end do + + ! call Jac_dYdu(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdu ) + ! if (Failed()) return END IF - IF ( PRESENT( dXdu ) ) THEN - call Jac_dXdu( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdu ) - if (Failed()) return + ! Calculate the partial derivative of the continuous state functions (X) with respect to the inputs (u) here: + if (present(dXdu) .and. (m%Jac%Nx > 0)) then + + ! Allocate dXdu if not allocated + if (.not. allocated(dXdu)) then + call AllocAry(dXdu, m%Jac%Nx, m%Jac%Nu, 'dXdu', ErrStat2, ErrMsg2); if (Failed()) return + end if + + ! Loop through input variables + do i = 1, size(Vars%u) + + ! Loop through number of linearization perturbations in variable + do j = 1, Vars%u(i)%Num + + ! Calculate column index + iCol = Vars%u(i)%iLoc(1) + j - 1 + + ! Calculate positive perturbation + call MV_Perturb(Vars%u(i), j, 1, m%Jac%u, m%Jac%u_perturb) + call SrvD_VarsUnpackInput(Vars, m%Jac%u_perturb, m%u_perturb) + call SrvD_CalcContStateDeriv(t, m%u_perturb, p, x, xd, z, OtherState, m, m%dxdt_lin, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackContState(Vars, m%dxdt_lin, m%Jac%x_pos) + + ! Calculate negative perturbation + call MV_Perturb(Vars%u(i), j, -1, m%Jac%u, m%Jac%u_perturb) + call SrvD_VarsUnpackInput(Vars, m%Jac%u_perturb, m%u_perturb) + call SrvD_CalcContStateDeriv(t, m%u_perturb, p, x, xd, z, OtherState, m, m%dxdt_lin, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackContState(Vars, m%dxdt_lin, m%Jac%x_neg) + + ! Get partial derivative via central difference and store in full linearization array + dXdu(:,iCol) = (m%Jac%x_pos - m%Jac%x_neg) / (2.0_R8Ki * Vars%u(i)%Perturb) + end do + end do + + ! call Jac_dXdu( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdu ) + ! if (Failed()) return END IF - IF ( PRESENT( dXddu ) ) THEN + if (present(dXddu)) then if (allocated(dXddu)) deallocate(dXddu) - END IF + end if - IF ( PRESENT( dZdu ) ) THEN + if (present(dZdu)) then if (allocated(dZdu)) deallocate(dZdu) - END IF + end if contains logical function Failed() @@ -3874,8 +3962,9 @@ end subroutine Compute_dX !> Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions !! with respect to the continuous states (x). The partial derivatives dY/dx, dX/dx, dXd/dx, and DZ/dx are returned. !! Note SrvD does not have continuous states, so these are not set. -SUBROUTINE SrvD_JacobianPContState( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdx, dXdx, dXddx, dZdx ) +SUBROUTINE SrvD_JacobianPContState(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdx, dXdx, dXddx, dZdx ) !.................................................................................................................................. + type(ModVarsType), intent(in ) :: Vars !< Module vars real(DbKi), intent(in ) :: t !< Time in seconds at operating point type(SrvD_InputType), intent(in ) :: u !< Inputs at operating point (may change to inout if a mesh copy is required) type(SrvD_ParameterType), intent(in ) :: p !< Parameters @@ -3906,22 +3995,92 @@ SUBROUTINE SrvD_JacobianPContState( t, u, p, x, xd, z, OtherState, y, m, ErrStat integer(IntKi) :: ErrStat2 ! Error status of the operation character(ErrMsgLen) :: ErrMsg2 ! Error message if ErrStat /= ErrID_None character(*), parameter :: RoutineName = 'SrvD_JacobianPContState' + integer(IntKi) :: i, j, iCol ! Initialize ErrStat ErrStat = ErrID_None ErrMsg = '' - ! Calculate the partial derivative of the output functions (Y) with respect to the inputs (u) here: - IF ( PRESENT( dYdx ) ) THEN - call Jac_dYdx( t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdx ) - if (Failed()) return - END IF + ! Copy state values + call SrvD_CopyContState(x, m%x_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackContState(Vars, x, m%Jac%x) - IF ( PRESENT( dXdx ) ) THEN - call Jac_dXdx( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdx ) - if (Failed()) return + ! Calculate the partial derivative of the output functions (Y) with respect to the inputs (u) here: + if (present(dYdx)) then + + ! Allocate dYdx if not allocated + if (.not. allocated(dYdx)) then + call AllocAry(dYdx, m%Jac%Ny, m%Jac%Nx, 'dYdx', ErrStat2, ErrMsg2); if (Failed()) return + end if + + ! Loop through state variables + do i = 1, size(Vars%x) + + ! Loop through number of linearization perturbations in variable + do j = 1, Vars%x(i)%Num + + ! Calculate column index + iCol = Vars%x(i)%iLoc(1) + j - 1 + + ! Calculate positive perturbation + call MV_Perturb(Vars%x(i), j, 1, m%Jac%x, m%Jac%x_perturb) + call SrvD_VarsUnpackContState(Vars, m%Jac%x_perturb, m%x_perturb) + call SrvD_CalcOutput(t, u, p, m%x_perturb, xd, z, OtherState, m%y_lin, m, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackOutput(Vars, m%y_lin, m%Jac%y_pos) + + ! Calculate negative perturbation + call MV_Perturb(Vars%x(i), j, -1, m%Jac%x, m%Jac%x_perturb) + call SrvD_VarsUnpackContState(Vars, m%Jac%x_perturb, m%x_perturb) + call SrvD_CalcOutput(t, u, p, m%x_perturb, xd, z, OtherState, m%y_lin, m, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackOutput(Vars, m%y_lin, m%Jac%y_neg) + + ! Get partial derivative via central difference and store in full linearization array + call MV_ComputeCentralDiff(Vars%y, Vars%x(i)%Perturb, m%Jac%y_pos, m%Jac%y_neg, dYdx(:,iCol)) + end do + end do + + ! call Jac_dYdx( t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdx ) + ! if (Failed()) return END IF + ! Calculate the partial derivative of the continuous state functions (X) with respect to the continuous states (x) here: + if (present(dXdx) .and. (m%Jac%Nx > 0)) then + + ! Allocate dXdx if not allocated + if (.not. allocated(dXdx)) then + call AllocAry(dXdx, m%Jac%Nx, m%Jac%Nx, 'dXdx', ErrStat2, ErrMsg2); if (Failed()) return + end if + + ! Loop through state variables + do i = 1, size(Vars%x) + + ! Loop through number of linearization perturbations in variable + do j = 1, Vars%x(i)%Num + + ! Calculate column index + iCol = Vars%x(i)%iLoc(1) + j - 1 + + ! Calculate positive perturbation + call MV_Perturb(Vars%x(i), j, 1, m%Jac%x, m%Jac%x_perturb) + call SrvD_VarsUnpackContState(Vars, m%Jac%x_perturb, m%x_perturb) + call SrvD_CalcContStateDeriv(t, u, p, m%x_perturb, xd, z, OtherState, m, m%dxdt_lin, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackContState(Vars, m%dxdt_lin, m%Jac%x_pos) + + ! Calculate negative perturbation + call MV_Perturb(Vars%x(i), j, -1, m%Jac%x, m%Jac%x_perturb) + call SrvD_VarsUnpackContState(Vars, m%Jac%x_perturb, m%x_perturb) + call SrvD_CalcContStateDeriv(t, u, p, m%x_perturb, xd, z, OtherState, m, m%dxdt_lin, ErrStat2, ErrMsg2); if (Failed()) return + call SrvD_VarsPackContState(Vars, m%dxdt_lin, m%Jac%x_neg) + + ! Get partial derivative via central difference and store in full linearization array + dXdx(:,iCol) = (m%Jac%x_pos - m%Jac%x_neg) / (2.0_R8Ki * Vars%x(i)%Perturb) + end do + end do + + ! call Jac_dXdx( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdx ) + ! if (Failed()) return + end if + IF ( PRESENT( dXddx ) ) THEN if (allocated(dXddx)) deallocate(dXddx) END IF From 3f5d720771184729ab309250e7f254aa270a7dde Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Wed, 18 Feb 2026 22:28:15 +0000 Subject: [PATCH 2/5] Add SrvD to Option 1 solve if it contains structural controllers --- modules/openfast-library/src/FAST_Solver.f90 | 74 ++++++++++++++++---- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/modules/openfast-library/src/FAST_Solver.f90 b/modules/openfast-library/src/FAST_Solver.f90 index fa5b395a2..8f2805d8a 100644 --- a/modules/openfast-library/src/FAST_Solver.f90 +++ b/modules/openfast-library/src/FAST_Solver.f90 @@ -46,6 +46,7 @@ subroutine FAST_SolverInit(p_FAST, p, m, GlueModData, GlueModMaps, Turbine, ErrS character(ErrMsgLen) :: ErrMsg2 integer(IntKi) :: i, j, k integer(IntKi), allocatable :: modIDs(:), modInds(:), iMod(:) + logical :: SrvDOpt1 !---------------------------------------------------------------------------- ! Initialize data in TC structure @@ -91,6 +92,17 @@ subroutine FAST_SolverInit(p_FAST, p, m, GlueModData, GlueModMaps, Turbine, ErrS p%BetaPrime = p%h*p%h*p%Beta*(1.0_R8Ki - p%AlphaF)/(1.0_R8Ki - p%AlphaM) p%GammaPrime = p%h*p%Gamma*(1.0_R8Ki - p%AlphaF)/(1.0_R8Ki - p%AlphaM) + ! ServoDyn is an Option 1 module if it has structural controllers + SrvDOpt1 = .false. + do i = 1, size(Turbine%SrvD%p) + SrvDOpt1 = SrvDOpt1 .or. & + (Turbine%SrvD%p(i)%NumBStC > 0) .or. & + (Turbine%SrvD%p(i)%NumTStC > 0) .or. & + (Turbine%SrvD%p(i)%NumSStC > 0) .or. & + (Turbine%SrvD%p(i)%NumNStC > 0) + end do + + !---------------------------------------------------------------------------- ! Module ordering for solve !---------------------------------------------------------------------------- @@ -115,7 +127,8 @@ subroutine FAST_SolverInit(p_FAST, p, m, GlueModData, GlueModMaps, Turbine, ErrS pack(modInds, ModIDs == Module_SD .and. p%ModCoupling /= LooseCoupling)] ! Indices of Option 1 modules - p%iModOpt1 = [pack(modInds, ModIDs == Module_ED .and. p%ModCoupling == LooseCoupling), & + p%iModOpt1 = [pack(modInds, ModIDs == Module_SrvD .and. SrvDOpt1), & + pack(modInds, ModIDs == Module_ED .and. p%ModCoupling == LooseCoupling), & pack(modInds, ModIDs == Module_BD .and. p%ModCoupling == LooseCoupling), & pack(modInds, ModIDs == Module_SD .and. p%ModCoupling == LooseCoupling), & pack(modInds, ModIDs == Module_SED), & @@ -450,9 +463,30 @@ subroutine SetVarSolveFlags() end associate end do end if - end if + case (Map_Variable) + + ! This includes all variable-to-variable mappings for modules + ! that are in tight coupling and/or Option 1. May need to limit + ! this in the future to just loads and accelerations. + + ! Add flag to source variable + do i = 1, size(SrcMod%Vars%y) + associate (Var => SrcMod%Vars%y(i)) + if (.not. MV_EqualDL(Mapping%SrcDL, Var%DL)) cycle + call MV_SetFlags(Var, VF_Solve) + end associate + end do + + ! Add flag to destination variable + do i = 1, size(DstMod%Vars%u) + associate (Var => DstMod%Vars%u(i)) + if (.not. MV_EqualDL(Mapping%DstDL, Var%DL)) cycle + call MV_SetFlags(Var, VF_Solve) + end associate + end do + end select end associate @@ -953,6 +987,14 @@ subroutine FAST_SolverStep0(p, m, GlueModData, GlueModMaps, Turbine, ErrStat, Er ! Set algorithmic acceleration from actual acceleration m%StatePred%a = m%StatePred%vd + ! Initialize the algorithmic acceleration to actual acceleration in BeamDyn + do i = 1, size(GlueModData) + if (GlueModData(i)%ID == Module_BD) then + Turbine%BD%OtherSt(GlueModData(i)%Ins, STATE_CURR)%xcc = & + Turbine%BD%OtherSt(GlueModData(i)%Ins, STATE_CURR)%acc + end if + end do + !---------------------------------------------------------------------------- ! Set Outputs !---------------------------------------------------------------------------- @@ -1272,9 +1314,11 @@ subroutine FAST_SolverStep(n_t_global, t_initial, p, m, GlueModData, GlueModMaps call FAST_InputSolve(p%iModOpt2(i), GlueModData, GlueModMaps, INPUT_CURR, Turbine, ErrStat2, ErrMsg2) if (Failed()) return - ! Update states - call FAST_UpdateStates(ModData, t_initial, n_t_global, Turbine, ErrStat2, ErrMsg2) - if (Failed()) return + ! Update states of modules not in the tight coupling category + if (iand(ModData%Category, MC_Tight) == 0) then + call FAST_UpdateStates(ModData, t_initial, n_t_global, Turbine, ErrStat2, ErrMsg2) + if (Failed()) return + end if ! Calculate outputs call FAST_CalcOutput(ModData, GlueModMaps, t_global_next, INPUT_CURR, STATE_PRED, Turbine, ErrStat2, ErrMsg2) @@ -1287,12 +1331,18 @@ subroutine FAST_SolverStep(n_t_global, t_initial, p, m, GlueModData, GlueModMaps !------------------------------------------------------------------------- do i = 1, size(p%iModOpt1) + associate (ModData => GlueModData(p%iModOpt1(i))) - call FAST_InputSolve(p%iModOpt1(i), GlueModData, GlueModMaps, INPUT_CURR, Turbine, ErrStat2, ErrMsg2) - if (Failed()) return + ! Solve for inputs to module + call FAST_InputSolve(p%iModOpt1(i), GlueModData, GlueModMaps, INPUT_CURR, Turbine, ErrStat2, ErrMsg2) + if (Failed()) return - call FAST_UpdateStates(GlueModData(p%iModOpt1(i)), t_initial, n_t_global, Turbine, ErrStat2, ErrMsg2) - if (Failed()) return + ! Update states for modules not updated in Option 2 + if (iand(ModData%Category, MC_Option2) == 0) then + call FAST_UpdateStates(GlueModData(p%iModOpt1(i)), t_initial, n_t_global, Turbine, ErrStat2, ErrMsg2) + if (Failed()) return + end if + end associate end do !------------------------------------------------------------------------- @@ -1505,9 +1555,9 @@ subroutine FAST_SolverStep(n_t_global, t_initial, p, m, GlueModData, GlueModMaps if (Failed()) return ! Transfer accelerations to BeamDyn - if (ModData%ID == Module_BD) then - call SetBDAccel(ModData, m%StatePred, Turbine%BD%OtherSt(ModData%Ins, STATE_PRED)) - end if + ! if (ModData%ID == Module_BD) then + ! call SetBDAccel(ModData, m%StatePred, Turbine%BD%OtherSt(ModData%Ins, STATE_PRED)) + ! end if end associate end do From 3fd6c7d3ae11ca2b0f9f9e77e856495003985c56 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Wed, 18 Feb 2026 23:12:48 +0000 Subject: [PATCH 3/5] Update r-test --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 5c1b8ad8e..7c071face 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 5c1b8ad8edfddf34b4458d3e1e238faaa980d38b +Subproject commit 7c071face93d0ca7b052255bb87e34266ca442de From 75778d4364b2dbca92e3d1117c7c63f9f0714957 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Thu, 19 Feb 2026 08:46:26 -0800 Subject: [PATCH 4/5] Debugging VS projects --- modules/awae/src/vtk.cpp | 2 +- vs-build/OpenFAST.sln | 218 +++++++++---------- vs-build/glue-codes/OpenFAST-Simulink.vfproj | 7 + vs-build/modules/AWAE.vfproj | 21 ++ vs-build/modules/AeroDisk.vfproj | 21 ++ vs-build/modules/AeroDyn.vfproj | 21 ++ vs-build/modules/BeamDyn.vfproj | 21 ++ vs-build/modules/ElastoDyn.vfproj | 21 ++ vs-build/modules/ExtLoads.vfproj | 21 ++ vs-build/modules/ExtLoads_Types.vfproj | 21 ++ vs-build/modules/ExtPtfm.vfproj | 21 ++ vs-build/modules/ExternalInflow.vfproj | 21 ++ vs-build/modules/ExternalInflow_Types.vfproj | 21 ++ vs-build/modules/FEAMooring.vfproj | 21 ++ vs-build/modules/HydroDyn.vfproj | 21 ++ vs-build/modules/IceDyn.vfproj | 21 ++ vs-build/modules/IceFloe.vfproj | 21 ++ vs-build/modules/InflowWind.vfproj | 21 ++ vs-build/modules/LinDyn.vfproj | 21 ++ vs-build/modules/MAP.vfproj | 21 ++ vs-build/modules/MoorDyn.vfproj | 21 ++ vs-build/modules/OpenFAST-Library.vfproj | 21 ++ vs-build/modules/OpenFAST-Prelib.vfproj | 21 ++ vs-build/modules/OrcaFlex.vfproj | 21 ++ vs-build/modules/SeaState.vfproj | 21 ++ vs-build/modules/ServoDyn.vfproj | 21 ++ vs-build/modules/SimpleElastoDyn.vfproj | 21 ++ vs-build/modules/SoilDyn.vfproj | 21 ++ vs-build/modules/SubDyn.vfproj | 21 ++ vs-build/modules/VersionInfo.vfproj | 21 ++ vs-build/modules/WakeDynamics.vfproj | 21 ++ 31 files changed, 701 insertions(+), 114 deletions(-) diff --git a/modules/awae/src/vtk.cpp b/modules/awae/src/vtk.cpp index b761fb7b6..3b4e5bbf1 100644 --- a/modules/awae/src/vtk.cpp +++ b/modules/awae/src/vtk.cpp @@ -216,7 +216,7 @@ extern "C" // Read remaining values const auto n_values{n_points * 3}; - for (auto i = 1U; i < n_values; ++i) + for (auto i = 1; i < n_values; ++i) { answer = fast_float::from_chars(answer.ptr, input.data() + input.size(), values[i], fast_float::chars_format::skip_white_space); diff --git a/vs-build/OpenFAST.sln b/vs-build/OpenFAST.sln index 90b4e2956..8ec8938fc 100644 --- a/vs-build/OpenFAST.sln +++ b/vs-build/OpenFAST.sln @@ -549,7 +549,6 @@ Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "OpenFAST-Simulink", "glue-c {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19} = {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19} {648CD825-ECB0-46D1-B1AA-A28F5C36CD91} = {648CD825-ECB0-46D1-B1AA-A28F5C36CD91} {676276A1-DC23-4287-8386-07076303C39D} = {676276A1-DC23-4287-8386-07076303C39D} - {6906E75C-2A54-431B-A11D-145864FCDD5C} = {6906E75C-2A54-431B-A11D-145864FCDD5C} {731C6D0A-CF24-4FD3-ABAC-17F31D97A188} = {731C6D0A-CF24-4FD3-ABAC-17F31D97A188} {774BDC53-33C4-4926-B01D-DC376DAE055B} = {774BDC53-33C4-4926-B01D-DC376DAE055B} {923F8E1F-F5FC-4572-9C32-94C90F04A5A9} = {923F8E1F-F5FC-4572-9C32-94C90F04A5A9} @@ -658,12 +657,12 @@ Global {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Double_Release|x64.Build.0 = Double_Release|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Double_Release|x86.ActiveCfg = Double_Release|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Double_Release|x86.Build.0 = Double_Release|x64 - {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x64.Build.0 = Debug|x64 + {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Debug|x86.Build.0 = Debug|x64 - {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x64.ActiveCfg = Release|x64 - {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x64.Build.0 = Release|x64 + {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x86.ActiveCfg = Release|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.Matlab_Release|x86.Build.0 = Release|x64 {5ADBD025-C654-42C2-BA7C-10F3C3CEEB0E}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -722,12 +721,12 @@ Global {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Double_Release|x64.Build.0 = Double_Release|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Double_Release|x86.Build.0 = Double_Release|x64 - {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x64.Build.0 = Debug|x64 + {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Debug|x86.Build.0 = Debug|x64 - {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x64.ActiveCfg = Release|x64 - {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x64.Build.0 = Release|x64 + {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x86.ActiveCfg = Release|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.Matlab_Release|x86.Build.0 = Release|x64 {9CB36EC2-18AF-468E-BE43-FE63E383AA3A}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -754,12 +753,12 @@ Global {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Double_Release|x64.Build.0 = Double_Release|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Double_Release|x86.ActiveCfg = Double_Release|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Double_Release|x86.Build.0 = Double_Release|x64 - {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x64.Build.0 = Debug|x64 + {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Debug|x86.Build.0 = Debug|x64 - {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x64.ActiveCfg = Release|x64 - {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x64.Build.0 = Release|x64 + {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x86.ActiveCfg = Release|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.Matlab_Release|x86.Build.0 = Release|x64 {12DF411B-C7DA-47BA-BB85-7714D5FD2A16}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -786,12 +785,12 @@ Global {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Double_Release|x64.Build.0 = Double_Release|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Double_Release|x86.ActiveCfg = Double_Release|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Double_Release|x86.Build.0 = Double_Release|x64 - {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x64.Build.0 = Debug|x64 + {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Debug|x86.Build.0 = Debug|x64 - {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x64.ActiveCfg = Release|x64 - {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x64.Build.0 = Release|x64 + {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x86.ActiveCfg = Release|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.Matlab_Release|x86.Build.0 = Release|x64 {A0BB16B8-FBCD-452A-A644-FDD2B21DD05D}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -818,12 +817,12 @@ Global {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Double_Release|x64.Build.0 = Double_Release|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Double_Release|x86.ActiveCfg = Double_Release|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Double_Release|x86.Build.0 = Double_Release|x64 - {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x64.Build.0 = Debug|x64 + {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Debug|x86.Build.0 = Debug|x64 - {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x64.ActiveCfg = Release|x64 - {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x64.Build.0 = Release|x64 + {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x86.ActiveCfg = Release|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.Matlab_Release|x86.Build.0 = Release|x64 {731C6D0A-CF24-4FD3-ABAC-17F31D97A188}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -850,12 +849,12 @@ Global {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Double_Release|x64.Build.0 = Double_Release|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Double_Release|x86.Build.0 = Double_Release|x64 - {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x64.Build.0 = Debug|x64 + {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Debug|x86.Build.0 = Debug|x64 - {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x64.ActiveCfg = Release|x64 - {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x64.Build.0 = Release|x64 + {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x86.ActiveCfg = Release|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.Matlab_Release|x86.Build.0 = Release|x64 {E8C5BB9B-9709-41FA-B6F2-F334B112663A}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -882,12 +881,12 @@ Global {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Double_Release|x64.Build.0 = Double_Release|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Double_Release|x86.Build.0 = Double_Release|x64 - {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x64.Build.0 = Debug|x64 + {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Debug|x86.Build.0 = Debug|x64 - {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x64.ActiveCfg = Release|x64 - {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x64.Build.0 = Release|x64 + {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x86.ActiveCfg = Release|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.Matlab_Release|x86.Build.0 = Release|x64 {B93E20A0-2230-4A2E-A1A6-DDA3240E8C8A}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -914,12 +913,12 @@ Global {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Double_Release|x64.Build.0 = Double_Release|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Double_Release|x86.ActiveCfg = Double_Release|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Double_Release|x86.Build.0 = Double_Release|x64 - {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x64.Build.0 = Debug|x64 + {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Debug|x86.Build.0 = Debug|x64 - {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x64.ActiveCfg = Release|x64 - {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x64.Build.0 = Release|x64 + {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x86.ActiveCfg = Release|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.Matlab_Release|x86.Build.0 = Release|x64 {AD8D7798-F800-4C73-B896-7E48EF1D52D3}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -946,12 +945,12 @@ Global {3000393A-702F-488E-B918-1D37955FA8D3}.Double_Release|x64.Build.0 = Double_Release|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Double_Release|x86.ActiveCfg = Double_Release|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Double_Release|x86.Build.0 = Double_Release|x64 - {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x64.Build.0 = Debug|x64 + {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Debug|x86.Build.0 = Debug|x64 - {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x64.ActiveCfg = Release|x64 - {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x64.Build.0 = Release|x64 + {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x86.ActiveCfg = Release|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.Matlab_Release|x86.Build.0 = Release|x64 {3000393A-702F-488E-B918-1D37955FA8D3}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -978,12 +977,12 @@ Global {676276A1-DC23-4287-8386-07076303C39D}.Double_Release|x64.Build.0 = Double_Release|x64 {676276A1-DC23-4287-8386-07076303C39D}.Double_Release|x86.ActiveCfg = Double_Release|x64 {676276A1-DC23-4287-8386-07076303C39D}.Double_Release|x86.Build.0 = Double_Release|x64 - {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x64.Build.0 = Debug|x64 + {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Debug|x86.Build.0 = Debug|x64 - {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x64.ActiveCfg = Release|x64 - {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x64.Build.0 = Release|x64 + {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x86.ActiveCfg = Release|x64 {676276A1-DC23-4287-8386-07076303C39D}.Matlab_Release|x86.Build.0 = Release|x64 {676276A1-DC23-4287-8386-07076303C39D}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1010,12 +1009,12 @@ Global {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Double_Release|x64.Build.0 = Double_Release|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Double_Release|x86.ActiveCfg = Double_Release|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Double_Release|x86.Build.0 = Double_Release|x64 - {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x64.Build.0 = Debug|x64 + {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Debug|x86.Build.0 = Debug|x64 - {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x64.ActiveCfg = Release|x64 - {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x64.Build.0 = Release|x64 + {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x86.ActiveCfg = Release|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.Matlab_Release|x86.Build.0 = Release|x64 {1DA9F21A-F9FE-45BC-A1CF-37A22220A9DA}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1042,12 +1041,12 @@ Global {951A453F-1999-483D-848A-9B63C282F43D}.Double_Release|x64.Build.0 = Double_Release|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Double_Release|x86.ActiveCfg = Double_Release|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Double_Release|x86.Build.0 = Double_Release|x64 - {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x64.Build.0 = Debug|x64 + {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Debug|x86.Build.0 = Debug|x64 - {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x64.ActiveCfg = Release|x64 - {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x64.Build.0 = Release|x64 + {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x86.ActiveCfg = Release|x64 {951A453F-1999-483D-848A-9B63C282F43D}.Matlab_Release|x86.Build.0 = Release|x64 {951A453F-1999-483D-848A-9B63C282F43D}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1074,12 +1073,12 @@ Global {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Double_Release|x64.Build.0 = Double_Release|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Double_Release|x86.ActiveCfg = Double_Release|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Double_Release|x86.Build.0 = Double_Release|x64 - {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x64.Build.0 = Debug|x64 + {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Debug|x86.Build.0 = Debug|x64 - {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x64.ActiveCfg = Release|x64 - {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x64.Build.0 = Release|x64 + {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x86.ActiveCfg = Release|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.Matlab_Release|x86.Build.0 = Release|x64 {D029FC73-035C-4EB8-96DA-5B1131706A2D}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1106,12 +1105,12 @@ Global {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Double_Release|x64.Build.0 = Double_Release|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Double_Release|x86.ActiveCfg = Double_Release|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Double_Release|x86.Build.0 = Double_Release|x64 - {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x64.Build.0 = Debug|x64 + {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Debug|x86.Build.0 = Debug|x64 - {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x64.ActiveCfg = Release|x64 - {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x64.Build.0 = Release|x64 + {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x86.ActiveCfg = Release|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.Matlab_Release|x86.Build.0 = Release|x64 {FEE80C0E-EF4F-459D-85F9-D7C53B633DBD}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1138,12 +1137,12 @@ Global {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Double_Release|x64.Build.0 = Double_Release|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Double_Release|x86.ActiveCfg = Double_Release|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Double_Release|x86.Build.0 = Double_Release|x64 - {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x64.Build.0 = Debug|x64 + {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Debug|x86.Build.0 = Debug|x64 - {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x64.ActiveCfg = Release|x64 - {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x64.Build.0 = Release|x64 + {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x86.ActiveCfg = Release|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.Matlab_Release|x86.Build.0 = Release|x64 {5F0B72CC-2FBA-4BCF-AB9E-9968A848BC19}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1170,12 +1169,12 @@ Global {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Double_Release|x64.Build.0 = Double_Release|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Double_Release|x86.ActiveCfg = Double_Release|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Double_Release|x86.Build.0 = Double_Release|x64 - {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x64.Build.0 = Debug|x64 + {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Debug|x86.Build.0 = Debug|x64 - {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x64.ActiveCfg = Release|x64 - {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x64.Build.0 = Release|x64 + {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x86.ActiveCfg = Release|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.Matlab_Release|x86.Build.0 = Release|x64 {923F8E1F-F5FC-4572-9C32-94C90F04A5A9}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1238,8 +1237,8 @@ Global {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Debug|x64.Build.0 = Debug|x64 {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Debug|x86.Build.0 = Debug|x64 - {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x64.ActiveCfg = Release|x64 - {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x64.Build.0 = Release|x64 + {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x86.ActiveCfg = Release|x64 {B50C776E-F931-4E83-916F-C4E6977E40A3}.Matlab_Release|x86.Build.0 = Release|x64 {B50C776E-F931-4E83-916F-C4E6977E40A3}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1298,12 +1297,12 @@ Global {2467FDD4-622B-4628-993A-73994FB8172E}.Double_Release|x64.Build.0 = Double_Release|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Double_Release|x86.ActiveCfg = Double_Release|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Double_Release|x86.Build.0 = Double_Release|x64 - {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x64.Build.0 = Debug|x64 + {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Debug|x86.Build.0 = Debug|x64 - {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x64.ActiveCfg = Release|x64 - {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x64.Build.0 = Release|x64 + {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x86.ActiveCfg = Release|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.Matlab_Release|x86.Build.0 = Release|x64 {2467FDD4-622B-4628-993A-73994FB8172E}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1330,12 +1329,12 @@ Global {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Double_Release|x64.Build.0 = Double_Release|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Double_Release|x86.ActiveCfg = Double_Release|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Double_Release|x86.Build.0 = Double_Release|x64 - {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x64.Build.0 = Debug|x64 + {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Debug|x86.Build.0 = Debug|x64 - {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x64.ActiveCfg = Release|x64 - {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x64.Build.0 = Release|x64 + {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x86.ActiveCfg = Release|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.Matlab_Release|x86.Build.0 = Release|x64 {648CD825-ECB0-46D1-B1AA-A28F5C36CD91}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1362,12 +1361,12 @@ Global {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Double_Release|x64.Build.0 = Double_Release|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Double_Release|x86.ActiveCfg = Double_Release|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Double_Release|x86.Build.0 = Double_Release|x64 - {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x64.Build.0 = Debug|x64 + {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Debug|x86.Build.0 = Debug|x64 - {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x64.ActiveCfg = Release|x64 - {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x64.Build.0 = Release|x64 + {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x86.ActiveCfg = Release|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.Matlab_Release|x86.Build.0 = Release|x64 {FE80CE9A-7E16-476D-B63A-F9F870ACB662}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1394,12 +1393,12 @@ Global {029204DD-3D5B-47C6-8CAA-A933886D4674}.Double_Release|x64.Build.0 = Double_Release|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Double_Release|x86.ActiveCfg = Double_Release|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Double_Release|x86.Build.0 = Double_Release|x64 - {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x64.Build.0 = Debug|x64 + {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Debug|x86.Build.0 = Debug|x64 - {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x64.ActiveCfg = Release|x64 - {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x64.Build.0 = Release|x64 + {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x86.ActiveCfg = Release|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.Matlab_Release|x86.Build.0 = Release|x64 {029204DD-3D5B-47C6-8CAA-A933886D4674}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1426,12 +1425,12 @@ Global {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Double_Release|x64.Build.0 = Double_Release|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Double_Release|x86.ActiveCfg = Double_Release|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Double_Release|x86.Build.0 = Double_Release|x64 - {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x64.Build.0 = Debug|x64 + {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Debug|x86.Build.0 = Debug|x64 - {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x64.ActiveCfg = Release|x64 - {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x64.Build.0 = Release|x64 + {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x86.ActiveCfg = Release|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.Matlab_Release|x86.Build.0 = Release|x64 {3C27CA2D-259A-4A45-AA19-DB64F44FBE3C}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1458,12 +1457,12 @@ Global {774BDC53-33C4-4926-B01D-DC376DAE055B}.Double_Release|x64.Build.0 = Double_Release|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Double_Release|x86.ActiveCfg = Double_Release|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Double_Release|x86.Build.0 = Double_Release|x64 - {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x64.Build.0 = Debug|x64 + {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Debug|x86.Build.0 = Debug|x64 - {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x64.ActiveCfg = Release|x64 - {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x64.Build.0 = Release|x64 + {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x86.ActiveCfg = Release|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.Matlab_Release|x86.Build.0 = Release|x64 {774BDC53-33C4-4926-B01D-DC376DAE055B}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1490,12 +1489,10 @@ Global {6906E75C-2A54-431B-A11D-145864FCDD5C}.Double_Release|x64.Build.0 = Double_Release|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Double_Release|x86.ActiveCfg = Double_Release|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Double_Release|x86.Build.0 = Double_Release|x64 - {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Debug|x64.Build.0 = Debug|x64 + {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Debug|x86.Build.0 = Debug|x64 - {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Release|x64.ActiveCfg = Release|x64 - {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Release|x64.Build.0 = Release|x64 + {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Release|x86.ActiveCfg = Release|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.Matlab_Release|x86.Build.0 = Release|x64 {6906E75C-2A54-431B-A11D-145864FCDD5C}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1523,11 +1520,9 @@ Global {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Double_Release|x86.ActiveCfg = Double_Release|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Double_Release|x86.Build.0 = Double_Release|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Debug|x64.Build.0 = Debug|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Debug|x86.Build.0 = Debug|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Release|x64.ActiveCfg = Release|x64 - {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Release|x64.Build.0 = Release|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Release|x86.ActiveCfg = Release|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.Matlab_Release|x86.Build.0 = Release|x64 {ACF05685-6592-462C-A3B3-9CDE2CAFD958}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1555,7 +1550,6 @@ Global {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Double_Release|x86.Build.0 = Double_Release|x64 {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Matlab_Debug|x64.Build.0 = Debug|x64 {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Matlab_Debug|x86.Build.0 = Debug|x64 {60BA8F27-5C49-42DA-9CE4-F85A8215D02A}.Matlab_Release|x64.ActiveCfg = Release|x64 @@ -1615,12 +1609,12 @@ Global {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Double_Release|x64.Build.0 = Double_Release|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Double_Release|x86.ActiveCfg = Double_Release|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Double_Release|x86.Build.0 = Double_Release|x64 - {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x64.Build.0 = Debug|x64 + {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Debug|x86.Build.0 = Debug|x64 - {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x64.ActiveCfg = Release|x64 - {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x64.Build.0 = Release|x64 + {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x86.ActiveCfg = Release|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.Matlab_Release|x86.Build.0 = Release|x64 {CA8A0366-3C47-439A-8E9A-25BB36E3C10D}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -1678,7 +1672,6 @@ Global {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Double_Release|x86.Build.0 = Double_Release|x64 {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Matlab_Debug|x64.Build.0 = Debug|x64 {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Matlab_Debug|x86.Build.0 = Debug|x64 {4A398285-E3C7-4CD9-8F43-51A017D5A48A}.Matlab_Release|x64.ActiveCfg = Release|x64 @@ -1884,7 +1877,6 @@ Global {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Double_Release|x86.ActiveCfg = Double_Release|x64 {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Double_Release|x86.Build.0 = Double_Release|x64 {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Matlab_Debug|x64.Build.0 = Debug|x64 {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Matlab_Debug|x86.Build.0 = Debug|x64 {C271833A-06D0-441D-A5A8-DDAB0AA4740C}.Matlab_Release|x64.ActiveCfg = Release|x64 @@ -2060,12 +2052,12 @@ Global {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Double_Release|x64.Build.0 = Double_Release|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Double_Release|x86.ActiveCfg = Double_Release|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Double_Release|x86.Build.0 = Double_Release|x64 - {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x64.Build.0 = Debug|x64 + {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x86.ActiveCfg = Debug|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Debug|x86.Build.0 = Debug|x64 - {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x64.ActiveCfg = Release|x64 - {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x64.Build.0 = Release|x64 + {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x86.ActiveCfg = Release|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.Matlab_Release|x86.Build.0 = Release|x64 {EA57ACC1-EE1F-4565-B4DA-FA04D11A2492}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -2353,12 +2345,12 @@ Global {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Double_Release|x64.Build.0 = Double_Release|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Double_Release|x86.ActiveCfg = Double_Release|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Double_Release|x86.Build.0 = Double_Release|x64 - {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x64.ActiveCfg = Debug|x64 - {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x64.Build.0 = Debug|x64 + {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x64.ActiveCfg = Matlab_Debug|x64 + {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x64.Build.0 = Matlab_Debug|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x86.ActiveCfg = Double_Debug|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Debug|x86.Build.0 = Double_Debug|x64 - {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x64.ActiveCfg = Release|x64 - {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x64.Build.0 = Release|x64 + {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x64.ActiveCfg = Matlab_Release|x64 + {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x64.Build.0 = Matlab_Release|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x86.ActiveCfg = Release|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.Matlab_Release|x86.Build.0 = Release|x64 {F8C26AB7-4B2F-4610-A18B-A8C860926B21}.OpenMP_Release|x64.ActiveCfg = OpenMP_Release|x64 @@ -2385,7 +2377,7 @@ Global {9779535B-8DE4-4484-8B59-6E78344D658A}.Double_Release|x64.Build.0 = Double_Release|x64 {9779535B-8DE4-4484-8B59-6E78344D658A}.Double_Release|x86.ActiveCfg = Double_Release|x64 {9779535B-8DE4-4484-8B59-6E78344D658A}.Double_Release|x86.Build.0 = Double_Release|x64 - {9779535B-8DE4-4484-8B59-6E78344D658A}.Matlab_Debug|x64.ActiveCfg = Double_Debug|x64 + {9779535B-8DE4-4484-8B59-6E78344D658A}.Matlab_Debug|x64.ActiveCfg = Debug|x64 {9779535B-8DE4-4484-8B59-6E78344D658A}.Matlab_Debug|x86.ActiveCfg = Double_Debug|x64 {9779535B-8DE4-4484-8B59-6E78344D658A}.Matlab_Debug|x86.Build.0 = Double_Debug|x64 {9779535B-8DE4-4484-8B59-6E78344D658A}.Matlab_Release|x64.ActiveCfg = Release|x64 diff --git a/vs-build/glue-codes/OpenFAST-Simulink.vfproj b/vs-build/glue-codes/OpenFAST-Simulink.vfproj index aa9a838a4..12a22420d 100644 --- a/vs-build/glue-codes/OpenFAST-Simulink.vfproj +++ b/vs-build/glue-codes/OpenFAST-Simulink.vfproj @@ -37,7 +37,14 @@ + + + + + + + diff --git a/vs-build/modules/AWAE.vfproj b/vs-build/modules/AWAE.vfproj index e22ffd9da..e45e8ec06 100644 --- a/vs-build/modules/AWAE.vfproj +++ b/vs-build/modules/AWAE.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/AeroDisk.vfproj b/vs-build/modules/AeroDisk.vfproj index eb8643815..cf14ce216 100644 --- a/vs-build/modules/AeroDisk.vfproj +++ b/vs-build/modules/AeroDisk.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/AeroDyn.vfproj b/vs-build/modules/AeroDyn.vfproj index 83aba1e89..19b702a15 100644 --- a/vs-build/modules/AeroDyn.vfproj +++ b/vs-build/modules/AeroDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/BeamDyn.vfproj b/vs-build/modules/BeamDyn.vfproj index 87f8c4928..cb4aa1896 100644 --- a/vs-build/modules/BeamDyn.vfproj +++ b/vs-build/modules/BeamDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/ElastoDyn.vfproj b/vs-build/modules/ElastoDyn.vfproj index 325df6431..d9b2acef7 100644 --- a/vs-build/modules/ElastoDyn.vfproj +++ b/vs-build/modules/ElastoDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/ExtLoads.vfproj b/vs-build/modules/ExtLoads.vfproj index 652af6480..e0c84181c 100644 --- a/vs-build/modules/ExtLoads.vfproj +++ b/vs-build/modules/ExtLoads.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/ExtLoads_Types.vfproj b/vs-build/modules/ExtLoads_Types.vfproj index 9c5b28e76..8afdbe9f2 100644 --- a/vs-build/modules/ExtLoads_Types.vfproj +++ b/vs-build/modules/ExtLoads_Types.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/ExtPtfm.vfproj b/vs-build/modules/ExtPtfm.vfproj index 8780241b7..b37ed4827 100644 --- a/vs-build/modules/ExtPtfm.vfproj +++ b/vs-build/modules/ExtPtfm.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/ExternalInflow.vfproj b/vs-build/modules/ExternalInflow.vfproj index d0a8159a4..e73e73a76 100644 --- a/vs-build/modules/ExternalInflow.vfproj +++ b/vs-build/modules/ExternalInflow.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/ExternalInflow_Types.vfproj b/vs-build/modules/ExternalInflow_Types.vfproj index 6ba521325..cf5b36a55 100644 --- a/vs-build/modules/ExternalInflow_Types.vfproj +++ b/vs-build/modules/ExternalInflow_Types.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/FEAMooring.vfproj b/vs-build/modules/FEAMooring.vfproj index 2ea9700bd..0aac9f8ad 100644 --- a/vs-build/modules/FEAMooring.vfproj +++ b/vs-build/modules/FEAMooring.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/HydroDyn.vfproj b/vs-build/modules/HydroDyn.vfproj index ea66e9821..e07f77c92 100644 --- a/vs-build/modules/HydroDyn.vfproj +++ b/vs-build/modules/HydroDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/IceDyn.vfproj b/vs-build/modules/IceDyn.vfproj index 35e2056db..ce7756d99 100644 --- a/vs-build/modules/IceDyn.vfproj +++ b/vs-build/modules/IceDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/IceFloe.vfproj b/vs-build/modules/IceFloe.vfproj index 31427f939..5b417f7a9 100644 --- a/vs-build/modules/IceFloe.vfproj +++ b/vs-build/modules/IceFloe.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/InflowWind.vfproj b/vs-build/modules/InflowWind.vfproj index b992cfe86..9f60d9b6d 100644 --- a/vs-build/modules/InflowWind.vfproj +++ b/vs-build/modules/InflowWind.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/LinDyn.vfproj b/vs-build/modules/LinDyn.vfproj index 9e5fa7d7a..afd7a7f5a 100644 --- a/vs-build/modules/LinDyn.vfproj +++ b/vs-build/modules/LinDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/MAP.vfproj b/vs-build/modules/MAP.vfproj index 87b3f2f3d..efb5f758b 100644 --- a/vs-build/modules/MAP.vfproj +++ b/vs-build/modules/MAP.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/MoorDyn.vfproj b/vs-build/modules/MoorDyn.vfproj index ddae8bb4f..d2e951ba9 100644 --- a/vs-build/modules/MoorDyn.vfproj +++ b/vs-build/modules/MoorDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/OpenFAST-Library.vfproj b/vs-build/modules/OpenFAST-Library.vfproj index a8a187750..ece570e47 100644 --- a/vs-build/modules/OpenFAST-Library.vfproj +++ b/vs-build/modules/OpenFAST-Library.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/OpenFAST-Prelib.vfproj b/vs-build/modules/OpenFAST-Prelib.vfproj index 068e8e04b..5910a53f8 100644 --- a/vs-build/modules/OpenFAST-Prelib.vfproj +++ b/vs-build/modules/OpenFAST-Prelib.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/OrcaFlex.vfproj b/vs-build/modules/OrcaFlex.vfproj index 4f5eca744..0bcfc3014 100644 --- a/vs-build/modules/OrcaFlex.vfproj +++ b/vs-build/modules/OrcaFlex.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/SeaState.vfproj b/vs-build/modules/SeaState.vfproj index 43572589a..10fe6249c 100644 --- a/vs-build/modules/SeaState.vfproj +++ b/vs-build/modules/SeaState.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/ServoDyn.vfproj b/vs-build/modules/ServoDyn.vfproj index b5c35066e..b865db6d1 100644 --- a/vs-build/modules/ServoDyn.vfproj +++ b/vs-build/modules/ServoDyn.vfproj @@ -84,6 +84,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/SimpleElastoDyn.vfproj b/vs-build/modules/SimpleElastoDyn.vfproj index 93f1bb1d1..ca795dd95 100644 --- a/vs-build/modules/SimpleElastoDyn.vfproj +++ b/vs-build/modules/SimpleElastoDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vs-build/modules/SoilDyn.vfproj b/vs-build/modules/SoilDyn.vfproj index fd101e595..d011cada3 100644 --- a/vs-build/modules/SoilDyn.vfproj +++ b/vs-build/modules/SoilDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/SubDyn.vfproj b/vs-build/modules/SubDyn.vfproj index 83a190e50..cce6203fc 100644 --- a/vs-build/modules/SubDyn.vfproj +++ b/vs-build/modules/SubDyn.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/VersionInfo.vfproj b/vs-build/modules/VersionInfo.vfproj index 6b50a005a..9ec48e494 100644 --- a/vs-build/modules/VersionInfo.vfproj +++ b/vs-build/modules/VersionInfo.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s diff --git a/vs-build/modules/WakeDynamics.vfproj b/vs-build/modules/WakeDynamics.vfproj index 7f7478a74..359458c9b 100644 --- a/vs-build/modules/WakeDynamics.vfproj +++ b/vs-build/modules/WakeDynamics.vfproj @@ -64,6 +64,27 @@ + + + + + + + + + + + + + + + + + + + + + s From e53c6948e81bfb7bd4212af5f65414b05d22fccc Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Thu, 19 Feb 2026 17:26:08 +0000 Subject: [PATCH 5/5] Remove old linearization code form ServoDyn --- modules/servodyn/src/ServoDyn.f90 | 2058 +------------------- modules/servodyn/src/ServoDyn_Registry.txt | 20 - modules/servodyn/src/ServoDyn_Types.f90 | 316 +-- 3 files changed, 14 insertions(+), 2380 deletions(-) diff --git a/modules/servodyn/src/ServoDyn.f90 b/modules/servodyn/src/ServoDyn.f90 index 1fcd729fd..b476eeb9c 100644 --- a/modules/servodyn/src/ServoDyn.f90 +++ b/modules/servodyn/src/ServoDyn.f90 @@ -520,9 +520,7 @@ SUBROUTINE SrvD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO p%TrimGain = InitInp%TrimGain p%RotSpeedRef = InitInp%RotSpeedRef - if (InitInp%Linearize) then - call SrvD_Init_Jacobian(InitInp, p, u, y, InitOut, ErrStat2, ErrMsg2); if(Failed()) return; - else + if (.not. InitInp%Linearize) then p%TrimCase = TrimCase_none end if @@ -870,554 +868,6 @@ logical function Failed() end function Failed end subroutine -!---------------------------------------------------------------------------------------------------------------------------------- -!> Initialize everything needed for linearization -subroutine SrvD_Init_Jacobian( InitInp, p, u, y, InitOut, ErrStat, ErrMsg ) - type(SrvD_InitInputType), intent(in ) :: InitInp !< Input data for initialization routine - type(SrvD_ParameterType), intent(inout) :: p !< Parameters - type(SrvD_InputType), intent(in ) :: u !< An initial guess for the input; input mesh must be defined - type(SrvD_OutputType), intent(in ) :: y !< outputs - type(SrvD_InitOutputType), intent(inout) :: InitOut !< Output for initialization routine - integer(IntKi), intent( out) :: ErrStat !< Error status of the operation - character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None - - ! local variables: - character(*), parameter :: RoutineName = 'SrvD_Init_Jacobian' - integer(IntKi) :: ErrStat2 ! temporary Error status of the operation - character(ErrMsgLen) :: ErrMsg2 ! temporary Error message if ErrStat /= ErrID_None - real(ReKi) :: dx - real(R8Ki) :: du_t, du_r - - ErrStat = ErrID_None - ErrMsg = "" - - ! --- System dimension - ! rough estimate based on tower length - dx = 0.2_ReKi*Pi/180.0_ReKi * max(TwoNorm(InitInp%NacRefPos - InitInp%TwrBaseRefPos), 1.0_ReKi) - ! for translation inputs - du_t = 0.2_R8Ki*Pi_R8/180.0_R8Ki * max(real(TwoNorm(InitInp%NacRefPos - InitInp%TwrBaseRefPos),R8Ki), 1.0_R8Ki) - ! for rotation inputs - du_r = 0.2_R8Ki * Pi_R8 / 180.0_R8Ki - - ! initialize jacobian indices - call SrvD_Init_Jacobian_y(); if (ErrStat >= AbortErrLev) return; - call SrvD_Init_Jacobian_x(dx); if (ErrStat >= AbortErrLev) return; - call SrvD_Init_Jacobian_u(du_t,du_r); if (ErrStat >= AbortErrLev) return; - - ! To figure out what is going on, use this to print stuff to screen - !call CheckInfo() - -contains - logical function Failed() - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - Failed = ErrStat >= AbortErrLev - end function Failed - !> This routine initializes the Jacobian parameters and - !! initialization outputs for the linearized outputs. - subroutine SrvD_Init_Jacobian_y() - integer(IntKi) :: i, j, index_next - ! determine how many outputs there are in the Jacobian - p%Jac_ny = 0 - - ! outputs always passed - p%Jac_ny = p%Jac_ny & - + size(y%BlPitchCom) & ! y%BlPitchCom(:) - + size(y%BlPRateCom) & ! y%BlPRateCom(:) - + size(y%BlPitchMom) & ! y%BlPitchMom(:) - + 1 & ! y%YawMom - + 1 & ! y%GenTrq - + 1 ! y%ElecPwr - - ! StC related outputs - p%Jac_ny = p%Jac_ny & - + p%NumBStC * 6 * p%NumBl & ! 3 Force, 3 Moment at each BStC instance on each blade - + p%NumNStC * 6 & ! 3 Force, 3 Moment at each NStC instance - + p%NumTStC * 6 & ! 3 Force, 3 Moment at each TStC instance - + p%NumSStC * 6 ! 3 Force, 3 Moment at each SStC instance - - ! User requested outputs - p%Jac_ny = p%Jac_ny & - + p%NumOuts ! user requested outputs - - !-------------------------------- - ! linearization output names - !-------------------------------- - call AllocAry(InitOut%LinNames_y, p%Jac_ny, 'LinNames_y', ErrStat2, ErrMsg2); if (Failed()) return; - call AllocAry(InitOut%RotFrame_y, p%Jac_ny, 'RotFrame_y', ErrStat2, ErrMsg2); if (Failed()) return; - InitOut%RotFrame_y = .false. ! Meshes are in global, not rotating frame - index_next = 1 ! Index counter initialize - - ! y%BlPitchCom -- NOTE: assumed order of these outputs - do i=1,size(y%BlPitchCom) - InitOut%LinNames_y(index_next) = 'BlPitchCom('//trim(num2lstr(i))//'), rad' - InitOut%RotFrame_y(index_next) = .true. - index_next = index_next + 1 - end do - - ! y%BlPRateCom -- NOTE: assumed order of these outputs - do i=1,size(y%BlPRateCom) - InitOut%LinNames_y(index_next) = 'BlPRateCom('//trim(num2lstr(i))//'), rad/s' - InitOut%RotFrame_y(index_next) = .true. - index_next = index_next + 1 - end do - - ! y%BlPitchMom -- NOTE: assumed order of these outputs - do i=1,size(y%BlPitchMom) - InitOut%LinNames_y(index_next) = 'BlPitchMom('//trim(num2lstr(i))//'), Nm' - InitOut%RotFrame_y(index_next) = .true. - index_next = index_next + 1 - end do - - ! y%YawMom -- not in rotating frame - InitOut%LinNames_y(index_next) = 'YawMom, Nm'; index_next = index_next + 1 - - ! y%GenPwr -- not in rotating frame - InitOut%LinNames_y(index_next) = 'GenTrq, Nm'; index_next = index_next + 1 - - ! y%ElecPwr -- not in rotating frame - InitOut%LinNames_y(index_next) = 'ElecPwr, W'; index_next = index_next + 1 - - !-------------------------------- - ! StC related outputs - !-------------------------------- - CALL AllocAry(p%Jac_Idx_BStC_y, 2, p%NumBl, p%NumBStC, 'Jac_Idx_BStC_y', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_BStC_y = 0_IntKi - CALL AllocAry(p%Jac_Idx_NStC_y, 2, p%NumNStC, 'Jac_Idx_NStC_y', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_NStC_y = 0_IntKi - CALL AllocAry(p%Jac_Idx_TStC_y, 2, p%NumTStC, 'Jac_Idx_TStC_y', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_TStC_y = 0_IntKi - CALL AllocAry(p%Jac_Idx_SStC_y, 2, p%NumSStC, 'Jac_Idx_SStC_y', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_SStC_y = 0_IntKi - ! Blade - if (p%NumBStC > 0) then - do j=1,p%NumBStC - do i=1,p%NumBl - p%Jac_Idx_BStC_y(1,i,j) = index_next ! Start index of BStC in y - call PackLoadMesh_Names( y%BStCLoadMesh(i,j), 'Blade '//trim(num2lstr(i))//' StC '//trim(num2lstr(j)), InitOut%LinNames_y, index_next ) - p%Jac_Idx_BStC_y(2,i,j) = index_next-1 ! End index of BStC in y - enddo - enddo - endif - ! Nacelle - if (p%NumNStC > 0) then - do j=1,p%NumNStC - p%Jac_Idx_NStC_y(1,j) = index_next ! Start index of NStC in y - call PackLoadMesh_Names( y%NStCLoadMesh(j), 'Nacelle StC '//trim(num2lstr(j)), InitOut%LinNames_y, index_next ) - p%Jac_Idx_NStC_y(2,j) = index_next-1 ! End index of NStC in y - enddo - endif - ! Tower - if (p%NumTStC > 0) then - do j=1,p%NumTStC - p%Jac_Idx_TStC_y(1,j) = index_next ! Start index of TStC in y - call PackLoadMesh_Names( y%TStCLoadMesh(j), 'Tower StC '//trim(num2lstr(j)), InitOut%LinNames_y, index_next ) - p%Jac_Idx_TStC_y(2,j) = index_next-1 ! End index of TStC in y - enddo - endif - ! Sub-tructure - if (p%NumSStC > 0) then - do j=1,p%NumSStC - p%Jac_Idx_SStC_y(1,j) = index_next ! Start index of SStC in y - call PackLoadMesh_Names( y%SStCLoadMesh(j), 'Substructure StC '//trim(num2lstr(j)), InitOut%LinNames_y, index_next ) - p%Jac_Idx_SStC_y(2,j) = index_next-1 ! End index of SStC in y - enddo - endif - - !-------------------------------- - ! y%OutParam -- User requested outputs - ! Some outputs are in rotating frame - !-------------------------------- - do i=1,p%NumOuts - InitOut%LinNames_y(index_next) = trim(p%OutParam(i)%Name)//', '//p%OutParam(i)%Units - if (ANY( p%OutParam(i)%Indx == BlPitchC )) InitOut%RotFrame_y(index_next) = .true. ! WriteOutput BlPitch commands - if (ANY( p%OutParam(i)%Indx == BlPRateC )) InitOut%RotFrame_y(index_next) = .true. ! WriteOutput BlPRate commands - if (ANY( p%OutParam(i)%Indx == BlPitchM )) InitOut%RotFrame_y(index_next) = .true. ! WriteOutput BlPitch moments - - ! Blade StC local output channels - if (ANY( p%OutParam(i)%Indx == BStC_XQ )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC X displacements - if (ANY( p%OutParam(i)%Indx == BStC_XQD )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC X displacement velocities - if (ANY( p%OutParam(i)%Indx == BStC_YQ )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC Y displacements - if (ANY( p%OutParam(i)%Indx == BStC_YQD )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC Y displacement velocities - if (ANY( p%OutParam(i)%Indx == BStC_ZQ )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC Z displacements - if (ANY( p%OutParam(i)%Indx == BStC_ZQD )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC Z displacement velocities - if (ANY( p%OutParam(i)%Indx == BStC_Fxl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - if (ANY( p%OutParam(i)%Indx == BStC_Fyl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - if (ANY( p%OutParam(i)%Indx == BStC_Fzl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - if (ANY( p%OutParam(i)%Indx == BStC_Mxl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - if (ANY( p%OutParam(i)%Indx == BStC_Myl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - if (ANY( p%OutParam(i)%Indx == BStC_Mzl )) InitOut%RotFrame_y(index_next) = .true. ! Blade StC local forces and moments - index_next = index_next + 1 - end do - end subroutine SrvD_Init_Jacobian_y - - !> This routine initializes the Jacobian parameters and initialization outputs for the linearized continuous states. - subroutine SrvD_Init_Jacobian_x(dx) - real(ReKi), intent(in ) :: dx ! default perturbation size - integer(IntKi) :: i, j, k, index_next - p%Jac_nx = 0 ! no states other than StC states - ! StC related states - p%Jac_nx = p%Jac_nx & - + p%NumBStC * 2 * 3 * p%NumBl & ! 3 displacement state, 3 displacement state derivatives at each BStC instance on each blade - + p%NumNStC * 2 * 3 & ! 3 displacement state, 3 displacement state derivatives at each NStC instance - + p%NumTStC * 2 * 3 & ! 3 displacement state, 3 displacement state derivatives at each TStC instance - + p%NumSStC * 2 * 3 ! 3 displacement state, 3 displacement state derivatives at each SStC instance - - ! allocate space for the row/column names and for perturbation sizes - CALL AllocAry(InitOut%LinNames_x , p%Jac_nx, 'LinNames_x' , ErrStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry(InitOut%RotFrame_x , p%Jac_nx, 'RotFrame_x' , ErrStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry(InitOut%DerivOrder_x, p%Jac_nx, 'DerivOrder_x', ErrStat2, ErrMsg2); if (Failed()) return; - ! --- Jac_x_indx: matrix to store index to help us figure out what the ith value of the x vector really means - ! column 1 indicates module's mesh and field perturbation index (index to p%dx) - ! column 2 indicates the first index (x-y-z component) (unused) - ! column 3 is the StC motion mesh (Instance index) - ! column 4 is the StC motion mesh (blade index BStC mesh, ignored on others) - call allocAry( p%Jac_x_indx, p%Jac_nx, 4, 'p%Jac_x_indx', ErrStat2, ErrMsg2); if (Failed()) return; - p%Jac_x_indx = 0_IntKi - ! perturbation sizes - CALL AllocAry(p%dx, 24, 'x perturbation', ErrStat2, ErrMsg2); if (Failed()) return; - p%dx(1:24) = dx ! all state perturbations are the same for disp and velocity - - ! Initialize RotFrame and DerivOrder - InitOut%RotFrame_x = .false. - InitOut%DerivOrder_x = 2 - !-------------------------------- - ! linearization state names - !-------------------------------- - CALL AllocAry(p%Jac_Idx_BStC_x, 2, p%NumBl, p%NumBStC, 'Jac_Idx_BStC_x', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_BStC_x = 0_IntKi - CALL AllocAry(p%Jac_Idx_NStC_x, 2, p%NumNStC, 'Jac_Idx_NStC_x', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_NStC_x = 0_IntKi - CALL AllocAry(p%Jac_Idx_TStC_x, 2, p%NumTStC, 'Jac_Idx_TStC_x', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_TStC_x = 0_IntKi - CALL AllocAry(p%Jac_Idx_SStC_x, 2, p%NumSStC, 'Jac_Idx_SStC_x', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_SStC_x = 0_IntKi - index_next = 0 ! Index counter initialize - ! Blade StC -- displacement state - if (p%NumBStC > 0) then - do j=1,p%NumBStC - do k=1,p%NumBl - p%Jac_Idx_BStC_x(1,k,j) = index_next+1 ! Start index of BStC in x - p%Jac_x_indx(index_next+1:index_next+6,1) = (/ 1, 2, 3, 4, 5, 6/) ! StC type and field index - p%Jac_x_indx(index_next+1:index_next+6,2) = (/ 1, 2, 3, 1, 2, 3/) ! component (x,y,z) - p%Jac_x_indx(index_next+1:index_next+6,3) = j ! Instance - p%Jac_x_indx(index_next+1:index_next+6,4) = k ! blade - InitOut%LinNames_x(index_next+1) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state X m'; ! x x%BStC(j)%StC_x(1,k) - InitOut%LinNames_x(index_next+2) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state Y m'; ! y x%BStC(j)%StC_x(3,k) - InitOut%LinNames_x(index_next+3) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state Z m'; ! z x%BStC(j)%StC_x(5,k) - InitOut%LinNames_x(index_next+4) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state dX/dt m/s'; ! x-dot x%BStC(j)%StC_x(2,k) - InitOut%LinNames_x(index_next+5) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state dY/dt m/s'; ! y-dot x%BStC(j)%StC_x(4,k) - InitOut%LinNames_x(index_next+6) = 'Blade '//trim(num2lstr(k))//' StC '//trim(num2lstr(j))//' local displacement state dZ/dt m/s'; ! z-dot x%BStC(j)%StC_x(6,k) - InitOut%RotFrame_x(index_next+1:index_next+6) = .true. - index_next = index_next + 6 - p%Jac_Idx_BStC_x(2,k,j) = index_next ! End index of BStC in x - enddo - enddo - endif - ! Nacelle StC -- displacement state - if (p%NumNStC > 0) then - do j=1,p%NumNStC - p%Jac_Idx_NStC_x(1,j) = index_next+1 ! Start index of NStC in x - p%Jac_x_indx(index_next+1:index_next+6,1) = (/ 7, 8, 9,10,11,12/) ! StC type and field index - p%Jac_x_indx(index_next+1:index_next+6,2) = (/ 1, 2, 3, 1, 2, 3/) ! component (x,y,z) - p%Jac_x_indx(index_next+1:index_next+6,3) = j ! Instance - InitOut%LinNames_x(index_next+1) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state X m'; ! x x%NStC(j)%StC_x(1,1) - InitOut%LinNames_x(index_next+2) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state Y m'; ! y x%NStC(j)%StC_x(3,1) - InitOut%LinNames_x(index_next+3) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state Z m'; ! z x%NStC(j)%StC_x(5,1) - InitOut%LinNames_x(index_next+4) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state dX/dt m/s'; ! x-dot x%NStC(j)%StC_x(2,1) - InitOut%LinNames_x(index_next+5) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state dY/dt m/s'; ! y-dot x%NStC(j)%StC_x(4,1) - InitOut%LinNames_x(index_next+6) = 'Nacelle StC '//trim(num2lstr(j))//' local displacement state dZ/dt m/s'; ! z-dot x%NStC(j)%StC_x(6,1) - index_next = index_next + 6 - p%Jac_Idx_NStC_x(2,j) = index_next ! End index of NStC in x - enddo - endif - ! Tower StC -- displacement state - if (p%NumTStC > 0) then - do j=1,p%NumTStC - p%Jac_Idx_TStC_x(1,j) = index_next+1 ! Start index of TStC in x - p%Jac_x_indx(index_next+1:index_next+6,1) = (/13,14,15,16,17,18/) ! StC type and field index - p%Jac_x_indx(index_next+1:index_next+6,2) = (/ 1, 2, 3, 1, 2, 3/) ! component (x,y,z) - p%Jac_x_indx(index_next+1:index_next+6,3) = j ! Instance - InitOut%LinNames_x(index_next+1) = 'Tower StC '//trim(num2lstr(j))//' local displacement state X m'; ! x x%TStC(j)%StC_x(1,1) - InitOut%LinNames_x(index_next+2) = 'Tower StC '//trim(num2lstr(j))//' local displacement state Y m'; ! y x%TStC(j)%StC_x(3,1) - InitOut%LinNames_x(index_next+3) = 'Tower StC '//trim(num2lstr(j))//' local displacement state Z m'; ! z x%TStC(j)%StC_x(5,1) - InitOut%LinNames_x(index_next+4) = 'Tower StC '//trim(num2lstr(j))//' local displacement state dX/dt m/s'; ! x-dot x%TStC(j)%StC_x(2,1) - InitOut%LinNames_x(index_next+5) = 'Tower StC '//trim(num2lstr(j))//' local displacement state dY/dt m/s'; ! y-dot x%TStC(j)%StC_x(4,1) - InitOut%LinNames_x(index_next+6) = 'Tower StC '//trim(num2lstr(j))//' local displacement state dZ/dt m/s'; ! z-dot x%TStC(j)%StC_x(6,1) - index_next = index_next + 6 - p%Jac_Idx_TStC_x(2,j) = index_next ! End index of TStC in x - enddo - endif - ! Substructure StC -- displacement state - if (p%NumSStC > 0) then - do j=1,p%NumSStC - p%Jac_Idx_SStC_x(1,j) = index_next+1 ! Start index of SStC in x - p%Jac_x_indx(index_next+1:index_next+6,1) = (/19,20,21,22,23,24/) ! StC type and field index - p%Jac_x_indx(index_next+1:index_next+6,2) = (/ 1, 2, 3, 1, 2, 3/) ! component (x,y,z) - p%Jac_x_indx(index_next+1:index_next+6,3) = j ! Instance - InitOut%LinNames_x(index_next+1) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state X m'; ! x x%SStC(j)%StC_x(1,1) - InitOut%LinNames_x(index_next+2) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state Y m'; ! y x%SStC(j)%StC_x(3,1) - InitOut%LinNames_x(index_next+3) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state Z m'; ! z x%SStC(j)%StC_x(5,1) - InitOut%LinNames_x(index_next+4) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state dX/dt m/s'; ! x-dot x%SStC(j)%StC_x(2,1) - InitOut%LinNames_x(index_next+5) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state dY/dt m/s'; ! y-dot x%SStC(j)%StC_x(4,1) - InitOut%LinNames_x(index_next+6) = 'Substructure StC '//trim(num2lstr(j))//' local displacement state dZ/dt m/s'; ! z-dot x%SStC(j)%StC_x(6,1) - index_next = index_next + 6 - p%Jac_Idx_SStC_x(2,j) = index_next ! End index of SStC in x - enddo - endif - end subroutine SrvD_Init_Jacobian_x - - !> This routine initializes the Jacobian parameters and initialization outputs for the linearized inputs - subroutine SrvD_Init_Jacobian_u(du_t,du_r) - real(R8Ki), intent(in ) :: du_t ! default perturbation size for input translations - real(R8Ki), intent(in ) :: du_r ! default perturbation size for input rotations - integer(IntKi) :: i, j, k, index_next - integer(IntKi) :: i_meshField ! Counter for mesh fields - ! Standard inputs - p%Jac_nu = 2*p%NumBl + 3 ! BlPitch, BlPRate, Yaw, YawRate, HSS_Spd - ! StC related inputs - p%Jac_nu = p%Jac_nu & - + p%NumBStC * 18 * p%NumBl & ! 3 Translation Displacements + 3 orientations + 6 velocities + 6 accelerations at each BStC instance on each blade - + p%NumNStC * 18 & ! 3 Translation Displacements + 3 orientations + 6 velocities + 6 accelerations at each NStC instance - + p%NumTStC * 18 & ! 3 Translation Displacements + 3 orientations + 6 velocities + 6 accelerations at each TStC instance - + p%NumSStC * 18 ! 3 Translation Displacements + 3 orientations + 6 velocities + 6 accelerations at each SStC instance - - ! allocate space for the row/column names and for perturbation sizes - ! --- Info of linearized inputs (Names, RotFrame, IsLoad) - call AllocAry(InitOut%LinNames_u, p%Jac_nu, 'LinNames_u', ErrStat2, ErrMsg2); if (Failed()) return; - call AllocAry(InitOut%RotFrame_u, p%Jac_nu, 'RotFrame_u', ErrStat2, ErrMsg2); if (Failed()) return; - call AllocAry(InitOut%IsLoad_u, p%Jac_nu, 'IsLoad_u' , ErrStat2, ErrMsg2); if (Failed()) return; - ! --- Jac_u_indx: matrix to store index to help us figure out what the ith value of the u vector really means - ! column 1 indicates module's mesh and field perturbation index (index to p%du) - ! column 2 indicates the first index (x-y-z component) of the field - ! column 3 is the StC motion mesh (Instance index) - ! column 4 is the StC motion mesh (blade index BStC mesh, ignored on others) - call allocAry( p%Jac_u_indx, p%Jac_nu, 4, 'p%Jac_u_indx', ErrStat2, ErrMsg2); if (Failed()) return; - p%Jac_u_indx = 0 - ! perturbation sizes - CALL AllocAry(p%du, 24, 'u perturbation', ErrStat2, ErrMsg2); if (Failed()) return; - p%du( 1) = du_t ! Blade u%*Mesh%TranslationDisp = 1; - p%du( 2) = du_r ! Blade u%*Mesh%Orientation = 2; - p%du( 3) = du_t ! Blade u%*Mesh%TranslationVel = 3; - p%du( 4) = du_r ! Blade u%*Mesh%RotationVel = 4; - p%du( 5) = du_t ! Blade u%*Mesh%TranslationAcc = 5; - p%du( 6) = du_r ! Blade u%*Mesh%RotationAcc = 6; - p%du( 7:12) = p%du( 1:6) ! Nacelle - p%du(13:18) = p%du( 1:6) ! Tower - p%du(19:24) = p%du( 1:6) ! Substructure - - ! Initialize RotFrame_u and IsLoad_u - InitOut%RotFrame_u = .false. ! every StC input is on a mesh, which stores values in the global (not rotating) frame - InitOut%IsLoad_u = .false. ! No loads present - - !-------------------------------- - ! linearization input names - !-------------------------------- - index_next = 1 - - ! u%BlPitch -- rotating frame - do i=1,p%NumBl - InitOut%LinNames_u(index_next) = 'BlPitch('//trim(Num2LStr(i))//'), rad' - InitOut%RotFrame_u(index_next) = .true. - index_next = index_next + 1 - enddo - - ! u%BlPRate -- rotating frame - do i=1,p%NumBl - InitOut%LinNames_u(index_next) = 'BlPRate('//trim(Num2LStr(i))//'), rad' - InitOut%RotFrame_u(index_next) = .true. - index_next = index_next + 1 - enddo - - ! u%Yaw -- not in rotating frame - InitOut%LinNames_u(index_next) = 'Yaw, rad'; index_next = index_next + 1 - - ! u%YawRate -- not in rotating frame - InitOut%LinNames_u(index_next) = 'YawRate, rad/s'; index_next = index_next + 1 - - ! u%HSS_Spd -- not in rotating frame - InitOut%LinNames_u(index_next) = 'HSS_Spd, rad/s'; index_next = index_next + 1 - - !-------------------------------- - ! StC related inputs - !-------------------------------- - CALL AllocAry(p%Jac_Idx_BStC_u, 2, p%NumBl, p%NumBStC, 'Jac_Idx_BStC_u', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_BStC_u = 0_IntKi - CALL AllocAry(p%Jac_Idx_NStC_u, 2, p%NumNStC, 'Jac_Idx_NStC_u', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_NStC_u = 0_IntKi - CALL AllocAry(p%Jac_Idx_TStC_u, 2, p%NumTStC, 'Jac_Idx_TStC_u', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_TStC_u = 0_IntKi - CALL AllocAry(p%Jac_Idx_SStC_u, 2, p%NumSStC, 'Jac_Idx_SStC_u', ErrStat2, ErrMsg2); if (Failed()) return; p%Jac_Idx_SStC_u = 0_IntKi - ! Blade - if (p%NumBStC > 0) then - do j=1,p%NumBStC - do i=1,p%NumBl - p%Jac_Idx_BStC_u(1,i,j) = index_next ! Start index of BStC in u - call PackMotionMesh_Names( u%BStCMotionMesh(i,j), 'Blade '//trim(num2lstr(i))//' StC '//trim(num2lstr(j)), InitOut%LinNames_u, index_next ) - p%Jac_Idx_BStC_u(2,i,j) = index_next-1 ! End index of BStC in u - enddo - enddo - endif - ! Nacelle - if (p%NumNStC > 0) then - do j=1,p%NumNStC - p%Jac_Idx_NStC_u(1,j) = index_next ! Start index of NStC in u - call PackMotionMesh_Names( u%NStCMotionMesh(j), 'Nacelle StC '//trim(num2lstr(j)), InitOut%LinNames_u, index_next ) - p%Jac_Idx_NStC_u(2,j) = index_next-1 ! End index of NStC in u - enddo - endif - ! Tower - if (p%NumTStC > 0) then - do j=1,p%NumTStC - p%Jac_Idx_TStC_u(1,j) = index_next ! Start index of TStC in u - call PackMotionMesh_Names( u%TStCMotionMesh(j), 'Tower StC '//trim(num2lstr(j)), InitOut%LinNames_u, index_next ) - p%Jac_Idx_TStC_u(2,j) = index_next-1 ! End index of TStC in u - enddo - endif - ! Sub-structure - if (p%NumSStC > 0) then - do j=1,p%NumSStC - p%Jac_Idx_SStC_u(1,j) = index_next ! Start index of SStC in u - call PackMotionMesh_Names( u%SStCMotionMesh(j), 'Substructure StC '//trim(num2lstr(j)), InitOut%LinNames_u, index_next ) - p%Jac_Idx_SStC_u(2,j) = index_next-1 ! End index of SStC in u - enddo - endif - - !-------------------------------- - ! linearization perturbation size - !-------------------------------- - index_next = 1 - !! u%BlPitch -- in rotating frame NOTE: this is calculated exactly, so not necessary to track - !! u%BlPRate -- in rotating frame NOTE: this is calculated exactly, so not necessary to track - !! u%Yaw -- not in rotating frame NOTE: this is calculated exactly, so not necessary to track - !! u%YawRate -- not in rotating frame NOTE: this is calculated exactly, so not necessary to track - !! u%HSS_Spd -- not in rotating frame NOTE: this is calculated exactly, so not necessary to track - - ! Blade StC instances - do j=1,p%NumBStC - do i=1,p%NumBl - index_next = p%Jac_Idx_BStC_u(1,i,j) - do i_meshField = 1,6 - do k=1,3 - p%Jac_u_indx(index_next,1) = i_meshField ! (TransDisp,Orient,TransVel,RotVel,TransAcc,RotAcc) - p%Jac_u_indx(index_next,2) = k ! component (x,y,z) - p%Jac_u_indx(index_next,3) = j ! Instance - p%Jac_u_indx(index_next,4) = i ! blade - index_next = index_next + 1 - enddo - enddo - enddo - enddo - ! Nacelle StC instances - do j=1,p%NumNStC - index_next = p%Jac_Idx_NStC_u(1,j) - do i_meshField = 7,12 - do k=1,3 - p%Jac_u_indx(index_next,1) = i_meshField ! (TransDisp,Orient,TransVel,RotVel,TransAcc,RotAcc) - p%Jac_u_indx(index_next,2) = k ! component (x,y,z) - p%Jac_u_indx(index_next,3) = j ! Instance - p%Jac_u_indx(index_next,4) = 1 ! Ignored - index_next = index_next + 1 - enddo - enddo - enddo - ! Tower StC instances - do j=1,p%NumTStC - index_next = p%Jac_Idx_TStC_u(1,j) - do i_meshField = 13,18 - do k=1,3 - p%Jac_u_indx(index_next,1) = i_meshField ! (TransDisp,Orient,TransVel,RotVel,TransAcc,RotAcc) - p%Jac_u_indx(index_next,2) = k ! component (x,y,z) - p%Jac_u_indx(index_next,3) = j ! Instance - p%Jac_u_indx(index_next,4) = 1 ! Ignored - index_next = index_next + 1 - enddo - enddo - enddo - ! Substructure StC instances - do j=1,p%NumSStC - index_next = p%Jac_Idx_SStC_u(1,j) - do i_meshField = 19,24 - do k=1,3 - p%Jac_u_indx(index_next,1) = i_meshField ! (TransDisp,Orient,TransVel,RotVel,TransAcc,RotAcc) - p%Jac_u_indx(index_next,2) = k ! component (x,y,z) - p%Jac_u_indx(index_next,3) = j ! Instance - p%Jac_u_indx(index_next,4) = 1 ! Ignored - index_next = index_next + 1 - enddo - enddo - enddo - end subroutine SrvD_Init_Jacobian_u - - subroutine CheckInfo() - character(1) :: Flag,FlagLoad - integer(IntKi) :: i,j,k - ! print out some info - if (allocated(InitOut%LinNames_y)) then - call WrScr('LinNames_y') - do j=1,p%NumBStC - do k=1,p%NumBl - call WrScr(' BStC '//trim(Num2LStr(j))//' blade '//trim(Num2LStr(k))//' range: '//trim(Num2LStr(p%Jac_Idx_BStC_y(1,k,j)))//' '//trim(Num2LStr(p%Jac_Idx_BStC_y(2,k,j)))) - enddo - enddo - do j=1,p%NumNStC - call WrScr(' NStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_NStC_y(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_NStC_y(2,j)))) - enddo - do j=1,p%NumTStC - call WrScr(' TStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_TStC_y(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_TStC_y(2,j)))) - enddo - do j=1,p%NumSStC - call WrScr(' SStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_SStC_y(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_SStC_y(2,j)))) - enddo - do i=1,size(InitOut%LinNames_y) - Flag='F' - if (InitOut%RotFrame_y(i)) Flag='T' - call WrScr(' '//Num2LStr(i)//Flag//' '//InitOut%LinNames_y(i)) - enddo - endif - if (allocated(InitOut%LinNames_x)) then - call WrScr('LinNames_x') - do j=1,p%NumBStC - do k=1,p%NumBl - call WrScr(' BStC '//trim(Num2LStr(j))//' blade '//trim(Num2LStr(k))//' range: '//trim(Num2LStr(p%Jac_Idx_BStC_x(1,k,j)))//' '//trim(Num2LStr(p%Jac_Idx_BStC_x(2,k,j)))) - enddo - enddo - do j=1,p%NumNStC - call WrScr(' NStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_NStC_x(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_NStC_x(2,j)))) - enddo - do j=1,p%NumTStC - call WrScr(' TStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_TStC_x(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_TStC_x(2,j)))) - enddo - do j=1,p%NumSStC - call WrScr(' SStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_SStC_x(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_SStC_x(2,j)))) - enddo - do i=1,size(InitOut%LinNames_x) - Flag='F' - if (InitOut%RotFrame_x(i)) Flag='T' - call WrScr(' '//Num2LStr(i)//Flag//' '//trim(Num2LStr(InitOut%DerivOrder_x(i)))//' '//InitOut%LinNames_x(i)) - enddo - endif - if (allocated(InitOut%LinNames_u)) then - call WrScr('Perturb Size u') - do i=1,size(p%du) - call WrScr(' '//trim(Num2LStr(i))//' '//trim(Num2LStr(p%du(i)))) - enddo - call WrScr('LinNames_u') - do j=1,p%NumBStC - do k=1,p%NumBl - call WrScr(' BStC '//trim(Num2LStr(j))//' blade '//trim(Num2LStr(k))//' range: '//trim(Num2LStr(p%Jac_Idx_BStC_u(1,k,j)))//' '//trim(Num2LStr(p%Jac_Idx_BStC_u(2,k,j)))) - enddo - enddo - do j=1,p%NumNStC - call WrScr(' NStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_NStC_u(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_NStC_u(2,j)))) - enddo - do j=1,p%NumTStC - call WrScr(' TStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_TStC_u(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_TStC_u(2,j)))) - enddo - do j=1,p%NumSStC - call WrScr(' SStC '//trim(Num2LStr(j))//' range: '//trim(Num2LStr(p%Jac_Idx_SStC_u(1,j)))//' '//trim(Num2LStr(p%Jac_Idx_SStC_u(2,j)))) - enddo - do i=1,size(InitOut%LinNames_u) - Flag='F' - FlagLoad='F' - if (InitOut%RotFrame_u(i)) Flag='T' - if (InitOut%IsLoad_u(i)) FlagLoad='T' - call WrScr(' '//Num2LStr(i)//Flag//' '//FlagLoad//' ('// & - trim(Num2LStr(p%Jac_u_indx(i,1)))//','//trim(Num2LStr(p%Jac_u_indx(i,2)))//','//trim(Num2LStr(p%Jac_u_indx(i,3)))// & - ') '//InitOut%LinNames_u(i)) - enddo - endif - end subroutine CheckInfo -end subroutine SrvD_Init_Jacobian - !---------------------------------------------------------------------------------------------------------------------------------- !> This routine sets the data structures for the structural control (StC) module -- Nacelle Instances subroutine StC_Nacelle_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,SrvD_MeshMap,u,p,x,xd,z,OtherState,y,m,UnSum,ErrStat,ErrMsg) @@ -2934,9 +2384,6 @@ SUBROUTINE SrvD_JacobianPInput(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrSta call MV_ComputeCentralDiff(Vars%y, Vars%u(i)%Perturb, m%Jac%y_pos, m%Jac%y_neg, dYdu(:,iCol)) end do end do - - ! call Jac_dYdu(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdu ) - ! if (Failed()) return END IF ! Calculate the partial derivative of the continuous state functions (X) with respect to the inputs (u) here: @@ -2972,9 +2419,6 @@ SUBROUTINE SrvD_JacobianPInput(Vars, t, u, p, x, xd, z, OtherState, y, m, ErrSta dXdu(:,iCol) = (m%Jac%x_pos - m%Jac%x_neg) / (2.0_R8Ki * Vars%u(i)%Perturb) end do end do - - ! call Jac_dXdu( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdu ) - ! if (Failed()) return END IF if (present(dXddu)) then @@ -2992,972 +2436,6 @@ logical function Failed() end function Failed END SUBROUTINE SrvD_JacobianPInput -!> Calculate the jacobian dYdu -subroutine Jac_dYdu( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu ) - real(DbKi), intent(in ) :: t !< Time in seconds at operating point - type(SrvD_InputType), intent(inout) :: u !< Inputs at operating point (out for copy only) - type(SrvD_ParameterType), intent(in ) :: p !< Parameters - type(SrvD_ContinuousStateType), intent(in ) :: x !< Continuous states at operating point - type(SrvD_DiscreteStateType), intent(in ) :: xd !< Discrete states at operating point - type(SrvD_ConstraintStateType), intent(in ) :: z !< Constraint states at operating point - type(SrvD_OtherStateType), intent(in ) :: OtherState !< Other states at operating point - type(SrvD_OutputType), intent(inout) :: y !< Output (need to make copies) - type(SrvD_MiscVarType), intent(inout) :: m !< Misc/optimization variables - integer(IntKi), intent( out) :: ErrStat !< Error status of the operation - character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None - real(R8Ki), allocatable, intent(inout) :: dYdu(:,:) !< Partial derivatives of output functions - - integer(IntKi) :: n ! Generic loop index - type(SrvD_InputType) :: u_perturb ! copy of inputs to perturb - type(SrvD_OutputType) :: y_p ! outputs positive perturbed - type(SrvD_OutputType) :: y_m ! outputs negative perturbed - real(R8Ki) :: delta_p ! delta+ change in input or state - real(R8Ki) :: delta_m ! delta- change in input or state - integer(IntKi) :: ErrStat2 - character(ErrMsgLen) :: ErrMsg2 - character(*), parameter :: RoutineName = 'Jac_dYdu' - - ! Initialize ErrStat - ErrStat = ErrID_None - ErrMsg = '' - - ! Allocate the dYdu array - if (.not. allocated(dYdu)) then - call allocAry(dYdu, p%Jac_ny, p%Jac_nu, 'dYdu', ErrStat2, ErrMsg2) - if (Failed()) return - elseif ( (size(dYdu,1) /= p%Jac_ny) .or. (size(dYdu,2) /= p%Jac_nu) ) then - deallocate(dYdu) - call allocAry(dYdu, p%Jac_ny, p%Jac_nu, 'dYdu', ErrStat2, ErrMsg2) - if (Failed()) return - end if - dYdu = 0.0_R8Ki - - !------------------------------------------------------------- - ! Calculate first three rows for Yaw, YawRate, HSS_Spd inputs - ! This is an analytical calculation. - ! First 3 columns in dY/du - !------------------------------------------------------------- - call dYdu_PitYawGen(); if (ErrStat > AbortErrLev) return; - - !------------------------------------------------------------- - ! Perturb each StC instance individually and place in appropriate location in dYdu - ! Each StC is basically an isolated piece that doesn't interact with any other StC or with anything else in SrvD, - ! so we take advantage of that here for computational expediency. - !------------------------------------------------------------- - ! make a copy of the inputs to perturb if an StC exists - if ( (p%NumBStC + p%NumNStC + p%NumTStC + p%NumSStC) > 0 ) then - call SrvD_CopyInput( u, u_perturb, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - endif - !------------------- - ! Blade StC - if (p%NumBStC > 0) then - do n=p%Jac_Idx_BStC_u(1,1,1),p%Jac_Idx_BStC_u(2,p%NumBl,p%NumBStC) ! input range for BStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dYdu( n, +1, u_perturb, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dYdu( n, -1, u_perturb, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdu(:,n) ) - enddo - endif - !------------------- - ! Nacelle StC - if (p%NumNStC > 0) then - do n=p%Jac_Idx_NStC_u(1,1),p%Jac_Idx_NStC_u(2,p%NumNStC) ! input range for NStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dYdu( n, +1, u_perturb, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dYdu( n, -1, u_perturb, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdu(:,n) ) - enddo - endif - !------------------- - ! Tower StC - if (p%NumTStC > 0) then - do n=p%Jac_Idx_TStC_u(1,1),p%Jac_Idx_TStC_u(2,p%NumTStC) ! input range for TStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dYdu( n, +1, u_perturb, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dYdu( n, -1, u_perturb, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdu(:,n) ) - enddo - endif - !------------------- - ! Substructure StC - if (p%NumSStC > 0) then - do n=p%Jac_Idx_SStC_u(1,1),p%Jac_Idx_SStC_u(2,p%NumSStC) ! input range for SStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dYdu( n, +1, u_perturb, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dYdu( n, -1, u_perturb, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdu(:,n) ) - enddo - endif - call Cleanup() - -contains - logical function Failed() - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - Failed = ErrStat >= AbortErrLev - if (Failed) call Cleanup - end function Failed - - subroutine Cleanup() - ! Ignore any errors from the destroy (these weren't created if no StCs) - call SrvD_DestroyInput( u_perturb, ErrStat2, ErrMsg2 ) - call SrvD_DestroyOutput( y_p, ErrStat2, ErrMsg2 ) - call SrvD_DestroyOutput( y_m, ErrStat2, ErrMsg2 ) - end subroutine Cleanup - - !> Subroutine for the yaw and generator portions of the dYdu matrix (first three rows of dYdu) - !! This is part of dYdu uses analytical results - subroutine dYdu_PitYawGen() - integer(IntKi) :: i ! Generic indices - real(R8Ki) :: GenTrq_du, ElecPwr_du ! derivatives of generator torque and electrical power w.r.t. u%HSS_SPD - integer :: Indx_u_BlPitch(3) - integer :: Indx_u_BlPRate(3) - integer :: Indx_u_Yaw - integer :: Indx_u_YawRate - integer :: Indx_u_HSS_Spd - integer :: SrvD_Indx_Y_BlPitchMom(3) - integer :: SrvD_Indx_Y_YawMom - integer :: SrvD_Indx_Y_GenTrq - integer :: SrvD_Indx_Y_ElecPwr - integer :: SrvD_Indx_Y_WrOutput - real(R8Ki) :: AllOuts(9,MaxOutPts) ! Extra precision here since analytical - - SrvD_Indx_Y_BlPitchMom = 2*p%NumBl + (/1,2,3/) ! Only the first p%NumBl entries are used - SrvD_Indx_Y_YawMom = 3*p%NumBl + 1 - SrvD_Indx_Y_GenTrq = SrvD_Indx_Y_YawMom + 1 - SrvD_Indx_Y_ElecPwr = SrvD_Indx_Y_GenTrq + 1 - SrvD_Indx_Y_WrOutput = p%Jac_ny - p%NumOuts ! Index to location before user requested outputs - - Indx_u_BlPitch = (/1,2,3/) ! Only the first p%NumBl entries are used - Indx_u_BlPRate = p%NumBl + (/1,2,3/) ! Only the first p%NumBl entries are used - Indx_u_Yaw = 2*p%NumBl + 1 - Indx_u_YawRate = Indx_u_Yaw + 1 - Indx_u_HSS_Spd = Indx_u_YawRate + 1 - - !> \f{equation}{ \frac{\partial Y}{\partial u} = \begin{bmatrix} - !! \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPRateCom_1}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPRateCom_2}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPRateCom_3}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{YawMom}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{YawMom}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{YawMom}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{YawMom}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{YawMom}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{YawMom}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} & \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} & \frac{\partial Y_{YawMom}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{GenTrq}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{GenTrq}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{GenTrq}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{GenTrq}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{GenTrq}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{GenTrq}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{GenTrq}}{\partial u_{Yaw}} & \frac{\partial Y_{GenTrq}}{\partial u_{YawRate}} & \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{ElecPwr}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{ElecPwr}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{ElecPwr}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{ElecPwr}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{ElecPwr}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{ElecPwr}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{ElecPwr}}{\partial u_{Yaw}} & \frac{\partial Y_{ElecPwr}}{\partial u_{YawRate}} & \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{Yaw}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{YawRate}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{HSS\_Spd}} \\ - !! = \begin{bmatrix} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchCom_1}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchCom_2}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchCom_3}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPRateCom_1}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPRateCom_2}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPRateCom_3}}{\partial u_{*}} - !! \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPitch_1}} & 0 & 0 & \frac{\partial Y_{BlPitchMom_1}}{\partial u_{BlPRate_1}} & 0 & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchMom_1}}{\partial u_{*}} - !! 0 & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPitch_2}} & 0 & 0 & \frac{\partial Y_{BlPitchMom_2}}{\partial u_{BlPRate_2}} & 0 & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchMom_2}}{\partial u_{*}} - !! 0 & 0 & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPitch_3}} & 0 & 0 & \frac{\partial Y_{BlPitchMom_3}}{\partial u_{BlPRate_3}} & 0 & 0 & 0 \\ ! \frac{\partial Y_{BlPitchMom_3}}{\partial u_{*}} - !! 0 & 0 & 0 & 0 & 0 & 0 & \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} & \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} & 0 \\ - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \\ - !! 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \\ - !! \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_1}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_2}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPitch_3}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_1}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_2}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{BlPRate_3}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{Yaw}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{YawRate}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{HSS\_Spd}} \\ - !!\f} - - ! ! Torque control: - !> Compute - !> \f$ \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \f$ and - !> \f$ \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \f$ in servodyn::torque_jacobianpinput. - call Torque_JacobianPInput( t, u, p, x, xd, z, OtherState, m, GenTrq_du, ElecPwr_du, ErrStat2, ErrMsg2 ) - if (Failed()) return - dYdu(SrvD_Indx_Y_GenTrq, Indx_u_HSS_Spd) = GenTrq_du - dYdu(SrvD_Indx_Y_ElecPwr,Indx_u_HSS_Spd) = ElecPwr_du - - ! Pitch control: - !> \f$ \frac{\partial Y_{BlPitchCom_k}}{\partial u} = 0 \f$ - do i=1,p%NumBl - !> \f$ \frac{\partial Y_{BlPitchMom_k}}{\partial u_{BlPitch_k}} = -p\%PitSpr \f$ - dYdu(SrvD_Indx_Y_BlPitchMom(i),Indx_u_BlPitch(i)) = -p%PitSpr(i) ! from Pitch_CalcOutput - !> \f$ \frac{\partial Y_{BlPitchMom_k}}{\partial u_{BlPRate_k}} = -p\%PitDamp \f$ - dYdu(SrvD_Indx_Y_BlPitchMom(i),Indx_u_BlPRate(i)) = -p%PitDamp(i) ! from Pitch_CalcOutput - enddo - - ! Yaw control: - !> \f$ \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} = -p\%YawSpr \f$ - dYdu(SrvD_Indx_Y_YawMom,Indx_u_Yaw) = -p%YawSpr ! from Yaw_CalcOutput - !> \f$ \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} = -p\%YawDamp \f$ - dYdu(SrvD_Indx_Y_YawMom,Indx_u_YawRate) = -p%YawDamp ! from Yaw_CalcOutput - - !< The section below needs to be updated after introducing new output channels - !............................................................................... - ! Calculate the output channels that will be affected by u%{Yaw,YawRate,HSS_Spd} - ! These terms are analytically calculated - !............................................................................... - AllOuts = 0.0_R8Ki ! all variables not specified below are zeros (either constant or disabled): - do I = 1,p%NumBl - AllOuts((/Indx_u_BlPitch(I),Indx_u_BlPRate(I)/), BlPitchM(I)) = 0.001_R8Ki*dYdu(SrvD_Indx_Y_BlPitchMom(I), (/Indx_u_BlPitch(I),Indx_u_BlPRate(I)/)) - enddo - AllOuts( Indx_u_HSS_Spd, GenTq) = 0.001_R8Ki*dYdu(SrvD_Indx_Y_GenTrq, Indx_u_HSS_Spd ) - AllOuts( Indx_u_HSS_Spd, GenPwr) = 0.001_R8Ki*dYdu(SrvD_Indx_Y_ElecPwr, Indx_u_HSS_Spd ) - AllOuts((/Indx_u_Yaw,Indx_u_YawRate/), YawMomCom) = -0.001_R8Ki*dYdu(SrvD_Indx_Y_YawMom, (/Indx_u_Yaw,Indx_u_YawRate/)) - - !............................................................................... - ! Place the selected output channels into the WriteOutput(:) portion of the - ! jacobian with the proper sign: - !............................................................................... - do I = 1,p%NumOuts ! Loop through all selected output channels - if (p%OutParam(I)%Indx > 0_IntKi) then - dYdu(I+SrvD_Indx_Y_WrOutput,1:9) = p%OutParam(I)%SignM * AllOuts( 1:9, p%OutParam(I)%Indx ) - else - dYdu(I+SrvD_Indx_Y_WrOutput,1:9) = 0.0_R8Ki - endif - enddo ! I - All selected output channels - end subroutine dYdu_PitYawGen - - !> Calculated dYdu for BStC instance - subroutine Jac_BStC_dYdu( n, sgn, u_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j,k ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_u_indx(n,4) ! this blade - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_BStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%BStCMotionMesh(k,j), u_StC%Mesh(k), m%SrvD_MeshMap%u_BStC_Mot2_BStC(k,j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! Set StC control channels - !call SetStCInput_CtrlChans(u_BStC) - ! call Calc - call StC_CopyOutput(m%y_BStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, u_StC, p%BStC(j), x%BStC(j), xd%BStC(j), z%BStC(j), OtherState%BStC(j), y_StC, m%BStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(k), y_perturb%BStCLoadMesh(k,j), m%SrvD_MeshMap%BStC_Frc2_y_BStC(k,j), ErrStat3, ErrMsg3, u_perturb%BStCMotionMesh(k,j), u_perturb%BStCMotionMesh(k,j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_BStC_Outs_Instance( j, p%NumBl, x%BStC(j), m%BStC(j), y_StC, AllOuts) - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_BStC_dYdu - - !> Calculated dYdu for NStC instance - subroutine Jac_NStC_dYdu( n, sgn, u_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j,k ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_NStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%NStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_NStC_Mot2_NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! Set StC control channels - !call SetStCInput_CtrlChans(u_NStC) - ! call Calc - call StC_CopyOutput(m%y_NStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3) - CALL StC_CalcOutput( t, u_StC, p%NStC(j), x%NStC(j), xd%NStC(j), z%NStC(j), OtherState%NStC(j), y_StC, m%NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%NStCLoadMesh(j), m%SrvD_MeshMap%NStC_Frc2_y_NStC(j), ErrStat3, ErrMsg3, u_perturb%NStCMotionMesh(j), u_perturb%NStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_NStC_Outs_Instance( j, x%NStC(j), m%NStC(j), y_StC, AllOuts) - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo ! I - All selected output channels -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_NStC_dYdu - - !> Calculated dYdu for TStC instance - subroutine Jac_TStC_dYdu( n, sgn, u_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j,k ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_TStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%TStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_TStC_Mot2_TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! Set StC control channels - !call SetStCInput_CtrlChans(u_TStC) - ! call Calc - call StC_CopyOutput(m%y_TStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, u_StC, p%TStC(j), x%TStC(j), xd%TStC(j), z%TStC(j), OtherState%TStC(j), y_StC, m%TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%TStCLoadMesh(j), m%SrvD_MeshMap%TStC_Frc2_y_TStC(j), ErrStat3, ErrMsg3, u_perturb%TStCMotionMesh(j), u_perturb%TStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_TStC_Outs_Instance( j, x%TStC(j), m%TStC(j), y_StC, AllOuts) - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo ! I - All selected output channels -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_TStC_dYdu - - !> Calculated dYdu for SStC instance - subroutine Jac_SStC_dYdu( n, sgn, u_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j,k ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_SStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%SStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_SStC_Mot2_SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! Set StC control channels - !call SetStCInput_CtrlChans(u_SStC) - ! call Calc - call StC_CopyOutput(m%y_SStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, u_StC, p%SStC(j), x%SStC(j), xd%SStC(j), z%SStC(j), OtherState%SStC(j), y_StC, m%SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%SStCLoadMesh(j), m%SrvD_MeshMap%SStC_Frc2_y_SStC(j), ErrStat3, ErrMsg3, u_perturb%SStCMotionMesh(j), u_perturb%SStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_SStC_Outs_Instance( j, x%SStC(j), m%SStC(j), y_StC, AllOuts) - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo ! I - All selected output channels -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_SStC_dYdu -end subroutine Jac_dYdu - -!> Calculate the jacobian dXdu -!! The only states exist with the StC instances -subroutine Jac_dXdu(t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg, dXdu) - real(DbKi), intent(in ) :: t !< Time in seconds at operating point - type(SrvD_InputType), intent(inout) :: u !< Inputs at operating point (out for copy only) - type(SrvD_ParameterType), intent(in ) :: p !< Parameters - type(SrvD_ContinuousStateType), intent(in ) :: x !< Continuous states at operating point - type(SrvD_DiscreteStateType), intent(in ) :: xd !< Discrete states at operating point - type(SrvD_ConstraintStateType), intent(in ) :: z !< Constraint states at operating point - type(SrvD_OtherStateType), intent(in ) :: OtherState !< Other states at operating point - type(SrvD_MiscVarType), intent(inout) :: m !< Misc/optimization variables - integer(IntKi), intent( out) :: ErrStat !< Error status of the operation - character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None - real(R8Ki), allocatable, intent(inout) :: dXdu(:,:) !< Partial derivatives of output functions - - integer(IntKi) :: n ! Generic loop index - type(SrvD_InputType) :: u_perturb ! copy of inputs to perturb - type(SrvD_ContinuousStateType) :: dx_p ! states positive perturbed - type(SrvD_ContinuousStateType) :: dx_m ! states negative perturbed - real(R8Ki) :: delta_p ! delta+ change in input or state - real(R8Ki) :: delta_m ! delta- change in input or state - integer(IntKi) :: ErrStat2 - character(ErrMsgLen) :: ErrMsg2 - character(*), parameter :: RoutineName = 'Jac_dXdu' - - ! Initialize ErrStat - ErrStat = ErrID_None - ErrMsg = '' - - ! Allocate the dXdu array regardless what states may or may not exist (glue code needs this) - if (.not. allocated(dXdu)) then - call allocAry(dXdu, p%Jac_nx, p%Jac_nu, 'dXdu', ErrStat2, ErrMsg2) - if (Failed()) return - elseif ( (size(dXdu,1) /= p%Jac_nx) .or. (size(dXdu,2) /= p%Jac_nu) ) then - deallocate(dXdu) - call allocAry(dXdu, p%Jac_nx, p%Jac_nu, 'dXdu', ErrStat2, ErrMsg2) - if (Failed()) return - endif - dXdu = 0.0_R8Ki - - !------------------------------------------------------------- - ! Perturb each StC instance individually and place in appropriate location in dXdu - ! Each StC is basically an isolated piece that doesn't interact with any other StC or with anything else in SrvD, - ! so we take advantage of that here for computational expediency. - !------------------------------------------------------------- - ! make a copy of the inputs to perturb if an StC exists - if ( (p%NumBStC + p%NumNStC + p%NumTStC + p%NumSStC) > 0 ) then - call SrvD_CopyInput( u, u_perturb, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - else - return ! nothing further to do here - endif - !------------------- - ! Blade StC - if (p%NumBStC > 0) then - do n=p%Jac_Idx_BStC_u(1,1,1),p%Jac_Idx_BStC_u(2,p%NumBl,p%NumBStC) ! input range for BStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dXdu( n, +1, u_perturb, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dXdu( n, -1, u_perturb, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdu(:,n) ) - enddo - endif - !------------------- - ! Nacelle StC - if (p%NumNStC > 0) then - do n=p%Jac_Idx_NStC_u(1,1),p%Jac_Idx_NStC_u(2,p%NumNStC) ! input range for NStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dXdu( n, +1, u_perturb, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dXdu( n, -1, u_perturb, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdu(:,n) ) - enddo - endif - !------------------- - ! Tower StC - if (p%NumTStC > 0) then - do n=p%Jac_Idx_TStC_u(1,1),p%Jac_Idx_TStC_u(2,p%NumTStC) ! input range for TStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dXdu( n, +1, u_perturb, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dXdu( n, -1, u_perturb, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdu(:,n) ) - enddo - endif - !------------------- - ! Substructure StC - if (p%NumSStC > 0) then - do n=p%Jac_Idx_SStC_u(1,1),p%Jac_Idx_SStC_u(2,p%NumSStC) ! input range for SStC - - ! perturb positive - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dXdu( n, +1, u_perturb, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyInput( u, u_perturb, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dXdu( n, -1, u_perturb, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdu(:,n) ) - enddo - endif - call Cleanup() - -contains - logical function Failed() - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - Failed = ErrStat >= AbortErrLev - if (Failed) call Cleanup - end function Failed - - subroutine Cleanup() - ! Ignore any errors from the destroy (these weren't created if no StCs) - call SrvD_DestroyInput( u_perturb, ErrStat2, ErrMsg2 ) - call SrvD_DestroyContState( dx_p, ErrStat2, ErrMsg2 ) - call SrvD_DestroyContState( dx_m, ErrStat2, ErrMsg2 ) - end subroutine Cleanup - - !> Calculated dXdu for BStC instance - subroutine Jac_BStC_dXdu( n, sgn, u_perturb, delta, x_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j,k ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_u_indx(n,4) ! this blade - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_BStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%BStCMotionMesh(k,j), u_StC%Mesh(k), m%SrvD_MeshMap%u_BStC_Mot2_BStC(k,j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! calculate change in ContState - call StC_CalcContStateDeriv( t, u_StC, p%BStC(j), x%BStC(j), xd%BStC(j), z%BStC(j), OtherState%BStC(j), m%BStC(j), x_perturb%BStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! cleanup - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_BStC_dXdu - - !> Calculated dXdu for NStC instance - subroutine Jac_NStC_dXdu( n, sgn, u_perturb, delta, x_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_NStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%NStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_NStC_Mot2_NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! calculate change in ContState - call StC_CalcContStateDeriv( t, u_StC, p%NStC(j), x%NStC(j), xd%NStC(j), z%NStC(j), OtherState%NStC(j), m%NStC(j), x_perturb%NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! cleanup - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_NStC_dXdu - - !> Calculated dXdu for TStC instance - subroutine Jac_TStC_dXdu( n, sgn, u_perturb, delta, x_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_TStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%TStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_TStC_Mot2_TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! calculate change in ContState - call StC_CalcContStateDeriv( t, u_StC, p%TStC(j), x%TStC(j), xd%TStC(j), z%TStC(j), OtherState%TStC(j), m%TStC(j), x_perturb%TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! cleanup - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_TStC_dXdu - - !> Calculated dXdu for SStC instance - subroutine Jac_SStC_dXdu( n, sgn, u_perturb, delta, x_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_InputType), intent(inout) :: u_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j ! Generic indices - type(StC_InputType) :: u_StC ! copy of the StC inputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_u_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_u_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_u( p, n, sgn, u_perturb, delta ) - ! Transfer motion mesh to this particular instance - call StC_CopyInput( m%u_SStC(1,j), u_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - call Transfer_Point_to_Point( u_perturb%SStCMotionMesh(j), u_StC%Mesh(1), m%SrvD_MeshMap%u_SStC_Mot2_SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! calculate change in ContState - call StC_CalcContStateDeriv( t, u_StC, p%SStC(j), x%SStC(j), xd%SStC(j), z%SStC(j), OtherState%SStC(j), m%SStC(j), x_perturb%SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - ! cleanup - call StC_DestroyInput( u_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_SStC_dXdu -end subroutine Jac_dXdu - - -!---------------------------------------------------------------------------------------------------------------------------------- -!> This routine perturbs the single mesh point associated with the nth element of the u array -!! WARNING: this routine must exactly match Init_Jacobian::SrvD_Init_Jacobian_u -subroutine SrvD_Perturb_u( p, n, perturb_sign, u, du ) - type(SrvD_ParameterType), intent(in ) :: p !< parameters - integer(IntKi), intent(in ) :: n !< number of array element to use - integer(IntKi), intent(in ) :: perturb_sign !< +1 or -1 (value to multiply perturbation by; positive or negative difference) - type(SrvD_InputType), intent(inout) :: u !< perturbed SrvD inputs - real(R8Ki), intent( out) :: du !< amount that specific input was perturbed - ! local variables - integer :: fieldIndx - integer :: instance, blade ! for StC mesh motions - fieldIndx = p%Jac_u_indx(n,2) - instance = p%Jac_u_indx(n,3) - blade = p%Jac_u_indx(n,4) - du = p%du( p%Jac_u_indx(n,1) ) - ! determine which mesh we're trying to perturb and perturb the input: - select case( p%Jac_u_indx(n,1) ) - !------------------------------- - ! 1:6 --> u%BStCMotionMesh(:,:)% - case ( 1) ! TranslationDisp = 1; - u%BStCMotionMesh(blade,instance)%TranslationDisp(fieldIndx,1) = u%BStCMotionMesh(blade,instance)%TranslationDisp(fieldIndx,1) + du * perturb_sign - case ( 2) ! Orientation = 2; - CALL PerturbOrientationMatrix( u%BStCMotionMesh(blade,instance)%Orientation(:,:,1), du * perturb_sign, fieldIndx ) - case ( 3) ! TranslationVel = 3; - u%BStCMotionMesh(blade,instance)%TranslationVel( fieldIndx,1) = u%BStCMotionMesh(blade,instance)%TranslationVel( fieldIndx,1) + du * perturb_sign - case ( 4) ! RotationVel = 4; - u%BStCMotionMesh(blade,instance)%RotationVel( fieldIndx,1) = u%BStCMotionMesh(blade,instance)%RotationVel( fieldIndx,1) + du * perturb_sign - case ( 5) ! TranslationAcc = 5; - u%BStCMotionMesh(blade,instance)%TranslationAcc( fieldIndx,1) = u%BStCMotionMesh(blade,instance)%TranslationAcc( fieldIndx,1) + du * perturb_sign - case ( 6) ! RotationAcc = 6; - u%BStCMotionMesh(blade,instance)%RotationAcc( fieldIndx,1) = u%BStCMotionMesh(blade,instance)%RotationAcc( fieldIndx,1) + du * perturb_sign - !------------------------------- - ! 7:12 --> u%NStCMotionMesh(:)% - case ( 7) ! TranslationDisp = 1; - u%NStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) = u%NStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) + du * perturb_sign - case ( 8) ! Orientation = 2; - CALL PerturbOrientationMatrix( u%NStCMotionMesh(instance)%Orientation(:,:,1), du * perturb_sign, fieldIndx ) - case ( 9) ! TranslationVel = 3; - u%NStCMotionMesh(instance)%TranslationVel( fieldIndx,1) = u%NStCMotionMesh(instance)%TranslationVel( fieldIndx,1) + du * perturb_sign - case (10) ! RotationVel = 4; - u%NStCMotionMesh(instance)%RotationVel( fieldIndx,1) = u%NStCMotionMesh(instance)%RotationVel( fieldIndx,1) + du * perturb_sign - case (11) ! TranslationAcc = 5; - u%NStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) = u%NStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) + du * perturb_sign - case (12) ! RotationAcc = 6; - u%NStCMotionMesh(instance)%RotationAcc( fieldIndx,1) = u%NStCMotionMesh(instance)%RotationAcc( fieldIndx,1) + du * perturb_sign - !------------------------------- - ! 13:18 --> u%TStCMotionMesh(:)% - case (13) ! TranslationDisp = 1; - u%TStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) = u%TStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) + du * perturb_sign - case (14) ! Orientation = 2; - CALL PerturbOrientationMatrix( u%TStCMotionMesh(instance)%Orientation(:,:,1), du * perturb_sign, fieldIndx, UseSmlAngle=.false. ) - case (15) ! TranslationVel = 3; - u%TStCMotionMesh(instance)%TranslationVel( fieldIndx,1) = u%TStCMotionMesh(instance)%TranslationVel( fieldIndx,1) + du * perturb_sign - case (16) ! RotationVel = 4; - u%TStCMotionMesh(instance)%RotationVel( fieldIndx,1) = u%TStCMotionMesh(instance)%RotationVel( fieldIndx,1) + du * perturb_sign - case (17) ! TranslationAcc = 5; - u%TStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) = u%TStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) + du * perturb_sign - case (18) ! RotationAcc = 6; - u%TStCMotionMesh(instance)%RotationAcc( fieldIndx,1) = u%TStCMotionMesh(instance)%RotationAcc( fieldIndx,1) + du * perturb_sign - !------------------------------- - ! 19:24 --> u%SStCMotionMesh(:)% - case (19) ! TranslationDisp = 1; - u%SStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) = u%SStCMotionMesh(instance)%TranslationDisp(fieldIndx,1) + du * perturb_sign - case (20) ! Orientation = 2; - CALL PerturbOrientationMatrix( u%SStCMotionMesh(instance)%Orientation(:,:,1), du * perturb_sign, fieldIndx, UseSmlAngle=.false. ) - case (21) ! TranslationVel = 3; - u%SStCMotionMesh(instance)%TranslationVel( fieldIndx,1) = u%SStCMotionMesh(instance)%TranslationVel( fieldIndx,1) + du * perturb_sign - case (22) ! RotationVel = 4; - u%SStCMotionMesh(instance)%RotationVel( fieldIndx,1) = u%SStCMotionMesh(instance)%RotationVel( fieldIndx,1) + du * perturb_sign - case (23) ! TranslationAcc = 5; - u%SStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) = u%SStCMotionMesh(instance)%TranslationAcc( fieldIndx,1) + du * perturb_sign - case (24) ! RotationAcc = 6; - u%SStCMotionMesh(instance)%RotationAcc( fieldIndx,1) = u%SStCMotionMesh(instance)%RotationAcc( fieldIndx,1) + du * perturb_sign - end select -end subroutine SrvD_Perturb_u - -!---------------------------------------------------------------------------------------------------------------------------------- -!> This routine perturbs the single mesh point associated with the nth element of the u array -!! WARNING: this routine must exactly match Init_Jacobian::SrvD_Init_Jacobian_x -subroutine SrvD_Perturb_x( p, n, perturb_sign, x, dx ) - type(SrvD_ParameterType), intent(in ) :: p !< parameters - integer(IntKi), intent(in ) :: n !< number of array element to use - integer(IntKi), intent(in ) :: perturb_sign !< +1 or -1 (value to multiply perturbation by; positive or negative difference) - type(SrvD_ContinuousStateType), intent(inout) :: x !< perturbed SrvD ContStates - real(R8Ki), intent( out) :: dx !< amount that specific input was perturbed - ! local variables - integer :: component - integer :: instance, blade ! for StC mesh motions - component = p%Jac_x_indx(n,2) ! component (x,y,z) -- unused - instance = p%Jac_x_indx(n,3) - blade = p%Jac_x_indx(n,4) - dx = p%dx( p%Jac_x_indx(n,1) ) - ! determine which mesh we're trying to perturb and perturb the input: - select case( p%Jac_x_indx(n,1) ) ! StC+field index - !------------------------------- - ! 1:6 --> x%BStC(instance)%StC_x - case ( 1) ! x - x%BStC(instance)%StC_x(1,blade) = x%BStC(instance)%StC_x(1,blade) + dx * perturb_sign - case ( 2) ! y - x%BStC(instance)%StC_x(3,blade) = x%BStC(instance)%StC_x(3,blade) + dx * perturb_sign - case ( 3) ! z - x%BStC(instance)%StC_x(5,blade) = x%BStC(instance)%StC_x(5,blade) + dx * perturb_sign - case ( 4) ! x-dot - x%BStC(instance)%StC_x(2,blade) = x%BStC(instance)%StC_x(2,blade) + dx * perturb_sign - case ( 5) ! y-dot - x%BStC(instance)%StC_x(4,blade) = x%BStC(instance)%StC_x(4,blade) + dx * perturb_sign - case ( 6) ! z-dot - x%BStC(instance)%StC_x(6,blade) = x%BStC(instance)%StC_x(6,blade) + dx * perturb_sign - !------------------------------- - ! 7:12 --> x%NStC(instance)%StC_x - case ( 7) ! x - x%NStC(instance)%StC_x(1,1) = x%NStC(instance)%StC_x(1,1) + dx * perturb_sign - case ( 8) ! y - x%NStC(instance)%StC_x(3,1) = x%NStC(instance)%StC_x(3,1) + dx * perturb_sign - case ( 9) ! z - x%NStC(instance)%StC_x(5,1) = x%NStC(instance)%StC_x(5,1) + dx * perturb_sign - case (10) ! x-dot - x%NStC(instance)%StC_x(2,1) = x%NStC(instance)%StC_x(2,1) + dx * perturb_sign - case (11) ! y-dot - x%NStC(instance)%StC_x(4,1) = x%NStC(instance)%StC_x(4,1) + dx * perturb_sign - case (12) ! z-dot - x%NStC(instance)%StC_x(6,1) = x%NStC(instance)%StC_x(6,1) + dx * perturb_sign - !------------------------------- - ! 13:18 --> x%TStC(instance)%StC_x - case (13) ! x - x%TStC(instance)%StC_x(1,1) = x%TStC(instance)%StC_x(1,1) + dx * perturb_sign - case (14) ! y - x%TStC(instance)%StC_x(3,1) = x%TStC(instance)%StC_x(3,1) + dx * perturb_sign - case (15) ! z - x%TStC(instance)%StC_x(5,1) = x%TStC(instance)%StC_x(5,1) + dx * perturb_sign - case (16) ! x-dot - x%TStC(instance)%StC_x(2,1) = x%TStC(instance)%StC_x(2,1) + dx * perturb_sign - case (17) ! y-dot - x%TStC(instance)%StC_x(4,1) = x%TStC(instance)%StC_x(4,1) + dx * perturb_sign - case (18) ! z-dot - x%TStC(instance)%StC_x(6,1) = x%TStC(instance)%StC_x(6,1) + dx * perturb_sign - !------------------------------- - ! 19:24 --> x%SStC(instance)%StC_x - case (19) ! x - x%SStC(instance)%StC_x(1,1) = x%SStC(instance)%StC_x(1,1) + dx * perturb_sign - case (20) ! y - x%SStC(instance)%StC_x(3,1) = x%SStC(instance)%StC_x(3,1) + dx * perturb_sign - case (21) ! z - x%SStC(instance)%StC_x(5,1) = x%SStC(instance)%StC_x(5,1) + dx * perturb_sign - case (22) ! x-dot - x%SStC(instance)%StC_x(2,1) = x%SStC(instance)%StC_x(2,1) + dx * perturb_sign - case (23) ! y-dot - x%SStC(instance)%StC_x(4,1) = x%SStC(instance)%StC_x(4,1) + dx * perturb_sign - case (24) ! z-dot - x%SStC(instance)%StC_x(6,1) = x%SStC(instance)%StC_x(6,1) + dx * perturb_sign - end select -end subroutine SrvD_Perturb_x - -!---------------------------------------------------------------------------------------------------------------------------------- -!> This routine uses values of two output types to compute an array of differences. -!! Do not change this packing without making sure subroutine servodyn::SrvD_Init_Jacobian_y is consistant with this routine! -SUBROUTINE Compute_dY(p, y_p, y_m, delta_p, delta_m, dY) - type(SrvD_ParameterType), intent(in ) :: p !< parameters - type(SrvD_OutputType), intent(in ) :: y_p !< SrvD outputs at \f$ u + \Delta u \f$ or \f$ x + \Delta x \f$ (p=plus) - type(SrvD_OutputType), intent(in ) :: y_m !< SrvD outputs at \f$ u - \Delta u \f$ or \f$ x - \Delta x \f$ (m=minus) - real(R8Ki), intent(in ) :: delta_p !< difference in inputs or states \f$ delta = \Delta u \f$ or \f$ delta = \Delta x \f$ - real(R8Ki), intent(in ) :: delta_m !< difference in inputs or states \f$ delta = \Delta u \f$ or \f$ delta = \Delta x \f$ - real(R8Ki), intent(inout) :: dY(:) !< column of dYdu or dYdx: \f$ \frac{\partial Y}{\partial u_i} = \frac{y_p - y_m}{2 \, \Delta u}\f$ or \f$ \frac{\partial Y}{\partial x_i} = \frac{y_p - y_m}{2 \, \Delta x}\f$ - - ! local variables: - integer(IntKi) :: i,j,k ! generic counters - integer(IntKi) :: indx_first ! index indicating next value of dY to be filled - integer(IntKi) :: SrvD_Indx_Y_WrOutput - - ! StC related outputs - if (p%NumBStC > 0) then - do j=1,p%NumBStC - do i=1,p%NumBl - indx_first = p%Jac_Idx_BStC_y(1,i,j) - call PackLoadMesh_dY( y_p%BStCLoadMesh(i,j), y_m%BStCLoadMesh(i,j), dY, indx_first ) - enddo - enddo - endif - if (p%NumNStC > 0) then - do j=1,p%NumNStC - indx_first = p%Jac_Idx_NStC_y(1,j) - call PackLoadMesh_dY( y_p%NStCLoadMesh(j), y_m%NStCLoadMesh(j), dY, indx_first ) - enddo - endif - if (p%NumTStC > 0) then - do j=1,p%NumTStC - indx_first = p%Jac_Idx_TStC_y(1,j) - call PackLoadMesh_dY( y_p%TStCLoadMesh(j), y_m%TStCLoadMesh(j), dY, indx_first ) - enddo - endif - if (p%NumSStC > 0) then - do j=1,p%NumSStC - indx_first = p%Jac_Idx_SStC_y(1,j) - call PackLoadMesh_dY( y_p%SStCLoadMesh(j), y_m%SStCLoadMesh(j), dY, indx_first ) - enddo - endif - - ! outputs - SrvD_Indx_Y_WrOutput = p%Jac_ny - p%NumOuts ! Index to location before user requested outputs - do k=1,p%NumOuts - dY(SrvD_Indx_Y_WrOutput+k) = real( y_p%WriteOutput(k) - y_m%WriteOutput(k), R8Ki ) - end do - - dY = dY / (delta_p + delta_m) -END SUBROUTINE Compute_dY - -!---------------------------------------------------------------------------------------------------------------------------------- -!> This routine uses values of two output types to compute an array of differences. -!! Do not change this packing without making sure subroutine servodyn::SrvD_Init_Jacobian_x is consistant with this routine! -subroutine Compute_dX( p, x_p, x_m, delta_p, delta_m, dX ) - type(SrvD_ParameterType), intent(in ) :: p !< parameters - type(SrvD_ContinuousStateType), intent(in ) :: x_p !< SrvD continuous states at \f$ u + \Delta u \f$ or \f$ x + \Delta x \f$ (p=plus) - type(SrvD_ContinuousStateType), intent(in ) :: x_m !< SrvD continuous states at \f$ u - \Delta u \f$ or \f$ x - \Delta x \f$ (m=minus) - real(R8Ki), intent(in ) :: delta_p !< difference in inputs or states \f$ delta = \Delta u \f$ or \f$ delta = \Delta x \f$ - real(R8Ki), intent(in ) :: delta_m !< difference in inputs or states \f$ delta = \Delta u \f$ or \f$ delta = \Delta x \f$ - real(R8Ki), intent(inout) :: dX(:) !< column of dXdu or dXdx: \f$ \frac{\partial X}{\partial u_i} = \frac{x_p - x_m}{2 \, \Delta u}\f$ or \f$ \frac{\partial X}{\partial x_i} = \frac{x_p - x_m}{2 \, \Delta x}\f$ - - ! local variables: - integer(IntKi) :: i,j,k ! generic counters - integer(IntKi) :: indx_prev ! index indicating index in dX before this one to be filled - - ! StC related outputs - if (p%NumBStC > 0) then - do j=1,p%NumBStC - do k=1,p%NumBl - indx_prev = p%Jac_Idx_BStC_x(1,k,j)-1 - dX(indx_prev+1) = x_p%BStC(j)%StC_x(1,k) - x_m%BStC(j)%StC_x(1,k) ! x x%BStC(j)%StC_x(1,k) - dX(indx_prev+2) = x_p%BStC(j)%StC_x(3,k) - x_m%BStC(j)%StC_x(3,k) ! y x%BStC(j)%StC_x(3,k) - dX(indx_prev+3) = x_p%BStC(j)%StC_x(5,k) - x_m%BStC(j)%StC_x(5,k) ! z x%BStC(j)%StC_x(5,k) - dX(indx_prev+4) = x_p%BStC(j)%StC_x(2,k) - x_m%BStC(j)%StC_x(2,k) ! x-dot x%BStC(j)%StC_x(2,k) - dX(indx_prev+5) = x_p%BStC(j)%StC_x(4,k) - x_m%BStC(j)%StC_x(4,k) ! y-dot x%BStC(j)%StC_x(4,k) - dX(indx_prev+6) = x_p%BStC(j)%StC_x(6,k) - x_m%BStC(j)%StC_x(6,k) ! z-dot x%BStC(j)%StC_x(6,k) - indx_prev = indx_prev + 6 - enddo - enddo - endif - if (p%NumNStC > 0) then - do j=1,p%NumNStC - indx_prev = p%Jac_Idx_NStC_x(1,j)-1 - dX(indx_prev+1) = x_p%NStC(j)%StC_x(1,1) - x_m%NStC(j)%StC_x(1,1) ! x x%NStC(j)%StC_x(1,1) - dX(indx_prev+2) = x_p%NStC(j)%StC_x(3,1) - x_m%NStC(j)%StC_x(3,1) ! y x%NStC(j)%StC_x(3,1) - dX(indx_prev+3) = x_p%NStC(j)%StC_x(5,1) - x_m%NStC(j)%StC_x(5,1) ! z x%NStC(j)%StC_x(5,1) - dX(indx_prev+4) = x_p%NStC(j)%StC_x(2,1) - x_m%NStC(j)%StC_x(2,1) ! x-dot x%NStC(j)%StC_x(2,1) - dX(indx_prev+5) = x_p%NStC(j)%StC_x(4,1) - x_m%NStC(j)%StC_x(4,1) ! y-dot x%NStC(j)%StC_x(4,1) - dX(indx_prev+6) = x_p%NStC(j)%StC_x(6,1) - x_m%NStC(j)%StC_x(6,1) ! z-dot x%NStC(j)%StC_x(6,1) - indx_prev = indx_prev + 6 - enddo - endif - if (p%NumTStC > 0) then - do j=1,p%NumTStC - indx_prev = p%Jac_Idx_TStC_x(1,j)-1 - dX(indx_prev+1) = x_p%TStC(j)%StC_x(1,1) - x_m%TStC(j)%StC_x(1,1) ! x x%TStC(j)%StC_x(1,1) - dX(indx_prev+2) = x_p%TStC(j)%StC_x(3,1) - x_m%TStC(j)%StC_x(3,1) ! y x%TStC(j)%StC_x(3,1) - dX(indx_prev+3) = x_p%TStC(j)%StC_x(5,1) - x_m%TStC(j)%StC_x(5,1) ! z x%TStC(j)%StC_x(5,1) - dX(indx_prev+4) = x_p%TStC(j)%StC_x(2,1) - x_m%TStC(j)%StC_x(2,1) ! x-dot x%TStC(j)%StC_x(2,1) - dX(indx_prev+5) = x_p%TStC(j)%StC_x(4,1) - x_m%TStC(j)%StC_x(4,1) ! y-dot x%TStC(j)%StC_x(4,1) - dX(indx_prev+6) = x_p%TStC(j)%StC_x(6,1) - x_m%TStC(j)%StC_x(6,1) ! z-dot x%TStC(j)%StC_x(6,1) - indx_prev = indx_prev + 6 - enddo - endif - if (p%NumSStC > 0) then - do j=1,p%NumSStC - indx_prev = p%Jac_Idx_SStC_x(1,j)-1 - dX(indx_prev+1) = x_p%SStC(j)%StC_x(1,1) - x_m%SStC(j)%StC_x(1,1) ! x x%SStC(j)%StC_x(1,1) - dX(indx_prev+2) = x_p%SStC(j)%StC_x(3,1) - x_m%SStC(j)%StC_x(3,1) ! y x%SStC(j)%StC_x(3,1) - dX(indx_prev+3) = x_p%SStC(j)%StC_x(5,1) - x_m%SStC(j)%StC_x(5,1) ! z x%SStC(j)%StC_x(5,1) - dX(indx_prev+4) = x_p%SStC(j)%StC_x(2,1) - x_m%SStC(j)%StC_x(2,1) ! x-dot x%SStC(j)%StC_x(2,1) - dX(indx_prev+5) = x_p%SStC(j)%StC_x(4,1) - x_m%SStC(j)%StC_x(4,1) ! y-dot x%SStC(j)%StC_x(4,1) - dX(indx_prev+6) = x_p%SStC(j)%StC_x(6,1) - x_m%SStC(j)%StC_x(6,1) ! z-dot x%SStC(j)%StC_x(6,1) - indx_prev = indx_prev + 6 - enddo - endif - - dX = dX / (delta_p + delta_m) -end subroutine Compute_dX - - !---------------------------------------------------------------------------------------------------------------------------------- !> Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions !! with respect to the continuous states (x). The partial derivatives dY/dx, dX/dx, dXd/dx, and DZ/dx are returned. @@ -4038,10 +2516,7 @@ SUBROUTINE SrvD_JacobianPContState(Vars, t, u, p, x, xd, z, OtherState, y, m, Er call MV_ComputeCentralDiff(Vars%y, Vars%x(i)%Perturb, m%Jac%y_pos, m%Jac%y_neg, dYdx(:,iCol)) end do end do - - ! call Jac_dYdx( t, u, p, x, xd, z, OtherState, y, m, ErrStat2, ErrMsg2, dYdx ) - ! if (Failed()) return - END IF + end if ! Calculate the partial derivative of the continuous state functions (X) with respect to the continuous states (x) here: if (present(dXdx) .and. (m%Jac%Nx > 0)) then @@ -4076,18 +2551,15 @@ SUBROUTINE SrvD_JacobianPContState(Vars, t, u, p, x, xd, z, OtherState, y, m, Er dXdx(:,iCol) = (m%Jac%x_pos - m%Jac%x_neg) / (2.0_R8Ki * Vars%x(i)%Perturb) end do end do - - ! call Jac_dXdx( t, u, p, x, xd, z, OtherState, m, ErrStat2, ErrMsg2, dXdx ) - ! if (Failed()) return end if - IF ( PRESENT( dXddx ) ) THEN + if (present(dXddx)) then if (allocated(dXddx)) deallocate(dXddx) - END IF + end if - IF ( PRESENT( dZdx ) ) THEN + if (present(dZdx)) then if (allocated(dZdx)) deallocate(dZdx) - END IF + end if contains logical function Failed() @@ -4096,524 +2568,6 @@ logical function Failed() end function Failed END SUBROUTINE SrvD_JacobianPContState -!> Calculate the jacobian dYdx -subroutine Jac_dYdx( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdx ) - real(DbKi), intent(in ) :: t !< Time in seconds at operating point - type(SrvD_InputType), intent(in ) :: u !< Inputs at operating point - type(SrvD_ParameterType), intent(in ) :: p !< Parameters - type(SrvD_ContinuousStateType), intent(in ) :: x !< Continuous states at operating point - type(SrvD_DiscreteStateType), intent(in ) :: xd !< Discrete states at operating point - type(SrvD_ConstraintStateType), intent(in ) :: z !< Constraint states at operating point - type(SrvD_OtherStateType), intent(in ) :: OtherState !< Other states at operating point - type(SrvD_OutputType), intent(inout) :: y !< Output (need to make copies) - type(SrvD_MiscVarType), intent(inout) :: m !< Misc/optimization variables - integer(IntKi), intent( out) :: ErrStat !< Error status of the operation - character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None - real(R8Ki), allocatable, intent(inout) :: dYdx(:,:) !< Partial derivatives of output functions - - integer(IntKi) :: n ! Generic loop index -- index to x for perturb - type(SrvD_OutputType) :: y_p ! outputs positive perturbed - type(SrvD_OutputType) :: y_m ! outputs negative perturbed - type(SrvD_ContinuousStateType) :: x_temp ! copy of inputs to perturb - real(R8Ki) :: delta_p ! delta+ change in input or state - real(R8Ki) :: delta_m ! delta- change in input or state - integer(IntKi) :: ErrStat2 - character(ErrMsgLen) :: ErrMsg2 - character(*), parameter :: RoutineName = 'Jac_dYdx' - - ! Initialize ErrStat - ErrStat = ErrID_None - ErrMsg = '' - - ! Allocate the dYdx array regardless what states may or may not exist (glue code needs this) - if (.not. allocated(dYdx)) then - call allocAry(dYdx, p%Jac_ny, p%Jac_nx, 'dYdx', ErrStat2, ErrMsg2) - if (Failed()) return - elseif ( (size(dYdx,1) /= p%Jac_ny) .or. (size(dYdx,2) /= p%Jac_nx) ) then - deallocate(dYdx) - call allocAry(dYdx, p%Jac_ny, p%Jac_nx, 'dYdx', ErrStat2, ErrMsg2) - if (Failed()) return - endif - dYdx = 0.0_R8Ki - - !------------------------------------------------------------- - ! Perturb each StC instance individually and place in appropriate location in dYdx - ! Each StC is basically an isolated piece that doesn't interact with any other StC or with anything else in SrvD, - ! so we take advantage of that here for computational expediency. - !------------------------------------------------------------- - ! make a copy of the inputs to perturb if an StC exists - if ( (p%NumBStC + p%NumNStC + p%NumTStC + p%NumSStC) > 0 ) then - call SrvD_CopyContState( x, x_temp, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - else - return ! Nothing further to do here - endif - !------------------- - ! Blade StC - if (p%NumBStC > 0) then - do n=p%Jac_Idx_BStC_x(1,1,1),p%Jac_Idx_BStC_x(2,p%NumBl,p%NumBStC) ! state range for BStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dYdx( n, +1, x_temp, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dYdx( n, -1, x_temp, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdx(:,n) ) - enddo - endif - !------------------- - ! Nacelle StC - if (p%NumNStC > 0) then - do n=p%Jac_Idx_NStC_x(1,1),p%Jac_Idx_NStC_x(2,p%NumNStC) ! state range for NStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dYdx( n, +1, x_temp, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dYdx( n, -1, x_temp, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdx(:,n) ) - enddo - endif - !------------------- - ! Tower StC - if (p%NumTStC > 0) then - do n=p%Jac_Idx_TStC_x(1,1),p%Jac_Idx_TStC_x(2,p%NumTStC) ! state range for TStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dYdx( n, +1, x_temp, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dYdx( n, -1, x_temp, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdx(:,n) ) - enddo - endif - !------------------- - ! Substructure StC - if (p%NumSStC > 0) then - do n=p%Jac_Idx_SStC_x(1,1),p%Jac_Idx_SStC_x(2,p%NumSStC) ! state range for SStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dYdx( n, +1, x_temp, delta_p, y_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyOutput( y, y_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dYdx( n, -1, x_temp, delta_m, y_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dY( p, y_p, y_m, delta_p, delta_m, dYdx(:,n) ) - enddo - endif - call Cleanup() - -contains - logical function Failed() - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - Failed = ErrStat >= AbortErrLev - if (Failed) call Cleanup - end function Failed - - subroutine Cleanup() - ! Ignore any errors from the destroy (these weren't created if no StCs) - call SrvD_DestroyContState( x_temp, ErrStat2, ErrMsg2 ) - call SrvD_DestroyOutput( y_p, ErrStat2, ErrMsg2 ) - call SrvD_DestroyOutput( y_m, ErrStat2, ErrMsg2 ) - end subroutine Cleanup - - !> Calculated dYdx for BStC instance - subroutine Jac_BStC_dYdx( n, sgn, x_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j,k ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_x_indx(n,4) ! this blade - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! call Calc - call StC_CopyOutput(m%y_BStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, m%u_BStC(1,j), p%BStC(j), x_perturb%BStC(j), xd%BStC(j), z%BStC(j), OtherState%BStC(j), y_StC, m%BStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(k), y_perturb%BStCLoadMesh(k,j), m%SrvD_MeshMap%BStC_Frc2_y_BStC(k,j), ErrStat3, ErrMsg3, u%BStCMotionMesh(k,j), u%BStCMotionMesh(k,j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_BStC_Outs_Instance(j, p%NumBl, x_perturb%BStC(j), m%BStC(j), y_StC, AllOuts) - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_BStC_dYdx - - !> Calculated dYdx for NStC instance - subroutine Jac_NStC_dYdx( n, sgn, x_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! call Calc - call StC_CopyOutput(m%y_NStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, m%u_NStC(1,j), p%NStC(j), x_perturb%NStC(j), xd%NStC(j), z%NStC(j), OtherState%NStC(j), y_StC, m%NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%NStCLoadMesh(j), m%SrvD_MeshMap%NStC_Frc2_y_NStC(j), ErrStat3, ErrMsg3, u%NStCMotionMesh(j), u%NStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_NStC_Outs_Instance(j, x_perturb%NStC(j), m%NStC(j), y_StC, AllOuts) - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_NStC_dYdx - - !> Calculated dYdx for TStC instance - subroutine Jac_TStC_dYdx( n, sgn, x_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! call Calc - call StC_CopyOutput(m%y_TStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, m%u_TStC(1,j), p%TStC(j), x_perturb%TStC(j), xd%TStC(j), z%TStC(j), OtherState%TStC(j), y_StC, m%TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%TStCLoadMesh(j), m%SrvD_MeshMap%TStC_Frc2_y_TStC(j), ErrStat3, ErrMsg3, u%TStCMotionMesh(j), u%TStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_TStC_Outs_Instance(j, x_perturb%TStC(j), m%TStC(j), y_StC, AllOuts) - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_TStC_dYdx - - !> Calculated dYdx for SStC instance - subroutine Jac_SStC_dYdx( n, sgn, x_perturb, delta, y_perturb, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of inputs to perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - type(SrvD_OutputType), intent(inout) :: y_perturb ! outputs perturbed - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: i,j ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - real(ReKi) :: AllOuts(0:MaxOutPts) ! All the available output channels - perturbed (ReKi since WriteOutput is ReKi) - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! call Calc - call StC_CopyOutput(m%y_SStC( j), y_StC, MESH_NEWCOPY, ErrStat3, ErrMsg3); if (ErrStat3 > AbortErrLev) return - CALL StC_CalcOutput( t, m%u_SStC(1,j), p%SStC(j), x_perturb%SStC(j), xd%SStC(j), z%SStC(j), OtherState%SStC(j), y_StC, m%SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - CALL Transfer_Point_to_Point( y_StC%Mesh(1), y_perturb%SStCLoadMesh(j), m%SrvD_MeshMap%SStC_Frc2_y_SStC(j), ErrStat3, ErrMsg3, u%SStCMotionMesh(j), u%SStCMotionMesh(j) ); if (ErrStat3 > AbortErrLev) return - ! collect relevant outputs - AllOuts = 0.0_ReKi - call Set_SStC_Outs_Instance(j, x_perturb%SStC(j), m%SStC(j), y_StC, AllOuts) - call StC_DestroyOutput( y_StC, ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - !------------------- - ! Store outputs - do I = 1,p%NumOuts ! Loop through all selected output channels - y_perturb%WriteOutput(I) = p%OutParam(I)%SignM * AllOuts( p%OutParam(I)%Indx ) - enddo -! do I = 1,p%NumOuts_DLL ! Loop through all DLL logging channels -! y_perturb%WriteOutput(I+p%NumOuts) = m%dll_data%LogChannels( I ) -! enddo - end subroutine Jac_SStC_dYdx -end subroutine Jac_dYdx - -!> Calculate the jacobian dXdx -!! The only states exist with the StC instances -subroutine Jac_dXdx(t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg, dXdx) - real(DbKi), intent(in ) :: t !< Time in seconds at operating point - type(SrvD_InputType), intent(in ) :: u !< Inputs at operating point - type(SrvD_ParameterType), intent(in ) :: p !< Parameters - type(SrvD_ContinuousStateType), intent(in ) :: x !< Continuous states at operating point - type(SrvD_DiscreteStateType), intent(in ) :: xd !< Discrete states at operating point - type(SrvD_ConstraintStateType), intent(in ) :: z !< Constraint states at operating point - type(SrvD_OtherStateType), intent(in ) :: OtherState !< Other states at operating point - type(SrvD_MiscVarType), intent(inout) :: m !< Misc/optimization variables - integer(IntKi), intent( out) :: ErrStat !< Error status of the operation - character(*), intent( out) :: ErrMsg !< Error message if ErrStat /= ErrID_None - real(R8Ki), allocatable, intent(inout) :: dXdx(:,:) !< Partial derivatives of output functions - - integer(IntKi) :: n ! Generic loop index - type(SrvD_ContinuousStateType) :: dx_p ! states positive perturbed - type(SrvD_ContinuousStateType) :: dx_m ! states negative perturbed - type(SrvD_ContinuousStateType) :: x_temp ! copy of states to perturb - real(R8Ki) :: delta_p ! delta+ change in input or state - real(R8Ki) :: delta_m ! delta- change in input or state - integer(IntKi) :: ErrStat2 - character(ErrMsgLen) :: ErrMsg2 - character(*), parameter :: RoutineName = 'Jac_dXdx' - - ! Initialize ErrStat - ErrStat = ErrID_None - ErrMsg = '' - - ! Allocate the dXdx array regardless what states may or may not exist (glue code needs this) - if (.not. allocated(dXdx)) then - call allocAry(dXdx, p%Jac_nx, p%Jac_nx, 'dXdx', ErrStat2, ErrMsg2) - if (Failed()) return - elseif ( (size(dXdx,1) /= p%Jac_nx) .or. (size(dXdx,2) /= p%Jac_nx) ) then - deallocate(dXdx) - call allocAry(dXdx, p%Jac_nx, p%Jac_nx, 'dXdx', ErrStat2, ErrMsg2) - if (Failed()) return - endif - dXdx = 0.0_R8Ki - - !------------------------------------------------------------- - ! Perturb each StC instance individually and place in appropriate location in dYdx - ! Each StC is basically an isolated piece that doesn't interact with any other StC or with anything else in SrvD, - ! so we take advantage of that here for computational expediency. - !------------------------------------------------------------- - ! make a copy of the inputs to perturb if an StC exists - if ( (p%NumBStC + p%NumNStC + p%NumTStC + p%NumSStC) > 0 ) then - call SrvD_CopyContState( x, x_temp, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_NEWCOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - else - return ! Nothing futher to do here - endif - !------------------- - ! Blade StC - if (p%NumBStC > 0) then - do n=p%Jac_Idx_BStC_x(1,1,1),p%Jac_Idx_BStC_x(2,p%NumBl,p%NumBStC) ! state range for BStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dXdx( n, +1, x_temp, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_BStC_dXdx( n, -1, x_temp, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdx(:,n) ) - enddo - endif - !------------------- - ! Nacelle StC - if (p%NumNStC > 0) then - do n=p%Jac_Idx_NStC_x(1,1),p%Jac_Idx_NStC_x(2,p%NumNStC) ! state range for NStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dXdx( n, +1, x_temp, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_NStC_dXdx( n, -1, x_temp, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdx(:,n) ) - enddo - endif - !------------------- - ! Tower StC - if (p%NumTStC > 0) then - do n=p%Jac_Idx_TStC_x(1,1),p%Jac_Idx_TStC_x(2,p%NumTStC) ! state range for TStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dXdx( n, +1, x_temp, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_TStC_dXdx( n, -1, x_temp, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdx(:,n) ) - enddo - endif - !------------------- - ! Substructure StC - if (p%NumSStC > 0) then - do n=p%Jac_Idx_SStC_x(1,1),p%Jac_Idx_SStC_x(2,p%NumSStC) ! state range for SStC - ! perturb positive - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_p, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dXdx( n, +1, x_temp, delta_p, dx_p, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! perturb negative - call SrvD_CopyContState( x, x_temp, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call SrvD_CopyContState( x, dx_m, MESH_UPDATECOPY, ErrStat2, ErrMsg2 ); if (Failed()) return; - call Jac_SStC_dXdx( n, -1, x_temp, delta_m, dx_m, ErrStat2, ErrMsg2 ); if (Failed()) return; - - ! Central difference - call Compute_dX( p, dx_p, dx_m, delta_p, delta_m, dXdx(:,n) ) - enddo - endif - call Cleanup() - -contains - logical function Failed() - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - Failed = ErrStat >= AbortErrLev - if (Failed) call Cleanup - end function Failed - - subroutine Cleanup() - ! Ignore any errors from the destroy (these weren't created if no StCs) - call SrvD_DestroyContState( x_temp, ErrStat2, ErrMsg2 ) - call SrvD_DestroyContState( dx_p, ErrStat2, ErrMsg2 ) - call SrvD_DestroyContState( dx_m, ErrStat2, ErrMsg2 ) - end subroutine Cleanup - - !> Calculated dYdx for BStC instance - subroutine Jac_BStC_dXdx( n, sgn, x_perturb, delta, x_perturb_out, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of states before perturb - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb_out ! copy of states after perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j,k ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_x_indx(n,4) ! this blade - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! calculate change in ContState - call StC_CalcContStateDeriv( t, m%u_BStC(1,j), p%BStC(j), x_perturb%BStC(j), xd%BStC(j), z%BStC(j), OtherState%BStC(j), m%BStC(j), x_perturb_out%BStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_BStC_dXdx - - !> Calculated dYdx for NStC instance - subroutine Jac_NStC_dXdx( n, sgn, x_perturb, delta, x_perturb_out, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of states before perturb - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb_out ! copy of states after perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j,k ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_x_indx(n,4) ! this blade - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! calculate change in ContState - call StC_CalcContStateDeriv( t, m%u_NStC(1,j), p%NStC(j), x_perturb%NStC(j), xd%NStC(j), z%NStC(j), OtherState%NStC(j), m%NStC(j), x_perturb_out%NStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_NStC_dXdx - - !> Calculated dYdx for TStC instance - subroutine Jac_TStC_dXdx( n, sgn, x_perturb, delta, x_perturb_out, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of states before perturb - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb_out ! copy of states after perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j,k ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_x_indx(n,4) ! this blade - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! calculate change in ContState - call StC_CalcContStateDeriv( t, m%u_TStC(1,j), p%TStC(j), x_perturb%TStC(j), xd%TStC(j), z%TStC(j), OtherState%TStC(j), m%TStC(j), x_perturb_out%TStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_TStC_dXdx - - !> Calculated dYdx for SStC instance - subroutine Jac_SStC_dXdx( n, sgn, x_perturb, delta, x_perturb_out, ErrStat3, ErrMsg3) - integer(IntKi), intent(in ) :: n ! which input to perturb - integer(IntKi), intent(in ) :: sgn ! sign of perturbation - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb ! copy of states before perturb - type(SrvD_ContinuousStateType), intent(inout) :: x_perturb_out ! copy of states after perturb - real(R8Ki), intent( out) :: delta ! delta+/- change in input or state - integer(IntKi), intent( out) :: ErrStat3 - character(ErrMsgLen), intent( out) :: ErrMsg3 - integer(IntKi) :: j,k ! Generic indices - type(StC_OutputType) :: y_StC ! copy of the StC outputs for StC_CalcOutput call - ! Since this is acting on only a single blade within a single StC instance, we can look up exactly which one - ! from the Jac_x_indx array. This allows us to simplify the number of calls dramatically - k = p%Jac_x_indx(n,4) ! this blade - j = p%Jac_x_indx(n,3) ! this instance - !------------------- - ! get u_op +/- delta u - call SrvD_Perturb_x( p, n, sgn, x_perturb, delta ) - ! calculate change in ContState - call StC_CalcContStateDeriv( t, m%u_SStC(1,j), p%SStC(j), x_perturb%SStC(j), xd%SStC(j), z%SStC(j), OtherState%SStC(j), m%SStC(j), x_perturb_out%SStC(j), ErrStat3, ErrMsg3 ); if (ErrStat3 > AbortErrLev) return - end subroutine Jac_SStC_dXdx - -end subroutine Jac_dXdx - !---------------------------------------------------------------------------------------------------------------------------------- !> Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions !! with respect to the discrete states (xd). The partial derivatives dY/dxd, dX/dxd, dXd/dxd, and DZ/dxd are returned. diff --git a/modules/servodyn/src/ServoDyn_Registry.txt b/modules/servodyn/src/ServoDyn_Registry.txt index 405e73c47..7234bca76 100644 --- a/modules/servodyn/src/ServoDyn_Registry.txt +++ b/modules/servodyn/src/ServoDyn_Registry.txt @@ -443,26 +443,6 @@ typedef ^ ParameterType Logical EXavrSWAP - - - "Use extendend avr SWAP" - typedef ^ ParameterType IntKi NumCableControl - - - "Number of cable control channels requested" - typedef ^ ParameterType IntKi NumStC_Control - - - "Number of cable StC channels requested" - typedef ^ ParameterType IntKi StCMeasNumPerChan {:} - - "Number of cable StC channel to average on each control channel sent to DLL" - -# parameters for linearization -typedef ^ ParameterType Integer Jac_u_indx {:}{:} - - "matrix to help fill/pack the u vector in computing the jacobian" - -typedef ^ ParameterType Integer Jac_x_indx {:}{:} - - "matrix to help fill/pack the x vector in computing the jacobian" - -typedef ^ ParameterType R8Ki du {:} - - "vector that determines size of perturbation for u (inputs)" -typedef ^ ParameterType ReKi dx {:} - - "vector that determines size of perturbation for x (continuous states)" -typedef ^ ParameterType Integer Jac_nu - - - "number of inputs in jacobian matrix" - -typedef ^ ParameterType Integer Jac_ny - - - "number of outputs in jacobian matrix" - -typedef ^ ParameterType Integer Jac_nx - - - "the number of continuous states in jacobian matrix" - -typedef ^ ParameterType Integer Jac_Idx_BStC_u {:}{:}{:} - - "the start and end indices of blade StC u jacobian [ start/end, blade, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_NStC_u {:}{:} - - "the start and end indices of nacelle StC u jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_TStC_u {:}{:} - - "the start and end indices of tower StC u jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_SStC_u {:}{:} - - "the start and end indices of substructure StC u jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_BStC_x {:}{:}{:} - - "the start and end indices of blade StC x jacobian [ start/end, blade, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_NStC_x {:}{:} - - "the start and end indices of nacelle StC x jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_TStC_x {:}{:} - - "the start and end indices of tower StC x jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_SStC_x {:}{:} - - "the start and end indices of substructure StC x jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_BStC_y {:}{:}{:} - - "the start and end indices of blade StC y jacobian [ start/end, blade, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_NStC_y {:}{:} - - "the start and end indices of nacelle StC y jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_TStC_y {:}{:} - - "the start and end indices of tower StC y jacobian [ start/end, instance ]" - -typedef ^ ParameterType Integer Jac_Idx_SStC_y {:}{:} - - "the start and end indices of substructure StC y jacobian [ start/end, instance ]" - # parameters for lidar assisted control typedef ^ ParameterType IntKi SensorType - - - "Lidar sensor type" - typedef ^ ParameterType IntKi NumBeam - - - "Number of beams" - diff --git a/modules/servodyn/src/ServoDyn_Types.f90 b/modules/servodyn/src/ServoDyn_Types.f90 index 997e5be48..50c511492 100644 --- a/modules/servodyn/src/ServoDyn_Types.f90 +++ b/modules/servodyn/src/ServoDyn_Types.f90 @@ -449,25 +449,6 @@ MODULE ServoDyn_Types INTEGER(IntKi) :: NumCableControl = 0_IntKi !< Number of cable control channels requested [-] INTEGER(IntKi) :: NumStC_Control = 0_IntKi !< Number of cable StC channels requested [-] INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: StCMeasNumPerChan !< Number of cable StC channel to average on each control channel sent to DLL [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_u_indx !< matrix to help fill/pack the u vector in computing the jacobian [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_x_indx !< matrix to help fill/pack the x vector in computing the jacobian [-] - REAL(R8Ki) , DIMENSION(:), ALLOCATABLE :: du !< vector that determines size of perturbation for u (inputs) [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: dx !< vector that determines size of perturbation for x (continuous states) [-] - INTEGER(IntKi) :: Jac_nu = 0_IntKi !< number of inputs in jacobian matrix [-] - INTEGER(IntKi) :: Jac_ny = 0_IntKi !< number of outputs in jacobian matrix [-] - INTEGER(IntKi) :: Jac_nx = 0_IntKi !< the number of continuous states in jacobian matrix [-] - INTEGER(IntKi) , DIMENSION(:,:,:), ALLOCATABLE :: Jac_Idx_BStC_u !< the start and end indices of blade StC u jacobian [ start/end, blade, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_NStC_u !< the start and end indices of nacelle StC u jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_TStC_u !< the start and end indices of tower StC u jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_SStC_u !< the start and end indices of substructure StC u jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:,:), ALLOCATABLE :: Jac_Idx_BStC_x !< the start and end indices of blade StC x jacobian [ start/end, blade, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_NStC_x !< the start and end indices of nacelle StC x jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_TStC_x !< the start and end indices of tower StC x jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_SStC_x !< the start and end indices of substructure StC x jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:,:), ALLOCATABLE :: Jac_Idx_BStC_y !< the start and end indices of blade StC y jacobian [ start/end, blade, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_NStC_y !< the start and end indices of nacelle StC y jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_TStC_y !< the start and end indices of tower StC y jacobian [ start/end, instance ] [-] - INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: Jac_Idx_SStC_y !< the start and end indices of substructure StC y jacobian [ start/end, instance ] [-] INTEGER(IntKi) :: SensorType = 0_IntKi !< Lidar sensor type [-] INTEGER(IntKi) :: NumBeam = 0_IntKi !< Number of beams [-] INTEGER(IntKi) :: NumPulseGate = 0_IntKi !< Number of pulse gates [-] @@ -3787,8 +3768,8 @@ subroutine SrvD_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg) integer(IntKi), intent(in ) :: CtrlCode integer(IntKi), intent( out) :: ErrStat character(*), intent( out) :: ErrMsg - integer(B4Ki) :: i1, i2, i3 - integer(B4Ki) :: LB(3), UB(3) + integer(B4Ki) :: i1 + integer(B4Ki) :: LB(1), UB(1) integer(IntKi) :: ErrStat2 character(ErrMsgLen) :: ErrMsg2 character(*), parameter :: RoutineName = 'SrvD_CopyParam' @@ -4070,201 +4051,6 @@ subroutine SrvD_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg) end if DstParamData%StCMeasNumPerChan = SrcParamData%StCMeasNumPerChan end if - if (allocated(SrcParamData%Jac_u_indx)) then - LB(1:2) = lbound(SrcParamData%Jac_u_indx) - UB(1:2) = ubound(SrcParamData%Jac_u_indx) - if (.not. allocated(DstParamData%Jac_u_indx)) then - allocate(DstParamData%Jac_u_indx(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_u_indx.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_u_indx = SrcParamData%Jac_u_indx - end if - if (allocated(SrcParamData%Jac_x_indx)) then - LB(1:2) = lbound(SrcParamData%Jac_x_indx) - UB(1:2) = ubound(SrcParamData%Jac_x_indx) - if (.not. allocated(DstParamData%Jac_x_indx)) then - allocate(DstParamData%Jac_x_indx(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_x_indx.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_x_indx = SrcParamData%Jac_x_indx - end if - if (allocated(SrcParamData%du)) then - LB(1:1) = lbound(SrcParamData%du) - UB(1:1) = ubound(SrcParamData%du) - if (.not. allocated(DstParamData%du)) then - allocate(DstParamData%du(LB(1):UB(1)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%du.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%du = SrcParamData%du - end if - if (allocated(SrcParamData%dx)) then - LB(1:1) = lbound(SrcParamData%dx) - UB(1:1) = ubound(SrcParamData%dx) - if (.not. allocated(DstParamData%dx)) then - allocate(DstParamData%dx(LB(1):UB(1)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%dx.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%dx = SrcParamData%dx - end if - DstParamData%Jac_nu = SrcParamData%Jac_nu - DstParamData%Jac_ny = SrcParamData%Jac_ny - DstParamData%Jac_nx = SrcParamData%Jac_nx - if (allocated(SrcParamData%Jac_Idx_BStC_u)) then - LB(1:3) = lbound(SrcParamData%Jac_Idx_BStC_u) - UB(1:3) = ubound(SrcParamData%Jac_Idx_BStC_u) - if (.not. allocated(DstParamData%Jac_Idx_BStC_u)) then - allocate(DstParamData%Jac_Idx_BStC_u(LB(1):UB(1),LB(2):UB(2),LB(3):UB(3)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_BStC_u.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_BStC_u = SrcParamData%Jac_Idx_BStC_u - end if - if (allocated(SrcParamData%Jac_Idx_NStC_u)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_NStC_u) - UB(1:2) = ubound(SrcParamData%Jac_Idx_NStC_u) - if (.not. allocated(DstParamData%Jac_Idx_NStC_u)) then - allocate(DstParamData%Jac_Idx_NStC_u(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_NStC_u.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_NStC_u = SrcParamData%Jac_Idx_NStC_u - end if - if (allocated(SrcParamData%Jac_Idx_TStC_u)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_TStC_u) - UB(1:2) = ubound(SrcParamData%Jac_Idx_TStC_u) - if (.not. allocated(DstParamData%Jac_Idx_TStC_u)) then - allocate(DstParamData%Jac_Idx_TStC_u(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_TStC_u.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_TStC_u = SrcParamData%Jac_Idx_TStC_u - end if - if (allocated(SrcParamData%Jac_Idx_SStC_u)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_SStC_u) - UB(1:2) = ubound(SrcParamData%Jac_Idx_SStC_u) - if (.not. allocated(DstParamData%Jac_Idx_SStC_u)) then - allocate(DstParamData%Jac_Idx_SStC_u(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_SStC_u.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_SStC_u = SrcParamData%Jac_Idx_SStC_u - end if - if (allocated(SrcParamData%Jac_Idx_BStC_x)) then - LB(1:3) = lbound(SrcParamData%Jac_Idx_BStC_x) - UB(1:3) = ubound(SrcParamData%Jac_Idx_BStC_x) - if (.not. allocated(DstParamData%Jac_Idx_BStC_x)) then - allocate(DstParamData%Jac_Idx_BStC_x(LB(1):UB(1),LB(2):UB(2),LB(3):UB(3)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_BStC_x.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_BStC_x = SrcParamData%Jac_Idx_BStC_x - end if - if (allocated(SrcParamData%Jac_Idx_NStC_x)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_NStC_x) - UB(1:2) = ubound(SrcParamData%Jac_Idx_NStC_x) - if (.not. allocated(DstParamData%Jac_Idx_NStC_x)) then - allocate(DstParamData%Jac_Idx_NStC_x(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_NStC_x.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_NStC_x = SrcParamData%Jac_Idx_NStC_x - end if - if (allocated(SrcParamData%Jac_Idx_TStC_x)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_TStC_x) - UB(1:2) = ubound(SrcParamData%Jac_Idx_TStC_x) - if (.not. allocated(DstParamData%Jac_Idx_TStC_x)) then - allocate(DstParamData%Jac_Idx_TStC_x(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_TStC_x.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_TStC_x = SrcParamData%Jac_Idx_TStC_x - end if - if (allocated(SrcParamData%Jac_Idx_SStC_x)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_SStC_x) - UB(1:2) = ubound(SrcParamData%Jac_Idx_SStC_x) - if (.not. allocated(DstParamData%Jac_Idx_SStC_x)) then - allocate(DstParamData%Jac_Idx_SStC_x(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_SStC_x.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_SStC_x = SrcParamData%Jac_Idx_SStC_x - end if - if (allocated(SrcParamData%Jac_Idx_BStC_y)) then - LB(1:3) = lbound(SrcParamData%Jac_Idx_BStC_y) - UB(1:3) = ubound(SrcParamData%Jac_Idx_BStC_y) - if (.not. allocated(DstParamData%Jac_Idx_BStC_y)) then - allocate(DstParamData%Jac_Idx_BStC_y(LB(1):UB(1),LB(2):UB(2),LB(3):UB(3)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_BStC_y.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_BStC_y = SrcParamData%Jac_Idx_BStC_y - end if - if (allocated(SrcParamData%Jac_Idx_NStC_y)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_NStC_y) - UB(1:2) = ubound(SrcParamData%Jac_Idx_NStC_y) - if (.not. allocated(DstParamData%Jac_Idx_NStC_y)) then - allocate(DstParamData%Jac_Idx_NStC_y(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_NStC_y.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_NStC_y = SrcParamData%Jac_Idx_NStC_y - end if - if (allocated(SrcParamData%Jac_Idx_TStC_y)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_TStC_y) - UB(1:2) = ubound(SrcParamData%Jac_Idx_TStC_y) - if (.not. allocated(DstParamData%Jac_Idx_TStC_y)) then - allocate(DstParamData%Jac_Idx_TStC_y(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_TStC_y.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_TStC_y = SrcParamData%Jac_Idx_TStC_y - end if - if (allocated(SrcParamData%Jac_Idx_SStC_y)) then - LB(1:2) = lbound(SrcParamData%Jac_Idx_SStC_y) - UB(1:2) = ubound(SrcParamData%Jac_Idx_SStC_y) - if (.not. allocated(DstParamData%Jac_Idx_SStC_y)) then - allocate(DstParamData%Jac_Idx_SStC_y(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%Jac_Idx_SStC_y.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstParamData%Jac_Idx_SStC_y = SrcParamData%Jac_Idx_SStC_y - end if DstParamData%SensorType = SrcParamData%SensorType DstParamData%NumBeam = SrcParamData%NumBeam DstParamData%NumPulseGate = SrcParamData%NumPulseGate @@ -4274,8 +4060,8 @@ subroutine SrvD_DestroyParam(ParamData, ErrStat, ErrMsg) type(SrvD_ParameterType), intent(inout) :: ParamData integer(IntKi), intent( out) :: ErrStat character(*), intent( out) :: ErrMsg - integer(B4Ki) :: i1, i2, i3 - integer(B4Ki) :: LB(3), UB(3) + integer(B4Ki) :: i1 + integer(B4Ki) :: LB(1), UB(1) integer(IntKi) :: ErrStat2 character(ErrMsgLen) :: ErrMsg2 character(*), parameter :: RoutineName = 'SrvD_DestroyParam' @@ -4355,62 +4141,14 @@ subroutine SrvD_DestroyParam(ParamData, ErrStat, ErrMsg) if (allocated(ParamData%StCMeasNumPerChan)) then deallocate(ParamData%StCMeasNumPerChan) end if - if (allocated(ParamData%Jac_u_indx)) then - deallocate(ParamData%Jac_u_indx) - end if - if (allocated(ParamData%Jac_x_indx)) then - deallocate(ParamData%Jac_x_indx) - end if - if (allocated(ParamData%du)) then - deallocate(ParamData%du) - end if - if (allocated(ParamData%dx)) then - deallocate(ParamData%dx) - end if - if (allocated(ParamData%Jac_Idx_BStC_u)) then - deallocate(ParamData%Jac_Idx_BStC_u) - end if - if (allocated(ParamData%Jac_Idx_NStC_u)) then - deallocate(ParamData%Jac_Idx_NStC_u) - end if - if (allocated(ParamData%Jac_Idx_TStC_u)) then - deallocate(ParamData%Jac_Idx_TStC_u) - end if - if (allocated(ParamData%Jac_Idx_SStC_u)) then - deallocate(ParamData%Jac_Idx_SStC_u) - end if - if (allocated(ParamData%Jac_Idx_BStC_x)) then - deallocate(ParamData%Jac_Idx_BStC_x) - end if - if (allocated(ParamData%Jac_Idx_NStC_x)) then - deallocate(ParamData%Jac_Idx_NStC_x) - end if - if (allocated(ParamData%Jac_Idx_TStC_x)) then - deallocate(ParamData%Jac_Idx_TStC_x) - end if - if (allocated(ParamData%Jac_Idx_SStC_x)) then - deallocate(ParamData%Jac_Idx_SStC_x) - end if - if (allocated(ParamData%Jac_Idx_BStC_y)) then - deallocate(ParamData%Jac_Idx_BStC_y) - end if - if (allocated(ParamData%Jac_Idx_NStC_y)) then - deallocate(ParamData%Jac_Idx_NStC_y) - end if - if (allocated(ParamData%Jac_Idx_TStC_y)) then - deallocate(ParamData%Jac_Idx_TStC_y) - end if - if (allocated(ParamData%Jac_Idx_SStC_y)) then - deallocate(ParamData%Jac_Idx_SStC_y) - end if end subroutine subroutine SrvD_PackParam(RF, Indata) type(RegFile), intent(inout) :: RF type(SrvD_ParameterType), intent(in) :: InData character(*), parameter :: RoutineName = 'SrvD_PackParam' - integer(B4Ki) :: i1, i2, i3 - integer(B4Ki) :: LB(3), UB(3) + integer(B4Ki) :: i1 + integer(B4Ki) :: LB(1), UB(1) if (RF%ErrStat >= AbortErrLev) return call RegPack(RF, InData%DT) call RegPack(RF, InData%HSSBrDT) @@ -4554,25 +4292,6 @@ subroutine SrvD_PackParam(RF, Indata) call RegPack(RF, InData%NumCableControl) call RegPack(RF, InData%NumStC_Control) call RegPackAlloc(RF, InData%StCMeasNumPerChan) - call RegPackAlloc(RF, InData%Jac_u_indx) - call RegPackAlloc(RF, InData%Jac_x_indx) - call RegPackAlloc(RF, InData%du) - call RegPackAlloc(RF, InData%dx) - call RegPack(RF, InData%Jac_nu) - call RegPack(RF, InData%Jac_ny) - call RegPack(RF, InData%Jac_nx) - call RegPackAlloc(RF, InData%Jac_Idx_BStC_u) - call RegPackAlloc(RF, InData%Jac_Idx_NStC_u) - call RegPackAlloc(RF, InData%Jac_Idx_TStC_u) - call RegPackAlloc(RF, InData%Jac_Idx_SStC_u) - call RegPackAlloc(RF, InData%Jac_Idx_BStC_x) - call RegPackAlloc(RF, InData%Jac_Idx_NStC_x) - call RegPackAlloc(RF, InData%Jac_Idx_TStC_x) - call RegPackAlloc(RF, InData%Jac_Idx_SStC_x) - call RegPackAlloc(RF, InData%Jac_Idx_BStC_y) - call RegPackAlloc(RF, InData%Jac_Idx_NStC_y) - call RegPackAlloc(RF, InData%Jac_Idx_TStC_y) - call RegPackAlloc(RF, InData%Jac_Idx_SStC_y) call RegPack(RF, InData%SensorType) call RegPack(RF, InData%NumBeam) call RegPack(RF, InData%NumPulseGate) @@ -4583,8 +4302,8 @@ subroutine SrvD_UnPackParam(RF, OutData) type(RegFile), intent(inout) :: RF type(SrvD_ParameterType), intent(inout) :: OutData character(*), parameter :: RoutineName = 'SrvD_UnPackParam' - integer(B4Ki) :: i1, i2, i3 - integer(B4Ki) :: LB(3), UB(3) + integer(B4Ki) :: i1 + integer(B4Ki) :: LB(1), UB(1) integer(IntKi) :: stat logical :: IsAllocAssoc if (RF%ErrStat /= ErrID_None) return @@ -4750,25 +4469,6 @@ subroutine SrvD_UnPackParam(RF, OutData) call RegUnpack(RF, OutData%NumCableControl); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%NumStC_Control); if (RegCheckErr(RF, RoutineName)) return call RegUnpackAlloc(RF, OutData%StCMeasNumPerChan); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_u_indx); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_x_indx); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%du); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%dx); if (RegCheckErr(RF, RoutineName)) return - call RegUnpack(RF, OutData%Jac_nu); if (RegCheckErr(RF, RoutineName)) return - call RegUnpack(RF, OutData%Jac_ny); if (RegCheckErr(RF, RoutineName)) return - call RegUnpack(RF, OutData%Jac_nx); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_BStC_u); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_NStC_u); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_TStC_u); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_SStC_u); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_BStC_x); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_NStC_x); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_TStC_x); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_SStC_x); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_BStC_y); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_NStC_y); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_TStC_y); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%Jac_Idx_SStC_y); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%SensorType); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%NumBeam); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%NumPulseGate); if (RegCheckErr(RF, RoutineName)) return