National Renewable Energy Lab hacked by Iranians


2020-04-11_19-40-552020-04-11_19-39-47

type(morison_axialcoeftype), dimension(:), allocatable morison_types::morison_initinputtype::axialcoefs Definition at line 257 of file Morison_Types.f90. type(morison_coefdpths), dimension(:), allocatable morison_types::morison_initinputtype::coefdpths Definition at line 271 of file Morison_Types.f90. type(morison_coefmembers), dimension(:), allocatable morison_types::morison_initinputtype::coefmembers Definition at line 273 of file Morison_Types.f90. type(morison_membertype), dimension(:), allocatable morison_types::morison_initinputtype::elements Definition at line 255 of file Morison_Types.f90. type(morison_filledgrouptype), dimension(:), allocatable morison_types::morison_initinputtype::filledgroups Definition at line 277 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::gravity Definition at line 245 of file Morison_Types.f90. type(morison_jointtype), dimension(:), allocatable morison_types::morison_initinputtype::inpjoints Definition at line 252 of file Morison_Types.f90. type(morison_memberinputtype), dimension(:), allocatable morison_types::morison_initinputtype::inpmembers Definition at line 275 of file Morison_Types.f90. type(morison_joutput), dimension(:), allocatable morison_types::morison_initinputtype::joutlst Definition at line 285 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::mgbottom Definition at line 281 of file Morison_Types.f90. type(morison_mgdepthstype), dimension(:), allocatable morison_types::morison_initinputtype::mgdepths Definition at line 279 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::mgtop Definition at line 280 of file Morison_Types.f90. type(morison_moutput), dimension(:), allocatable morison_types::morison_initinputtype::moutlst Definition at line 283 of file Morison_Types.f90. type(morison_memberproptype), dimension(:), allocatable morison_types::morison_initinputtype::mpropsets Definition at line 259 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::msl2swl Definition at line 248 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::naxcoefs Definition at line 256 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::ncoefdpth Definition at line 270 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::ncoefmembers Definition at line 272 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nelements Definition at line 254 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nfillgroups Definition at line 276 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::njoints Definition at line 249 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::njoutputs Definition at line 284 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nmembers Definition at line 274 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nmgdepths Definition at line 278 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nmoutputs Definition at line 282 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nnodes Definition at line 250 of file Morison_Types.f90. type(morison_nodetype), dimension(:), allocatable morison_types::morison_initinputtype::nodes Definition at line 253 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::npropsets Definition at line 258 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::nstepwave Definition at line 294 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::numouts Definition at line 288 of file Morison_Types.f90. logical morison_types::morison_initinputtype::outall Definition at line 290 of file Morison_Types.f90. character(10), dimension(1:4032) morison_types::morison_initinputtype::outlist Definition at line 286 of file Morison_Types.f90. character(1024) morison_types::morison_initinputtype::outrootname Definition at line 291 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::outswtch Definition at line 289 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplaxca Definition at line 266 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplaxcamg Definition at line 267 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplaxcp Definition at line 268 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplaxcpmg Definition at line 269 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplca Definition at line 262 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplcamg Definition at line 263 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplcd Definition at line 260 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplcdmg Definition at line 261 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplcp Definition at line 264 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::simplcpmg Definition at line 265 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::totalpossiblesupermembers Definition at line 251 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::unoutfile Definition at line 292 of file Morison_Types.f90. integer(intki) morison_types::morison_initinputtype::unsum Definition at line 293 of file Morison_Types.f90. logical, dimension(:), allocatable morison_types::morison_initinputtype::validoutlist Definition at line 287 of file Morison_Types.f90. real(reki), dimension(:,:,:), allocatable morison_types::morison_initinputtype::waveacc0 Definition at line 295 of file Morison_Types.f90. real(reki), dimension(:,:), allocatable morison_types::morison_initinputtype::wavedynp0 Definition at line 297 of file Morison_Types.f90. real(reki), dimension(:), allocatable morison_types::morison_initinputtype::wavetime Definition at line 296 of file Morison_Types.f90. real(reki), dimension(:,:,:), allocatable morison_types::morison_initinputtype::wavevel0 Definition at line 298 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::wtrdens Definition at line 246 of file Morison_Types.f90. real(reki) morison_types::morison_initinputtype::wtrdpth Definition at line 247 of file Morison_Types.f90.

thumbnail_Screenshot_20200411-193055_WinZip


