-
Notifications
You must be signed in to change notification settings - Fork 5
/
SharedTypes.f90
executable file
·161 lines (150 loc) · 6.45 KB
/
SharedTypes.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
MODULE SharedTypes
!
!----------------------------------------------------------------------------------------------------
USE NWTC_Library
IMPLICIT NONE
!-------------------------------------------------------------------------------------------------
! Public types and subroutines
!-------------------------------------------------------------------------------------------------
TYPE, PUBLIC :: Marker
REAL(ReKi) :: Position(3)
REAL(ReKi) :: Orientation(3,3) ! Direction Cosine Matrix (DCM)
REAL(ReKi) :: TranslationVel(3)
REAL(ReKi) :: RotationVel(3)
END TYPE Marker
TYPE, PUBLIC :: Load
REAL(ReKi) :: Force(3)
REAL(ReKi) :: Moment(3)
END TYPE Load
TYPE, PUBLIC :: AllAeroMarkers
TYPE(Marker), ALLOCATABLE :: Blade(:,:)
TYPE(Marker), ALLOCATABLE :: Hub(:)
TYPE(Marker), ALLOCATABLE :: RotorFurl(:)
TYPE(Marker), ALLOCATABLE :: Nacelle(:)
TYPE(Marker), ALLOCATABLE :: Tower(:)
TYPE(Marker), ALLOCATABLE :: Tail(:)
END TYPE AllAeroMarkers
TYPE, PUBLIC :: AllAeroLoads
TYPE(Load), ALLOCATABLE :: Blade(:,:)
TYPE(Load), ALLOCATABLE :: Hub(:)
TYPE(Load), ALLOCATABLE :: RotorFurl(:)
TYPE(Load), ALLOCATABLE :: Nacelle(:)
TYPE(Load), ALLOCATABLE :: Tower(:)
TYPE(Load), ALLOCATABLE :: Tail(:)
END TYPE AllAeroLoads
TYPE, PUBLIC :: ProgDesc2
CHARACTER(20) :: Name
CHARACTER(99) :: Ver
END TYPE ProgDesc2
TYPE, PUBLIC :: AeroConfig
TYPE(Marker), ALLOCATABLE :: Blade(:)
REAL(ReKi) :: BladeLength
TYPE(Marker) :: Hub
TYPE(Marker) :: RotorFurl
TYPE(Marker) :: Nacelle
TYPE(Marker) :: TailFin
TYPE(Marker) :: Tower
TYPE(Marker) :: Substructure
TYPE(Marker) :: Foundation
END TYPE AeroConfig
!====================================================================================================
!CONTAINS
!====================================================================================================
!SUBROUTINE AllocateLoads(LoadVar,NB,NBEle,NHub,NNacelle,NTwr,NTail,ErrorStatus)
!! Allocation subroutine for type AllAeroLoads
!!----------------------------------------------------------------------------------------------------
!
! ! Passed variables
!
! TYPE(AllAeroLoads), INTENT(INOUT) :: LoadVar
! INTEGER, INTENT(IN) :: NB ! Number of blades
! INTEGER, INTENT(IN) :: NBEle ! Number of elements per blade
! INTEGER, INTENT(IN) :: NHub ! Number of elements on the hub
! INTEGER, INTENT(IN) :: NNacelle ! Number of elements on the nacelle
! INTEGER, INTENT(IN) :: NTwr ! Number of elements on the tower
! INTEGER, INTENT(IN) :: NTail ! Number of elements on the tail
! INTEGER, INTENT(OUT) :: ErrorStatus ! Determines if an error was encountered
!
!
! ! Allocate the states
!
!
! IF (.NOT. ALLOCATED(LoadVar%Blade) .AND. NB*NBEle > 0 ) THEN
! ALLOCATE( LoadVar%Blade(NB,NBEle), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(LoadVar%Hub) .AND. NHub > 0 ) THEN
! ALLOCATE( LoadVar%Hub(NHub), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(LoadVar%Nacelle) .AND. NNacelle > 0 ) THEN
! ALLOCATE( LoadVar%Nacelle(NNacelle), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(LoadVar%Tower) .AND. NTwr > 0 ) THEN
! ALLOCATE( LoadVar%Tower(NTwr), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(LoadVar%Tail) .AND. NTail > 0 ) THEN
! ALLOCATE( LoadVar%Tail(NTail), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! ErrorStatus = 0
!
!
!END SUBROUTINE AllocateLoads
!!====================================================================================================
!SUBROUTINE AllocateStates(StateVar,NB,NBEle,NHub,NNacelle,NTwr,NTail,ErrorStatus)
!! Allocation subroutine for type AllAeroStates
!!----------------------------------------------------------------------------------------------------
!
! ! Passed variables
!
! TYPE(AllAeroStates), INTENT(INOUT) :: StateVar
! INTEGER, INTENT(IN) :: NB ! Number of blades
! INTEGER, INTENT(IN) :: NBEle ! Number of elements per blade
! INTEGER, INTENT(IN) :: NHub ! Number of elements on the hub
! INTEGER, INTENT(IN) :: NNacelle ! Number of elements on the nacelle
! INTEGER, INTENT(IN) :: NTwr ! Number of elements on the tower
! INTEGER, INTENT(IN) :: NTail ! Number of elements on the tail
! INTEGER, INTENT(OUT) :: ErrorStatus ! Determines if an error was encountered
!
!
! ! Allocate the states
!
! IF (.NOT. ALLOCATED(StateVar%Blade) .AND. NB*NBEle > 0 ) THEN
! ALLOCATE( StateVar%Blade(NB,NBEle), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(StateVar%Hub) .AND. NHub > 0 ) THEN
! ALLOCATE( StateVar%Hub(NHub), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(StateVar%Nacelle) .AND. NNacelle > 0 ) THEN
! ALLOCATE( StateVar%Nacelle(NNacelle), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(StateVar%Tower) .AND. NTwr > 0 ) THEN
! ALLOCATE( StateVar%Tower(NTwr), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! IF (.NOT. ALLOCATED(StateVar%Tail) .AND. NTail > 0 ) THEN
! ALLOCATE( StateVar%Tail(NTail), STAT=ErrorStatus )
! IF (ErrorStatus /=0) RETURN
! ENDIF
!
! ErrorStatus = 0
!
!
!END SUBROUTINE AllocateStates
!====================================================================================================
END MODULE SharedTypes