From 03e8dd6d8effd17779c50bcc7ed4add1ef78993d Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 4 Nov 2021 11:50:04 -0600 Subject: [PATCH] [bugfix] SrvD: fix inconsistency in initial pos/orient for StC The reference position, reference orientation, translational displacement, and orientation at init are now passed to SrvD for all the StC instances. It is possible to do this with less info since some orientations could be assumed at init, but for throroughness we pass all of it to ServoDyn to use in initializing the StC instances. This in some ways future-proofs for when arbitrary initial orientations are added to the code (if ever) --- modules/elastodyn/src/ElastoDyn.f90 | 8 +- modules/elastodyn/src/ElastoDyn_Registry.txt | 4 +- modules/elastodyn/src/ElastoDyn_Types.f90 | 50 +- modules/openfast-library/src/FAST_Subs.f90 | 32 +- modules/servodyn/src/BladedInterface_EX.f90 | 5 +- modules/servodyn/src/ServoDyn.f90 | 49 +- modules/servodyn/src/ServoDyn_Driver.f90 | 51 +- modules/servodyn/src/ServoDyn_Registry.txt | 22 +- modules/servodyn/src/ServoDyn_Types.f90 | 484 ++++++++++++++----- modules/servodyn/src/StrucCtrl.f90 | 25 +- modules/servodyn/src/StrucCtrl_Registry.txt | 6 +- modules/servodyn/src/StrucCtrl_Types.f90 | 282 ++++++++--- 12 files changed, 754 insertions(+), 264 deletions(-) diff --git a/modules/elastodyn/src/ElastoDyn.f90 b/modules/elastodyn/src/ElastoDyn.f90 index e680d11c0c..753ae6ca21 100644 --- a/modules/elastodyn/src/ElastoDyn.f90 +++ b/modules/elastodyn/src/ElastoDyn.f90 @@ -250,9 +250,11 @@ SUBROUTINE ED_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut InitOut%PlatformPos(2) = InitOut%PlatformPos(2) - TransMat(3,2)*p%PtfmRefzt InitOut%PlatformPos(3) = InitOut%PlatformPos(3) - TransMat(3,3)*p%PtfmRefzt + p%PtfmRefzt - InitOut%HubHt = p%HubHt - InitOut%TwrBasePos = y%TowerLn2Mesh%Position(:,p%TwrNodes + 2) - InitOut%TwrBaseOrient = y%TowerLn2Mesh%Orientation(:,:,p%TwrNodes + 2) + InitOut%HubHt = p%HubHt + InitOut%TwrBaseRefPos = y%TowerLn2Mesh%Position(:,p%TwrNodes + 2) + InitOut%TwrBaseTransDisp = y%TowerLn2Mesh%TranslationDisp(:,p%TwrNodes + 2) + InitOut%TwrBaseRefOrient = y%TowerLn2Mesh%RefOrientation(:,:,p%TwrNodes + 2) + InitOut%TwrBaseOrient = y%TowerLn2Mesh%Orientation(:,:,p%TwrNodes + 2) InitOut%HubRad = p%HubRad InitOut%RotSpeed = p%RotSpeed InitOut%isFixed_GenDOF = .not. InputFileData%GenDOF diff --git a/modules/elastodyn/src/ElastoDyn_Registry.txt b/modules/elastodyn/src/ElastoDyn_Registry.txt index 69076faeca..f747ea5cc2 100644 --- a/modules/elastodyn/src/ElastoDyn_Registry.txt +++ b/modules/elastodyn/src/ElastoDyn_Registry.txt @@ -38,7 +38,9 @@ typedef ^ InitOutputType ReKi HubHt - - - "Height of the hub" meters typedef ^ InitOutputType ReKi BldRNodes {:} - - "Radius to analysis nodes relative to hub ( 0 < RNodes(:) < BldFlexL )" typedef ^ InitOutputType ReKi TwrHNodes {:} - - "Location of variable-spaced tower nodes (relative to the tower rigid base height" typedef ^ InitOutputType ReKi PlatformPos {6} - - "Initial platform position (6 DOFs)" -typedef ^ InitOutputType ReKi TwrBasePos {3} - - "initial position of the tower base (for SrvD)" m +typedef ^ InitOutputType ReKi TwrBaseRefPos {3} - - "initial position of the tower base (for SrvD)" m +typedef ^ InitOutputType R8Ki TwrBaseTransDisp {3} - - "initial displacement of the tower base (for SrvD)" m +typedef ^ InitOutputType R8Ki TwrBaseRefOrient {3}{3} - - "reference orientation of the tower base (for SrvD)" typedef ^ InitOutputType R8Ki TwrBaseOrient {3}{3} - - "initial orientation of the tower base (for SrvD)" typedef ^ InitOutputType ReKi HubRad - - - "Preconed hub radius (distance from the rotor apex to the blade root)" m typedef ^ InitOutputType ReKi RotSpeed - - - "Initial or fixed rotor speed" rad/s diff --git a/modules/elastodyn/src/ElastoDyn_Types.f90 b/modules/elastodyn/src/ElastoDyn_Types.f90 index 7909c4793e..6fd3d21ea6 100644 --- a/modules/elastodyn/src/ElastoDyn_Types.f90 +++ b/modules/elastodyn/src/ElastoDyn_Types.f90 @@ -58,7 +58,9 @@ MODULE ElastoDyn_Types REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BldRNodes !< Radius to analysis nodes relative to hub ( 0 < RNodes(:) < BldFlexL ) [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwrHNodes !< Location of variable-spaced tower nodes (relative to the tower rigid base height [-] REAL(ReKi) , DIMENSION(1:6) :: PlatformPos !< Initial platform position (6 DOFs) [-] - REAL(ReKi) , DIMENSION(1:3) :: TwrBasePos !< initial position of the tower base (for SrvD) [m] + REAL(ReKi) , DIMENSION(1:3) :: TwrBaseRefPos !< initial position of the tower base (for SrvD) [m] + REAL(R8Ki) , DIMENSION(1:3) :: TwrBaseTransDisp !< initial displacement of the tower base (for SrvD) [m] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: TwrBaseRefOrient !< reference orientation of the tower base (for SrvD) [-] REAL(R8Ki) , DIMENSION(1:3,1:3) :: TwrBaseOrient !< initial orientation of the tower base (for SrvD) [-] REAL(ReKi) :: HubRad !< Preconed hub radius (distance from the rotor apex to the blade root) [m] REAL(ReKi) :: RotSpeed !< Initial or fixed rotor speed [rad/s] @@ -1136,7 +1138,9 @@ SUBROUTINE ED_CopyInitOutput( SrcInitOutputData, DstInitOutputData, CtrlCode, Er DstInitOutputData%TwrHNodes = SrcInitOutputData%TwrHNodes ENDIF DstInitOutputData%PlatformPos = SrcInitOutputData%PlatformPos - DstInitOutputData%TwrBasePos = SrcInitOutputData%TwrBasePos + DstInitOutputData%TwrBaseRefPos = SrcInitOutputData%TwrBaseRefPos + DstInitOutputData%TwrBaseTransDisp = SrcInitOutputData%TwrBaseTransDisp + DstInitOutputData%TwrBaseRefOrient = SrcInitOutputData%TwrBaseRefOrient DstInitOutputData%TwrBaseOrient = SrcInitOutputData%TwrBaseOrient DstInitOutputData%HubRad = SrcInitOutputData%HubRad DstInitOutputData%RotSpeed = SrcInitOutputData%RotSpeed @@ -1374,7 +1378,9 @@ SUBROUTINE ED_PackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs Re_BufSz = Re_BufSz + SIZE(InData%TwrHNodes) ! TwrHNodes END IF Re_BufSz = Re_BufSz + SIZE(InData%PlatformPos) ! PlatformPos - Re_BufSz = Re_BufSz + SIZE(InData%TwrBasePos) ! TwrBasePos + Re_BufSz = Re_BufSz + SIZE(InData%TwrBaseRefPos) ! TwrBaseRefPos + Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseTransDisp) ! TwrBaseTransDisp + Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseRefOrient) ! TwrBaseRefOrient Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseOrient) ! TwrBaseOrient Re_BufSz = Re_BufSz + 1 ! HubRad Re_BufSz = Re_BufSz + 1 ! RotSpeed @@ -1567,10 +1573,20 @@ SUBROUTINE ED_PackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs ReKiBuf(Re_Xferred) = InData%PlatformPos(i1) Re_Xferred = Re_Xferred + 1 END DO - DO i1 = LBOUND(InData%TwrBasePos,1), UBOUND(InData%TwrBasePos,1) - ReKiBuf(Re_Xferred) = InData%TwrBasePos(i1) + DO i1 = LBOUND(InData%TwrBaseRefPos,1), UBOUND(InData%TwrBaseRefPos,1) + ReKiBuf(Re_Xferred) = InData%TwrBaseRefPos(i1) Re_Xferred = Re_Xferred + 1 END DO + DO i1 = LBOUND(InData%TwrBaseTransDisp,1), UBOUND(InData%TwrBaseTransDisp,1) + DbKiBuf(Db_Xferred) = InData%TwrBaseTransDisp(i1) + Db_Xferred = Db_Xferred + 1 + END DO + DO i2 = LBOUND(InData%TwrBaseRefOrient,2), UBOUND(InData%TwrBaseRefOrient,2) + DO i1 = LBOUND(InData%TwrBaseRefOrient,1), UBOUND(InData%TwrBaseRefOrient,1) + DbKiBuf(Db_Xferred) = InData%TwrBaseRefOrient(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO DO i2 = LBOUND(InData%TwrBaseOrient,2), UBOUND(InData%TwrBaseOrient,2) DO i1 = LBOUND(InData%TwrBaseOrient,1), UBOUND(InData%TwrBaseOrient,1) DbKiBuf(Db_Xferred) = InData%TwrBaseOrient(i1,i2) @@ -1889,12 +1905,28 @@ SUBROUTINE ED_UnPackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Er OutData%PlatformPos(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - i1_l = LBOUND(OutData%TwrBasePos,1) - i1_u = UBOUND(OutData%TwrBasePos,1) - DO i1 = LBOUND(OutData%TwrBasePos,1), UBOUND(OutData%TwrBasePos,1) - OutData%TwrBasePos(i1) = ReKiBuf(Re_Xferred) + i1_l = LBOUND(OutData%TwrBaseRefPos,1) + i1_u = UBOUND(OutData%TwrBaseRefPos,1) + DO i1 = LBOUND(OutData%TwrBaseRefPos,1), UBOUND(OutData%TwrBaseRefPos,1) + OutData%TwrBaseRefPos(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO + i1_l = LBOUND(OutData%TwrBaseTransDisp,1) + i1_u = UBOUND(OutData%TwrBaseTransDisp,1) + DO i1 = LBOUND(OutData%TwrBaseTransDisp,1), UBOUND(OutData%TwrBaseTransDisp,1) + OutData%TwrBaseTransDisp(i1) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + i1_l = LBOUND(OutData%TwrBaseRefOrient,1) + i1_u = UBOUND(OutData%TwrBaseRefOrient,1) + i2_l = LBOUND(OutData%TwrBaseRefOrient,2) + i2_u = UBOUND(OutData%TwrBaseRefOrient,2) + DO i2 = LBOUND(OutData%TwrBaseRefOrient,2), UBOUND(OutData%TwrBaseRefOrient,2) + DO i1 = LBOUND(OutData%TwrBaseRefOrient,1), UBOUND(OutData%TwrBaseRefOrient,1) + OutData%TwrBaseRefOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO i1_l = LBOUND(OutData%TwrBaseOrient,1) i1_u = UBOUND(OutData%TwrBaseOrient,1) i2_l = LBOUND(OutData%TwrBaseOrient,2) diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 2b1deedf7e..9ee9ceb0a0 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -1148,12 +1148,18 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, Init%InData_SrvD%RootName = TRIM(p_FAST%OutFileRoot)//'.'//TRIM(y_FAST%Module_Abrev(Module_SrvD)) Init%InData_SrvD%NumBl = Init%OutData_ED%NumBl Init%InData_SrvD%Gravity = (/ 0.0_ReKi, 0.0_ReKi, -p_FAST%Gravity /) ! "Gravitational acceleration vector" m/s^2 - Init%InData_SrvD%NacPosition(1:3) = ED%Input(1)%NacelleLoads%Position(1:3,1) - Init%InData_SrvD%NacOrientation(1:3,1:3) = ED%Input(1)%NacelleLoads%RefOrientation(1:3,1:3,1) ! R8Ki - Init%InData_SrvD%TwrBasePos = Init%OutData_ED%TwrBasePos - Init%InData_SrvD%TwrBaseOrient = Init%OutData_ED%TwrBaseOrient ! R8Ki - Init%InData_SrvD%PlatformPos(1:3) = ED%y%PlatformPtMesh%Position(1:3,1) - Init%InData_SrvD%PlatformOrient(1:3,1:3) = ED%y%PlatformPtMesh%Orientation(1:3,1:3,1) ! R8Ki + Init%InData_SrvD%NacRefPos(1:3) = ED%y%NacelleMotion%Position(1:3,1) + Init%InData_SrvD%NacTransDisp(1:3) = ED%y%NacelleMotion%TranslationDisp(1:3,1) ! R8Ki + Init%InData_SrvD%NacRefOrient(1:3,1:3) = ED%y%NacelleMotion%RefOrientation(1:3,1:3,1) ! R8Ki + Init%InData_SrvD%NacOrient(1:3,1:3) = ED%y%NacelleMotion%Orientation(1:3,1:3,1) ! R8Ki + Init%InData_SrvD%TwrBaseRefPos = Init%OutData_ED%TwrBaseRefPos + Init%InData_SrvD%TwrBaseTransDisp = Init%OutData_ED%TwrBaseTransDisp + Init%InData_SrvD%TwrBaseRefOrient = Init%OutData_ED%TwrBaseRefOrient ! R8Ki + Init%InData_SrvD%TwrBaseOrient = Init%OutData_ED%TwrBaseOrient ! R8Ki + Init%InData_SrvD%PtfmRefPos(1:3) = ED%y%PlatformPtMesh%Position(1:3,1) + Init%InData_SrvD%PtfmTransDisp(1:3) = ED%y%PlatformPtMesh%TranslationDisp(1:3,1) + Init%InData_SrvD%PtfmRefOrient(1:3,1:3)= ED%y%PlatformPtMesh%RefOrientation(1:3,1:3,1) ! R8Ki + Init%InData_SrvD%PtfmOrient(1:3,1:3) = ED%y%PlatformPtMesh%Orientation(1:3,1:3,1) ! R8Ki Init%InData_SrvD%TMax = p_FAST%TMax Init%InData_SrvD%AirDens = AirDens Init%InData_SrvD%AvgWindSpeed = Init%OutData_IfW%WindFileInfo%MWS @@ -1163,17 +1169,23 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, Init%InData_SrvD%RotSpeedRef = Init%OutData_ED%RotSpeed Init%InData_SrvD%InterpOrder = p_FAST%InterpOrder - CALL AllocAry( Init%InData_SrvD%BladeRootPosition, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootPosition', errStat2, ErrMsg2) + CALL AllocAry( Init%InData_SrvD%BladeRootRefPos, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootRefPos', errStat2, ErrMsg2) CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) - CALL AllocAry( Init%InData_SrvD%BladeRootOrientation,3, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootOrientation', errStat2, ErrMsg2) + CALL AllocAry( Init%InData_SrvD%BladeRootTransDisp, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootTransDisp', errStat2, ErrMsg2) + CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) + CALL AllocAry( Init%InData_SrvD%BladeRootRefOrient, 3, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootRefOrient', errStat2, ErrMsg2) + CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) + CALL AllocAry( Init%InData_SrvD%BladeRootOrient, 3, 3, Init%OutData_ED%NumBl, 'Init%InData_SrvD%BladeRootOrient', errStat2, ErrMsg2) CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) IF (ErrStat >= AbortErrLev) THEN CALL Cleanup() RETURN END IF do k=1,Init%OutData_ED%NumBl - Init%InData_SrvD%BladeRootPosition(:,k) = ED%y%BladeRootMotion(k)%Position(:,1) - Init%InData_SrvD%BladeRootOrientation(:,:,k) = ED%y%BladeRootMotion(k)%RefOrientation(:,:,1) + Init%InData_SrvD%BladeRootRefPos(:,k) = ED%y%BladeRootMotion(k)%Position(:,1) + Init%InData_SrvD%BladeRootTransDisp(:,k) = ED%y%BladeRootMotion(k)%TranslationDisp(:,1) + Init%InData_SrvD%BladeRootRefOrient(:,:,k)= ED%y%BladeRootMotion(k)%RefOrientation(:,:,1) + Init%InData_SrvD%BladeRootOrient(:,:,k) = ED%y%BladeRootMotion(k)%Orientation(:,:,1) enddo diff --git a/modules/servodyn/src/BladedInterface_EX.f90 b/modules/servodyn/src/BladedInterface_EX.f90 index dee0ed724b..19514b28b6 100644 --- a/modules/servodyn/src/BladedInterface_EX.f90 +++ b/modules/servodyn/src/BladedInterface_EX.f90 @@ -172,13 +172,16 @@ subroutine InitPtfmMotionSensors() ! Channels 1001:1018 TranslationAcc =.TRUE., RotationAcc=.TRUE.) if (Failed()) return; ! Create the node on the mesh - CALL MeshPositionNode ( u%PtfmMotionMesh,1, InitInp%PlatformPos(1:3), ErrStat2, ErrMsg2, InitInp%PlatformOrient ) + CALL MeshPositionNode ( u%PtfmMotionMesh,1, InitInp%PtfmRefPos(1:3), ErrStat2, ErrMsg2, InitInp%PtfmRefOrient ) if (Failed()) return; ! Create the mesh element CALL MeshConstructElement ( u%PtfmMotionMesh, ELEMENT_POINT, ErrStat2, ErrMsg2, 1 ) if (Failed()) return; CALL MeshCommit ( u%PtfmMotionMesh, ErrStat2, ErrMsg2 ) if (Failed()) return; + ! Set any initial offsets + u%PtfmMotionMesh%TranslationDisp(1:3,1) = InitInp%PtfmRefPos(1:3) + u%PtfmMotionMesh%Orientation(1:3,1:3,1) = InitInp%PtfmOrient(1:3,1:3) ! Writing out info on channels if (UnSum > 0) then call WrSumInfoSend(1001, 'General channel group -- Platform motion -- Displacement TDX (m)') diff --git a/modules/servodyn/src/ServoDyn.f90 b/modules/servodyn/src/ServoDyn.f90 index e6ee113b83..3253bea851 100644 --- a/modules/servodyn/src/ServoDyn.f90 +++ b/modules/servodyn/src/ServoDyn.f90 @@ -702,10 +702,15 @@ subroutine StC_Nacelle_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,Srv StC_InitInp%NumMeshPts = 1_IntKi ! single point mesh for Nacelle Interval = SrvD_p%DT ! Pass the ServoDyn DT - CALL AllocAry( StC_InitInp%InitPosition, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitPosition', errStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry( StC_InitInp%InitOrientation,3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrientation', errStat2, ErrMsg2); if (Failed()) return; - StC_InitInp%InitPosition(:,1) = SrvD_InitInp%NacPosition - StC_InitInp%InitOrientation(:,:,1) = SrvD_InitInp%NacOrientation + CALL AllocAry( StC_InitInp%InitRefPos, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefPos', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitTransDisp, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitTransDisp', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitRefOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefOrient', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrient', errStat2, ErrMsg2); if (Failed()) return; + StC_InitInp%InitRefPos(1:3,1) = SrvD_InitInp%NacRefPos(1:3) + StC_InitInp%InitTransDisp(1:3,1) = SrvD_InitInp%NacTransDisp(1:3) + StC_InitInp%InitRefOrient(1:3,1:3,1) = SrvD_InitInp%NacRefOrient(1:3,1:3) + StC_InitInp%InitOrient(1:3,1:3,1) = SrvD_InitInp%NacOrient(1:3,1:3) + CALL StC_Init( StC_InitInp, u(1,j), p(j), x(j), xd(j), z(j), OtherState(j), y(j), m(j), Interval, StC_InitOut, ErrStat2, ErrMsg2 ) if (Failed()) return; @@ -825,10 +830,14 @@ subroutine StC_Tower_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,SrvD_ StC_InitInp%NumMeshPts = 1_IntKi ! single point mesh for Tower Interval = SrvD_p%DT ! Pass the ServoDyn DT - CALL AllocAry( StC_InitInp%InitPosition, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitPosition', errStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry( StC_InitInp%InitOrientation,3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrientation', errStat2, ErrMsg2); if (Failed()) return; - StC_InitInp%InitPosition(:,1) = SrvD_InitInp%TwrBasePos - StC_InitInp%InitOrientation(:,:,1) = SrvD_InitInp%TwrBaseOrient + CALL AllocAry( StC_InitInp%InitRefPos, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefPos', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitTransDisp, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitTransDisp', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitRefOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefOrient', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrient', errStat2, ErrMsg2); if (Failed()) return; + StC_InitInp%InitRefPos(1:3,1) = SrvD_InitInp%TwrBaseRefPos(1:3) + StC_InitInp%InitTransDisp(1:3,1) = SrvD_InitInp%TwrBaseTransDisp(1:3) + StC_InitInp%InitRefOrient(1:3,1:3,1) = SrvD_InitInp%TwrBaseRefOrient(1:3,1:3) + StC_InitInp%InitOrient(1:3,1:3,1) = SrvD_InitInp%TwrBaseOrient(1:3,1:3) CALL StC_Init( StC_InitInp, u(1,j), p(j), x(j), xd(j), z(j), OtherState(j), y(j), m(j), Interval, StC_InitOut, ErrStat2, ErrMsg2 ) if (Failed()) return; @@ -947,11 +956,15 @@ subroutine StC_Blade_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,SrvD_ StC_InitInp%NumMeshPts = SrvD_p%NumBl ! p%NumBl points for blades Interval = SrvD_p%DT ! Pass the ServoDyn DT - CALL AllocAry( StC_InitInp%InitPosition, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitPosition', errStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry( StC_InitInp%InitOrientation,3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrientation', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitRefPos, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefPos', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitTransDisp, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitTransDisp', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitRefOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefOrient', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrient', errStat2, ErrMsg2); if (Failed()) return; do k=1,StC_InitInp%NumMeshPts - StC_InitInp%InitPosition(:,k) = SrvD_InitInp%BladeRootPosition(:,k) - StC_InitInp%InitOrientation(:,:,k) = SrvD_InitInp%BladeRootOrientation(:,:,k) + StC_InitInp%InitRefPos(1:3,k) = SrvD_InitInp%BladeRootRefPos(1:3,k) + StC_InitInp%InitTransDisp(1:3,k) = SrvD_InitInp%BladeRootTransDisp(1:3,k) + StC_InitInp%InitRefOrient(1:3,1:3,k) = SrvD_InitInp%BladeRootRefOrient(1:3,1:3,k) + StC_InitInp%InitOrient(1:3,1:3,k) = SrvD_InitInp%BladeRootOrient(1:3,1:3,k) enddo CALL StC_Init( StC_InitInp, u(1,j), p(j), x(j), xd(j), z(j), OtherState(j), y(j), m(j), Interval, StC_InitOut, ErrStat2, ErrMsg2 ) @@ -1076,10 +1089,14 @@ subroutine StC_Substruc_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,Sr StC_InitInp%NumMeshPts = 1_IntKi ! single point mesh for Platform Interval = SrvD_p%DT ! Pass the ServoDyn DT - CALL AllocAry( StC_InitInp%InitPosition, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitPosition', errStat2, ErrMsg2); if (Failed()) return; - CALL AllocAry( StC_InitInp%InitOrientation,3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrientation', errStat2, ErrMsg2); if (Failed()) return; - StC_InitInp%InitPosition(1:3,1) = SrvD_InitInp%PlatformPos(1:3) - StC_InitInp%InitOrientation(:,:,1) = SrvD_InitInp%PlatformOrient + CALL AllocAry( StC_InitInp%InitRefPos, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefPos', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitTransDisp, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitTransDisp', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitRefOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitRefOrient', errStat2, ErrMsg2); if (Failed()) return; + CALL AllocAry( StC_InitInp%InitOrient, 3, 3, StC_InitInp%NumMeshPts, 'StC_InitInp%InitOrient', errStat2, ErrMsg2); if (Failed()) return; + StC_InitInp%InitRefPos(1:3,1) = SrvD_InitInp%PtfmRefPos(1:3) + StC_InitInp%InitTransDisp(1:3,1) = SrvD_InitInp%PtfmTransDisp(1:3) + StC_InitInp%InitRefOrient(1:3,1:3,1) = SrvD_InitInp%PtfmRefOrient + StC_InitInp%InitOrient(1:3,1:3,1) = SrvD_InitInp%PtfmOrient CALL StC_Init( StC_InitInp, u(1,j), p(j), x(j), xd(j), z(j), OtherState(j), y(j), m(j), Interval, StC_InitOut, ErrStat2, ErrMsg2 ) if (Failed()) return; diff --git a/modules/servodyn/src/ServoDyn_Driver.f90 b/modules/servodyn/src/ServoDyn_Driver.f90 index 3d9734eaa5..6bc6d0ef47 100644 --- a/modules/servodyn/src/ServoDyn_Driver.f90 +++ b/modules/servodyn/src/ServoDyn_Driver.f90 @@ -91,32 +91,61 @@ PROGRAM SrvD_Driver InitInData%gravity = 9.81 !m/s^2 !FIXME: why are these hard coded!!!? ! StrucCtrl nacelle position - InitInData%NacPosition = (/ 90.0, 0.0, 0.0 /) ! m, position of nacelle (for NStC) - InitInData%NacOrientation= 0.0_R8Ki + InitInData%NacRefPos = (/ 90.0, 0.0, 0.0 /) ! m, reference position of nacelle (for NStC) + InitInData%NacTransDisp = (/ 0.0, 0.0, 0.0 /) ! m, initial displacement of nacelle (for NStC) + InitInData%NacRefOrient = 0.0_R8Ki + InitInData%NacOrient = 0.0_R8Ki do j=1,3 - InitInData%NacOrientation(j,j) = 1.0_R8Ki + InitInData%NacRefOrient(j,j) = 1.0_R8Ki + InitInData%NacOrient(j,j) = 1.0_R8Ki enddo ! StrucCtrl tower - InitInData%TwrBasePos = (/ 0.0, 0.0, 0.0 /) ! m, position of tower base (for TStC) - InitInData%TwrBaseOrient = 0.0_R8Ki + InitInData%TwrBaseRefPos = (/ 0.0, 0.0, 0.0 /) ! m, reference position of tower base (for TStC) + InitInData%TwrBaseTransDisp = (/ 0.0, 0.0, 0.0 /) ! m, initial displacement tower base (for TStC) + InitInData%TwrBaseRefOrient = 0.0_R8Ki + InitInData%TwrBaseOrient = 0.0_R8Ki do j=1,3 - InitInData%TwrBaseOrient(j,j) = 1.0_R8Ki + InitInData%TwrBaseRefOrient(j,j) = 1.0_R8Ki + InitInData%TwrBaseOrient(j,j) = 1.0_R8Ki enddo ! StrucCtrl single blade - call AllocAry(InitInData%BladeRootPosition, 3,1, 'InitInData%BladeRootPosition', ErrStat,ErrMsg) + call AllocAry(InitInData%BladeRootRefPos, 3,1, 'InitInData%BladeRootRefPos', ErrStat,ErrMsg) IF ( ErrStat /= ErrID_None ) THEN CALL WrScr( ErrMsg ) IF (ErrStat >= AbortErrLev) call ProgAbort('') END IF - call AllocAry(InitInData%BladeRootOrientation, 3,3,1, 'InitInData%BladeRootOrientation',ErrStat,ErrMsg) + call AllocAry(InitInData%BladeRootTransDisp, 3,1, 'InitInData%BladeRootTransDisp', ErrStat,ErrMsg) IF ( ErrStat /= ErrID_None ) THEN CALL WrScr( ErrMsg ) IF (ErrStat >= AbortErrLev) call ProgAbort('') END IF - InitInData%BladeRootPosition(1:3,1) = (/ 0.0, 0.0, 0.0 /) ! m, position of blade root (for BStC) - InitInData%BladeRootOrientation = 0.0_R8Ki + call AllocAry(InitInData%BladeRootRefOrient, 3,3,1, 'InitInData%BladeRootRefOrient', ErrStat,ErrMsg) + IF ( ErrStat /= ErrID_None ) THEN + CALL WrScr( ErrMsg ) + IF (ErrStat >= AbortErrLev) call ProgAbort('') + END IF + call AllocAry(InitInData%BladeRootOrient, 3,3,1, 'InitInData%BladeRootOrient', ErrStat,ErrMsg) + IF ( ErrStat /= ErrID_None ) THEN + CALL WrScr( ErrMsg ) + IF (ErrStat >= AbortErrLev) call ProgAbort('') + END IF +! FIXME: This isn't a very useful position to put a blade + InitInData%BladeRootRefPos(1:3,1) = (/ 0.0, 0.0, 0.0 /) ! m, reference position of blade root (for BStC) + InitInData%BladeRootTransDisp(1:3,1) = (/ 0.0, 0.0, 0.0 /) ! m, initial dispalcement of blade root (for BStC) + InitInData%BladeRootRefOrient = 0.0_R8Ki + InitInData%BladeRootOrient = 0.0_R8Ki + do j=1,3 + InitInData%BladeRootRefOrient(j,j,1) = 1.0_R8Ki + InitInData%BladeRootOrient(j,j,1) = 1.0_R8Ki + enddo + ! StrucCtrl substructure + InitInData%PtfmRefPos = (/ 0.0, 0.0, 0.0 /) ! m, reference position of Ptfm + InitInData%PtfmTransDisp = (/ 0.0, 0.0, 0.0 /) ! m, initial displacement of Ptfm + InitInData%PtfmRefOrient = 0.0_R8Ki + InitInData%PtfmOrient = 0.0_R8Ki do j=1,3 - InitInData%BladeRootOrientation(j,j,1) = 1.0_R8Ki + InitInData%PtfmRefOrient(j,j) = 1.0_R8Ki + InitInData%PtfmOrient(j,j) = 1.0_R8Ki enddo InitInData%TMax = 10.0 !s InitInData%AirDens = 1.225 !kg/m^3 diff --git a/modules/servodyn/src/ServoDyn_Registry.txt b/modules/servodyn/src/ServoDyn_Registry.txt index 32d3c839f2..7b145279fc 100644 --- a/modules/servodyn/src/ServoDyn_Registry.txt +++ b/modules/servodyn/src/ServoDyn_Registry.txt @@ -22,12 +22,18 @@ typedef ^ InitInputType IntKi NumBl - - - "Number of blades on the turbine" - typedef ^ InitInputType CHARACTER(1024) RootName - - - "RootName for writing output files" - typedef ^ InitInputType ReKi BlPitchInit {:} - - "Initial blade pitch" - typedef ^ InitInputType ReKi Gravity {3} - - "Gravitational acceleration vector" m/s^2 -typedef ^ InitInputType ReKi NacPosition {3} - - "nacelle origin for setting up mesh" m -typedef ^ InitInputType R8Ki NacOrientation {3}{3} - - "nacelle orientation for setting up mesh" - -typedef ^ InitInputType ReKi TwrBasePos {3} - - "tower base origin for setting up mesh" m +typedef ^ InitInputType ReKi NacRefPos {3} - - "nacelle origin for setting up mesh" m +typedef ^ InitInputType R8Ki NacTransDisp {3} - - "nacelle displacement from origin at init for setting up mesh" m +typedef ^ InitInputType R8Ki NacOrient {3}{3} - - "nacelle orientation for setting up mesh" - +typedef ^ InitInputType R8Ki NacRefOrient {3}{3} - - "nacelle reference orientation for setting up mesh" - +typedef ^ InitInputType ReKi TwrBaseRefPos {3} - - "tower base origin for setting up mesh" m +typedef ^ InitInputType R8Ki TwrBaseTransDisp {3} - - "tower base translation from origin at init for setting up mesh" m typedef ^ InitInputType R8Ki TwrBaseOrient {3}{3} - - "tower base orientation for setting up mesh" m -typedef ^ InitInputType ReKi PlatformPos {3} - - "platform origin for setting up mesh" m -typedef ^ InitInputType R8Ki PlatformOrient {3}{3} - - "platform orientation for setting up mesh" m +typedef ^ InitInputType R8Ki TwrBaseRefOrient {3}{3} - - "tower reference orientation for setting up mesh" m +typedef ^ InitInputType ReKi PtfmRefPos {3} - - "platform origin for setting up mesh" m +typedef ^ InitInputType R8Ki PtfmTransDisp {3} - - "platform displacement from origin for setting up mesh" m +typedef ^ InitInputType R8Ki PtfmOrient {3}{3} - - "platform orientation for setting up mesh" m +typedef ^ InitInputType R8Ki PtfmRefOrient {3}{3} - - "platform reference orientation for setting up mesh" m typedef ^ InitInputType DbKi Tmax - - - "max time from glue code" s typedef ^ InitInputType ReKi AvgWindSpeed - - - "average wind speed for the simulation" m/s typedef ^ InitInputType ReKi AirDens - - - "air density" kg/m^3 @@ -37,8 +43,10 @@ typedef ^ InitInputType IntKi NumCtrl2SC - - - "number of controller outputs [to typedef ^ InitInputType IntKi TrimCase - - - "Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [used only if CalcSteady=True]" - typedef ^ InitInputType ReKi TrimGain - - - "Proportional gain for the rotational speed error (>0) [used only if TrimCase>0]" "rad/(rad/s) for yaw or pitch; Nm/(rad/s) for torque" typedef ^ InitInputType ReKi RotSpeedRef - - - "Reference rotor speed" "rad/s" -typedef ^ InitInputType ReKi BladeRootPosition {:}{:} - - "X-Y-Z reference position of each blade root (3 x NumBlades)" m -typedef ^ InitInputType R8Ki BladeRootOrientation {:}{:}{:} - - "DCM reference orientation of blade roots (3x3 x NumBlades)" - +typedef ^ InitInputType ReKi BladeRootRefPos {:}{:} - - "X-Y-Z reference position of each blade root (3 x NumBlades)" m +typedef ^ InitInputType R8Ki BladeRootTransDisp {:}{:} - - "X-Y-Z translation from reference position at init of each blade root (3 x NumBlades)" m +typedef ^ InitInputType R8Ki BladeRootOrient {:}{:}{:} - - "DCM reference orientation of blade roots (3x3 x NumBlades)" - +typedef ^ InitInputType R8Ki BladeRootRefOrient {:}{:}{:} - - "DCM reference orientation of blade roots (3x3 x NumBlades)" - typedef ^ InitInputType LOGICAL UseInputFile - .TRUE. - "read input from input file" - typedef ^ InitInputType FileInfoType PassedPrimaryInputData - - - "Primary input file as FileInfoType (set by driver/glue code)" - #ADD in the TMD submodule input file passing here diff --git a/modules/servodyn/src/ServoDyn_Types.f90 b/modules/servodyn/src/ServoDyn_Types.f90 index 73ccd2ea3e..ba93e4640d 100644 --- a/modules/servodyn/src/ServoDyn_Types.f90 +++ b/modules/servodyn/src/ServoDyn_Types.f90 @@ -42,12 +42,18 @@ MODULE ServoDyn_Types CHARACTER(1024) :: RootName !< RootName for writing output files [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BlPitchInit !< Initial blade pitch [-] REAL(ReKi) , DIMENSION(1:3) :: Gravity !< Gravitational acceleration vector [m/s^2] - REAL(ReKi) , DIMENSION(1:3) :: NacPosition !< nacelle origin for setting up mesh [m] - REAL(R8Ki) , DIMENSION(1:3,1:3) :: NacOrientation !< nacelle orientation for setting up mesh [-] - REAL(ReKi) , DIMENSION(1:3) :: TwrBasePos !< tower base origin for setting up mesh [m] + REAL(ReKi) , DIMENSION(1:3) :: NacRefPos !< nacelle origin for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3) :: NacTransDisp !< nacelle displacement from origin at init for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: NacOrient !< nacelle orientation for setting up mesh [-] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: NacRefOrient !< nacelle reference orientation for setting up mesh [-] + REAL(ReKi) , DIMENSION(1:3) :: TwrBaseRefPos !< tower base origin for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3) :: TwrBaseTransDisp !< tower base translation from origin at init for setting up mesh [m] REAL(R8Ki) , DIMENSION(1:3,1:3) :: TwrBaseOrient !< tower base orientation for setting up mesh [m] - REAL(ReKi) , DIMENSION(1:3) :: PlatformPos !< platform origin for setting up mesh [m] - REAL(R8Ki) , DIMENSION(1:3,1:3) :: PlatformOrient !< platform orientation for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: TwrBaseRefOrient !< tower reference orientation for setting up mesh [m] + REAL(ReKi) , DIMENSION(1:3) :: PtfmRefPos !< platform origin for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3) :: PtfmTransDisp !< platform displacement from origin for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: PtfmOrient !< platform orientation for setting up mesh [m] + REAL(R8Ki) , DIMENSION(1:3,1:3) :: PtfmRefOrient !< platform reference orientation for setting up mesh [m] REAL(DbKi) :: Tmax !< max time from glue code [s] REAL(ReKi) :: AvgWindSpeed !< average wind speed for the simulation [m/s] REAL(ReKi) :: AirDens !< air density [kg/m^3] @@ -57,8 +63,10 @@ MODULE ServoDyn_Types INTEGER(IntKi) :: TrimCase !< Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [used only if CalcSteady=True] [-] REAL(ReKi) :: TrimGain !< Proportional gain for the rotational speed error (>0) [used only if TrimCase>0] [rad/(rad/s) for yaw or pitch; Nm/(rad/s) for torque] REAL(ReKi) :: RotSpeedRef !< Reference rotor speed [rad/s] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BladeRootPosition !< X-Y-Z reference position of each blade root (3 x NumBlades) [m] - REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: BladeRootOrientation !< DCM reference orientation of blade roots (3x3 x NumBlades) [-] + REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BladeRootRefPos !< X-Y-Z reference position of each blade root (3 x NumBlades) [m] + REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: BladeRootTransDisp !< X-Y-Z translation from reference position at init of each blade root (3 x NumBlades) [m] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: BladeRootOrient !< DCM reference orientation of blade roots (3x3 x NumBlades) [-] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: BladeRootRefOrient !< DCM reference orientation of blade roots (3x3 x NumBlades) [-] LOGICAL :: UseInputFile = .TRUE. !< read input from input file [-] TYPE(FileInfoType) :: PassedPrimaryInputData !< Primary input file as FileInfoType (set by driver/glue code) [-] INTEGER(IntKi) :: NumCableControl !< Number of cable control channels requested [-] @@ -548,12 +556,18 @@ SUBROUTINE SrvD_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCode, Err DstInitInputData%BlPitchInit = SrcInitInputData%BlPitchInit ENDIF DstInitInputData%Gravity = SrcInitInputData%Gravity - DstInitInputData%NacPosition = SrcInitInputData%NacPosition - DstInitInputData%NacOrientation = SrcInitInputData%NacOrientation - DstInitInputData%TwrBasePos = SrcInitInputData%TwrBasePos + DstInitInputData%NacRefPos = SrcInitInputData%NacRefPos + DstInitInputData%NacTransDisp = SrcInitInputData%NacTransDisp + DstInitInputData%NacOrient = SrcInitInputData%NacOrient + DstInitInputData%NacRefOrient = SrcInitInputData%NacRefOrient + DstInitInputData%TwrBaseRefPos = SrcInitInputData%TwrBaseRefPos + DstInitInputData%TwrBaseTransDisp = SrcInitInputData%TwrBaseTransDisp DstInitInputData%TwrBaseOrient = SrcInitInputData%TwrBaseOrient - DstInitInputData%PlatformPos = SrcInitInputData%PlatformPos - DstInitInputData%PlatformOrient = SrcInitInputData%PlatformOrient + DstInitInputData%TwrBaseRefOrient = SrcInitInputData%TwrBaseRefOrient + DstInitInputData%PtfmRefPos = SrcInitInputData%PtfmRefPos + DstInitInputData%PtfmTransDisp = SrcInitInputData%PtfmTransDisp + DstInitInputData%PtfmOrient = SrcInitInputData%PtfmOrient + DstInitInputData%PtfmRefOrient = SrcInitInputData%PtfmRefOrient DstInitInputData%Tmax = SrcInitInputData%Tmax DstInitInputData%AvgWindSpeed = SrcInitInputData%AvgWindSpeed DstInitInputData%AirDens = SrcInitInputData%AirDens @@ -563,35 +577,65 @@ SUBROUTINE SrvD_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCode, Err DstInitInputData%TrimCase = SrcInitInputData%TrimCase DstInitInputData%TrimGain = SrcInitInputData%TrimGain DstInitInputData%RotSpeedRef = SrcInitInputData%RotSpeedRef -IF (ALLOCATED(SrcInitInputData%BladeRootPosition)) THEN - i1_l = LBOUND(SrcInitInputData%BladeRootPosition,1) - i1_u = UBOUND(SrcInitInputData%BladeRootPosition,1) - i2_l = LBOUND(SrcInitInputData%BladeRootPosition,2) - i2_u = UBOUND(SrcInitInputData%BladeRootPosition,2) - IF (.NOT. ALLOCATED(DstInitInputData%BladeRootPosition)) THEN - ALLOCATE(DstInitInputData%BladeRootPosition(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) +IF (ALLOCATED(SrcInitInputData%BladeRootRefPos)) THEN + i1_l = LBOUND(SrcInitInputData%BladeRootRefPos,1) + i1_u = UBOUND(SrcInitInputData%BladeRootRefPos,1) + i2_l = LBOUND(SrcInitInputData%BladeRootRefPos,2) + i2_u = UBOUND(SrcInitInputData%BladeRootRefPos,2) + IF (.NOT. ALLOCATED(DstInitInputData%BladeRootRefPos)) THEN + ALLOCATE(DstInitInputData%BladeRootRefPos(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootPosition.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootRefPos.', ErrStat, ErrMsg,RoutineName) RETURN END IF END IF - DstInitInputData%BladeRootPosition = SrcInitInputData%BladeRootPosition + DstInitInputData%BladeRootRefPos = SrcInitInputData%BladeRootRefPos ENDIF -IF (ALLOCATED(SrcInitInputData%BladeRootOrientation)) THEN - i1_l = LBOUND(SrcInitInputData%BladeRootOrientation,1) - i1_u = UBOUND(SrcInitInputData%BladeRootOrientation,1) - i2_l = LBOUND(SrcInitInputData%BladeRootOrientation,2) - i2_u = UBOUND(SrcInitInputData%BladeRootOrientation,2) - i3_l = LBOUND(SrcInitInputData%BladeRootOrientation,3) - i3_u = UBOUND(SrcInitInputData%BladeRootOrientation,3) - IF (.NOT. ALLOCATED(DstInitInputData%BladeRootOrientation)) THEN - ALLOCATE(DstInitInputData%BladeRootOrientation(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) +IF (ALLOCATED(SrcInitInputData%BladeRootTransDisp)) THEN + i1_l = LBOUND(SrcInitInputData%BladeRootTransDisp,1) + i1_u = UBOUND(SrcInitInputData%BladeRootTransDisp,1) + i2_l = LBOUND(SrcInitInputData%BladeRootTransDisp,2) + i2_u = UBOUND(SrcInitInputData%BladeRootTransDisp,2) + IF (.NOT. ALLOCATED(DstInitInputData%BladeRootTransDisp)) THEN + ALLOCATE(DstInitInputData%BladeRootTransDisp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootOrientation.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootTransDisp.', ErrStat, ErrMsg,RoutineName) RETURN END IF END IF - DstInitInputData%BladeRootOrientation = SrcInitInputData%BladeRootOrientation + DstInitInputData%BladeRootTransDisp = SrcInitInputData%BladeRootTransDisp +ENDIF +IF (ALLOCATED(SrcInitInputData%BladeRootOrient)) THEN + i1_l = LBOUND(SrcInitInputData%BladeRootOrient,1) + i1_u = UBOUND(SrcInitInputData%BladeRootOrient,1) + i2_l = LBOUND(SrcInitInputData%BladeRootOrient,2) + i2_u = UBOUND(SrcInitInputData%BladeRootOrient,2) + i3_l = LBOUND(SrcInitInputData%BladeRootOrient,3) + i3_u = UBOUND(SrcInitInputData%BladeRootOrient,3) + IF (.NOT. ALLOCATED(DstInitInputData%BladeRootOrient)) THEN + ALLOCATE(DstInitInputData%BladeRootOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstInitInputData%BladeRootOrient = SrcInitInputData%BladeRootOrient +ENDIF +IF (ALLOCATED(SrcInitInputData%BladeRootRefOrient)) THEN + i1_l = LBOUND(SrcInitInputData%BladeRootRefOrient,1) + i1_u = UBOUND(SrcInitInputData%BladeRootRefOrient,1) + i2_l = LBOUND(SrcInitInputData%BladeRootRefOrient,2) + i2_u = UBOUND(SrcInitInputData%BladeRootRefOrient,2) + i3_l = LBOUND(SrcInitInputData%BladeRootRefOrient,3) + i3_u = UBOUND(SrcInitInputData%BladeRootRefOrient,3) + IF (.NOT. ALLOCATED(DstInitInputData%BladeRootRefOrient)) THEN + ALLOCATE(DstInitInputData%BladeRootRefOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%BladeRootRefOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstInitInputData%BladeRootRefOrient = SrcInitInputData%BladeRootRefOrient ENDIF DstInitInputData%UseInputFile = SrcInitInputData%UseInputFile CALL NWTC_Library_Copyfileinfotype( SrcInitInputData%PassedPrimaryInputData, DstInitInputData%PassedPrimaryInputData, CtrlCode, ErrStat2, ErrMsg2 ) @@ -649,11 +693,17 @@ SUBROUTINE SrvD_DestroyInitInput( InitInputData, ErrStat, ErrMsg ) IF (ALLOCATED(InitInputData%BlPitchInit)) THEN DEALLOCATE(InitInputData%BlPitchInit) ENDIF -IF (ALLOCATED(InitInputData%BladeRootPosition)) THEN - DEALLOCATE(InitInputData%BladeRootPosition) +IF (ALLOCATED(InitInputData%BladeRootRefPos)) THEN + DEALLOCATE(InitInputData%BladeRootRefPos) ENDIF -IF (ALLOCATED(InitInputData%BladeRootOrientation)) THEN - DEALLOCATE(InitInputData%BladeRootOrientation) +IF (ALLOCATED(InitInputData%BladeRootTransDisp)) THEN + DEALLOCATE(InitInputData%BladeRootTransDisp) +ENDIF +IF (ALLOCATED(InitInputData%BladeRootOrient)) THEN + DEALLOCATE(InitInputData%BladeRootOrient) +ENDIF +IF (ALLOCATED(InitInputData%BladeRootRefOrient)) THEN + DEALLOCATE(InitInputData%BladeRootRefOrient) ENDIF CALL NWTC_Library_Destroyfileinfotype( InitInputData%PassedPrimaryInputData, ErrStat, ErrMsg ) IF (ALLOCATED(InitInputData%CableControlRequestor)) THEN @@ -712,12 +762,18 @@ SUBROUTINE SrvD_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM Re_BufSz = Re_BufSz + SIZE(InData%BlPitchInit) ! BlPitchInit END IF Re_BufSz = Re_BufSz + SIZE(InData%Gravity) ! Gravity - Re_BufSz = Re_BufSz + SIZE(InData%NacPosition) ! NacPosition - Db_BufSz = Db_BufSz + SIZE(InData%NacOrientation) ! NacOrientation - Re_BufSz = Re_BufSz + SIZE(InData%TwrBasePos) ! TwrBasePos + Re_BufSz = Re_BufSz + SIZE(InData%NacRefPos) ! NacRefPos + Db_BufSz = Db_BufSz + SIZE(InData%NacTransDisp) ! NacTransDisp + Db_BufSz = Db_BufSz + SIZE(InData%NacOrient) ! NacOrient + Db_BufSz = Db_BufSz + SIZE(InData%NacRefOrient) ! NacRefOrient + Re_BufSz = Re_BufSz + SIZE(InData%TwrBaseRefPos) ! TwrBaseRefPos + Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseTransDisp) ! TwrBaseTransDisp Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseOrient) ! TwrBaseOrient - Re_BufSz = Re_BufSz + SIZE(InData%PlatformPos) ! PlatformPos - Db_BufSz = Db_BufSz + SIZE(InData%PlatformOrient) ! PlatformOrient + Db_BufSz = Db_BufSz + SIZE(InData%TwrBaseRefOrient) ! TwrBaseRefOrient + Re_BufSz = Re_BufSz + SIZE(InData%PtfmRefPos) ! PtfmRefPos + Db_BufSz = Db_BufSz + SIZE(InData%PtfmTransDisp) ! PtfmTransDisp + Db_BufSz = Db_BufSz + SIZE(InData%PtfmOrient) ! PtfmOrient + Db_BufSz = Db_BufSz + SIZE(InData%PtfmRefOrient) ! PtfmRefOrient Db_BufSz = Db_BufSz + 1 ! Tmax Re_BufSz = Re_BufSz + 1 ! AvgWindSpeed Re_BufSz = Re_BufSz + 1 ! AirDens @@ -727,15 +783,25 @@ SUBROUTINE SrvD_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM Int_BufSz = Int_BufSz + 1 ! TrimCase Re_BufSz = Re_BufSz + 1 ! TrimGain Re_BufSz = Re_BufSz + 1 ! RotSpeedRef - Int_BufSz = Int_BufSz + 1 ! BladeRootPosition allocated yes/no - IF ( ALLOCATED(InData%BladeRootPosition) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! BladeRootPosition upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%BladeRootPosition) ! BladeRootPosition - END IF - Int_BufSz = Int_BufSz + 1 ! BladeRootOrientation allocated yes/no - IF ( ALLOCATED(InData%BladeRootOrientation) ) THEN - Int_BufSz = Int_BufSz + 2*3 ! BladeRootOrientation upper/lower bounds for each dimension - Db_BufSz = Db_BufSz + SIZE(InData%BladeRootOrientation) ! BladeRootOrientation + Int_BufSz = Int_BufSz + 1 ! BladeRootRefPos allocated yes/no + IF ( ALLOCATED(InData%BladeRootRefPos) ) THEN + Int_BufSz = Int_BufSz + 2*2 ! BladeRootRefPos upper/lower bounds for each dimension + Re_BufSz = Re_BufSz + SIZE(InData%BladeRootRefPos) ! BladeRootRefPos + END IF + Int_BufSz = Int_BufSz + 1 ! BladeRootTransDisp allocated yes/no + IF ( ALLOCATED(InData%BladeRootTransDisp) ) THEN + Int_BufSz = Int_BufSz + 2*2 ! BladeRootTransDisp upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%BladeRootTransDisp) ! BladeRootTransDisp + END IF + Int_BufSz = Int_BufSz + 1 ! BladeRootOrient allocated yes/no + IF ( ALLOCATED(InData%BladeRootOrient) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! BladeRootOrient upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%BladeRootOrient) ! BladeRootOrient + END IF + Int_BufSz = Int_BufSz + 1 ! BladeRootRefOrient allocated yes/no + IF ( ALLOCATED(InData%BladeRootRefOrient) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! BladeRootRefOrient upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%BladeRootRefOrient) ! BladeRootRefOrient END IF Int_BufSz = Int_BufSz + 1 ! UseInputFile ! Allocate buffers for subtypes, if any (we'll get sizes from these) @@ -831,33 +897,63 @@ SUBROUTINE SrvD_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM ReKiBuf(Re_Xferred) = InData%Gravity(i1) Re_Xferred = Re_Xferred + 1 END DO - DO i1 = LBOUND(InData%NacPosition,1), UBOUND(InData%NacPosition,1) - ReKiBuf(Re_Xferred) = InData%NacPosition(i1) + DO i1 = LBOUND(InData%NacRefPos,1), UBOUND(InData%NacRefPos,1) + ReKiBuf(Re_Xferred) = InData%NacRefPos(i1) Re_Xferred = Re_Xferred + 1 END DO - DO i2 = LBOUND(InData%NacOrientation,2), UBOUND(InData%NacOrientation,2) - DO i1 = LBOUND(InData%NacOrientation,1), UBOUND(InData%NacOrientation,1) - DbKiBuf(Db_Xferred) = InData%NacOrientation(i1,i2) + DO i1 = LBOUND(InData%NacTransDisp,1), UBOUND(InData%NacTransDisp,1) + DbKiBuf(Db_Xferred) = InData%NacTransDisp(i1) + Db_Xferred = Db_Xferred + 1 + END DO + DO i2 = LBOUND(InData%NacOrient,2), UBOUND(InData%NacOrient,2) + DO i1 = LBOUND(InData%NacOrient,1), UBOUND(InData%NacOrient,1) + DbKiBuf(Db_Xferred) = InData%NacOrient(i1,i2) Db_Xferred = Db_Xferred + 1 END DO END DO - DO i1 = LBOUND(InData%TwrBasePos,1), UBOUND(InData%TwrBasePos,1) - ReKiBuf(Re_Xferred) = InData%TwrBasePos(i1) + DO i2 = LBOUND(InData%NacRefOrient,2), UBOUND(InData%NacRefOrient,2) + DO i1 = LBOUND(InData%NacRefOrient,1), UBOUND(InData%NacRefOrient,1) + DbKiBuf(Db_Xferred) = InData%NacRefOrient(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + DO i1 = LBOUND(InData%TwrBaseRefPos,1), UBOUND(InData%TwrBaseRefPos,1) + ReKiBuf(Re_Xferred) = InData%TwrBaseRefPos(i1) Re_Xferred = Re_Xferred + 1 END DO + DO i1 = LBOUND(InData%TwrBaseTransDisp,1), UBOUND(InData%TwrBaseTransDisp,1) + DbKiBuf(Db_Xferred) = InData%TwrBaseTransDisp(i1) + Db_Xferred = Db_Xferred + 1 + END DO DO i2 = LBOUND(InData%TwrBaseOrient,2), UBOUND(InData%TwrBaseOrient,2) DO i1 = LBOUND(InData%TwrBaseOrient,1), UBOUND(InData%TwrBaseOrient,1) DbKiBuf(Db_Xferred) = InData%TwrBaseOrient(i1,i2) Db_Xferred = Db_Xferred + 1 END DO END DO - DO i1 = LBOUND(InData%PlatformPos,1), UBOUND(InData%PlatformPos,1) - ReKiBuf(Re_Xferred) = InData%PlatformPos(i1) + DO i2 = LBOUND(InData%TwrBaseRefOrient,2), UBOUND(InData%TwrBaseRefOrient,2) + DO i1 = LBOUND(InData%TwrBaseRefOrient,1), UBOUND(InData%TwrBaseRefOrient,1) + DbKiBuf(Db_Xferred) = InData%TwrBaseRefOrient(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + DO i1 = LBOUND(InData%PtfmRefPos,1), UBOUND(InData%PtfmRefPos,1) + ReKiBuf(Re_Xferred) = InData%PtfmRefPos(i1) Re_Xferred = Re_Xferred + 1 END DO - DO i2 = LBOUND(InData%PlatformOrient,2), UBOUND(InData%PlatformOrient,2) - DO i1 = LBOUND(InData%PlatformOrient,1), UBOUND(InData%PlatformOrient,1) - DbKiBuf(Db_Xferred) = InData%PlatformOrient(i1,i2) + DO i1 = LBOUND(InData%PtfmTransDisp,1), UBOUND(InData%PtfmTransDisp,1) + DbKiBuf(Db_Xferred) = InData%PtfmTransDisp(i1) + Db_Xferred = Db_Xferred + 1 + END DO + DO i2 = LBOUND(InData%PtfmOrient,2), UBOUND(InData%PtfmOrient,2) + DO i1 = LBOUND(InData%PtfmOrient,1), UBOUND(InData%PtfmOrient,1) + DbKiBuf(Db_Xferred) = InData%PtfmOrient(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + DO i2 = LBOUND(InData%PtfmRefOrient,2), UBOUND(InData%PtfmRefOrient,2) + DO i1 = LBOUND(InData%PtfmRefOrient,1), UBOUND(InData%PtfmRefOrient,1) + DbKiBuf(Db_Xferred) = InData%PtfmRefOrient(i1,i2) Db_Xferred = Db_Xferred + 1 END DO END DO @@ -879,46 +975,91 @@ SUBROUTINE SrvD_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM Re_Xferred = Re_Xferred + 1 ReKiBuf(Re_Xferred) = InData%RotSpeedRef Re_Xferred = Re_Xferred + 1 - IF ( .NOT. ALLOCATED(InData%BladeRootPosition) ) THEN + IF ( .NOT. ALLOCATED(InData%BladeRootRefPos) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 ELSE IntKiBuf( Int_Xferred ) = 1 Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootPosition,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootPosition,1) + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootRefPos,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootRefPos,1) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootPosition,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootPosition,2) + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootRefPos,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootRefPos,2) Int_Xferred = Int_Xferred + 2 - DO i2 = LBOUND(InData%BladeRootPosition,2), UBOUND(InData%BladeRootPosition,2) - DO i1 = LBOUND(InData%BladeRootPosition,1), UBOUND(InData%BladeRootPosition,1) - ReKiBuf(Re_Xferred) = InData%BladeRootPosition(i1,i2) + DO i2 = LBOUND(InData%BladeRootRefPos,2), UBOUND(InData%BladeRootRefPos,2) + DO i1 = LBOUND(InData%BladeRootRefPos,1), UBOUND(InData%BladeRootRefPos,1) + ReKiBuf(Re_Xferred) = InData%BladeRootRefPos(i1,i2) Re_Xferred = Re_Xferred + 1 END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%BladeRootOrientation) ) THEN + IF ( .NOT. ALLOCATED(InData%BladeRootTransDisp) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootTransDisp,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootTransDisp,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootTransDisp,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootTransDisp,2) + Int_Xferred = Int_Xferred + 2 + + DO i2 = LBOUND(InData%BladeRootTransDisp,2), UBOUND(InData%BladeRootTransDisp,2) + DO i1 = LBOUND(InData%BladeRootTransDisp,1), UBOUND(InData%BladeRootTransDisp,1) + DbKiBuf(Db_Xferred) = InData%BladeRootTransDisp(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END IF + IF ( .NOT. ALLOCATED(InData%BladeRootOrient) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 ELSE IntKiBuf( Int_Xferred ) = 1 Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrientation,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrientation,1) + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrient,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrient,1) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrientation,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrientation,2) + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrient,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrient,2) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrientation,3) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrientation,3) + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootOrient,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootOrient,3) Int_Xferred = Int_Xferred + 2 - DO i3 = LBOUND(InData%BladeRootOrientation,3), UBOUND(InData%BladeRootOrientation,3) - DO i2 = LBOUND(InData%BladeRootOrientation,2), UBOUND(InData%BladeRootOrientation,2) - DO i1 = LBOUND(InData%BladeRootOrientation,1), UBOUND(InData%BladeRootOrientation,1) - DbKiBuf(Db_Xferred) = InData%BladeRootOrientation(i1,i2,i3) + DO i3 = LBOUND(InData%BladeRootOrient,3), UBOUND(InData%BladeRootOrient,3) + DO i2 = LBOUND(InData%BladeRootOrient,2), UBOUND(InData%BladeRootOrient,2) + DO i1 = LBOUND(InData%BladeRootOrient,1), UBOUND(InData%BladeRootOrient,1) + DbKiBuf(Db_Xferred) = InData%BladeRootOrient(i1,i2,i3) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF + IF ( .NOT. ALLOCATED(InData%BladeRootRefOrient) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootRefOrient,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootRefOrient,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootRefOrient,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootRefOrient,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%BladeRootRefOrient,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BladeRootRefOrient,3) + Int_Xferred = Int_Xferred + 2 + + DO i3 = LBOUND(InData%BladeRootRefOrient,3), UBOUND(InData%BladeRootRefOrient,3) + DO i2 = LBOUND(InData%BladeRootRefOrient,2), UBOUND(InData%BladeRootRefOrient,2) + DO i1 = LBOUND(InData%BladeRootRefOrient,1), UBOUND(InData%BladeRootRefOrient,1) + DbKiBuf(Db_Xferred) = InData%BladeRootRefOrient(i1,i2,i3) Db_Xferred = Db_Xferred + 1 END DO END DO @@ -1072,28 +1213,50 @@ SUBROUTINE SrvD_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E OutData%Gravity(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - i1_l = LBOUND(OutData%NacPosition,1) - i1_u = UBOUND(OutData%NacPosition,1) - DO i1 = LBOUND(OutData%NacPosition,1), UBOUND(OutData%NacPosition,1) - OutData%NacPosition(i1) = ReKiBuf(Re_Xferred) + i1_l = LBOUND(OutData%NacRefPos,1) + i1_u = UBOUND(OutData%NacRefPos,1) + DO i1 = LBOUND(OutData%NacRefPos,1), UBOUND(OutData%NacRefPos,1) + OutData%NacRefPos(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - i1_l = LBOUND(OutData%NacOrientation,1) - i1_u = UBOUND(OutData%NacOrientation,1) - i2_l = LBOUND(OutData%NacOrientation,2) - i2_u = UBOUND(OutData%NacOrientation,2) - DO i2 = LBOUND(OutData%NacOrientation,2), UBOUND(OutData%NacOrientation,2) - DO i1 = LBOUND(OutData%NacOrientation,1), UBOUND(OutData%NacOrientation,1) - OutData%NacOrientation(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + i1_l = LBOUND(OutData%NacTransDisp,1) + i1_u = UBOUND(OutData%NacTransDisp,1) + DO i1 = LBOUND(OutData%NacTransDisp,1), UBOUND(OutData%NacTransDisp,1) + OutData%NacTransDisp(i1) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + i1_l = LBOUND(OutData%NacOrient,1) + i1_u = UBOUND(OutData%NacOrient,1) + i2_l = LBOUND(OutData%NacOrient,2) + i2_u = UBOUND(OutData%NacOrient,2) + DO i2 = LBOUND(OutData%NacOrient,2), UBOUND(OutData%NacOrient,2) + DO i1 = LBOUND(OutData%NacOrient,1), UBOUND(OutData%NacOrient,1) + OutData%NacOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) Db_Xferred = Db_Xferred + 1 END DO END DO - i1_l = LBOUND(OutData%TwrBasePos,1) - i1_u = UBOUND(OutData%TwrBasePos,1) - DO i1 = LBOUND(OutData%TwrBasePos,1), UBOUND(OutData%TwrBasePos,1) - OutData%TwrBasePos(i1) = ReKiBuf(Re_Xferred) + i1_l = LBOUND(OutData%NacRefOrient,1) + i1_u = UBOUND(OutData%NacRefOrient,1) + i2_l = LBOUND(OutData%NacRefOrient,2) + i2_u = UBOUND(OutData%NacRefOrient,2) + DO i2 = LBOUND(OutData%NacRefOrient,2), UBOUND(OutData%NacRefOrient,2) + DO i1 = LBOUND(OutData%NacRefOrient,1), UBOUND(OutData%NacRefOrient,1) + OutData%NacRefOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + i1_l = LBOUND(OutData%TwrBaseRefPos,1) + i1_u = UBOUND(OutData%TwrBaseRefPos,1) + DO i1 = LBOUND(OutData%TwrBaseRefPos,1), UBOUND(OutData%TwrBaseRefPos,1) + OutData%TwrBaseRefPos(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO + i1_l = LBOUND(OutData%TwrBaseTransDisp,1) + i1_u = UBOUND(OutData%TwrBaseTransDisp,1) + DO i1 = LBOUND(OutData%TwrBaseTransDisp,1), UBOUND(OutData%TwrBaseTransDisp,1) + OutData%TwrBaseTransDisp(i1) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO i1_l = LBOUND(OutData%TwrBaseOrient,1) i1_u = UBOUND(OutData%TwrBaseOrient,1) i2_l = LBOUND(OutData%TwrBaseOrient,2) @@ -1104,19 +1267,45 @@ SUBROUTINE SrvD_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E Db_Xferred = Db_Xferred + 1 END DO END DO - i1_l = LBOUND(OutData%PlatformPos,1) - i1_u = UBOUND(OutData%PlatformPos,1) - DO i1 = LBOUND(OutData%PlatformPos,1), UBOUND(OutData%PlatformPos,1) - OutData%PlatformPos(i1) = ReKiBuf(Re_Xferred) + i1_l = LBOUND(OutData%TwrBaseRefOrient,1) + i1_u = UBOUND(OutData%TwrBaseRefOrient,1) + i2_l = LBOUND(OutData%TwrBaseRefOrient,2) + i2_u = UBOUND(OutData%TwrBaseRefOrient,2) + DO i2 = LBOUND(OutData%TwrBaseRefOrient,2), UBOUND(OutData%TwrBaseRefOrient,2) + DO i1 = LBOUND(OutData%TwrBaseRefOrient,1), UBOUND(OutData%TwrBaseRefOrient,1) + OutData%TwrBaseRefOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + i1_l = LBOUND(OutData%PtfmRefPos,1) + i1_u = UBOUND(OutData%PtfmRefPos,1) + DO i1 = LBOUND(OutData%PtfmRefPos,1), UBOUND(OutData%PtfmRefPos,1) + OutData%PtfmRefPos(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - i1_l = LBOUND(OutData%PlatformOrient,1) - i1_u = UBOUND(OutData%PlatformOrient,1) - i2_l = LBOUND(OutData%PlatformOrient,2) - i2_u = UBOUND(OutData%PlatformOrient,2) - DO i2 = LBOUND(OutData%PlatformOrient,2), UBOUND(OutData%PlatformOrient,2) - DO i1 = LBOUND(OutData%PlatformOrient,1), UBOUND(OutData%PlatformOrient,1) - OutData%PlatformOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + i1_l = LBOUND(OutData%PtfmTransDisp,1) + i1_u = UBOUND(OutData%PtfmTransDisp,1) + DO i1 = LBOUND(OutData%PtfmTransDisp,1), UBOUND(OutData%PtfmTransDisp,1) + OutData%PtfmTransDisp(i1) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + i1_l = LBOUND(OutData%PtfmOrient,1) + i1_u = UBOUND(OutData%PtfmOrient,1) + i2_l = LBOUND(OutData%PtfmOrient,2) + i2_u = UBOUND(OutData%PtfmOrient,2) + DO i2 = LBOUND(OutData%PtfmOrient,2), UBOUND(OutData%PtfmOrient,2) + DO i1 = LBOUND(OutData%PtfmOrient,1), UBOUND(OutData%PtfmOrient,1) + OutData%PtfmOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + i1_l = LBOUND(OutData%PtfmRefOrient,1) + i1_u = UBOUND(OutData%PtfmRefOrient,1) + i2_l = LBOUND(OutData%PtfmRefOrient,2) + i2_u = UBOUND(OutData%PtfmRefOrient,2) + DO i2 = LBOUND(OutData%PtfmRefOrient,2), UBOUND(OutData%PtfmRefOrient,2) + DO i1 = LBOUND(OutData%PtfmRefOrient,1), UBOUND(OutData%PtfmRefOrient,1) + OutData%PtfmRefOrient(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) Db_Xferred = Db_Xferred + 1 END DO END DO @@ -1138,7 +1327,7 @@ SUBROUTINE SrvD_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E Re_Xferred = Re_Xferred + 1 OutData%RotSpeedRef = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootPosition not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootRefPos not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 @@ -1148,20 +1337,71 @@ SUBROUTINE SrvD_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E i2_l = IntKiBuf( Int_Xferred ) i2_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%BladeRootPosition)) DEALLOCATE(OutData%BladeRootPosition) - ALLOCATE(OutData%BladeRootPosition(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%BladeRootRefPos)) DEALLOCATE(OutData%BladeRootRefPos) + ALLOCATE(OutData%BladeRootRefPos(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootPosition.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootRefPos.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i2 = LBOUND(OutData%BladeRootPosition,2), UBOUND(OutData%BladeRootPosition,2) - DO i1 = LBOUND(OutData%BladeRootPosition,1), UBOUND(OutData%BladeRootPosition,1) - OutData%BladeRootPosition(i1,i2) = ReKiBuf(Re_Xferred) + DO i2 = LBOUND(OutData%BladeRootRefPos,2), UBOUND(OutData%BladeRootRefPos,2) + DO i1 = LBOUND(OutData%BladeRootRefPos,1), UBOUND(OutData%BladeRootRefPos,1) + OutData%BladeRootRefPos(i1,i2) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootOrientation not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootTransDisp not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%BladeRootTransDisp)) DEALLOCATE(OutData%BladeRootTransDisp) + ALLOCATE(OutData%BladeRootTransDisp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootTransDisp.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i2 = LBOUND(OutData%BladeRootTransDisp,2), UBOUND(OutData%BladeRootTransDisp,2) + DO i1 = LBOUND(OutData%BladeRootTransDisp,1), UBOUND(OutData%BladeRootTransDisp,1) + OutData%BladeRootTransDisp(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootOrient not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i3_l = IntKiBuf( Int_Xferred ) + i3_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%BladeRootOrient)) DEALLOCATE(OutData%BladeRootOrient) + ALLOCATE(OutData%BladeRootOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i3 = LBOUND(OutData%BladeRootOrient,3), UBOUND(OutData%BladeRootOrient,3) + DO i2 = LBOUND(OutData%BladeRootOrient,2), UBOUND(OutData%BladeRootOrient,2) + DO i1 = LBOUND(OutData%BladeRootOrient,1), UBOUND(OutData%BladeRootOrient,1) + OutData%BladeRootOrient(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BladeRootRefOrient not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 @@ -1174,16 +1414,16 @@ SUBROUTINE SrvD_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E i3_l = IntKiBuf( Int_Xferred ) i3_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%BladeRootOrientation)) DEALLOCATE(OutData%BladeRootOrientation) - ALLOCATE(OutData%BladeRootOrientation(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%BladeRootRefOrient)) DEALLOCATE(OutData%BladeRootRefOrient) + ALLOCATE(OutData%BladeRootRefOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootOrientation.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BladeRootRefOrient.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i3 = LBOUND(OutData%BladeRootOrientation,3), UBOUND(OutData%BladeRootOrientation,3) - DO i2 = LBOUND(OutData%BladeRootOrientation,2), UBOUND(OutData%BladeRootOrientation,2) - DO i1 = LBOUND(OutData%BladeRootOrientation,1), UBOUND(OutData%BladeRootOrientation,1) - OutData%BladeRootOrientation(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) + DO i3 = LBOUND(OutData%BladeRootRefOrient,3), UBOUND(OutData%BladeRootRefOrient,3) + DO i2 = LBOUND(OutData%BladeRootRefOrient,2), UBOUND(OutData%BladeRootRefOrient,2) + DO i1 = LBOUND(OutData%BladeRootRefOrient,1), UBOUND(OutData%BladeRootRefOrient,1) + OutData%BladeRootRefOrient(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) Db_Xferred = Db_Xferred + 1 END DO END DO diff --git a/modules/servodyn/src/StrucCtrl.f90 b/modules/servodyn/src/StrucCtrl.f90 index 8b47a5ad06..b205e09c3c 100644 --- a/modules/servodyn/src/StrucCtrl.f90 +++ b/modules/servodyn/src/StrucCtrl.f90 @@ -98,8 +98,7 @@ SUBROUTINE StC_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOu TYPE(StC_InputFile) :: InputFileData ! Data stored in the module's input file INTEGER(IntKi) :: i_pt ! Generic counter for mesh point INTEGER(IntKi) :: i ! Generic counter for mesh point - REAL(ReKi), allocatable, dimension(:,:) :: PositionGlobal - REAL(R8Ki), allocatable, dimension(:,:,:) :: OrientationP + REAL(ReKi), allocatable, dimension(:,:) :: RefPosGlobal type(FileInfoType) :: FileInfo_In !< The derived type for holding the full input file for parsing -- we may pass this in the future type(FileInfoType) :: FileInfo_In_PrescribeFrc !< The derived type for holding the prescribed forces input file for parsing -- we may pass this in the future @@ -204,15 +203,13 @@ SUBROUTINE StC_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOu ! set positions and orientations for tuned mass dampers's - call AllocAry(InitOut%RelPosition, 3, p%NumMeshPts, 'RelPosition', ErrStat2,ErrMsg2); if (Failed()) return; - call AllocAry(PositionGlobal, 3, p%NumMeshPts, 'PositionGlobal', ErrStat2,ErrMsg2); if (Failed()) return; - call AllocAry(OrientationP, 3, 3, p%NumMeshPts, 'OrientationP', ErrStat2,ErrMsg2); if (Failed()) return; + call AllocAry(InitOut%RelPosition, 3, p%NumMeshPts, 'RelPosition', ErrStat2,ErrMsg2); if (Failed()) return; + call AllocAry(RefPosGlobal, 3, p%NumMeshPts, 'RefPosGlobal', ErrStat2,ErrMsg2); if (Failed()) return; - ! Set the initial positions and orietantions for each point + ! Set the initial positions and orientations for each point (Ref coords) do i_pt = 1,p%NumMeshPts InitOut%RelPosition(:,i_pt) = (/ InputFileData%StC_P_X, InputFileData%StC_P_Y, InputFileData%StC_P_Z /) - OrientationP(:,:,i_pt) = InitInp%InitOrientation(:,:,i_pt) - PositionGlobal(:,i_pt) = InitInp%InitPosition(:,i_pt) + real( matmul(InitOut%RelPosition(:,i_pt),OrientationP(:,:,i_pt)), ReKi) + RefPosGlobal(:,i_pt) = InitInp%InitRefPos(:,i_pt) + real( matmul(InitOut%RelPosition(:,i_pt),InitInp%InitRefOrient(:,:,i_pt)), ReKi) enddo ! Define system output initializations (set up mesh) here: @@ -249,8 +246,7 @@ SUBROUTINE StC_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOu ! Create the node on the mesh - ! make position node at point P (rest position of tuned mass dampers, somewhere above the yaw bearing) - CALL MeshPositionNode ( u%Mesh(i_pt),1, PositionGlobal(:,i_pt), ErrStat2, ErrMsg2, OrientationP(:,:,i_pt) ) + CALL MeshPositionNode ( u%Mesh(i_pt),1, RefPosGlobal(:,i_pt), ErrStat2, ErrMsg2, InitInp%InitRefOrient(:,:,i_pt) ) CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) ! Create the mesh element @@ -278,6 +274,10 @@ SUBROUTINE StC_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOu u%Mesh(i_pt)%RemapFlag = .TRUE. y%Mesh(i_pt)%RemapFlag = .TRUE. + + ! Set initial displacements + u%Mesh(i_pt)%Orientation(1:3,1:3,1) = InitInp%InitOrient(:,:,i_pt) + u%Mesh(i_pt)%TranslationDisp(1:3,1) = InitInp%InitTransDisp(:,i_pt) enddo @@ -409,9 +409,8 @@ logical function Failed() end function Failed !......................................... SUBROUTINE cleanup() - if (UnEcho > 0) close(UnEcho) ! Close echo file - if (allocated(PositionGlobal)) deallocate(PositionGlobal) - if (allocated(OrientationP )) deallocate(OrientationP ) + if (UnEcho > 0) close(UnEcho) ! Close echo file + if (allocated(RefPosGlobal )) deallocate(RefPosGlobal ) CALL StC_DestroyInputFile( InputFileData, ErrStat2, ErrMsg2) ! Ignore warnings here. END SUBROUTINE cleanup !......................................... diff --git a/modules/servodyn/src/StrucCtrl_Registry.txt b/modules/servodyn/src/StrucCtrl_Registry.txt index c4bbf4c2d2..f0fd1c2b3c 100644 --- a/modules/servodyn/src/StrucCtrl_Registry.txt +++ b/modules/servodyn/src/StrucCtrl_Registry.txt @@ -82,8 +82,10 @@ typedef StrucCtrl/StC InitInputType CHARACTER(1024) InputFile - - typedef ^ InitInputType CHARACTER(1024) RootName - - - "RootName for writing output files" - typedef ^ ^ ReKi Gravity {3} - - "Gravitational acceleration vector" "m/s^2" typedef ^ InitInputType IntKi NumMeshPts - - - "Number of mesh points" - -typedef ^ InitInputType ReKi InitPosition {:}{:} - - "X-Y-Z reference position of point: i.e. each blade root (3 x NumBlades)" m -typedef ^ InitInputType R8Ki InitOrientation {:}{:}{:} - - "DCM reference orientation of point: i.e. each blade root (3x3 x NumBlades)" - +typedef ^ InitInputType ReKi InitRefPos {:}{:} - - "X-Y-Z reference position of point: i.e. each blade root (3 x NumBlades)" m +typedef ^ InitInputType R8Ki InitTransDisp {:}{:} - - "X-Y-Z displacement from position of point at init: i.e. each blade root (3 x NumBlades)" m +typedef ^ InitInputType R8Ki InitOrient {:}{:}{:} - - "DCM orientation of point at init: i.e. each blade root (3x3 x NumBlades)" - +typedef ^ InitInputType R8Ki InitRefOrient {:}{:}{:} - - "DCM reference orientation of point: i.e. each blade root (3x3 x NumBlades)" - typedef ^ InitInputType LOGICAL UseInputFile - .TRUE. - "Read from the input file. If false, must parse the string info passed" - typedef ^ InitInputType FileInfoType PassedPrimaryInputData - - - "Primary input file as FileInfoType (set by driver/glue code)" - typedef ^ InitInputType LOGICAL UseInputFile_PrescribeFrc - .TRUE. - "Read from the input file. If false, must parse the string info passed" - diff --git a/modules/servodyn/src/StrucCtrl_Types.f90 b/modules/servodyn/src/StrucCtrl_Types.f90 index f8cfdf67d9..b42083f03e 100644 --- a/modules/servodyn/src/StrucCtrl_Types.f90 +++ b/modules/servodyn/src/StrucCtrl_Types.f90 @@ -108,8 +108,10 @@ MODULE StrucCtrl_Types CHARACTER(1024) :: RootName !< RootName for writing output files [-] REAL(ReKi) , DIMENSION(1:3) :: Gravity !< Gravitational acceleration vector [m/s^2] INTEGER(IntKi) :: NumMeshPts !< Number of mesh points [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InitPosition !< X-Y-Z reference position of point: i.e. each blade root (3 x NumBlades) [m] - REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: InitOrientation !< DCM reference orientation of point: i.e. each blade root (3x3 x NumBlades) [-] + REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InitRefPos !< X-Y-Z reference position of point: i.e. each blade root (3 x NumBlades) [m] + REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: InitTransDisp !< X-Y-Z displacement from position of point at init: i.e. each blade root (3 x NumBlades) [m] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: InitOrient !< DCM orientation of point at init: i.e. each blade root (3x3 x NumBlades) [-] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: InitRefOrient !< DCM reference orientation of point: i.e. each blade root (3x3 x NumBlades) [-] LOGICAL :: UseInputFile = .TRUE. !< Read from the input file. If false, must parse the string info passed [-] TYPE(FileInfoType) :: PassedPrimaryInputData !< Primary input file as FileInfoType (set by driver/glue code) [-] LOGICAL :: UseInputFile_PrescribeFrc = .TRUE. !< Read from the input file. If false, must parse the string info passed [-] @@ -958,35 +960,65 @@ SUBROUTINE StC_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCode, ErrS DstInitInputData%RootName = SrcInitInputData%RootName DstInitInputData%Gravity = SrcInitInputData%Gravity DstInitInputData%NumMeshPts = SrcInitInputData%NumMeshPts -IF (ALLOCATED(SrcInitInputData%InitPosition)) THEN - i1_l = LBOUND(SrcInitInputData%InitPosition,1) - i1_u = UBOUND(SrcInitInputData%InitPosition,1) - i2_l = LBOUND(SrcInitInputData%InitPosition,2) - i2_u = UBOUND(SrcInitInputData%InitPosition,2) - IF (.NOT. ALLOCATED(DstInitInputData%InitPosition)) THEN - ALLOCATE(DstInitInputData%InitPosition(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) +IF (ALLOCATED(SrcInitInputData%InitRefPos)) THEN + i1_l = LBOUND(SrcInitInputData%InitRefPos,1) + i1_u = UBOUND(SrcInitInputData%InitRefPos,1) + i2_l = LBOUND(SrcInitInputData%InitRefPos,2) + i2_u = UBOUND(SrcInitInputData%InitRefPos,2) + IF (.NOT. ALLOCATED(DstInitInputData%InitRefPos)) THEN + ALLOCATE(DstInitInputData%InitRefPos(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitPosition.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitRefPos.', ErrStat, ErrMsg,RoutineName) RETURN END IF END IF - DstInitInputData%InitPosition = SrcInitInputData%InitPosition + DstInitInputData%InitRefPos = SrcInitInputData%InitRefPos ENDIF -IF (ALLOCATED(SrcInitInputData%InitOrientation)) THEN - i1_l = LBOUND(SrcInitInputData%InitOrientation,1) - i1_u = UBOUND(SrcInitInputData%InitOrientation,1) - i2_l = LBOUND(SrcInitInputData%InitOrientation,2) - i2_u = UBOUND(SrcInitInputData%InitOrientation,2) - i3_l = LBOUND(SrcInitInputData%InitOrientation,3) - i3_u = UBOUND(SrcInitInputData%InitOrientation,3) - IF (.NOT. ALLOCATED(DstInitInputData%InitOrientation)) THEN - ALLOCATE(DstInitInputData%InitOrientation(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) +IF (ALLOCATED(SrcInitInputData%InitTransDisp)) THEN + i1_l = LBOUND(SrcInitInputData%InitTransDisp,1) + i1_u = UBOUND(SrcInitInputData%InitTransDisp,1) + i2_l = LBOUND(SrcInitInputData%InitTransDisp,2) + i2_u = UBOUND(SrcInitInputData%InitTransDisp,2) + IF (.NOT. ALLOCATED(DstInitInputData%InitTransDisp)) THEN + ALLOCATE(DstInitInputData%InitTransDisp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitOrientation.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitTransDisp.', ErrStat, ErrMsg,RoutineName) RETURN END IF END IF - DstInitInputData%InitOrientation = SrcInitInputData%InitOrientation + DstInitInputData%InitTransDisp = SrcInitInputData%InitTransDisp +ENDIF +IF (ALLOCATED(SrcInitInputData%InitOrient)) THEN + i1_l = LBOUND(SrcInitInputData%InitOrient,1) + i1_u = UBOUND(SrcInitInputData%InitOrient,1) + i2_l = LBOUND(SrcInitInputData%InitOrient,2) + i2_u = UBOUND(SrcInitInputData%InitOrient,2) + i3_l = LBOUND(SrcInitInputData%InitOrient,3) + i3_u = UBOUND(SrcInitInputData%InitOrient,3) + IF (.NOT. ALLOCATED(DstInitInputData%InitOrient)) THEN + ALLOCATE(DstInitInputData%InitOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstInitInputData%InitOrient = SrcInitInputData%InitOrient +ENDIF +IF (ALLOCATED(SrcInitInputData%InitRefOrient)) THEN + i1_l = LBOUND(SrcInitInputData%InitRefOrient,1) + i1_u = UBOUND(SrcInitInputData%InitRefOrient,1) + i2_l = LBOUND(SrcInitInputData%InitRefOrient,2) + i2_u = UBOUND(SrcInitInputData%InitRefOrient,2) + i3_l = LBOUND(SrcInitInputData%InitRefOrient,3) + i3_u = UBOUND(SrcInitInputData%InitRefOrient,3) + IF (.NOT. ALLOCATED(DstInitInputData%InitRefOrient)) THEN + ALLOCATE(DstInitInputData%InitRefOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInitInputData%InitRefOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstInitInputData%InitRefOrient = SrcInitInputData%InitRefOrient ENDIF DstInitInputData%UseInputFile = SrcInitInputData%UseInputFile CALL NWTC_Library_Copyfileinfotype( SrcInitInputData%PassedPrimaryInputData, DstInitInputData%PassedPrimaryInputData, CtrlCode, ErrStat2, ErrMsg2 ) @@ -1007,11 +1039,17 @@ SUBROUTINE StC_DestroyInitInput( InitInputData, ErrStat, ErrMsg ) ! ErrStat = ErrID_None ErrMsg = "" -IF (ALLOCATED(InitInputData%InitPosition)) THEN - DEALLOCATE(InitInputData%InitPosition) +IF (ALLOCATED(InitInputData%InitRefPos)) THEN + DEALLOCATE(InitInputData%InitRefPos) ENDIF -IF (ALLOCATED(InitInputData%InitOrientation)) THEN - DEALLOCATE(InitInputData%InitOrientation) +IF (ALLOCATED(InitInputData%InitTransDisp)) THEN + DEALLOCATE(InitInputData%InitTransDisp) +ENDIF +IF (ALLOCATED(InitInputData%InitOrient)) THEN + DEALLOCATE(InitInputData%InitOrient) +ENDIF +IF (ALLOCATED(InitInputData%InitRefOrient)) THEN + DEALLOCATE(InitInputData%InitRefOrient) ENDIF CALL NWTC_Library_Destroyfileinfotype( InitInputData%PassedPrimaryInputData, ErrStat, ErrMsg ) CALL NWTC_Library_Destroyfileinfotype( InitInputData%PassedPrescribeFrcData, ErrStat, ErrMsg ) @@ -1056,15 +1094,25 @@ SUBROUTINE StC_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs Int_BufSz = Int_BufSz + 1*LEN(InData%RootName) ! RootName Re_BufSz = Re_BufSz + SIZE(InData%Gravity) ! Gravity Int_BufSz = Int_BufSz + 1 ! NumMeshPts - Int_BufSz = Int_BufSz + 1 ! InitPosition allocated yes/no - IF ( ALLOCATED(InData%InitPosition) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! InitPosition upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%InitPosition) ! InitPosition - END IF - Int_BufSz = Int_BufSz + 1 ! InitOrientation allocated yes/no - IF ( ALLOCATED(InData%InitOrientation) ) THEN - Int_BufSz = Int_BufSz + 2*3 ! InitOrientation upper/lower bounds for each dimension - Db_BufSz = Db_BufSz + SIZE(InData%InitOrientation) ! InitOrientation + Int_BufSz = Int_BufSz + 1 ! InitRefPos allocated yes/no + IF ( ALLOCATED(InData%InitRefPos) ) THEN + Int_BufSz = Int_BufSz + 2*2 ! InitRefPos upper/lower bounds for each dimension + Re_BufSz = Re_BufSz + SIZE(InData%InitRefPos) ! InitRefPos + END IF + Int_BufSz = Int_BufSz + 1 ! InitTransDisp allocated yes/no + IF ( ALLOCATED(InData%InitTransDisp) ) THEN + Int_BufSz = Int_BufSz + 2*2 ! InitTransDisp upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%InitTransDisp) ! InitTransDisp + END IF + Int_BufSz = Int_BufSz + 1 ! InitOrient allocated yes/no + IF ( ALLOCATED(InData%InitOrient) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! InitOrient upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%InitOrient) ! InitOrient + END IF + Int_BufSz = Int_BufSz + 1 ! InitRefOrient allocated yes/no + IF ( ALLOCATED(InData%InitRefOrient) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! InitRefOrient upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%InitRefOrient) ! InitRefOrient END IF Int_BufSz = Int_BufSz + 1 ! UseInputFile ! Allocate buffers for subtypes, if any (we'll get sizes from these) @@ -1144,46 +1192,91 @@ SUBROUTINE StC_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMs END DO IntKiBuf(Int_Xferred) = InData%NumMeshPts Int_Xferred = Int_Xferred + 1 - IF ( .NOT. ALLOCATED(InData%InitPosition) ) THEN + IF ( .NOT. ALLOCATED(InData%InitRefPos) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 ELSE IntKiBuf( Int_Xferred ) = 1 Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InitPosition,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitPosition,1) + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitRefPos,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitRefPos,1) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InitPosition,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitPosition,2) + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitRefPos,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitRefPos,2) Int_Xferred = Int_Xferred + 2 - DO i2 = LBOUND(InData%InitPosition,2), UBOUND(InData%InitPosition,2) - DO i1 = LBOUND(InData%InitPosition,1), UBOUND(InData%InitPosition,1) - ReKiBuf(Re_Xferred) = InData%InitPosition(i1,i2) + DO i2 = LBOUND(InData%InitRefPos,2), UBOUND(InData%InitRefPos,2) + DO i1 = LBOUND(InData%InitRefPos,1), UBOUND(InData%InitRefPos,1) + ReKiBuf(Re_Xferred) = InData%InitRefPos(i1,i2) Re_Xferred = Re_Xferred + 1 END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%InitOrientation) ) THEN + IF ( .NOT. ALLOCATED(InData%InitTransDisp) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 ELSE IntKiBuf( Int_Xferred ) = 1 Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrientation,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrientation,1) + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitTransDisp,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitTransDisp,1) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrientation,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrientation,2) + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitTransDisp,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitTransDisp,2) Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrientation,3) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrientation,3) + + DO i2 = LBOUND(InData%InitTransDisp,2), UBOUND(InData%InitTransDisp,2) + DO i1 = LBOUND(InData%InitTransDisp,1), UBOUND(InData%InitTransDisp,1) + DbKiBuf(Db_Xferred) = InData%InitTransDisp(i1,i2) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END IF + IF ( .NOT. ALLOCATED(InData%InitOrient) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrient,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrient,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrient,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrient,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitOrient,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitOrient,3) Int_Xferred = Int_Xferred + 2 - DO i3 = LBOUND(InData%InitOrientation,3), UBOUND(InData%InitOrientation,3) - DO i2 = LBOUND(InData%InitOrientation,2), UBOUND(InData%InitOrientation,2) - DO i1 = LBOUND(InData%InitOrientation,1), UBOUND(InData%InitOrientation,1) - DbKiBuf(Db_Xferred) = InData%InitOrientation(i1,i2,i3) + DO i3 = LBOUND(InData%InitOrient,3), UBOUND(InData%InitOrient,3) + DO i2 = LBOUND(InData%InitOrient,2), UBOUND(InData%InitOrient,2) + DO i1 = LBOUND(InData%InitOrient,1), UBOUND(InData%InitOrient,1) + DbKiBuf(Db_Xferred) = InData%InitOrient(i1,i2,i3) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF + IF ( .NOT. ALLOCATED(InData%InitRefOrient) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitRefOrient,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitRefOrient,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitRefOrient,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitRefOrient,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%InitRefOrient,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InitRefOrient,3) + Int_Xferred = Int_Xferred + 2 + + DO i3 = LBOUND(InData%InitRefOrient,3), UBOUND(InData%InitRefOrient,3) + DO i2 = LBOUND(InData%InitRefOrient,2), UBOUND(InData%InitRefOrient,2) + DO i1 = LBOUND(InData%InitRefOrient,1), UBOUND(InData%InitRefOrient,1) + DbKiBuf(Db_Xferred) = InData%InitRefOrient(i1,i2,i3) Db_Xferred = Db_Xferred + 1 END DO END DO @@ -1296,7 +1389,7 @@ SUBROUTINE StC_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Er END DO OutData%NumMeshPts = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitPosition not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitRefPos not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 @@ -1306,20 +1399,71 @@ SUBROUTINE StC_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Er i2_l = IntKiBuf( Int_Xferred ) i2_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InitPosition)) DEALLOCATE(OutData%InitPosition) - ALLOCATE(OutData%InitPosition(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%InitRefPos)) DEALLOCATE(OutData%InitRefPos) + ALLOCATE(OutData%InitRefPos(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitPosition.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitRefPos.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i2 = LBOUND(OutData%InitPosition,2), UBOUND(OutData%InitPosition,2) - DO i1 = LBOUND(OutData%InitPosition,1), UBOUND(OutData%InitPosition,1) - OutData%InitPosition(i1,i2) = ReKiBuf(Re_Xferred) + DO i2 = LBOUND(OutData%InitRefPos,2), UBOUND(OutData%InitRefPos,2) + DO i1 = LBOUND(OutData%InitRefPos,1), UBOUND(OutData%InitRefPos,1) + OutData%InitRefPos(i1,i2) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitOrientation not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitTransDisp not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%InitTransDisp)) DEALLOCATE(OutData%InitTransDisp) + ALLOCATE(OutData%InitTransDisp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitTransDisp.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i2 = LBOUND(OutData%InitTransDisp,2), UBOUND(OutData%InitTransDisp,2) + DO i1 = LBOUND(OutData%InitTransDisp,1), UBOUND(OutData%InitTransDisp,1) + OutData%InitTransDisp(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitOrient not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i3_l = IntKiBuf( Int_Xferred ) + i3_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%InitOrient)) DEALLOCATE(OutData%InitOrient) + ALLOCATE(OutData%InitOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitOrient.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i3 = LBOUND(OutData%InitOrient,3), UBOUND(OutData%InitOrient,3) + DO i2 = LBOUND(OutData%InitOrient,2), UBOUND(OutData%InitOrient,2) + DO i1 = LBOUND(OutData%InitOrient,1), UBOUND(OutData%InitOrient,1) + OutData%InitOrient(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InitRefOrient not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 @@ -1332,16 +1476,16 @@ SUBROUTINE StC_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Er i3_l = IntKiBuf( Int_Xferred ) i3_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InitOrientation)) DEALLOCATE(OutData%InitOrientation) - ALLOCATE(OutData%InitOrientation(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%InitRefOrient)) DEALLOCATE(OutData%InitRefOrient) + ALLOCATE(OutData%InitRefOrient(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitOrientation.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InitRefOrient.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i3 = LBOUND(OutData%InitOrientation,3), UBOUND(OutData%InitOrientation,3) - DO i2 = LBOUND(OutData%InitOrientation,2), UBOUND(OutData%InitOrientation,2) - DO i1 = LBOUND(OutData%InitOrientation,1), UBOUND(OutData%InitOrientation,1) - OutData%InitOrientation(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) + DO i3 = LBOUND(OutData%InitRefOrient,3), UBOUND(OutData%InitRefOrient,3) + DO i2 = LBOUND(OutData%InitRefOrient,2), UBOUND(OutData%InitRefOrient,2) + DO i1 = LBOUND(OutData%InitRefOrient,1), UBOUND(OutData%InitRefOrient,1) + OutData%InitRefOrient(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) Db_Xferred = Db_Xferred + 1 END DO END DO