1 !STARTOFREGISTRYGENERATEDFILE 2 ! 3 ! WARNING This file is generated automatically by the FAST registry 4 ! Do not edit. Your changes to this file will be lost. 5 ! 6 ! FAST Registry (v2.03.01, 18-June-2014) 7 !********************************************************************************************************************************* 8 ! Conv_Radiation_Types 9 !………………………………………………………………………………………………………………… 10 ! This file is part of Conv_Radiation. 11 ! 12 ! Copyright (C) 2012-2014 National Renewable Energy Laboratory 13 ! 14 ! Licensed under the Apache License, Version 2.0 (the “License”); 15 ! you may not use this file except in compliance with the License. 16 ! You may obtain a copy of the License at 17 ! 18 ! 0 19 ! 20 ! Unless required by applicable law or agreed to in writing, software 21 ! distributed under the License is distributed on an “AS IS” BASIS, 22 ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 ! See the License for the specific language governing permissions and 24 ! limitations under the License. 25 ! 26 ! 27 ! W A R N I N G : This file was automatically generated from the FAST registry. Changes made to this file may be lost. 28 ! 29 !********************************************************************************************************************************* 30 MODULE conv_radiation_types 31 ! This module contains all of the user-defined types needed in Conv_Radiation. It also contains copy, destroy, pack, and 32 ! unpack routines associated with each defined data type. This code will be generated by the FAST Registry. 33 !——————————————————————————————————————————— 34 USE nwtc_library 35 IMPLICIT NONE 36 ! ========= Conv_Rdtn_InitInputType ======= 37 TYPE, database() :: conv_rdtn_initinputtype 38 REAL(DbKi) :: RdtnDT ! [-] 39 CHARACTER(80) :: RdtnDTChr 40 REAL(ReKi) :: HighFreq ! [-] 41 CHARACTER(1024) :: WAMITFile ! [-] 42 REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: HdroAddMs ! [-] 43 REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: HdroFreq ! [-] 44 REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: HdroDmpng ! [-] 45 INTEGER(IntKi) :: NInpFreq ! [-] 46 REAL(DbKi) :: RdtnTMax ! [-] 47 INTEGER(IntKi) :: UnSum ! [-] 48 END TYPE conv_rdtn_initinputtype 49 ! ======================= 50 ! ========= Conv_Rdtn_InitOutputType ======= 51 TYPE, database() :: conv_rdtn_initoutputtype 52 INTEGER(IntKi) :: DummyInitOut ! [-] 53 END TYPE conv_rdtn_initoutputtype 54 ! ======================= 55 ! ========= Conv_Rdtn_ContinuousStateType ======= 56 TYPE, database() :: conv_rdtn_continuousstatetype 57 REAL(ReKi) :: DummyContState ! Remove this variable if you have continuous states [-] 58 END TYPE conv_rdtn_continuousstatetype 59 ! ======================= 60 ! ========= Conv_Rdtn_DiscreteStateType ======= 61 TYPE, database() :: conv_rdtn_discretestatetype 62 REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: XDHistory ! [-] 63 REAL(DbKi) :: LastTime ! [-] 64 END TYPE conv_rdtn_discretestatetype 65 ! ======================= 66 ! ========= Conv_Rdtn_ConstraintStateType ======= 67 TYPE, database() :: conv_rdtn_constraintstatetype 68 REAL(ReKi) :: DummyConstrState ! Remove this variable if you have constraint states [-] 69 END TYPE conv_rdtn_constraintstatetype 70 ! ======================= 71 ! ========= Conv_Rdtn_OtherStateType ======= 72 TYPE, database() :: conv_rdtn_otherstatetype 73 INTEGER(IntKi) :: LastIndRdtn ! [-] 74 INTEGER(IntKi) :: LastIndRdtn2 ! [-] 75 INTEGER(IntKi) :: IndRdtn ! [-] 76 END TYPE conv_rdtn_otherstatetype 77 ! ======================= 78 ! ========= Conv_Rdtn_ParameterType ======= 79 TYPE, database() :: conv_rdtn_parametertype 80 REAL(DbKi) :: DT ! Time step for continuous state integration & discrete state update [seconds] 81 REAL(DbKi) :: RdtnDT ! [-] 82 REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: RdtnKrnl ! [-] 83 INTEGER(IntKi) :: NStepRdtn ! [-] 84 INTEGER(IntKi) :: NStepRdtn1 ! [-] 85 END TYPE conv_rdtn_parametertype 86 ! ======================= 87 ! ========= Conv_Rdtn_InputType ======= 88 TYPE, database() :: conv_rdtn_inputtype 89 REAL(ReKi) , DIMENSION(1:6) :: Velocity ! [-] 90 END TYPE conv_rdtn_inputtype 91 ! ======================= 92 ! ========= Conv_Rdtn_OutputType ======= 93 TYPE, database() :: conv_rdtn_outputtype 94 REAL(ReKi) , DIMENSION(1:6) :: F_Rdtn ! [-] 95 END TYPE conv_rdtn_outputtype 96 ! ======================= 97 CONTAINS 98 SUBROUTINE conv_rdtn_copyinitinput( SrcInitInputData, DstInitInputData, CtrlCode, ErrStat, ErrMsg ) 99 TYPE(conv_rdtn_initinputtype), INTENT(INOUT) :: srcinitinputdata 100 TYPE(conv_rdtn_initinputtype), INTENT(INOUT) :: dstinitinputdata 101 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 102 INTEGER(IntKi), INTENT( OUT) :: errstat 103 CHARACTER(*), INTENT( OUT) :: errmsg 104 ! Local 105 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 106 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 107 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 108 ! 109 errstat = errid_none 110 errmsg = “” 111 dstinitinputdata%RdtnDT = srcinitinputdata%RdtnDT 112 dstinitinputdata%RdtnDTChr = srcinitinputdata%RdtnDTChr 113 dstinitinputdata%HighFreq = srcinitinputdata%HighFreq 114 dstinitinputdata%WAMITFile = srcinitinputdata%WAMITFile 115 IF (ALLOCATED(srcinitinputdata%HdroAddMs)) THEN 116 i1_l = lbound(srcinitinputdata%HdroAddMs,1) 117 i1_u = ubound(srcinitinputdata%HdroAddMs,1) 118 i2_l = lbound(srcinitinputdata%HdroAddMs,2) 119 i2_u = ubound(srcinitinputdata%HdroAddMs,2) 120 IF (.NOT. ALLOCATED(dstinitinputdata%HdroAddMs)) THEN 121 ALLOCATE(dstinitinputdata%HdroAddMs(i1_l:i1_u,i2_l:i2_u),stat=errstat) 122 IF (errstat /= 0) THEN 123 errstat = errid_fatal 124 errmsg = ‘Conv_Rdtn_CopyInitInput: Error allocating DstInitInputData%HdroAddMs.’ 125 RETURN 126 END IF 127 END IF 128 dstinitinputdata%HdroAddMs = srcinitinputdata%HdroAddMs 129 ENDIF 130 IF (ALLOCATED(srcinitinputdata%HdroFreq)) THEN 131 i1_l = lbound(srcinitinputdata%HdroFreq,1) 132 i1_u = ubound(srcinitinputdata%HdroFreq,1) 133 IF (.NOT. ALLOCATED(dstinitinputdata%HdroFreq)) THEN 134 ALLOCATE(dstinitinputdata%HdroFreq(i1_l:i1_u),stat=errstat) 135 IF (errstat /= 0) THEN 136 errstat = errid_fatal 137 errmsg = ‘Conv_Rdtn_CopyInitInput: Error allocating DstInitInputData%HdroFreq.’ 138 RETURN 139 END IF 140 END IF 141 dstinitinputdata%HdroFreq = srcinitinputdata%HdroFreq 142 ENDIF 143 IF (ALLOCATED(srcinitinputdata%HdroDmpng)) THEN 144 i1_l = lbound(srcinitinputdata%HdroDmpng,1) 145 i1_u = ubound(srcinitinputdata%HdroDmpng,1) 146 i2_l = lbound(srcinitinputdata%HdroDmpng,2) 147 i2_u = ubound(srcinitinputdata%HdroDmpng,2) 148 IF (.NOT. ALLOCATED(dstinitinputdata%HdroDmpng)) THEN 149 ALLOCATE(dstinitinputdata%HdroDmpng(i1_l:i1_u,i2_l:i2_u),stat=errstat) 150 IF (errstat /= 0) THEN 151 errstat = errid_fatal 152 errmsg = ‘Conv_Rdtn_CopyInitInput: Error allocating DstInitInputData%HdroDmpng.’ 153 RETURN 154 END IF 155 END IF 156 dstinitinputdata%HdroDmpng = srcinitinputdata%HdroDmpng 157 ENDIF 158 dstinitinputdata%NInpFreq = srcinitinputdata%NInpFreq 159 dstinitinputdata%RdtnTMax = srcinitinputdata%RdtnTMax 160 dstinitinputdata%UnSum = srcinitinputdata%UnSum 161 END SUBROUTINE conv_rdtn_copyinitinput 162 163 SUBROUTINE conv_rdtn_destroyinitinput( InitInputData, ErrStat, ErrMsg ) 164 TYPE(conv_rdtn_initinputtype), INTENT(INOUT) :: initinputdata 165 INTEGER(IntKi), INTENT( OUT) :: errstat 166 CHARACTER(*), INTENT( OUT) :: errmsg 167 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 168 ! 169 errstat = errid_none 170 errmsg = “” 171 IF (ALLOCATED(initinputdata%HdroAddMs)) THEN 172 DEALLOCATE(initinputdata%HdroAddMs) 173 ENDIF 174 IF (ALLOCATED(initinputdata%HdroFreq)) THEN 175 DEALLOCATE(initinputdata%HdroFreq) 176 ENDIF 177 IF (ALLOCATED(initinputdata%HdroDmpng)) THEN 178 DEALLOCATE(initinputdata%HdroDmpng) 179 ENDIF 180 END SUBROUTINE conv_rdtn_destroyinitinput 181 182 SUBROUTINE conv_rdtn_packinitinput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 183 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 184 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 185 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 186 TYPE(conv_rdtn_initinputtype), INTENT(INOUT) :: indata 187 INTEGER(IntKi), INTENT( OUT) :: errstat 188 CHARACTER(*), INTENT( OUT) :: errmsg 189 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 190 ! Local variables 191 INTEGER(IntKi) :: re_bufsz 192 INTEGER(IntKi) :: re_xferred 193 INTEGER(IntKi) :: re_currsz 194 INTEGER(IntKi) :: db_bufsz 195 INTEGER(IntKi) :: db_xferred 196 INTEGER(IntKi) :: db_currsz 197 INTEGER(IntKi) :: int_bufsz 198 INTEGER(IntKi) :: int_xferred 199 INTEGER(IntKi) :: int_currsz 200 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 201 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 202 ! buffers to store meshes, if any 203 onlysize = .false. 204 IF ( present(sizeonly) ) THEN 205 onlysize = sizeonly 206 ENDIF 207 ! 208 errstat = errid_none 209 errmsg = “” 210 re_xferred = 1 211 db_xferred = 1 212 int_xferred = 1 213 re_bufsz = 0 214 db_bufsz = 0 215 int_bufsz = 0 216 db_bufsz = db_bufsz + 1 ! RdtnDT 217 re_bufsz = re_bufsz + 1 ! HighFreq 218 re_bufsz = re_bufsz + SIZE( indata%HdroAddMs ) ! HdroAddMs 219 re_bufsz = re_bufsz + SIZE( indata%HdroFreq ) ! HdroFreq 220 re_bufsz = re_bufsz + SIZE( indata%HdroDmpng ) ! HdroDmpng 221 int_bufsz = int_bufsz + 1 ! NInpFreq 222 db_bufsz = db_bufsz + 1 ! RdtnTMax 223 int_bufsz = int_bufsz + 1 ! UnSum 224 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 225 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 226 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 227 IF ( .NOT. onlysize ) dbkibuf( db_xferred:db_xferred+(1)-1 ) = (indata%RdtnDT ) 228 db_xferred = db_xferred + 1 229 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(1)-1 ) = (indata%HighFreq ) 230 re_xferred = re_xferred + 1 231 IF ( ALLOCATED(indata%HdroAddMs) ) THEN 232 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%HdroAddMs))-1 ) = pack(indata%HdroAddMs ,.true.) 233 re_xferred = re_xferred + SIZE(indata%HdroAddMs) 234 ENDIF 235 IF ( ALLOCATED(indata%HdroFreq) ) THEN 236 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%HdroFreq))-1 ) = pack(indata%HdroFreq ,.true.) 237 re_xferred = re_xferred + SIZE(indata%HdroFreq) 238 ENDIF 239 IF ( ALLOCATED(indata%HdroDmpng) ) THEN 240 IF ( NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%HdroDmpng))-1 ) = pack(indata%HdroDmpng ,.true.) 241 re_xferred = re_xferred + SIZE(indata%HdroDmpng) 242 ENDIF 243 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%NInpFreq ) 244 int_xferred = int_xferred + 1 245 IF ( .NOT. onlysize ) dbkibuf( db_xferred:db_xferred+(1)-1 ) = (indata%RdtnTMax ) 246 db_xferred = db_xferred + 1 247 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%UnSum ) 248 int_xferred = int_xferred + 1 249 END SUBROUTINE conv_rdtn_packinitinput 250 251 SUBROUTINE conv_rdtn_unpackinitinput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 252 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 253 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 254 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 255 TYPE(conv_rdtn_initinputtype), INTENT(INOUT) :: outdata 256 INTEGER(IntKi), INTENT( OUT) :: errstat 257 CHARACTER(*), INTENT( OUT) :: errmsg 258 ! Local variables 259 INTEGER(IntKi) :: re_bufsz 260 INTEGER(IntKi) :: re_xferred 261 INTEGER(IntKi) :: re_currsz 262 INTEGER(IntKi) :: db_bufsz 263 INTEGER(IntKi) :: db_xferred 264 INTEGER(IntKi) :: db_currsz 265 INTEGER(IntKi) :: int_bufsz 266 INTEGER(IntKi) :: int_xferred 267 INTEGER(IntKi) :: int_currsz 268 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 269 LOGICAL, ALLOCATABLE :: mask1(:) 270 LOGICAL, ALLOCATABLE :: mask2(:,:) 271 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 272 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 273 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 274 ! buffers to store meshes, if any 275 ! 276 errstat = errid_none 277 errmsg = “” 278 re_xferred = 1 279 db_xferred = 1 280 int_xferred = 1 281 re_bufsz = 0 282 db_bufsz = 0 283 int_bufsz = 0 284 outdata%RdtnDT = dbkibuf( db_xferred ) 285 db_xferred = db_xferred + 1 286 outdata%HighFreq = rekibuf( re_xferred ) 287 re_xferred = re_xferred + 1 288 IF ( ALLOCATED(outdata%HdroAddMs) ) THEN 289 ALLOCATE(mask2(SIZE(outdata%HdroAddMs,1),SIZE(outdata%HdroAddMs,2))); mask2 = .true. 290 outdata%HdroAddMs = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%HdroAddMs))-1 ),mask2,outdata%HdroAddMs) 291 DEALLOCATE(mask2) 292 re_xferred = re_xferred + SIZE(outdata%HdroAddMs) 293 ENDIF 294 IF ( ALLOCATED(outdata%HdroFreq) ) THEN 295 ALLOCATE(mask1(SIZE(outdata%HdroFreq,1))); mask1 = .true. 296 outdata%HdroFreq = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%HdroFreq))-1 ),mask1,outdata%HdroFreq) 297 DEALLOCATE(mask1) 298 re_xferred = re_xferred + SIZE(outdata%HdroFreq) 299 ENDIF 300 IF ( ALLOCATED(outdata%HdroDmpng) ) THEN 301 ALLOCATE(mask2(SIZE(outdata%HdroDmpng,1),SIZE(outdata%HdroDmpng,2))); mask2 = .true. 302 outdata%HdroDmpng = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%HdroDmpng))-1 ),mask2,outdata%HdroDmpng) 303 DEALLOCATE(mask2) 304 re_xferred = re_xferred + SIZE(outdata%HdroDmpng) 305 ENDIF 306 outdata%NInpFreq = intkibuf( int_xferred ) 307 int_xferred = int_xferred + 1 308 outdata%RdtnTMax = dbkibuf( db_xferred ) 309 db_xferred = db_xferred + 1 310 outdata%UnSum = intkibuf( int_xferred ) 311 int_xferred = int_xferred + 1 312 re_xferred = re_xferred-1 313 db_xferred = db_xferred-1 314 int_xferred = int_xferred-1 315 END SUBROUTINE conv_rdtn_unpackinitinput 316 317 SUBROUTINE conv_rdtn_copyinitoutput( SrcInitOutputData, DstInitOutputData, CtrlCode, ErrStat, ErrMsg ) 318 TYPE(conv_rdtn_initoutputtype), INTENT(INOUT) :: srcinitoutputdata 319 TYPE(conv_rdtn_initoutputtype), INTENT(INOUT) :: dstinitoutputdata 320 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 321 INTEGER(IntKi), INTENT( OUT) :: errstat 322 CHARACTER(*), INTENT( OUT) :: errmsg 323 ! Local 324 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 325 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 326 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 327 ! 328 errstat = errid_none 329 errmsg = “” 330 dstinitoutputdata%DummyInitOut = srcinitoutputdata%DummyInitOut 331 END SUBROUTINE conv_rdtn_copyinitoutput 332 333 SUBROUTINE conv_rdtn_destroyinitoutput( InitOutputData, ErrStat, ErrMsg ) 334 TYPE(conv_rdtn_initoutputtype), INTENT(INOUT) :: initoutputdata 335 INTEGER(IntKi), INTENT( OUT) :: errstat 336 CHARACTER(*), INTENT( OUT) :: errmsg 337 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 338 ! 339 errstat = errid_none 340 errmsg = “” 341 END SUBROUTINE conv_rdtn_destroyinitoutput 342 343 SUBROUTINE conv_rdtn_packinitoutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 344 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 345 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 346 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 347 TYPE(conv_rdtn_initoutputtype), INTENT(INOUT) :: indata 348 INTEGER(IntKi), INTENT( OUT) :: errstat 349 CHARACTER(*), INTENT( OUT) :: errmsg 350 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 351 ! Local variables 352 INTEGER(IntKi) :: re_bufsz 353 INTEGER(IntKi) :: re_xferred 354 INTEGER(IntKi) :: re_currsz 355 INTEGER(IntKi) :: db_bufsz 356 INTEGER(IntKi) :: db_xferred 357 INTEGER(IntKi) :: db_currsz 358 INTEGER(IntKi) :: int_bufsz 359 INTEGER(IntKi) :: int_xferred 360 INTEGER(IntKi) :: int_currsz 361 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 362 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 363 ! buffers to store meshes, if any 364 onlysize = .false. 365 IF ( present(sizeonly) ) THEN 366 onlysize = sizeonly 367 ENDIF 368 ! 369 errstat = errid_none 370 errmsg = “” 371 re_xferred = 1 372 db_xferred = 1 373 int_xferred = 1 374 re_bufsz = 0 375 db_bufsz = 0 376 int_bufsz = 0 377 int_bufsz = int_bufsz + 1 ! DummyInitOut 378 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 379 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 380 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 381 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%DummyInitOut ) 382 int_xferred = int_xferred + 1 383 END SUBROUTINE conv_rdtn_packinitoutput 384 385 SUBROUTINE conv_rdtn_unpackinitoutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 386 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 387 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 388 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 389 TYPE(conv_rdtn_initoutputtype), INTENT(INOUT) :: outdata 390 INTEGER(IntKi), INTENT( OUT) :: errstat 391 CHARACTER(*), INTENT( OUT) :: errmsg 392 ! Local variables 393 INTEGER(IntKi) :: re_bufsz 394 INTEGER(IntKi) :: re_xferred 395 INTEGER(IntKi) :: re_currsz 396 INTEGER(IntKi) :: db_bufsz 397 INTEGER(IntKi) :: db_xferred 398 INTEGER(IntKi) :: db_currsz 399 INTEGER(IntKi) :: int_bufsz 400 INTEGER(IntKi) :: int_xferred 401 INTEGER(IntKi) :: int_currsz 402 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 403 LOGICAL, ALLOCATABLE :: mask1(:) 404 LOGICAL, ALLOCATABLE :: mask2(:,:) 405 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 406 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 407 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 408 ! buffers to store meshes, if any 409 ! 410 errstat = errid_none 411 errmsg = “” 412 re_xferred = 1 413 db_xferred = 1 414 int_xferred = 1 415 re_bufsz = 0 416 db_bufsz = 0 417 int_bufsz = 0 418 outdata%DummyInitOut = intkibuf( int_xferred ) 419 int_xferred = int_xferred + 1 420 re_xferred = re_xferred-1 421 db_xferred = db_xferred-1 422 int_xferred = int_xferred-1 423 END SUBROUTINE conv_rdtn_unpackinitoutput 424 425 SUBROUTINE conv_rdtn_copycontstate( SrcContStateData, DstContStateData, CtrlCode, ErrStat, ErrMsg ) 426 TYPE(conv_rdtn_continuousstatetype), INTENT(INOUT) :: srccontstatedata 427 TYPE(conv_rdtn_continuousstatetype), INTENT(INOUT) :: dstcontstatedata 428 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 429 INTEGER(IntKi), INTENT( OUT) :: errstat 430 CHARACTER(*), INTENT( OUT) :: errmsg 431 ! Local 432 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 433 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 434 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 435 ! 436 errstat = errid_none 437 errmsg = “” 438 dstcontstatedata%DummyContState = srccontstatedata%DummyContState 439 END SUBROUTINE conv_rdtn_copycontstate 440 441 SUBROUTINE conv_rdtn_destroycontstate( ContStateData, ErrStat, ErrMsg ) 442 TYPE(conv_rdtn_continuousstatetype), INTENT(INOUT) :: contstatedata 443 INTEGER(IntKi), INTENT( OUT) :: errstat 444 CHARACTER(*), INTENT( OUT) :: errmsg 445 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 446 ! 447 errstat = errid_none 448 errmsg = “” 449 END SUBROUTINE conv_rdtn_destroycontstate 450 451 SUBROUTINE conv_rdtn_packcontstate( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 452 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 453 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 454 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 455 TYPE(conv_rdtn_continuousstatetype), INTENT(INOUT) :: indata 456 INTEGER(IntKi), INTENT( OUT) :: errstat 457 CHARACTER(*), INTENT( OUT) :: errmsg 458 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 459 ! Local variables 460 INTEGER(IntKi) :: re_bufsz 461 INTEGER(IntKi) :: re_xferred 462 INTEGER(IntKi) :: re_currsz 463 INTEGER(IntKi) :: db_bufsz 464 INTEGER(IntKi) :: db_xferred 465 INTEGER(IntKi) :: db_currsz 466 INTEGER(IntKi) :: int_bufsz 467 INTEGER(IntKi) :: int_xferred 468 INTEGER(IntKi) :: int_currsz 469 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 470 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 471 ! buffers to store meshes, if any 472 onlysize = .false. 473 IF ( present(sizeonly) ) THEN 474 onlysize = sizeonly 475 ENDIF 476 ! 477 errstat = errid_none 478 errmsg = “” 479 re_xferred = 1 480 db_xferred = 1 481 int_xferred = 1 482 re_bufsz = 0 483 db_bufsz = 0 484 int_bufsz = 0 485 re_bufsz = re_bufsz + 1 ! DummyContState 486 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 487 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 488 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 489 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(1)-1 ) = (indata%DummyContState ) 490 re_xferred = re_xferred + 1 491 END SUBROUTINE conv_rdtn_packcontstate 492 493 SUBROUTINE conv_rdtn_unpackcontstate( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 494 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 495 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 496 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 497 TYPE(conv_rdtn_continuousstatetype), INTENT(INOUT) :: outdata 498 INTEGER(IntKi), INTENT( OUT) :: errstat 499 CHARACTER(*), INTENT( OUT) :: errmsg 500 ! Local variables 501 INTEGER(IntKi) :: re_bufsz 502 INTEGER(IntKi) :: re_xferred 503 INTEGER(IntKi) :: re_currsz 504 INTEGER(IntKi) :: db_bufsz 505 INTEGER(IntKi) :: db_xferred 506 INTEGER(IntKi) :: db_currsz 507 INTEGER(IntKi) :: int_bufsz 508 INTEGER(IntKi) :: int_xferred 509 INTEGER(IntKi) :: int_currsz 510 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 511 LOGICAL, ALLOCATABLE :: mask1(:) 512 LOGICAL, ALLOCATABLE :: mask2(:,:) 513 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 514 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 515 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 516 ! buffers to store meshes, if any 517 ! 518 errstat = errid_none 519 errmsg = “” 520 re_xferred = 1 521 db_xferred = 1 522 int_xferred = 1 523 re_bufsz = 0 524 db_bufsz = 0 525 int_bufsz = 0 526 outdata%DummyContState = rekibuf( re_xferred ) 527 re_xferred = re_xferred + 1 528 re_xferred = re_xferred-1 529 db_xferred = db_xferred-1 530 int_xferred = int_xferred-1 531 END SUBROUTINE conv_rdtn_unpackcontstate 532 533 SUBROUTINE conv_rdtn_copydiscstate( SrcDiscStateData, DstDiscStateData, CtrlCode, ErrStat, ErrMsg ) 534 TYPE(conv_rdtn_discretestatetype), INTENT(INOUT) :: srcdiscstatedata 535 TYPE(conv_rdtn_discretestatetype), INTENT(INOUT) :: dstdiscstatedata 536 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 537 INTEGER(IntKi), INTENT( OUT) :: errstat 538 CHARACTER(*), INTENT( OUT) :: errmsg 539 ! Local 540 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 541 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 542 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 543 ! 544 errstat = errid_none 545 errmsg = “” 546 IF (ALLOCATED(srcdiscstatedata%XDHistory)) THEN 547 i1_l = lbound(srcdiscstatedata%XDHistory,1) 548 i1_u = ubound(srcdiscstatedata%XDHistory,1) 549 i2_l = lbound(srcdiscstatedata%XDHistory,2) 550 i2_u = ubound(srcdiscstatedata%XDHistory,2) 551 IF (.NOT. ALLOCATED(dstdiscstatedata%XDHistory)) THEN 552 ALLOCATE(dstdiscstatedata%XDHistory(i1_l:i1_u,i2_l:i2_u),stat=errstat) 553 IF (errstat /= 0) THEN 554 errstat = errid_fatal 555 errmsg = ‘Conv_Rdtn_CopyDiscState: Error allocating DstDiscStateData%XDHistory.’ 556 RETURN 557 END IF 558 END IF 559 dstdiscstatedata%XDHistory = srcdiscstatedata%XDHistory 560 ENDIF 561 dstdiscstatedata%LastTime = srcdiscstatedata%LastTime 562 END SUBROUTINE conv_rdtn_copydiscstate 563 564 SUBROUTINE conv_rdtn_destroydiscstate( DiscStateData, ErrStat, ErrMsg ) 565 TYPE(conv_rdtn_discretestatetype), INTENT(INOUT) :: discstatedata 566 INTEGER(IntKi), INTENT( OUT) :: errstat 567 CHARACTER(*), INTENT( OUT) :: errmsg 568 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 569 ! 570 errstat = errid_none 571 errmsg = “” 572 IF (ALLOCATED(discstatedata%XDHistory)) THEN 573 DEALLOCATE(discstatedata%XDHistory) 574 ENDIF 575 END SUBROUTINE conv_rdtn_destroydiscstate 576 577 SUBROUTINE conv_rdtn_packdiscstate( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 578 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 579 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 580 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 581 TYPE(conv_rdtn_discretestatetype), INTENT(INOUT) :: indata 582 INTEGER(IntKi), INTENT( OUT) :: errstat 583 CHARACTER(*), INTENT( OUT) :: errmsg 584 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 585 ! Local variables 586 INTEGER(IntKi) :: re_bufsz 587 INTEGER(IntKi) :: re_xferred 588 INTEGER(IntKi) :: re_currsz 589 INTEGER(IntKi) :: db_bufsz 590 INTEGER(IntKi) :: db_xferred 591 INTEGER(IntKi) :: db_currsz 592 INTEGER(IntKi) :: int_bufsz 593 INTEGER(IntKi) :: int_xferred 594 INTEGER(IntKi) :: int_currsz 595 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 596 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 597 ! buffers to store meshes, if any 598 onlysize = .false. 599 IF ( present(sizeonly) ) THEN 600 onlysize = sizeonly 601 ENDIF 602 ! 603 errstat = errid_none 604 errmsg = “” 605 re_xferred = 1 606 db_xferred = 1 607 int_xferred = 1 608 re_bufsz = 0 609 db_bufsz = 0 610 int_bufsz = 0 611 re_bufsz = re_bufsz + SIZE( indata%XDHistory ) ! XDHistory 612 db_bufsz = db_bufsz + 1 ! LastTime 613 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 614 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 615 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 616 IF ( ALLOCATED(indata%XDHistory) ) THEN 617 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%XDHistory))-1 ) = pack(indata%XDHistory ,.true.) 618 re_xferred = re_xferred + SIZE(indata%XDHistory) 619 ENDIF 620 IF ( .NOT. onlysize ) dbkibuf( db_xferred:db_xferred+(1)-1 ) = (indata%LastTime ) 621 db_xferred = db_xferred + 1 622 END SUBROUTINE conv_rdtn_packdiscstate 623 624 SUBROUTINE conv_rdtn_unpackdiscstate( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 625 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 626 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 627 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 628 TYPE(conv_rdtn_discretestatetype), INTENT(INOUT) :: outdata 629 INTEGER(IntKi), INTENT( OUT) :: errstat 630 CHARACTER(*), INTENT( OUT) :: errmsg 631 ! Local variables 632 INTEGER(IntKi) :: re_bufsz 633 INTEGER(IntKi) :: re_xferred 634 INTEGER(IntKi) :: re_currsz 635 INTEGER(IntKi) :: db_bufsz 636 INTEGER(IntKi) :: db_xferred 637 INTEGER(IntKi) :: db_currsz 638 INTEGER(IntKi) :: int_bufsz 639 INTEGER(IntKi) :: int_xferred 640 INTEGER(IntKi) :: int_currsz 641 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 642 LOGICAL, ALLOCATABLE :: mask1(:) 643 LOGICAL, ALLOCATABLE :: mask2(:,:) 644 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 645 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 646 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 647 ! buffers to store meshes, if any 648 ! 649 errstat = errid_none 650 errmsg = “” 651 re_xferred = 1 652 db_xferred = 1 653 int_xferred = 1 654 re_bufsz = 0 655 db_bufsz = 0 656 int_bufsz = 0 657 IF ( ALLOCATED(outdata%XDHistory) ) THEN 658 ALLOCATE(mask2(SIZE(outdata%XDHistory,1),SIZE(outdata%XDHistory,2))); mask2 = .true. 659 outdata%XDHistory = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%XDHistory))-1 ),mask2,outdata%XDHistory) 660 DEALLOCATE(mask2) 661 re_xferred = re_xferred + SIZE(outdata%XDHistory) 662 ENDIF 663 outdata%LastTime = dbkibuf( db_xferred ) 664 db_xferred = db_xferred + 1 665 re_xferred = re_xferred-1 666 db_xferred = db_xferred-1 667 int_xferred = int_xferred-1 668 END SUBROUTINE conv_rdtn_unpackdiscstate 669 670 SUBROUTINE conv_rdtn_copyconstrstate( SrcConstrStateData, DstConstrStateData, CtrlCode, ErrStat, ErrMsg ) 671 TYPE(conv_rdtn_constraintstatetype), INTENT(INOUT) :: srcconstrstatedata 672 TYPE(conv_rdtn_constraintstatetype), INTENT(INOUT) :: dstconstrstatedata 673 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 674 INTEGER(IntKi), INTENT( OUT) :: errstat 675 CHARACTER(*), INTENT( OUT) :: errmsg 676 ! Local 677 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 678 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 679 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 680 ! 681 errstat = errid_none 682 errmsg = “” 683 dstconstrstatedata%DummyConstrState = srcconstrstatedata%DummyConstrState 684 END SUBROUTINE conv_rdtn_copyconstrstate 685 686 SUBROUTINE conv_rdtn_destroyconstrstate( ConstrStateData, ErrStat, ErrMsg ) 687 TYPE(conv_rdtn_constraintstatetype), INTENT(INOUT) :: constrstatedata 688 INTEGER(IntKi), INTENT( OUT) :: errstat 689 CHARACTER(*), INTENT( OUT) :: errmsg 690 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 691 ! 692 errstat = errid_none 693 errmsg = “” 694 END SUBROUTINE conv_rdtn_destroyconstrstate 695 696 SUBROUTINE conv_rdtn_packconstrstate( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 697 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 698 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 699 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 700 TYPE(conv_rdtn_constraintstatetype), INTENT(INOUT) :: indata 701 INTEGER(IntKi), INTENT( OUT) :: errstat 702 CHARACTER(*), INTENT( OUT) :: errmsg 703 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 704 ! Local variables 705 INTEGER(IntKi) :: re_bufsz 706 INTEGER(IntKi) :: re_xferred 707 INTEGER(IntKi) :: re_currsz 708 INTEGER(IntKi) :: db_bufsz 709 INTEGER(IntKi) :: db_xferred 710 INTEGER(IntKi) :: db_currsz 711 INTEGER(IntKi) :: int_bufsz 712 INTEGER(IntKi) :: int_xferred 713 INTEGER(IntKi) :: int_currsz 714 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 715 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 716 ! buffers to store meshes, if any 717 onlysize = .false. 718 IF ( present(sizeonly) ) THEN 719 onlysize = sizeonly 720 ENDIF 721 ! 722 errstat = errid_none 723 errmsg = “” 724 re_xferred = 1 725 db_xferred = 1 726 int_xferred = 1 727 re_bufsz = 0 728 db_bufsz = 0 729 int_bufsz = 0 730 re_bufsz = re_bufsz + 1 ! DummyConstrState 731 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 732 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 733 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 734 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(1)-1 ) = (indata%DummyConstrState ) 735 re_xferred = re_xferred + 1 736 END SUBROUTINE conv_rdtn_packconstrstate 737 738 SUBROUTINE conv_rdtn_unpackconstrstate( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 739 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 740 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 741 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 742 TYPE(conv_rdtn_constraintstatetype), INTENT(INOUT) :: outdata 743 INTEGER(IntKi), INTENT( OUT) :: errstat 744 CHARACTER(*), INTENT( OUT) :: errmsg 745 ! Local variables 746 INTEGER(IntKi) :: re_bufsz 747 INTEGER(IntKi) :: re_xferred 748 INTEGER(IntKi) :: re_currsz 749 INTEGER(IntKi) :: db_bufsz 750 INTEGER(IntKi) :: db_xferred 751 INTEGER(IntKi) :: db_currsz 752 INTEGER(IntKi) :: int_bufsz 753 INTEGER(IntKi) :: int_xferred 754 INTEGER(IntKi) :: int_currsz 755 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 756 LOGICAL, ALLOCATABLE :: mask1(:) 757 LOGICAL, ALLOCATABLE :: mask2(:,:) 758 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 759 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 760 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 761 ! buffers to store meshes, if any 762 ! 763 errstat = errid_none 764 errmsg = “” 765 re_xferred = 1 766 db_xferred = 1 767 int_xferred = 1 768 re_bufsz = 0 769 db_bufsz = 0 770 int_bufsz = 0 771 outdata%DummyConstrState = rekibuf( re_xferred ) 772 re_xferred = re_xferred + 1 773 re_xferred = re_xferred-1 774 db_xferred = db_xferred-1 775 int_xferred = int_xferred-1 776 END SUBROUTINE conv_rdtn_unpackconstrstate 777 778 SUBROUTINE conv_rdtn_copyotherstate( SrcOtherStateData, DstOtherStateData, CtrlCode, ErrStat, ErrMsg ) 779 TYPE(conv_rdtn_otherstatetype), INTENT(INOUT) :: srcotherstatedata 780 TYPE(conv_rdtn_otherstatetype), INTENT(INOUT) :: dstotherstatedata 781 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 782 INTEGER(IntKi), INTENT( OUT) :: errstat 783 CHARACTER(*), INTENT( OUT) :: errmsg 784 ! Local 785 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 786 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 787 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 788 ! 789 errstat = errid_none 790 errmsg = “” 791 dstotherstatedata%LastIndRdtn = srcotherstatedata%LastIndRdtn 792 dstotherstatedata%LastIndRdtn2 = srcotherstatedata%LastIndRdtn2 793 dstotherstatedata%IndRdtn = srcotherstatedata%IndRdtn 794 END SUBROUTINE conv_rdtn_copyotherstate 795 796 SUBROUTINE conv_rdtn_destroyotherstate( OtherStateData, ErrStat, ErrMsg ) 797 TYPE(conv_rdtn_otherstatetype), INTENT(INOUT) :: otherstatedata 798 INTEGER(IntKi), INTENT( OUT) :: errstat 799 CHARACTER(*), INTENT( OUT) :: errmsg 800 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 801 ! 802 errstat = errid_none 803 errmsg = “” 804 END SUBROUTINE conv_rdtn_destroyotherstate 805 806 SUBROUTINE conv_rdtn_packotherstate( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 807 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 808 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 809 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 810 TYPE(conv_rdtn_otherstatetype), INTENT(INOUT) :: indata 811 INTEGER(IntKi), INTENT( OUT) :: errstat 812 CHARACTER(*), INTENT( OUT) :: errmsg 813 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 814 ! Local variables 815 INTEGER(IntKi) :: re_bufsz 816 INTEGER(IntKi) :: re_xferred 817 INTEGER(IntKi) :: re_currsz 818 INTEGER(IntKi) :: db_bufsz 819 INTEGER(IntKi) :: db_xferred 820 INTEGER(IntKi) :: db_currsz 821 INTEGER(IntKi) :: int_bufsz 822 INTEGER(IntKi) :: int_xferred 823 INTEGER(IntKi) :: int_currsz 824 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 825 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 826 ! buffers to store meshes, if any 827 onlysize = .false. 828 IF ( present(sizeonly) ) THEN 829 onlysize = sizeonly 830 ENDIF 831 ! 832 errstat = errid_none 833 errmsg = “” 834 re_xferred = 1 835 db_xferred = 1 836 int_xferred = 1 837 re_bufsz = 0 838 db_bufsz = 0 839 int_bufsz = 0 840 int_bufsz = int_bufsz + 1 ! LastIndRdtn 841 int_bufsz = int_bufsz + 1 ! LastIndRdtn2 842 int_bufsz = int_bufsz + 1 ! IndRdtn 843 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 844 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 845 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 846 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%LastIndRdtn ) 847 int_xferred = int_xferred + 1 848 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%LastIndRdtn2 ) 849 int_xferred = int_xferred + 1 850 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%IndRdtn ) 851 int_xferred = int_xferred + 1 852 END SUBROUTINE conv_rdtn_packotherstate 853 854 SUBROUTINE conv_rdtn_unpackotherstate( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 855 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 856 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 857 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 858 TYPE(conv_rdtn_otherstatetype), INTENT(INOUT) :: outdata 859 INTEGER(IntKi), INTENT( OUT) :: errstat 860 CHARACTER(*), INTENT( OUT) :: errmsg 861 ! Local variables 862 INTEGER(IntKi) :: re_bufsz 863 INTEGER(IntKi) :: re_xferred 864 INTEGER(IntKi) :: re_currsz 865 INTEGER(IntKi) :: db_bufsz 866 INTEGER(IntKi) :: db_xferred 867 INTEGER(IntKi) :: db_currsz 868 INTEGER(IntKi) :: int_bufsz 869 INTEGER(IntKi) :: int_xferred 870 INTEGER(IntKi) :: int_currsz 871 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 872 LOGICAL, ALLOCATABLE :: mask1(:) 873 LOGICAL, ALLOCATABLE :: mask2(:,:) 874 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 875 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 876 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 877 ! buffers to store meshes, if any 878 ! 879 errstat = errid_none 880 errmsg = “” 881 re_xferred = 1 882 db_xferred = 1 883 int_xferred = 1 884 re_bufsz = 0 885 db_bufsz = 0 886 int_bufsz = 0 887 outdata%LastIndRdtn = intkibuf( int_xferred ) 888 int_xferred = int_xferred + 1 889 outdata%LastIndRdtn2 = intkibuf( int_xferred ) 890 int_xferred = int_xferred + 1 891 outdata%IndRdtn = intkibuf( int_xferred ) 892 int_xferred = int_xferred + 1 893 re_xferred = re_xferred-1 894 db_xferred = db_xferred-1 895 int_xferred = int_xferred-1 896 END SUBROUTINE conv_rdtn_unpackotherstate 897 898 SUBROUTINE conv_rdtn_copyparam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) 899 TYPE(conv_rdtn_parametertype), INTENT(INOUT) :: srcparamdata 900 TYPE(conv_rdtn_parametertype), INTENT(INOUT) :: dstparamdata 901 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 902 INTEGER(IntKi), INTENT( OUT) :: errstat 903 CHARACTER(*), INTENT( OUT) :: errmsg 904 ! Local 905 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 906 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 907 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 908 ! 909 errstat = errid_none 910 errmsg = “” 911 dstparamdata%DT = srcparamdata%DT 912 dstparamdata%RdtnDT = srcparamdata%RdtnDT 913 IF (ALLOCATED(srcparamdata%RdtnKrnl)) THEN 914 i1_l = lbound(srcparamdata%RdtnKrnl,1) 915 i1_u = ubound(srcparamdata%RdtnKrnl,1) 916 i2_l = lbound(srcparamdata%RdtnKrnl,2) 917 i2_u = ubound(srcparamdata%RdtnKrnl,2) 918 i3_l = lbound(srcparamdata%RdtnKrnl,3) 919 i3_u = ubound(srcparamdata%RdtnKrnl,3) 920 IF (.NOT. ALLOCATED(dstparamdata%RdtnKrnl)) THEN 921 ALLOCATE(dstparamdata%RdtnKrnl(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),stat=errstat) 922 IF (errstat /= 0) THEN 923 errstat = errid_fatal 924 errmsg = ‘Conv_Rdtn_CopyParam: Error allocating DstParamData%RdtnKrnl.’ 925 RETURN 926 END IF 927 END IF 928 dstparamdata%RdtnKrnl = srcparamdata%RdtnKrnl 929 ENDIF 930 dstparamdata%NStepRdtn = srcparamdata%NStepRdtn 931 dstparamdata%NStepRdtn1 = srcparamdata%NStepRdtn1 932 END SUBROUTINE conv_rdtn_copyparam 933 934 SUBROUTINE conv_rdtn_destroyparam( ParamData, ErrStat, ErrMsg ) 935 TYPE(conv_rdtn_parametertype), INTENT(INOUT) :: paramdata 936 INTEGER(IntKi), INTENT( OUT) :: errstat 937 CHARACTER(*), INTENT( OUT) :: errmsg 938 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 939 ! 940 errstat = errid_none 941 errmsg = “” 942 IF (ALLOCATED(paramdata%RdtnKrnl)) THEN 943 DEALLOCATE(paramdata%RdtnKrnl) 944 ENDIF 945 END SUBROUTINE conv_rdtn_destroyparam 946 947 SUBROUTINE conv_rdtn_packparam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 948 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 949 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 950 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 951 TYPE(conv_rdtn_parametertype), INTENT(INOUT) :: indata 952 INTEGER(IntKi), INTENT( OUT) :: errstat 953 CHARACTER(*), INTENT( OUT) :: errmsg 954 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 955 ! Local variables 956 INTEGER(IntKi) :: re_bufsz 957 INTEGER(IntKi) :: re_xferred 958 INTEGER(IntKi) :: re_currsz 959 INTEGER(IntKi) :: db_bufsz 960 INTEGER(IntKi) :: db_xferred 961 INTEGER(IntKi) :: db_currsz 962 INTEGER(IntKi) :: int_bufsz 963 INTEGER(IntKi) :: int_xferred 964 INTEGER(IntKi) :: int_currsz 965 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 966 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 967 ! buffers to store meshes, if any 968 onlysize = .false. 969 IF ( present(sizeonly) ) THEN 970 onlysize = sizeonly 971 ENDIF 972 ! 973 errstat = errid_none 974 errmsg = “” 975 re_xferred = 1 976 db_xferred = 1 977 int_xferred = 1 978 re_bufsz = 0 979 db_bufsz = 0 980 int_bufsz = 0 981 db_bufsz = db_bufsz + 1 ! DT 982 db_bufsz = db_bufsz + 1 ! RdtnDT 983 re_bufsz = re_bufsz + SIZE( indata%RdtnKrnl ) ! RdtnKrnl 984 int_bufsz = int_bufsz + 1 ! NStepRdtn 985 int_bufsz = int_bufsz + 1 ! NStepRdtn1 986 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 987 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 988 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 989 IF ( .NOT. onlysize ) dbkibuf( db_xferred:db_xferred+(1)-1 ) = (indata%DT ) 990 db_xferred = db_xferred + 1 991 IF ( .NOT. onlysize ) dbkibuf( db_xferred:db_xferred+(1)-1 ) = (indata%RdtnDT ) 992 db_xferred = db_xferred + 1 993 IF ( ALLOCATED(indata%RdtnKrnl) ) THEN 994 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%RdtnKrnl))-1 ) = pack(indata%RdtnKrnl ,.true.) 995 re_xferred = re_xferred + SIZE(indata%RdtnKrnl) 996 ENDIF 997 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%NStepRdtn ) 998 int_xferred = int_xferred + 1 999 IF ( .NOT. onlysize ) intkibuf( int_xferred:int_xferred+(1)-1 ) = (indata%NStepRdtn1 ) 1000 int_xferred = int_xferred + 1 1001 END SUBROUTINE conv_rdtn_packparam 1002 1003 SUBROUTINE conv_rdtn_unpackparam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 1004 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 1005 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 1006 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 1007 TYPE(conv_rdtn_parametertype), INTENT(INOUT) :: outdata 1008 INTEGER(IntKi), INTENT( OUT) :: errstat 1009 CHARACTER(*), INTENT( OUT) :: errmsg 1010 ! Local variables 1011 INTEGER(IntKi) :: re_bufsz 1012 INTEGER(IntKi) :: re_xferred 1013 INTEGER(IntKi) :: re_currsz 1014 INTEGER(IntKi) :: db_bufsz 1015 INTEGER(IntKi) :: db_xferred 1016 INTEGER(IntKi) :: db_currsz 1017 INTEGER(IntKi) :: int_bufsz 1018 INTEGER(IntKi) :: int_xferred 1019 INTEGER(IntKi) :: int_currsz 1020 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 1021 LOGICAL, ALLOCATABLE :: mask1(:) 1022 LOGICAL, ALLOCATABLE :: mask2(:,:) 1023 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 1024 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 1025 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 1026 ! buffers to store meshes, if any 1027 ! 1028 errstat = errid_none 1029 errmsg = “” 1030 re_xferred = 1 1031 db_xferred = 1 1032 int_xferred = 1 1033 re_bufsz = 0 1034 db_bufsz = 0 1035 int_bufsz = 0 1036 outdata%DT = dbkibuf( db_xferred ) 1037 db_xferred = db_xferred + 1 1038 outdata%RdtnDT = dbkibuf( db_xferred ) 1039 db_xferred = db_xferred + 1 1040 IF ( ALLOCATED(outdata%RdtnKrnl) ) THEN 1041 ALLOCATE(mask3(SIZE(outdata%RdtnKrnl,1),SIZE(outdata%RdtnKrnl,2),SIZE(outdata%RdtnKrnl,3))); mask3 = .true. 1042 outdata%RdtnKrnl = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%RdtnKrnl))-1 ),mask3,outdata%RdtnKrnl) 1043 DEALLOCATE(mask3) 1044 re_xferred = re_xferred + SIZE(outdata%RdtnKrnl) 1045 ENDIF 1046 outdata%NStepRdtn = intkibuf( int_xferred ) 1047 int_xferred = int_xferred + 1 1048 outdata%NStepRdtn1 = intkibuf( int_xferred ) 1049 int_xferred = int_xferred + 1 1050 re_xferred = re_xferred-1 1051 db_xferred = db_xferred-1 1052 int_xferred = int_xferred-1 1053 END SUBROUTINE conv_rdtn_unpackparam 1054 1055 SUBROUTINE conv_rdtn_copyinput( SrcInputData, DstInputData, CtrlCode, ErrStat, ErrMsg ) 1056 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: srcinputdata 1057 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: dstinputdata 1058 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 1059 INTEGER(IntKi), INTENT( OUT) :: errstat 1060 CHARACTER(*), INTENT( OUT) :: errmsg 1061 ! Local 1062 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 1063 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 1064 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 1065 ! 1066 errstat = errid_none 1067 errmsg = “” 1068 dstinputdata%Velocity = srcinputdata%Velocity 1069 END SUBROUTINE conv_rdtn_copyinput 1070 1071 SUBROUTINE conv_rdtn_destroyinput( InputData, ErrStat, ErrMsg ) 1072 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: inputdata 1073 INTEGER(IntKi), INTENT( OUT) :: errstat 1074 CHARACTER(*), INTENT( OUT) :: errmsg 1075 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 1076 ! 1077 errstat = errid_none 1078 errmsg = “” 1079 END SUBROUTINE conv_rdtn_destroyinput 1080 1081 SUBROUTINE conv_rdtn_packinput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 1082 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 1083 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 1084 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 1085 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: indata 1086 INTEGER(IntKi), INTENT( OUT) :: errstat 1087 CHARACTER(*), INTENT( OUT) :: errmsg 1088 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 1089 ! Local variables 1090 INTEGER(IntKi) :: re_bufsz 1091 INTEGER(IntKi) :: re_xferred 1092 INTEGER(IntKi) :: re_currsz 1093 INTEGER(IntKi) :: db_bufsz 1094 INTEGER(IntKi) :: db_xferred 1095 INTEGER(IntKi) :: db_currsz 1096 INTEGER(IntKi) :: int_bufsz 1097 INTEGER(IntKi) :: int_xferred 1098 INTEGER(IntKi) :: int_currsz 1099 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 1100 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 1101 ! buffers to store meshes, if any 1102 onlysize = .false. 1103 IF ( present(sizeonly) ) THEN 1104 onlysize = sizeonly 1105 ENDIF 1106 ! 1107 errstat = errid_none 1108 errmsg = “” 1109 re_xferred = 1 1110 db_xferred = 1 1111 int_xferred = 1 1112 re_bufsz = 0 1113 db_bufsz = 0 1114 int_bufsz = 0 1115 re_bufsz = re_bufsz + SIZE( indata%Velocity ) ! Velocity 1116 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 1117 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 1118 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 1119 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%Velocity))-1 ) = pack(indata%Velocity ,.true.) 1120 re_xferred = re_xferred + SIZE(indata%Velocity) 1121 END SUBROUTINE conv_rdtn_packinput 1122 1123 SUBROUTINE conv_rdtn_unpackinput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 1124 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 1125 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 1126 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 1127 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: outdata 1128 INTEGER(IntKi), INTENT( OUT) :: errstat 1129 CHARACTER(*), INTENT( OUT) :: errmsg 1130 ! Local variables 1131 INTEGER(IntKi) :: re_bufsz 1132 INTEGER(IntKi) :: re_xferred 1133 INTEGER(IntKi) :: re_currsz 1134 INTEGER(IntKi) :: db_bufsz 1135 INTEGER(IntKi) :: db_xferred 1136 INTEGER(IntKi) :: db_currsz 1137 INTEGER(IntKi) :: int_bufsz 1138 INTEGER(IntKi) :: int_xferred 1139 INTEGER(IntKi) :: int_currsz 1140 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 1141 LOGICAL, ALLOCATABLE :: mask1(:) 1142 LOGICAL, ALLOCATABLE :: mask2(:,:) 1143 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 1144 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 1145 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 1146 ! buffers to store meshes, if any 1147 ! 1148 errstat = errid_none 1149 errmsg = “” 1150 re_xferred = 1 1151 db_xferred = 1 1152 int_xferred = 1 1153 re_bufsz = 0 1154 db_bufsz = 0 1155 int_bufsz = 0 1156 ALLOCATE(mask1(SIZE(outdata%Velocity,1))); mask1 = .true. 1157 outdata%Velocity = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%Velocity))-1 ),mask1,outdata%Velocity) 1158 DEALLOCATE(mask1) 1159 re_xferred = re_xferred + SIZE(outdata%Velocity) 1160 re_xferred = re_xferred-1 1161 db_xferred = db_xferred-1 1162 int_xferred = int_xferred-1 1163 END SUBROUTINE conv_rdtn_unpackinput 1164 1165 SUBROUTINE conv_rdtn_copyoutput( SrcOutputData, DstOutputData, CtrlCode, ErrStat, ErrMsg ) 1166 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: srcoutputdata 1167 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: dstoutputdata 1168 INTEGER(IntKi), INTENT(IN ) :: ctrlcode 1169 INTEGER(IntKi), INTENT( OUT) :: errstat 1170 CHARACTER(*), INTENT( OUT) :: errmsg 1171 ! Local 1172 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5,j,k 1173 INTEGER(IntKi) :: i1_l,i2_l,i3_l,i4_l,i5_l ! lower bounds for an array dimension 1174 INTEGER(IntKi) :: i1_u,i2_u,i3_u,i4_u,i5_u ! upper bounds for an array dimension 1175 ! 1176 errstat = errid_none 1177 errmsg = “” 1178 dstoutputdata%F_Rdtn = srcoutputdata%F_Rdtn 1179 END SUBROUTINE conv_rdtn_copyoutput 1180 1181 SUBROUTINE conv_rdtn_destroyoutput( OutputData, ErrStat, ErrMsg ) 1182 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: outputdata 1183 INTEGER(IntKi), INTENT( OUT) :: errstat 1184 CHARACTER(*), INTENT( OUT) :: errmsg 1185 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 1186 ! 1187 errstat = errid_none 1188 errmsg = “” 1189 END SUBROUTINE conv_rdtn_destroyoutput 1190 1191 SUBROUTINE conv_rdtn_packoutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly ) 1192 REAL(ReKi), ALLOCATABLE, INTENT( OUT) :: rekibuf(:) 1193 REAL(DbKi), ALLOCATABLE, INTENT( OUT) :: dbkibuf(:) 1194 INTEGER(IntKi), ALLOCATABLE, INTENT( OUT) :: intkibuf(:) 1195 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: indata 1196 INTEGER(IntKi), INTENT( OUT) :: errstat 1197 CHARACTER(*), INTENT( OUT) :: errmsg 1198 LOGICAL,OPTIONAL, INTENT(IN ) :: sizeonly 1199 ! Local variables 1200 INTEGER(IntKi) :: re_bufsz 1201 INTEGER(IntKi) :: re_xferred 1202 INTEGER(IntKi) :: re_currsz 1203 INTEGER(IntKi) :: db_bufsz 1204 INTEGER(IntKi) :: db_xferred 1205 INTEGER(IntKi) :: db_currsz 1206 INTEGER(IntKi) :: int_bufsz 1207 INTEGER(IntKi) :: int_xferred 1208 INTEGER(IntKi) :: int_currsz 1209 INTEGER(IntKi) :: i,i1,i2,i3,i4,i5 1210 LOGICAL :: onlysize ! if present and true, do not pack, just allocate buffers 1211 ! buffers to store meshes, if any 1212 onlysize = .false. 1213 IF ( present(sizeonly) ) THEN 1214 onlysize = sizeonly 1215 ENDIF 1216 ! 1217 errstat = errid_none 1218 errmsg = “” 1219 re_xferred = 1 1220 db_xferred = 1 1221 int_xferred = 1 1222 re_bufsz = 0 1223 db_bufsz = 0 1224 int_bufsz = 0 1225 re_bufsz = re_bufsz + SIZE( indata%F_Rdtn ) ! F_Rdtn 1226 IF ( re_bufsz .GT. 0 ) ALLOCATE( rekibuf( re_bufsz ) ) 1227 IF ( db_bufsz .GT. 0 ) ALLOCATE( dbkibuf( db_bufsz ) ) 1228 IF ( int_bufsz .GT. 0 ) ALLOCATE( intkibuf( int_bufsz ) ) 1229 IF ( .NOT. onlysize ) rekibuf( re_xferred:re_xferred+(SIZE(indata%F_Rdtn))-1 ) = pack(indata%F_Rdtn ,.true.) 1230 re_xferred = re_xferred + SIZE(indata%F_Rdtn) 1231 END SUBROUTINE conv_rdtn_packoutput 1232 1233 SUBROUTINE conv_rdtn_unpackoutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) 1234 REAL(ReKi), ALLOCATABLE, INTENT(IN ) :: rekibuf(:) 1235 REAL(DbKi), ALLOCATABLE, INTENT(IN ) :: dbkibuf(:) 1236 INTEGER(IntKi), ALLOCATABLE, INTENT(IN ) :: intkibuf(:) 1237 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: outdata 1238 INTEGER(IntKi), INTENT( OUT) :: errstat 1239 CHARACTER(*), INTENT( OUT) :: errmsg 1240 ! Local variables 1241 INTEGER(IntKi) :: re_bufsz 1242 INTEGER(IntKi) :: re_xferred 1243 INTEGER(IntKi) :: re_currsz 1244 INTEGER(IntKi) :: db_bufsz 1245 INTEGER(IntKi) :: db_xferred 1246 INTEGER(IntKi) :: db_currsz 1247 INTEGER(IntKi) :: int_bufsz 1248 INTEGER(IntKi) :: int_xferred 1249 INTEGER(IntKi) :: int_currsz 1250 INTEGER(IntKi) :: i, i1, i2, i3, i4, i5 1251 LOGICAL, ALLOCATABLE :: mask1(:) 1252 LOGICAL, ALLOCATABLE :: mask2(:,:) 1253 LOGICAL, ALLOCATABLE :: mask3(:,:,:) 1254 LOGICAL, ALLOCATABLE :: mask4(:,:,:,:) 1255 LOGICAL, ALLOCATABLE :: mask5(:,:,:,:,:) 1256 ! buffers to store meshes, if any 1257 ! 1258 errstat = errid_none 1259 errmsg = “” 1260 re_xferred = 1 1261 db_xferred = 1 1262 int_xferred = 1 1263 re_bufsz = 0 1264 db_bufsz = 0 1265 int_bufsz = 0 1266 ALLOCATE(mask1(SIZE(outdata%F_Rdtn,1))); mask1 = .true. 1267 outdata%F_Rdtn = unpack(rekibuf( re_xferred:re_xferred+(SIZE(outdata%F_Rdtn))-1 ),mask1,outdata%F_Rdtn) 1268 DEALLOCATE(mask1) 1269 re_xferred = re_xferred + SIZE(outdata%F_Rdtn) 1270 re_xferred = re_xferred-1 1271 db_xferred = db_xferred-1 1272 int_xferred = int_xferred-1 1273 END SUBROUTINE conv_rdtn_unpackoutput 1274 1275 1276 SUBROUTINE conv_rdtn_input_extrapinterp(u, tin, u_out, tin_out, ErrStat, ErrMsg ) 1277 ! 1278 ! This subroutine calculates a extrapolated (or interpolated) input u_out at time t_out, from previous/future time 1279 ! values of u (which has values associated with times in t). Order of the interpolation is given by the size of u 1280 ! 1281 ! expressions below based on either 1282 ! 1283 ! f(t) = a 1284 ! f(t) = a + b * t, or 1285 ! f(t) = a + b * t + c * t**2 1286 ! 1287 ! where a, b and c are determined as the solution to 1288 ! f(t1) = u1, f(t2) = u2, f(t3) = u3 (as appropriate) 1289 ! 1290 !…………………………………………………………………………………………………………………. 1291 1292 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: u(:) ! Inputs at t1 > t2 > t3 1293 REAL(DbKi), INTENT(IN ) :: tin(:) ! Times associated with the inputs 1294 TYPE(conv_rdtn_inputtype), INTENT(INOUT) :: u_out ! Inputs at tin_out 1295 REAL(DbKi), INTENT(IN ) :: tin_out ! time to be extrap/interp’d to 1296 INTEGER(IntKi), INTENT( OUT) :: errstat ! Error status of the operation 1297 CHARACTER(*), INTENT( OUT) :: errmsg ! Error message if ErrStat /= ErrID_None 1298 ! local variables 1299 REAL(DbKi) :: t(size(tin)) ! Times associated with the inputs 1300 REAL(DbKi) :: t_out ! Time to which to be extrap/interpd 1301 INTEGER(IntKi) :: order ! order of polynomial fit (max 2) 1302 REAL(DbKi) :: b0 ! temporary for extrapolation/interpolation 1303 REAL(DbKi) :: c0 ! temporary for extrapolation/interpolation 1304 REAL(DbKi),ALLOCATABLE,DIMENSION(:) :: b1 ! temporary for extrapolation/interpolation 1305 REAL(DbKi),ALLOCATABLE,DIMENSION(:) :: c1 ! temporary for extrapolation/interpolation 1306 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:) :: b2 ! temporary for extrapolation/interpolation 1307 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:) :: c2 ! temporary for extrapolation/interpolation 1308 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:) :: b3 ! temporary for extrapolation/interpolation 1309 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:) :: c3 ! temporary for extrapolation/interpolation 1310 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:) :: b4 ! temporary for extrapolation/interpolation 1311 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:) :: c4 ! temporary for extrapolation/interpolation 1312 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:,:):: b5 ! temporary for extrapolation/interpolation 1313 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:,:):: c5 ! temporary for extrapolation/interpolation 1314 INTEGER :: i01 ! dim1 level 0 counter variable for arrays of ddts 1315 INTEGER :: i11 ! dim1 level 1 counter variable for arrays of ddts 1316 INTEGER :: i21 ! dim1 level 2 counter variable for arrays of ddts 1317 INTEGER :: i31 ! dim1 level 3 counter variable for arrays of ddts 1318 INTEGER :: i41 ! dim1 level 4 counter variable for arrays of ddts 1319 INTEGER :: i51 ! dim1 level 5 counter variable for arrays of ddts 1320 INTEGER :: i61 ! dim1 level 6 counter variable for arrays of ddts 1321 INTEGER :: i71 ! dim1 level 7 counter variable for arrays of ddts 1322 INTEGER :: i81 ! dim1 level 8 counter variable for arrays of ddts 1323 INTEGER :: i91 ! dim1 level 9 counter variable for arrays of ddts 1324 INTEGER :: i02 ! dim2 level 0 counter variable for arrays of ddts 1325 INTEGER :: i12 ! dim2 level 1 counter variable for arrays of ddts 1326 INTEGER :: i22 ! dim2 level 2 counter variable for arrays of ddts 1327 INTEGER :: i32 ! dim2 level 3 counter variable for arrays of ddts 1328 INTEGER :: i42 ! dim2 level 4 counter variable for arrays of ddts 1329 INTEGER :: i52 ! dim2 level 5 counter variable for arrays of ddts 1330 INTEGER :: i62 ! dim2 level 6 counter variable for arrays of ddts 1331 INTEGER :: i72 ! dim2 level 7 counter variable for arrays of ddts 1332 INTEGER :: i82 ! dim2 level 8 counter variable for arrays of ddts 1333 INTEGER :: i92 ! dim2 level 9 counter variable for arrays of ddts 1334 INTEGER :: i03 ! dim3 level 0 counter variable for arrays of ddts 1335 INTEGER :: i13 ! dim3 level 1 counter variable for arrays of ddts 1336 INTEGER :: i23 ! dim3 level 2 counter variable for arrays of ddts 1337 INTEGER :: i33 ! dim3 level 3 counter variable for arrays of ddts 1338 INTEGER :: i43 ! dim3 level 4 counter variable for arrays of ddts 1339 INTEGER :: i53 ! dim3 level 5 counter variable for arrays of ddts 1340 INTEGER :: i63 ! dim3 level 6 counter variable for arrays of ddts 1341 INTEGER :: i73 ! dim3 level 7 counter variable for arrays of ddts 1342 INTEGER :: i83 ! dim3 level 8 counter variable for arrays of ddts 1343 INTEGER :: i93 ! dim3 level 9 counter variable for arrays of ddts 1344 INTEGER :: i04 ! dim4 level 0 counter variable for arrays of ddts 1345 INTEGER :: i14 ! dim4 level 1 counter variable for arrays of ddts 1346 INTEGER :: i24 ! dim4 level 2 counter variable for arrays of ddts 1347 INTEGER :: i34 ! dim4 level 3 counter variable for arrays of ddts 1348 INTEGER :: i44 ! dim4 level 4 counter variable for arrays of ddts 1349 INTEGER :: i54 ! dim4 level 5 counter variable for arrays of ddts 1350 INTEGER :: i64 ! dim4 level 6 counter variable for arrays of ddts 1351 INTEGER :: i74 ! dim4 level 7 counter variable for arrays of ddts 1352 INTEGER :: i84 ! dim4 level 8 counter variable for arrays of ddts 1353 INTEGER :: i94 ! dim4 level 9 counter variable for arrays of ddts 1354 INTEGER :: i05 ! dim5 level 0 counter variable for arrays of ddts 1355 INTEGER :: i15 ! dim5 level 1 counter variable for arrays of ddts 1356 INTEGER :: i25 ! dim5 level 2 counter variable for arrays of ddts 1357 INTEGER :: i35 ! dim5 level 3 counter variable for arrays of ddts 1358 INTEGER :: i45 ! dim5 level 4 counter variable for arrays of ddts 1359 INTEGER :: i55 ! dim5 level 5 counter variable for arrays of ddts 1360 INTEGER :: i65 ! dim5 level 6 counter variable for arrays of ddts 1361 INTEGER :: i75 ! dim5 level 7 counter variable for arrays of ddts 1362 INTEGER :: i85 ! dim5 level 8 counter variable for arrays of ddts 1363 INTEGER :: i95 ! dim5 level 9 counter variable for arrays of ddts 1364 ! Initialize ErrStat 1365 errstat = errid_none 1366 errmsg = “” 1367 ! we’ll subtract a constant from the times to resolve some 1368 ! numerical issues when t gets large (and to simplify the equations) 1369 t = tin – tin(1) 1370 t_out = tin_out – tin(1) 1371 1372 if ( size(t) .ne. size(u)) then 1373 errstat = errid_fatal 1374 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: size(t) must equal size(u) ‘ 1375 RETURN 1376 endif 1377 if (size(u) .gt. 3) then 1378 errstat = errid_fatal 1379 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: size(u) must be less than 4 ‘ 1380 RETURN 1381 endif 1382 order = SIZE(u) – 1 1383 IF ( order .eq. 0 ) THEN 1384 u_out%Velocity = u(1)%Velocity 1385 ELSE IF ( order .eq. 1 ) THEN 1386 IF ( equalrealnos( t(1), t(2) ) ) THEN 1387 errstat = errid_fatal 1388 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: t(1) must not equal t(2) to avoid a division-by-zero error.’ 1389 RETURN 1390 END IF 1391 ALLOCATE(b1(SIZE(u_out%Velocity,1))) 1392 ALLOCATE(c1(SIZE(u_out%Velocity,1))) 1393 b1 = -(u(1)%Velocity – u(2)%Velocity)/t(2) 1394 u_out%Velocity = u(1)%Velocity + b1 * t_out 1395 DEALLOCATE(b1) 1396 DEALLOCATE(c1) 1397 ELSE IF ( order .eq. 2 ) THEN 1398 IF ( equalrealnos( t(1), t(2) ) ) THEN 1399 errstat = errid_fatal 1400 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: t(1) must not equal t(2) to avoid a division-by-zero error.’ 1401 RETURN 1402 END IF 1403 IF ( equalrealnos( t(2), t(3) ) ) THEN 1404 errstat = errid_fatal 1405 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: t(2) must not equal t(3) to avoid a division-by-zero error.’ 1406 RETURN 1407 END IF 1408 IF ( equalrealnos( t(1), t(3) ) ) THEN 1409 errstat = errid_fatal 1410 errmsg = ‘ Error in Conv_Rdtn_Input_ExtrapInterp: t(1) must not equal t(3) to avoid a division-by-zero error.’ 1411 RETURN 1412 END IF 1413 ALLOCATE(b1(SIZE(u_out%Velocity,1))) 1414 ALLOCATE(c1(SIZE(u_out%Velocity,1))) 1415 b1 = (t(3)**2*(u(1)%Velocity – u(2)%Velocity) + t(2)**2*(-u(1)%Velocity + u(3)%Velocity))/(t(2)*t(3)*(t(2) – t(3))) 1416 c1 = ( (t(2)-t(3))*u(1)%Velocity + t(3)*u(2)%Velocity – t(2)*u(3)%Velocity ) / (t(2)*t(3)*(t(2) – t(3))) 1417 u_out%Velocity = u(1)%Velocity + b1 * t_out + c1 * t_out**2 1418 DEALLOCATE(b1) 1419 DEALLOCATE(c1) 1420 ELSE 1421 errstat = errid_fatal 1422 errmsg = ‘ order must be less than 3 in Conv_Rdtn_Input_ExtrapInterp ‘ 1423 RETURN 1424 ENDIF 1425 END SUBROUTINE conv_rdtn_input_extrapinterp 1426 1427 1428 SUBROUTINE conv_rdtn_output_extrapinterp(u, tin, u_out, tin_out, ErrStat, ErrMsg ) 1429 ! 1430 ! This subroutine calculates a extrapolated (or interpolated) input u_out at time t_out, from previous/future time 1431 ! values of u (which has values associated with times in t). Order of the interpolation is given by the size of u 1432 ! 1433 ! expressions below based on either 1434 ! 1435 ! f(t) = a 1436 ! f(t) = a + b * t, or 1437 ! f(t) = a + b * t + c * t**2 1438 ! 1439 ! where a, b and c are determined as the solution to 1440 ! f(t1) = u1, f(t2) = u2, f(t3) = u3 (as appropriate) 1441 ! 1442 !…………………………………………………………………………………………………………………. 1443 1444 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: u(:) ! Inputs at t1 > t2 > t3 1445 REAL(DbKi), INTENT(IN ) :: tin(:) ! Times associated with the inputs 1446 TYPE(conv_rdtn_outputtype), INTENT(INOUT) :: u_out ! Inputs at tin_out 1447 REAL(DbKi), INTENT(IN ) :: tin_out ! time to be extrap/interp’d to 1448 INTEGER(IntKi), INTENT( OUT) :: errstat ! Error status of the operation 1449 CHARACTER(*), INTENT( OUT) :: errmsg ! Error message if ErrStat /= ErrID_None 1450 ! local variables 1451 REAL(DbKi) :: t(size(tin)) ! Times associated with the inputs 1452 REAL(DbKi) :: t_out ! Time to which to be extrap/interpd 1453 INTEGER(IntKi) :: order ! order of polynomial fit (max 2) 1454 REAL(DbKi) :: b0 ! temporary for extrapolation/interpolation 1455 REAL(DbKi) :: c0 ! temporary for extrapolation/interpolation 1456 REAL(DbKi),ALLOCATABLE,DIMENSION(:) :: b1 ! temporary for extrapolation/interpolation 1457 REAL(DbKi),ALLOCATABLE,DIMENSION(:) :: c1 ! temporary for extrapolation/interpolation 1458 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:) :: b2 ! temporary for extrapolation/interpolation 1459 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:) :: c2 ! temporary for extrapolation/interpolation 1460 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:) :: b3 ! temporary for extrapolation/interpolation 1461 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:) :: c3 ! temporary for extrapolation/interpolation 1462 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:) :: b4 ! temporary for extrapolation/interpolation 1463 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:) :: c4 ! temporary for extrapolation/interpolation 1464 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:,:):: b5 ! temporary for extrapolation/interpolation 1465 REAL(DbKi),ALLOCATABLE,DIMENSION(:,:,:,:,:):: c5 ! temporary for extrapolation/interpolation 1466 INTEGER :: i01 ! dim1 level 0 counter variable for arrays of ddts 1467 INTEGER :: i11 ! dim1 level 1 counter variable for arrays of ddts 1468 INTEGER :: i21 ! dim1 level 2 counter variable for arrays of ddts 1469 INTEGER :: i31 ! dim1 level 3 counter variable for arrays of ddts 1470 INTEGER :: i41 ! dim1 level 4 counter variable for arrays of ddts 1471 INTEGER :: i51 ! dim1 level 5 counter variable for arrays of ddts 1472 INTEGER :: i61 ! dim1 level 6 counter variable for arrays of ddts 1473 INTEGER :: i71 ! dim1 level 7 counter variable for arrays of ddts 1474 INTEGER :: i81 ! dim1 level 8 counter variable for arrays of ddts 1475 INTEGER :: i91 ! dim1 level 9 counter variable for arrays of ddts 1476 INTEGER :: i02 ! dim2 level 0 counter variable for arrays of ddts 1477 INTEGER :: i12 ! dim2 level 1 counter variable for arrays of ddts 1478 INTEGER :: i22 ! dim2 level 2 counter variable for arrays of ddts 1479 INTEGER :: i32 ! dim2 level 3 counter variable for arrays of ddts 1480 INTEGER :: i42 ! dim2 level 4 counter variable for arrays of ddts 1481 INTEGER :: i52 ! dim2 level 5 counter variable for arrays of ddts 1482 INTEGER :: i62 ! dim2 level 6 counter variable for arrays of ddts 1483 INTEGER :: i72 ! dim2 level 7 counter variable for arrays of ddts 1484 INTEGER :: i82 ! dim2 level 8 counter variable for arrays of ddts 1485 INTEGER :: i92 ! dim2 level 9 counter variable for arrays of ddts 1486 INTEGER :: i03 ! dim3 level 0 counter variable for arrays of ddts 1487 INTEGER :: i13 ! dim3 level 1 counter variable for arrays of ddts 1488 INTEGER :: i23 ! dim3 level 2 counter variable for arrays of ddts 1489 INTEGER :: i33 ! dim3 level 3 counter variable for arrays of ddts 1490 INTEGER :: i43 ! dim3 level 4 counter variable for arrays of ddts 1491 INTEGER :: i53 ! dim3 level 5 counter variable for arrays of ddts 1492 INTEGER :: i63 ! dim3 level 6 counter variable for arrays of ddts 1493 INTEGER :: i73 ! dim3 level 7 counter variable for arrays of ddts 1494 INTEGER :: i83 ! dim3 level 8 counter variable for arrays of ddts 1495 INTEGER :: i93 ! dim3 level 9 counter variable for arrays of ddts 1496 INTEGER :: i04 ! dim4 level 0 counter variable for arrays of ddts 1497 INTEGER :: i14 ! dim4 level 1 counter variable for arrays of ddts 1498 INTEGER :: i24 ! dim4 level 2 counter variable for arrays of ddts 1499 INTEGER :: i34 ! dim4 level 3 counter variable for arrays of ddts 1500 INTEGER :: i44 ! dim4 level 4 counter variable for arrays of ddts 1501 INTEGER :: i54 ! dim4 level 5 counter variable for arrays of ddts 1502 INTEGER :: i64 ! dim4 level 6 counter variable for arrays of ddts 1503 INTEGER :: i74 ! dim4 level 7 counter variable for arrays of ddts 1504 INTEGER :: i84 ! dim4 level 8 counter variable for arrays of ddts 1505 INTEGER :: i94 ! dim4 level 9 counter variable for arrays of ddts 1506 INTEGER :: i05 ! dim5 level 0 counter variable for arrays of ddts 1507 INTEGER :: i15 ! dim5 level 1 counter variable for arrays of ddts 1508 INTEGER :: i25 ! dim5 level 2 counter variable for arrays of ddts 1509 INTEGER :: i35 ! dim5 level 3 counter variable for arrays of ddts 1510 INTEGER :: i45 ! dim5 level 4 counter variable for arrays of ddts 1511 INTEGER :: i55 ! dim5 level 5 counter variable for arrays of ddts 1512 INTEGER :: i65 ! dim5 level 6 counter variable for arrays of ddts 1513 INTEGER :: i75 ! dim5 level 7 counter variable for arrays of ddts 1514 INTEGER :: i85 ! dim5 level 8 counter variable for arrays of ddts 1515 INTEGER :: i95 ! dim5 level 9 counter variable for arrays of ddts 1516 ! Initialize ErrStat 1517 errstat = errid_none 1518 errmsg = “” 1519 ! we’ll subtract a constant from the times to resolve some 1520 ! numerical issues when t gets large (and to simplify the equations) 1521 t = tin – tin(1) 1522 t_out = tin_out – tin(1) 1523 1524 if ( size(t) .ne. size(u)) then 1525 errstat = errid_fatal 1526 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: size(t) must equal size(u) ‘ 1527 RETURN 1528 endif 1529 if (size(u) .gt. 3) then 1530 errstat = errid_fatal 1531 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: size(u) must be less than 4 ‘ 1532 RETURN 1533 endif 1534 order = SIZE(u) – 1 1535 IF ( order .eq. 0 ) THEN 1536 u_out%F_Rdtn = u(1)%F_Rdtn 1537 ELSE IF ( order .eq. 1 ) THEN 1538 IF ( equalrealnos( t(1), t(2) ) ) THEN 1539 errstat = errid_fatal 1540 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: t(1) must not equal t(2) to avoid a division-by-zero error.’ 1541 RETURN 1542 END IF 1543 ALLOCATE(b1(SIZE(u_out%F_Rdtn,1))) 1544 ALLOCATE(c1(SIZE(u_out%F_Rdtn,1))) 1545 b1 = -(u(1)%F_Rdtn – u(2)%F_Rdtn)/t(2) 1546 u_out%F_Rdtn = u(1)%F_Rdtn + b1 * t_out 1547 DEALLOCATE(b1) 1548 DEALLOCATE(c1) 1549 ELSE IF ( order .eq. 2 ) THEN 1550 IF ( equalrealnos( t(1), t(2) ) ) THEN 1551 errstat = errid_fatal 1552 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: t(1) must not equal t(2) to avoid a division-by-zero error.’ 1553 RETURN 1554 END IF 1555 IF ( equalrealnos( t(2), t(3) ) ) THEN 1556 errstat = errid_fatal 1557 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: t(2) must not equal t(3) to avoid a division-by-zero error.’ 1558 RETURN 1559 END IF 1560 IF ( equalrealnos( t(1), t(3) ) ) THEN 1561 errstat = errid_fatal 1562 errmsg = ‘ Error in Conv_Rdtn_Output_ExtrapInterp: t(1) must not equal t(3) to avoid a division-by-zero error.’ 1563 RETURN 1564 END IF 1565 ALLOCATE(b1(SIZE(u_out%F_Rdtn,1))) 1566 ALLOCATE(c1(SIZE(u_out%F_Rdtn,1))) 1567 b1 = (t(3)**2*(u(1)%F_Rdtn – u(2)%F_Rdtn) + t(2)**2*(-u(1)%F_Rdtn + u(3)%F_Rdtn))/(t(2)*t(3)*(t(2) – t(3))) 1568 c1 = ( (t(2)-t(3))*u(1)%F_Rdtn + t(3)*u(2)%F_Rdtn – t(2)*u(3)%F_Rdtn ) / (t(2)*t(3)*(t(2) – t(3))) 1569 u_out%F_Rdtn = u(1)%F_Rdtn + b1 * t_out + c1 * t_out**2 1570 DEALLOCATE(b1) 1571 DEALLOCATE(c1) 1572 ELSE 1573 errstat = errid_fatal 1574 errmsg = ‘ order must be less than 3 in Conv_Rdtn_Output_ExtrapInterp ‘ 1575 RETURN 1576 ENDIF 1577 END SUBROUTINE conv_rdtn_output_extrapinterp 1578 1579 END MODULE conv_radiation_types 1580 !ENDOFREGISTRYGENERATEDFILE source Conv_Radiation_Types.f90 Ge111