text:
!STARTOFREGISTRYGENERATEDFILE 'IfW_BladedFFWind_Types.f90'
!
! WARNING This file is generated automatically by the FAST registry.
! Do not edit.  Your changes to this file will be lost.
!
! FAST Registry
!*********************************************************************************************************************************
! IfW_BladedFFWind_Types
!.................................................................................................................................
! This file is part of IfW_BladedFFWind.
!
! Copyright (C) 2012-2016 National Renewable Energy Laboratory
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
!     http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
!
!
! W A R N I N G : This file was automatically generated from the FAST registry.  Changes made to this file may be lost.
!
!*********************************************************************************************************************************
!> This module contains the user-defined types needed in IfW_BladedFFWind. It also contains copy, destroy, pack, and
!! unpack routines associated with each defined data type. This code is automatically generated by the FAST Registry.
MODULE IfW_BladedFFWind_Types
!---------------------------------------------------------------------------------------------------------------------------------
USE IfW_FFWind_Base_Types
USE NWTC_Library
IMPLICIT NONE
! =========  IfW_BladedFFWind_InitInputType  =======
  TYPE, PUBLIC :: IfW_BladedFFWind_InitInputType
    CHARACTER(1024)  :: WindFileName      !< Name of the wind file to use [-]
    LOGICAL  :: TowerFileExist      !< Tower file exists [-]
    INTEGER(IntKi)  :: SumFileUnit      !< Unit number for the summary file (-1 for none).  Provided by IfW. [-]
    LOGICAL  :: NativeBladedFmt      !< Whether this is native Bladed (needs wind profile and TI scaling) or not [-]
    INTEGER(IntKi)  :: TurbineID = 0      !< Wind turbine ID number in the fixed (DEFAULT) file name when FixedWindFileRootName = .TRUE. (used by FAST.Farm) [-]
    LOGICAL  :: FixedWindFileRootName = .FALSE.      !< Do the wind data files have a fixed (DEFAULT) file name? (used by FAST.Farm) [-]
  END TYPE IfW_BladedFFWind_InitInputType
! =======================
! =========  IfW_BladedFFWind_InitOutputType  =======
  TYPE, PUBLIC :: IfW_BladedFFWind_InitOutputType
    TYPE(ProgDesc)  :: Ver      !< Version information off FFWind submodule [-]
    REAL(ReKi) , DIMENSION(1:3)  :: TI      !< Turbulence intensity given in the file [-]
    REAL(ReKi)  :: PropagationDir      !< Propogation direction from native Bladed format [degrees]
    REAL(ReKi)  :: VFlowAngle      !< Vertical flow angle from native Bladed format [degrees]
  END TYPE IfW_BladedFFWind_InitOutputType
! =======================
! =========  IfW_BladedFFWind_MiscVarType  =======
  TYPE, PUBLIC :: IfW_BladedFFWind_MiscVarType
    INTEGER(IntKi)  :: dummy = 0      !< An Index into the TData array [-]
  END TYPE IfW_BladedFFWind_MiscVarType
! =======================
! =========  IfW_BladedFFWind_ParameterType  =======
  TYPE, PUBLIC :: IfW_BladedFFWind_ParameterType
    TYPE(IfW_FFWind_ParameterType)  :: FF      !< Parameters used in all full-field wind types [-]
  END TYPE IfW_BladedFFWind_ParameterType
! =======================
CONTAINS
 SUBROUTINE IfW_BladedFFWind_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCode, ErrStat, ErrMsg )
   TYPE(IfW_BladedFFWind_InitInputType), INTENT(IN) :: SrcInitInputData
   TYPE(IfW_BladedFFWind_InitInputType), INTENT(INOUT) :: DstInitInputData
   INTEGER(IntKi),  INTENT(IN   ) :: CtrlCode
   INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
   CHARACTER(*),    INTENT(  OUT) :: ErrMsg
! Local
   INTEGER(IntKi)                 :: i,j,k
   INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
   INTEGER(IntKi)                 :: ErrStat2
   CHARACTER(ErrMsgLen)           :: ErrMsg2
   CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_CopyInitInput'
!
   ErrStat = ErrID_None
   ErrMsg  = ""
    DstInitInputData%WindFileName = SrcInitInputData%WindFileName
    DstInitInputData%TowerFileExist = SrcInitInputData%TowerFileExist
    DstInitInputData%SumFileUnit = SrcInitInputData%SumFileUnit
    DstInitInputData%NativeBladedFmt = SrcInitInputData%NativeBladedFmt
    DstInitInputData%TurbineID = SrcInitInputData%TurbineID
    DstInitInputData%FixedWindFileRootName = SrcInitInputData%FixedWindFileRootName
 END SUBROUTINE IfW_BladedFFWind_CopyInitInput

 SUBROUTINE IfW_BladedFFWind_DestroyInitInput( InitInputData, ErrStat, ErrMsg )
  TYPE(IfW_BladedFFWind_InitInputType), INTENT(INOUT) :: InitInputData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  CHARACTER(*),    PARAMETER :: RoutineName = 'IfW_BladedFFWind_DestroyInitInput'
  INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5
!
  ErrStat = ErrID_None
  ErrMsg  = ""
 END SUBROUTINE IfW_BladedFFWind_DestroyInitInput

 SUBROUTINE IfW_BladedFFWind_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly )
  REAL(ReKi),       ALLOCATABLE, INTENT(  OUT) :: ReKiBuf(:)
  REAL(DbKi),       ALLOCATABLE, INTENT(  OUT) :: DbKiBuf(:)
  INTEGER(IntKi),   ALLOCATABLE, INTENT(  OUT) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_InitInputType),  INTENT(IN) :: InData
  INTEGER(IntKi),   INTENT(  OUT) :: ErrStat
  CHARACTER(*),     INTENT(  OUT) :: ErrMsg
  LOGICAL,OPTIONAL, INTENT(IN   ) :: SizeOnly
    ! Local variables
  INTEGER(IntKi)                 :: Re_BufSz
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_BufSz
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_BufSz
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i,i1,i2,i3,i4,i5
  LOGICAL                        :: OnlySize ! if present and true, do not pack, just allocate buffers
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_PackInitInput'
 ! buffers to store subtypes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)

  OnlySize = .FALSE.
  IF ( PRESENT(SizeOnly) ) THEN
    OnlySize = SizeOnly
  ENDIF
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_BufSz  = 0
  Db_BufSz  = 0
  Int_BufSz  = 0
      Int_BufSz  = Int_BufSz  + 1*LEN(InData%WindFileName)  ! WindFileName
      Int_BufSz  = Int_BufSz  + 1  ! TowerFileExist
      Int_BufSz  = Int_BufSz  + 1  ! SumFileUnit
      Int_BufSz  = Int_BufSz  + 1  ! NativeBladedFmt
      Int_BufSz  = Int_BufSz  + 1  ! TurbineID
      Int_BufSz  = Int_BufSz  + 1  ! FixedWindFileRootName
  IF ( Re_BufSz  .GT. 0 ) THEN
     ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating ReKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Db_BufSz  .GT. 0 ) THEN
     ALLOCATE( DbKiBuf(  Db_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating DbKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Int_BufSz  .GT. 0 ) THEN
     ALLOCATE( IntKiBuf(  Int_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating IntKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF(OnlySize) RETURN ! return early if only trying to allocate buffers (not pack them)

  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred = 1

    DO I = 1, LEN(InData%WindFileName)
      IntKiBuf(Int_Xferred) = ICHAR(InData%WindFileName(I:I), IntKi)
      Int_Xferred = Int_Xferred + 1
    END DO ! I
    IntKiBuf(Int_Xferred) = TRANSFER(InData%TowerFileExist, IntKiBuf(1))
    Int_Xferred = Int_Xferred + 1
    IntKiBuf(Int_Xferred) = InData%SumFileUnit
    Int_Xferred = Int_Xferred + 1
    IntKiBuf(Int_Xferred) = TRANSFER(InData%NativeBladedFmt, IntKiBuf(1))
    Int_Xferred = Int_Xferred + 1
    IntKiBuf(Int_Xferred) = InData%TurbineID
    Int_Xferred = Int_Xferred + 1
    IntKiBuf(Int_Xferred) = TRANSFER(InData%FixedWindFileRootName, IntKiBuf(1))
    Int_Xferred = Int_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_PackInitInput

 SUBROUTINE IfW_BladedFFWind_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
  REAL(ReKi),      ALLOCATABLE, INTENT(IN   ) :: ReKiBuf(:)
  REAL(DbKi),      ALLOCATABLE, INTENT(IN   ) :: DbKiBuf(:)
  INTEGER(IntKi),  ALLOCATABLE, INTENT(IN   ) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_InitInputType), INTENT(INOUT) :: OutData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
    ! Local variables
  INTEGER(IntKi)                 :: Buf_size
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i
  INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_UnPackInitInput'
 ! buffers to store meshes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred  = 1
    DO I = 1, LEN(OutData%WindFileName)
      OutData%WindFileName(I:I) = CHAR(IntKiBuf(Int_Xferred))
      Int_Xferred = Int_Xferred + 1
    END DO ! I
    OutData%TowerFileExist = TRANSFER(IntKiBuf(Int_Xferred), OutData%TowerFileExist)
    Int_Xferred = Int_Xferred + 1
    OutData%SumFileUnit = IntKiBuf(Int_Xferred)
    Int_Xferred = Int_Xferred + 1
    OutData%NativeBladedFmt = TRANSFER(IntKiBuf(Int_Xferred), OutData%NativeBladedFmt)
    Int_Xferred = Int_Xferred + 1
    OutData%TurbineID = IntKiBuf(Int_Xferred)
    Int_Xferred = Int_Xferred + 1
    OutData%FixedWindFileRootName = TRANSFER(IntKiBuf(Int_Xferred), OutData%FixedWindFileRootName)
    Int_Xferred = Int_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_UnPackInitInput

 SUBROUTINE IfW_BladedFFWind_CopyInitOutput( SrcInitOutputData, DstInitOutputData, CtrlCode, ErrStat, ErrMsg )
   TYPE(IfW_BladedFFWind_InitOutputType), INTENT(IN) :: SrcInitOutputData
   TYPE(IfW_BladedFFWind_InitOutputType), INTENT(INOUT) :: DstInitOutputData
   INTEGER(IntKi),  INTENT(IN   ) :: CtrlCode
   INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
   CHARACTER(*),    INTENT(  OUT) :: ErrMsg
! Local
   INTEGER(IntKi)                 :: i,j,k
   INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
   INTEGER(IntKi)                 :: ErrStat2
   CHARACTER(ErrMsgLen)           :: ErrMsg2
   CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_CopyInitOutput'
!
   ErrStat = ErrID_None
   ErrMsg  = ""
      CALL NWTC_Library_Copyprogdesc( SrcInitOutputData%Ver, DstInitOutputData%Ver, CtrlCode, ErrStat2, ErrMsg2 )
         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg,RoutineName)
         IF (ErrStat>=AbortErrLev) RETURN
    DstInitOutputData%TI = SrcInitOutputData%TI
    DstInitOutputData%PropagationDir = SrcInitOutputData%PropagationDir
    DstInitOutputData%VFlowAngle = SrcInitOutputData%VFlowAngle
 END SUBROUTINE IfW_BladedFFWind_CopyInitOutput

 SUBROUTINE IfW_BladedFFWind_DestroyInitOutput( InitOutputData, ErrStat, ErrMsg )
  TYPE(IfW_BladedFFWind_InitOutputType), INTENT(INOUT) :: InitOutputData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  CHARACTER(*),    PARAMETER :: RoutineName = 'IfW_BladedFFWind_DestroyInitOutput'
  INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5
!
  ErrStat = ErrID_None
  ErrMsg  = ""
  CALL NWTC_Library_Destroyprogdesc( InitOutputData%Ver, ErrStat, ErrMsg )
 END SUBROUTINE IfW_BladedFFWind_DestroyInitOutput

 SUBROUTINE IfW_BladedFFWind_PackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly )
  REAL(ReKi),       ALLOCATABLE, INTENT(  OUT) :: ReKiBuf(:)
  REAL(DbKi),       ALLOCATABLE, INTENT(  OUT) :: DbKiBuf(:)
  INTEGER(IntKi),   ALLOCATABLE, INTENT(  OUT) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_InitOutputType),  INTENT(IN) :: InData
  INTEGER(IntKi),   INTENT(  OUT) :: ErrStat
  CHARACTER(*),     INTENT(  OUT) :: ErrMsg
  LOGICAL,OPTIONAL, INTENT(IN   ) :: SizeOnly
    ! Local variables
  INTEGER(IntKi)                 :: Re_BufSz
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_BufSz
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_BufSz
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i,i1,i2,i3,i4,i5
  LOGICAL                        :: OnlySize ! if present and true, do not pack, just allocate buffers
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_PackInitOutput'
 ! buffers to store subtypes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)

  OnlySize = .FALSE.
  IF ( PRESENT(SizeOnly) ) THEN
    OnlySize = SizeOnly
  ENDIF
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_BufSz  = 0
  Db_BufSz  = 0
  Int_BufSz  = 0
   ! Allocate buffers for subtypes, if any (we'll get sizes from these)
      Int_BufSz   = Int_BufSz + 3  ! Ver: size of buffers for each call to pack subtype
      CALL NWTC_Library_Packprogdesc( Re_Buf, Db_Buf, Int_Buf, InData%Ver, ErrStat2, ErrMsg2, .TRUE. ) ! Ver
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf)) THEN ! Ver
         Re_BufSz  = Re_BufSz  + SIZE( Re_Buf  )
         DEALLOCATE(Re_Buf)
      END IF
      IF(ALLOCATED(Db_Buf)) THEN ! Ver
         Db_BufSz  = Db_BufSz  + SIZE( Db_Buf  )
         DEALLOCATE(Db_Buf)
      END IF
      IF(ALLOCATED(Int_Buf)) THEN ! Ver
         Int_BufSz = Int_BufSz + SIZE( Int_Buf )
         DEALLOCATE(Int_Buf)
      END IF
      Re_BufSz   = Re_BufSz   + SIZE(InData%TI)  ! TI
      Re_BufSz   = Re_BufSz   + 1  ! PropagationDir
      Re_BufSz   = Re_BufSz   + 1  ! VFlowAngle
  IF ( Re_BufSz  .GT. 0 ) THEN
     ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating ReKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Db_BufSz  .GT. 0 ) THEN
     ALLOCATE( DbKiBuf(  Db_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating DbKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Int_BufSz  .GT. 0 ) THEN
     ALLOCATE( IntKiBuf(  Int_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating IntKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF(OnlySize) RETURN ! return early if only trying to allocate buffers (not pack them)

  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred = 1

      CALL NWTC_Library_Packprogdesc( Re_Buf, Db_Buf, Int_Buf, InData%Ver, ErrStat2, ErrMsg2, OnlySize ) ! Ver
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Re_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Re_Buf) > 0) ReKiBuf( Re_Xferred:Re_Xferred+SIZE(Re_Buf)-1 ) = Re_Buf
        Re_Xferred = Re_Xferred + SIZE(Re_Buf)
        DEALLOCATE(Re_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
      IF(ALLOCATED(Db_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Db_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Db_Buf) > 0) DbKiBuf( Db_Xferred:Db_Xferred+SIZE(Db_Buf)-1 ) = Db_Buf
        Db_Xferred = Db_Xferred + SIZE(Db_Buf)
        DEALLOCATE(Db_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
      IF(ALLOCATED(Int_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Int_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Int_Buf) > 0) IntKiBuf( Int_Xferred:Int_Xferred+SIZE(Int_Buf)-1 ) = Int_Buf
        Int_Xferred = Int_Xferred + SIZE(Int_Buf)
        DEALLOCATE(Int_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
    DO i1 = LBOUND(InData%TI,1), UBOUND(InData%TI,1)
      ReKiBuf(Re_Xferred) = InData%TI(i1)
      Re_Xferred = Re_Xferred + 1
    END DO
    ReKiBuf(Re_Xferred) = InData%PropagationDir
    Re_Xferred = Re_Xferred + 1
    ReKiBuf(Re_Xferred) = InData%VFlowAngle
    Re_Xferred = Re_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_PackInitOutput

 SUBROUTINE IfW_BladedFFWind_UnPackInitOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
  REAL(ReKi),      ALLOCATABLE, INTENT(IN   ) :: ReKiBuf(:)
  REAL(DbKi),      ALLOCATABLE, INTENT(IN   ) :: DbKiBuf(:)
  INTEGER(IntKi),  ALLOCATABLE, INTENT(IN   ) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_InitOutputType), INTENT(INOUT) :: OutData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
    ! Local variables
  INTEGER(IntKi)                 :: Buf_size
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i
  INTEGER(IntKi)                 :: i1, i1_l, i1_u  !  bounds (upper/lower) for an array dimension 1
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_UnPackInitOutput'
 ! buffers to store meshes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred  = 1
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Re_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Re_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Re_Buf = ReKiBuf( Re_Xferred:Re_Xferred+Buf_size-1 )
        Re_Xferred = Re_Xferred + Buf_size
      END IF
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Db_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Db_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Db_Buf = DbKiBuf( Db_Xferred:Db_Xferred+Buf_size-1 )
        Db_Xferred = Db_Xferred + Buf_size
      END IF
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Int_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Int_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Int_Buf = IntKiBuf( Int_Xferred:Int_Xferred+Buf_size-1 )
        Int_Xferred = Int_Xferred + Buf_size
      END IF
      CALL NWTC_Library_Unpackprogdesc( Re_Buf, Db_Buf, Int_Buf, OutData%Ver, ErrStat2, ErrMsg2 ) ! Ver
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf )) DEALLOCATE(Re_Buf )
      IF(ALLOCATED(Db_Buf )) DEALLOCATE(Db_Buf )
      IF(ALLOCATED(Int_Buf)) DEALLOCATE(Int_Buf)
    i1_l = LBOUND(OutData%TI,1)
    i1_u = UBOUND(OutData%TI,1)
    DO i1 = LBOUND(OutData%TI,1), UBOUND(OutData%TI,1)
      OutData%TI(i1) = ReKiBuf(Re_Xferred)
      Re_Xferred = Re_Xferred + 1
    END DO
    OutData%PropagationDir = ReKiBuf(Re_Xferred)
    Re_Xferred = Re_Xferred + 1
    OutData%VFlowAngle = ReKiBuf(Re_Xferred)
    Re_Xferred = Re_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_UnPackInitOutput

 SUBROUTINE IfW_BladedFFWind_CopyMisc( SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg )
   TYPE(IfW_BladedFFWind_MiscVarType), INTENT(IN) :: SrcMiscData
   TYPE(IfW_BladedFFWind_MiscVarType), INTENT(INOUT) :: DstMiscData
   INTEGER(IntKi),  INTENT(IN   ) :: CtrlCode
   INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
   CHARACTER(*),    INTENT(  OUT) :: ErrMsg
! Local
   INTEGER(IntKi)                 :: i,j,k
   INTEGER(IntKi)                 :: ErrStat2
   CHARACTER(ErrMsgLen)           :: ErrMsg2
   CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_CopyMisc'
!
   ErrStat = ErrID_None
   ErrMsg  = ""
    DstMiscData%dummy = SrcMiscData%dummy
 END SUBROUTINE IfW_BladedFFWind_CopyMisc

 SUBROUTINE IfW_BladedFFWind_DestroyMisc( MiscData, ErrStat, ErrMsg )
  TYPE(IfW_BladedFFWind_MiscVarType), INTENT(INOUT) :: MiscData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  CHARACTER(*),    PARAMETER :: RoutineName = 'IfW_BladedFFWind_DestroyMisc'
  INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5
!
  ErrStat = ErrID_None
  ErrMsg  = ""
 END SUBROUTINE IfW_BladedFFWind_DestroyMisc

 SUBROUTINE IfW_BladedFFWind_PackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly )
  REAL(ReKi),       ALLOCATABLE, INTENT(  OUT) :: ReKiBuf(:)
  REAL(DbKi),       ALLOCATABLE, INTENT(  OUT) :: DbKiBuf(:)
  INTEGER(IntKi),   ALLOCATABLE, INTENT(  OUT) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_MiscVarType),  INTENT(IN) :: InData
  INTEGER(IntKi),   INTENT(  OUT) :: ErrStat
  CHARACTER(*),     INTENT(  OUT) :: ErrMsg
  LOGICAL,OPTIONAL, INTENT(IN   ) :: SizeOnly
    ! Local variables
  INTEGER(IntKi)                 :: Re_BufSz
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_BufSz
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_BufSz
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i,i1,i2,i3,i4,i5
  LOGICAL                        :: OnlySize ! if present and true, do not pack, just allocate buffers
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_PackMisc'
 ! buffers to store subtypes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)

  OnlySize = .FALSE.
  IF ( PRESENT(SizeOnly) ) THEN
    OnlySize = SizeOnly
  ENDIF
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_BufSz  = 0
  Db_BufSz  = 0
  Int_BufSz  = 0
      Int_BufSz  = Int_BufSz  + 1  ! dummy
  IF ( Re_BufSz  .GT. 0 ) THEN
     ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating ReKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Db_BufSz  .GT. 0 ) THEN
     ALLOCATE( DbKiBuf(  Db_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating DbKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Int_BufSz  .GT. 0 ) THEN
     ALLOCATE( IntKiBuf(  Int_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating IntKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF(OnlySize) RETURN ! return early if only trying to allocate buffers (not pack them)

  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred = 1

    IntKiBuf(Int_Xferred) = InData%dummy
    Int_Xferred = Int_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_PackMisc

 SUBROUTINE IfW_BladedFFWind_UnPackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
  REAL(ReKi),      ALLOCATABLE, INTENT(IN   ) :: ReKiBuf(:)
  REAL(DbKi),      ALLOCATABLE, INTENT(IN   ) :: DbKiBuf(:)
  INTEGER(IntKi),  ALLOCATABLE, INTENT(IN   ) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_MiscVarType), INTENT(INOUT) :: OutData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
    ! Local variables
  INTEGER(IntKi)                 :: Buf_size
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_UnPackMisc'
 ! buffers to store meshes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred  = 1
    OutData%dummy = IntKiBuf(Int_Xferred)
    Int_Xferred = Int_Xferred + 1
 END SUBROUTINE IfW_BladedFFWind_UnPackMisc

 SUBROUTINE IfW_BladedFFWind_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg )
   TYPE(IfW_BladedFFWind_ParameterType), INTENT(IN) :: SrcParamData
   TYPE(IfW_BladedFFWind_ParameterType), INTENT(INOUT) :: DstParamData
   INTEGER(IntKi),  INTENT(IN   ) :: CtrlCode
   INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
   CHARACTER(*),    INTENT(  OUT) :: ErrMsg
! Local
   INTEGER(IntKi)                 :: i,j,k
   INTEGER(IntKi)                 :: ErrStat2
   CHARACTER(ErrMsgLen)           :: ErrMsg2
   CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_CopyParam'
!
   ErrStat = ErrID_None
   ErrMsg  = ""
      CALL IfW_FFWind_CopyParam( SrcParamData%FF, DstParamData%FF, CtrlCode, ErrStat2, ErrMsg2 )
         CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg,RoutineName)
         IF (ErrStat>=AbortErrLev) RETURN
 END SUBROUTINE IfW_BladedFFWind_CopyParam

 SUBROUTINE IfW_BladedFFWind_DestroyParam( ParamData, ErrStat, ErrMsg )
  TYPE(IfW_BladedFFWind_ParameterType), INTENT(INOUT) :: ParamData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
  CHARACTER(*),    PARAMETER :: RoutineName = 'IfW_BladedFFWind_DestroyParam'
  INTEGER(IntKi)                 :: i, i1, i2, i3, i4, i5
!
  ErrStat = ErrID_None
  ErrMsg  = ""
  CALL IfW_FFWind_DestroyParam( ParamData%FF, ErrStat, ErrMsg )
 END SUBROUTINE IfW_BladedFFWind_DestroyParam

 SUBROUTINE IfW_BladedFFWind_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, SizeOnly )
  REAL(ReKi),       ALLOCATABLE, INTENT(  OUT) :: ReKiBuf(:)
  REAL(DbKi),       ALLOCATABLE, INTENT(  OUT) :: DbKiBuf(:)
  INTEGER(IntKi),   ALLOCATABLE, INTENT(  OUT) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_ParameterType),  INTENT(IN) :: InData
  INTEGER(IntKi),   INTENT(  OUT) :: ErrStat
  CHARACTER(*),     INTENT(  OUT) :: ErrMsg
  LOGICAL,OPTIONAL, INTENT(IN   ) :: SizeOnly
    ! Local variables
  INTEGER(IntKi)                 :: Re_BufSz
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_BufSz
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_BufSz
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i,i1,i2,i3,i4,i5
  LOGICAL                        :: OnlySize ! if present and true, do not pack, just allocate buffers
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_PackParam'
 ! buffers to store subtypes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)

  OnlySize = .FALSE.
  IF ( PRESENT(SizeOnly) ) THEN
    OnlySize = SizeOnly
  ENDIF
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_BufSz  = 0
  Db_BufSz  = 0
  Int_BufSz  = 0
   ! Allocate buffers for subtypes, if any (we'll get sizes from these)
      Int_BufSz   = Int_BufSz + 3  ! FF: size of buffers for each call to pack subtype
      CALL IfW_FFWind_PackParam( Re_Buf, Db_Buf, Int_Buf, InData%FF, ErrStat2, ErrMsg2, .TRUE. ) ! FF
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf)) THEN ! FF
         Re_BufSz  = Re_BufSz  + SIZE( Re_Buf  )
         DEALLOCATE(Re_Buf)
      END IF
      IF(ALLOCATED(Db_Buf)) THEN ! FF
         Db_BufSz  = Db_BufSz  + SIZE( Db_Buf  )
         DEALLOCATE(Db_Buf)
      END IF
      IF(ALLOCATED(Int_Buf)) THEN ! FF
         Int_BufSz = Int_BufSz + SIZE( Int_Buf )
         DEALLOCATE(Int_Buf)
      END IF
  IF ( Re_BufSz  .GT. 0 ) THEN
     ALLOCATE( ReKiBuf(  Re_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating ReKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Db_BufSz  .GT. 0 ) THEN
     ALLOCATE( DbKiBuf(  Db_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating DbKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF ( Int_BufSz  .GT. 0 ) THEN
     ALLOCATE( IntKiBuf(  Int_BufSz  ), STAT=ErrStat2 )
     IF (ErrStat2 /= 0) THEN
       CALL SetErrStat(ErrID_Fatal, 'Error allocating IntKiBuf.', ErrStat, ErrMsg,RoutineName)
       RETURN
     END IF
  END IF
  IF(OnlySize) RETURN ! return early if only trying to allocate buffers (not pack them)

  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred = 1

      CALL IfW_FFWind_PackParam( Re_Buf, Db_Buf, Int_Buf, InData%FF, ErrStat2, ErrMsg2, OnlySize ) ! FF
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Re_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Re_Buf) > 0) ReKiBuf( Re_Xferred:Re_Xferred+SIZE(Re_Buf)-1 ) = Re_Buf
        Re_Xferred = Re_Xferred + SIZE(Re_Buf)
        DEALLOCATE(Re_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
      IF(ALLOCATED(Db_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Db_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Db_Buf) > 0) DbKiBuf( Db_Xferred:Db_Xferred+SIZE(Db_Buf)-1 ) = Db_Buf
        Db_Xferred = Db_Xferred + SIZE(Db_Buf)
        DEALLOCATE(Db_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
      IF(ALLOCATED(Int_Buf)) THEN
        IntKiBuf( Int_Xferred ) = SIZE(Int_Buf); Int_Xferred = Int_Xferred + 1
        IF (SIZE(Int_Buf) > 0) IntKiBuf( Int_Xferred:Int_Xferred+SIZE(Int_Buf)-1 ) = Int_Buf
        Int_Xferred = Int_Xferred + SIZE(Int_Buf)
        DEALLOCATE(Int_Buf)
      ELSE
        IntKiBuf( Int_Xferred ) = 0; Int_Xferred = Int_Xferred + 1
      ENDIF
 END SUBROUTINE IfW_BladedFFWind_PackParam

 SUBROUTINE IfW_BladedFFWind_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
  REAL(ReKi),      ALLOCATABLE, INTENT(IN   ) :: ReKiBuf(:)
  REAL(DbKi),      ALLOCATABLE, INTENT(IN   ) :: DbKiBuf(:)
  INTEGER(IntKi),  ALLOCATABLE, INTENT(IN   ) :: IntKiBuf(:)
  TYPE(IfW_BladedFFWind_ParameterType), INTENT(INOUT) :: OutData
  INTEGER(IntKi),  INTENT(  OUT) :: ErrStat
  CHARACTER(*),    INTENT(  OUT) :: ErrMsg
    ! Local variables
  INTEGER(IntKi)                 :: Buf_size
  INTEGER(IntKi)                 :: Re_Xferred
  INTEGER(IntKi)                 :: Db_Xferred
  INTEGER(IntKi)                 :: Int_Xferred
  INTEGER(IntKi)                 :: i
  INTEGER(IntKi)                 :: ErrStat2
  CHARACTER(ErrMsgLen)           :: ErrMsg2
  CHARACTER(*), PARAMETER        :: RoutineName = 'IfW_BladedFFWind_UnPackParam'
 ! buffers to store meshes, if any
  REAL(ReKi),      ALLOCATABLE   :: Re_Buf(:)
  REAL(DbKi),      ALLOCATABLE   :: Db_Buf(:)
  INTEGER(IntKi),  ALLOCATABLE   :: Int_Buf(:)
    !
  ErrStat = ErrID_None
  ErrMsg  = ""
  Re_Xferred  = 1
  Db_Xferred  = 1
  Int_Xferred  = 1
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Re_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Re_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Re_Buf = ReKiBuf( Re_Xferred:Re_Xferred+Buf_size-1 )
        Re_Xferred = Re_Xferred + Buf_size
      END IF
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Db_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Db_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Db_Buf = DbKiBuf( Db_Xferred:Db_Xferred+Buf_size-1 )
        Db_Xferred = Db_Xferred + Buf_size
      END IF
      Buf_size=IntKiBuf( Int_Xferred )
      Int_Xferred = Int_Xferred + 1
      IF(Buf_size > 0) THEN
        ALLOCATE(Int_Buf(Buf_size),STAT=ErrStat2)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal, 'Error allocating Int_Buf.', ErrStat, ErrMsg,RoutineName)
           RETURN
        END IF
        Int_Buf = IntKiBuf( Int_Xferred:Int_Xferred+Buf_size-1 )
        Int_Xferred = Int_Xferred + Buf_size
      END IF
      CALL IfW_FFWind_UnpackParam( Re_Buf, Db_Buf, Int_Buf, OutData%FF, ErrStat2, ErrMsg2 ) ! FF
        CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
        IF (ErrStat >= AbortErrLev) RETURN

      IF(ALLOCATED(Re_Buf )) DEALLOCATE(Re_Buf )
      IF(ALLOCATED(Db_Buf )) DEALLOCATE(Db_Buf )
      IF(ALLOCATED(Int_Buf)) DEALLOCATE(Int_Buf)
 END SUBROUTINE IfW_BladedFFWind_UnPackParam

END MODULE IfW_BladedFFWind_Types
!ENDOFREGISTRYGENERATEDFILE

max_stars_repo_name: ndevelder/openfast

max_issues_repo_name: ndevelder/openfast

max_forks_repo_name: ndevelder/openfast


!        Generated by TAPENADE     (INRIA, Ecuador team)
!  tapenade 3.x
!
!  Differentiation of dxyz in forward (tangent) mode:
!   variations   of useful results: z
!   with respect to varying inputs: x y z
!>    @brief BLAS adapting : z=x*y
!>    @param[in] N length of vectors [z],[x],[y]
!>    @param[in] x vector [x]
!>    @param[in] y vector [y]
!>    @param[out] z vector [z]
SUBROUTINE g_DXYZ(n, x, g_x, y, g_y, z, g_z)
  IMPLICIT NONE
  INTEGER :: n, i, m
  DOUBLE PRECISION :: x(n), y(n), z(n)
  DOUBLE PRECISION :: g_x(n), g_y(n), g_z(n)
  INTRINSIC MOD
  m = MOD(n, 4)
  DO i=1,m
    g_z(i) = y(i)*g_x(i) + x(i)*g_y(i)
    z(i) = x(i)*y(i)
  END DO
  m = m + 1
  DO i=m,n,4
    g_z(i+0) = y(i+0)*g_x(i+0) + x(i+0)*g_y(i+0)
    z(i+0) = x(i+0)*y(i+0)
    g_z(i+1) = y(i+1)*g_x(i+1) + x(i+1)*g_y(i+1)
    z(i+1) = x(i+1)*y(i+1)
    g_z(i+2) = y(i+2)*g_x(i+2) + x(i+2)*g_y(i+2)
    z(i+2) = x(i+2)*y(i+2)
    g_z(i+3) = y(i+3)*g_x(i+3) + x(i+3)*g_y(i+3)
    z(i+3) = x(i+3)*y(i+3)
  END DO
  RETURN
END SUBROUTINE g_DXYZ


!================================================================================
!  Subroutine that rescales the current velocities.  The rescales velocity
!  will have the spectrum that is defined in the input file via parameters
!  isp_type (spectrum type) and peak_wavenum (peak wavenumber).
!
!  The program is copies from a part of init_velocity.f90.  Some time in the
!  future we should make it one routine that is called in init_velocity.
!
!  Time-stamp: <2010-01-25 17:01:55 (chumakov)>
!================================================================================

subroutine velocity_rescale

    use m_openmpi
    use m_parameters
    use m_io
    use m_fields
    use x_fftw

    implicit none

    integer :: i, j, k, n

    real, allocatable   :: rr(:)
    real*8, allocatable :: e_spec(:), e_spec1(:)
    integer*8, allocatable :: hits(:), hits1(:)

    integer   :: n_shell
    real*8    :: sc_rad1, sc_rad2

    real*8 :: wmag, wmag2, ratio, fac

    ! if Taylor-Green, return
    if (isp_type .eq. -1) return

!================================================================================
    allocate (e_spec(kmax), e_spec1(kmax), rr(nx + 2), hits(kmax), hits1(kmax), stat=ierr)
    if (ierr .ne. 0) stop "cannot allocate the init_velocity arrays"

    write (out, *) 'Rescaling the velocities'
    call flush (out)

!-------------------------------------------------------------------------------
!     Making the spectrum to be what is prescribed in the input file <...>.in
!-------------------------------------------------------------------------------

    ! --- first get the energy spectrum (copied from m_stat.f90)

    ! need this normalization factor because the FFT is unnormalized
    fac = one/real(nx*ny*nz_all)**2

    ! zeroing out the arrays
    e_spec1 = zip
    e_spec = zip
    hits = 0
    hits1 = 0

    ! finding the total energy in each shell and number of hits in each shell
    ! storing them in arrays hits1 and e_spec1
    do k = 1, nz
        do j = 1, ny
            do i = 1, nx

                n_shell = nint(sqrt(real(akx(i)**2 + aky(k)**2 + akz(j)**2, 4)))
                if (n_shell .gt. 0 .and. n_shell .le. kmax) then
                    hits1(n_shell) = hits1(n_shell) + 1
                    e_spec1(n_shell) = e_spec1(n_shell) + &
                                       fac*(fields(i, j, k, 1)**2 + fields(i, j, k, 2)**2 + fields(i, j, k, 3)**2)
                end if
            end do
        end do
    end do

    ! reducing the number of hits and energy to two arrays on master node
    count = kmax
    call MPI_REDUCE(hits1, hits, count, MPI_INTEGER8, MPI_SUM, 0, MPI_COMM_TASK, mpi_err)
    count = kmax
    call MPI_REDUCE(e_spec1, e_spec, count, MPI_REAL8, MPI_SUM, 0, MPI_COMM_TASK, mpi_err)

    ! now the master node counts the energy density in each shell
    if (myid .eq. 0) then
        fac = four/three*PI/two
        do k = 1, kmax
            sc_rad1 = real(k, 8) + half
            sc_rad2 = real(k, 8) - half
            if (k .eq. 1) sc_rad2 = 0.d0
            if (hits(k) .gt. 0) then
                e_spec(k) = e_spec(k)/hits(k)*fac*(sc_rad1**3 - sc_rad2**3)
            else
                e_spec(k) = zip
            end if
        end do
    end if

    ! broadcasting the spectrum
    count = kmax
    call MPI_BCAST(e_spec, count, MPI_REAL8, 0, MPI_COMM_TASK, mpi_err)

!-------------------------------------------------------------------------------
!  Now make the spectrum to be as desired
!-------------------------------------------------------------------------------

    ! first, define the desired spectrum
    do k = 1, kmax

        wmag = real(k, 8)
        ratio = wmag/peak_wavenum

        if (isp_type .eq. 0) then
            ! Plain Kolmogorov spectrum
            e_spec1(k) = wmag**(-5.d0/3.d0)

        else if (isp_type .eq. 1) then
            ! Exponential spectrum
            e_spec1(k) = ratio**3/peak_wavenum*exp(-3.0D0*ratio)

        else if (isp_type .eq. 3) then
            ! Von Karman spectrum
            fac = two*PI*ratio
            e_spec1(k) = fac**4/(one + fac**2)**3

        else
            write (out, *) "ERROR: WRONG INITIAL SPECTRUM TYPE: ", isp_type
            call flush (out)
            stop

        end if
    end do

!  normalize it so it has the unit total energy
    e_spec1 = e_spec1/sum(e_spec1(1:kmax))

    ! now go over all Fourier shells and multiply the velocities in a shell by
    ! the sqrt of ratio of the resired to the current spectrum
    do k = 1, nz
        do j = 1, ny
            do i = 1, nx + 2

                n_shell = nint(sqrt(real(akx(i)**2 + aky(k)**2 + akz(j)**2, 4)))
                if (n_shell .gt. 0 .and. n_shell .le. kmax .and. e_spec(n_shell) .gt. zip) then
                    fields(i, j, k, 1:3) = fields(i, j, k, 1:3)*sqrt(e_spec1(n_shell)/e_spec(n_shell))
                else
                    fields(i, j, k, 1:3) = zip
                end if

            end do
        end do
    end do

    write (out, *) "Rescaled the velocities."
    call flush (out)

    ! deallocate work arrays
    deallocate (e_spec, e_spec1, rr, hits, hits1, stat=ierr)

    return
end subroutine velocity_rescale


text:
Sugar Daddies is arriving businesses now open at the location formerly occupied by Yogurt Shack.  It is a sort of dessert food court, consisting of two businesses (Davis Creamery and Cupcake Craving), one selling ice cream and the other selling cupcakes and Cookies, Pastries, and Baked Goods cookies.  The two companies often merge their products with desserts like ice cream sandwiches and brownie ice cream combos. It is the reincarnation of the Davis Creamery in Oakshade Town Center, which also sold all three of these items. The name Sugar Daddies is a catchy play on words resulting from the two owners being fathers.

Cupcakes are $2.50 a pop; ice cream is $2.95 for a small, $4.50 for a regular, and $4.95 for a sundae. They also have shakes and malts, house made cookies, cowpies (your choice of ice cream with your choice of two cookies), and the infamous cow kiss (hot brownie with two scoops of salted caramel on top). They also have milk and coke products available.

On Sundays they have Sunday Gourmet ice creams available, which feature their higherend and quirkier flavors like Maple Bacon, Honey Lavender (with local lavender pollen), Green Tea, Honey Goat Cheese and Fig Swirl, etc.  Their ice cream is cows Udderly Delicious.

Sugar Daddies has Daily Specials Monday  Friday:

Monday is $1 Scoop from 510pm
Tuesday is $2 Cupcakes all day
Wednesday is $6 Quarts of Ice Cream all day
Thursday is $3 Cowpies ( ice cream sandwich that you create ) all day
Friday is $3.50 Shakes from 47pm

Updates, deals, and a paperless loyalty program for Sugar Daddies can also be found on the UCD alumni created OptTown mobile app.

There is outdoor seating at the parklets parklet.

20110615 12:39:17 nbsp Im thrilled to have this place downtown, and even more thrilled that their real blueberry ice cream is as good as ever.  If you like blueberries at all, you will love this ice cream  it is so rich and flavorful.  The real strawberry ice cream is very good too, just not as unusual as the blueberry, of course!  A quick trip to Thai Canteen followed by some Davis Creamery ice cream makes for a lovely, dogfriendly evening outdoors. Users/CovertProfessor

20110703 14:35:55 nbsp We dropped by this place after lunch today.  Very nice!  I had a scoop of the avocado coconut ice cream and it was excellent.  Incredibly rich and creamy.  Theyll happily give you samples of the ice cream, so if you think it sounds weird, give it a tryyoull be pleasantly surprised.

My wife got a raspberryfilled chocolate cupcake with fudge frosting and it was quite good as well.  I dont know if they sell milk there, but they really should  a big, cold glass of milk is a must with cupcakes this rich.  Weve got a German chocolate cupcake in the fridge for later. Users/TomGarberson

20110713 12:16:57 nbsp Milk is now Available!!! Whole milk, 2% and, Chocolate. Users/meganvisciglia
 Thats just awesome! Users/TomGarberson

20110713 15:29:45 nbsp Sugar Daddies? Needs a catchy, attentiongrabbing apostrophe instead perhaps: Sugar Daddys.
Just throwing in my marketing (two) sense. Users/RaoulDuke

20110716 18:05:49 nbsp may its Daddies plural b/c its 3 businesses in one? Users/jsbmeb

20110817 08:42:14 nbsp Suggestion: Can you start a twitter account or something that lists what flavors you have that day? I feel I would come a lot more if I knew what you were going to have....

Also, is dollar(or $1.50 now) scoop night gone? Users/elliottPollard

20110830 17:11:55 nbsp This place is great! Friendly service and delicious offerings! Users/ashleyinthemist

20110905 22:10:43 nbsp I just went here for a cupcake and it was delicious! I got the chocolate cupcake with a cheesecake center and cheesecake topping and it was great. I will have to go back for some ice cream next time. I tried a sample of the Nutella ice cream which was absolutely awesome, not too rich  perfect flavor. The only complaint I had was that they just handed the cupcake to me on a napkin. Most cupcake places I am used to give you a box and a fork.  Users/OliviaHenry

20110907 22:56:50 nbsp Really happy to see that Davis Creamery is back, though I have mixed feelings about the introduction of cupcakes adorable cupcakes all lined up nice and pretty arent exactly conducive to a healthy diet. Ive only ever had the Champagne cupcake (which was delicious, by the way), but my boyfriend absolutely LOVES the orange creamsicle shake. Reasonable prices, really tasty desserts, topped off with friendly service. Really hope these guys are in it for the long haul. Users/AbbYu

20110930 11:48:03 nbsp Despite the large number of diabetics and lowcarb dieters in the world, very few bakeries offer lowcarb items. Nevertheless, I always ask when I pass a new bakery. I was surprised to find that Sugar Daddies has a whole section of sugarfree cupcakes. When they told me that they used maltitol as a sweetener I was slightly disappointed because maltitol is the least desireable of the sugar alcohols. It has a relatively high glycemic index and causes intestinal distress in some people. When I pointed this out, they were concerned and promised to look into substituting another sweetener. I could not ask for more. Users/MikeRubin

20111110 16:23:30 nbsp I loved this place when it was the Davis Creamery and I love it now as Sugar Daddies (though I did prefer the previous location to the new one).  I havent tried their ice cream, but I have had their cookies and cupcakes. Actually I discovered this place when I was searching for Cupcake Craving locations after a friend bought me one for my birthday one year.  Trust me, the cupcakes are AWESOME. The best Ive ever had. Im especially fond of Lemon Burst, Smores, and the cheesecake ones.  You will not be disappointed.  As for their cookies, they were very good as well, though not as amazing as the cupcakes.  Im not sure if they still do it, but they used to sell their dayold leftover cookies in a bag at a discounted price. They would throw about a dozen random kinds in the bag and mark the contents on the outside. Having such variety at a discounted price was really great, especially when your family has very different tastes!  Anyway, this place is great, definitely give it a shot, you will want to stop there on your way home from work or class every day! Users/IndigoShell

20111217 14:39:03 nbsp The name Sugar Daddies was created by the shops owners who felt it was a perfect fit since they are both Dads :) Users/meganvisciglia

20120219 21:16:01 nbsp This is probably the best ice cream in town. The flavor and texture are unsurpassed by anything else in Davis. Users/eganio

20120524 20:44:18 nbsp Excellent ice cream as usual.  However caveat emptor!  They are charging an illegal credit card use fee disguised as a $.25 total cash discount.  This is against both the policies of VIsa and California Civil Code Section 1748.1.  Lets hope they change their policy and come into compliance.  Excellent ice cream, by the way...... Users/DaveyBalaban
  Discounts for cash are legal; fees for credit cards are not.  It may not make much sense, but that is the law.  See Credit Card Minimum Purchase.   Users/CovertProfessor

20120525 01:11:40 nbsp I have been coming here every week for $1 scoop night. I love this place, the ice cream is always good, and the workers recognize me and the group of friends I come with!

White Chocolate Mocha and Orange Mango Sorbet are my favorites. I also like the seasonal ones like Irish Cream as well.  Users/chandru

20120607 19:57:59 nbsp Delicious and refreshing ice cream with interesting and always pleasing flavors. Irish Cream, Mexican Chocolate, Salted Caramel, LemonBasil, Nutella, and their awesome one with avocado are all great flavors. Raspberry sorbet is always perfect and not overly sweet. Orange Mango isnt my favorite, though its not a bad flavor. I just personally dont find it super appealing. The workers are all very kind and friendly, and will happily give you a sample so that you can see what you like. Ive been trying to come here every week for $1 scoop night with my friends, though I didnt get to go last week due to large amounts of work, and were always recognized when we come in. Friendly people who make awesome ice cream, recognize you, and talk with you when you come in? I think yes.

Their ice cream shakes are really good, and always have a pleasingly thick consistency, though its not so thick that pulling the stuff through the straw is a chore. Sometimes I get those instead of $1 scoops.

Cupcakes are always nice and fluffy, and Ive never had a problem with the frosting being overly sweet or the bread of the cupcake being dry/stale. They are delicious. I recommend you purchase one. Users/AlexTK

20120626 13:44:46 nbsp Best ice cream in town, but the customer service is terrible. Ive been flat out ignored and only begrudgingly served every time I come here, after waiting at the cash register until the line backs up. Also, on one dollar scoop night my boyfriend ordered two scoops, but they gave him a one scoop cup and when two scoops wouldnt fit the girl working there spooned the rest back into the carton and gave him two half scoops worth.

Bleh. Users/sundeimasu

20120626 14:08:50 nbsp Keep an eye out for their peach sorbet. That stuff is amazing. Users/LizPhillips

20120710 14:25:32 nbsp The Monkey Mania shake is amazing. Users/jsogul

20130104 18:23:15 nbsp The ice cream is fabulous but I find the cupcakes to be consistently a bit too dry and a bit too sweet. Let Them Eat Cake is better for cupcakes.  Users/PhoebeAyers

ext: f

max_stars_repo_name: voflo/Search

max_issues_repo_name: voflo/Search

max_forks_repo_name: voflo/Search


text:
      subroutine snlm (ltot, mtot, xnlm)
      implicit none
c     Set nlm, legendre normalization factors, xnlm in common /nlm/
c     Calculates legendre norm factors
c     xnlm= sqrt ((2l+1)(l-m)!/(l+m)!)

cc      include 'dim.h'
      integer ltot, mtot, il, im, mmaxp1, l, m, i
      double precision xnlm(ltot+1, mtot+1)

c     flg(i) = i! * afac**i, set in factst
      double precision flg(0:210), afac, cnlm

      call factst (afac, flg)

c     initialize xnlm explicitly
      do 20  il = 1, ltot+1
         mmaxp1 = min(mtot+1, il)
         do 5  im = mmaxp1, mtot+1
            xnlm(il, im) = 0.d0
 5       continue
         do 10  im = 1, mmaxp1
            l = il-1
            m = im-1
            cnlm = (2*l+1) * flg(l-m) / flg(l+m)
            xnlm(il,im) = sqrt(cnlm) * afac**m
 10      continue
 20   continue
      return
      end
      subroutine factst (afac, flg)
      implicit none

c     FACTorial SeT, flg(i) = i! * afac**i
      double precision afac, flg(0:210)
      integer i
c     afac = 1/64 works with double precision on a VAX
      afac = 1/64.d0

      flg(0) = 1
      flg(1) = afac
      do 10  i = 2, 210
         flg(i) = flg(i-1) * i * afac
 10   continue
      return
      end

max_stars_repo_name: keechul/ifeffit

max_stars_repo_licenses: Naumen Condor-1.1 MS-PL

max_issues_repo_name: bruceravel/ifeffit

max_issues_repo_licenses: Naumen Condor-1.1 MS-PL

max_forks_repo_name: bruceravel/ifeffit

max_forks_repo_licenses: Naumen Condor-1.1 MS-PL


text:
In 1974, the Beta Pi chapter of TriDelta was established on the UC Davis campus at 227 First Street. The first sorority affiliated with the university, TriDelta helped encourage other national sororities to make UC Davis its home. Since then, the Beta Pi branch of TriDelta has maintained its status as one of the top womens sororites at UC Davis.  Focused on academics as well as social events and activities, many consider Tridelta a rewarding and enjoyable organization to be a part of. Please feel free to check out Beta Pis website: http://www.davistridelta.com/. If you are interested in sorority recruitment, or just want to take a look at all the greek system has to offer, visit http://www.davispanhellenic.com/page.php?page_id4822.

Contact Us
President: Melanie Sarti
              masarti@ucdavis.edu
VP Public Relations: Noelie LeBlanc
              noelie.leblanc@hotmail.com
VP Membership: Kelly Schaaf
              kcschaaf@ucdavis.edu
Reference Chair: Shelby Collins
                        shelby612@yahoo.com

 Philanthropy
Of Course, a big part of sorority life is being active in the community and making a difference for some deserving causes.  Every year, UC Davis Tridelta holds 3 philanthropy events to raise funds for various charities and participates in many community service projects throughout the year.  In the fall, Beta Pi holds Delta Desserts in which all proceeds go to the MakeAWish Foundation.  In the spring, TriDelts hold their annual softball tournament, Big Bats, at Playfields Park on Research Park Drive.  To enter your team into the tournament,  donate raffle prizes or supplies, or to make a financial contribution, see the Tridelta Beta Pi website above and go to the contact page. Proceeds go to St. Judes Childrens Cancer Research Hospital. New in 2008, Tridelta held its first annual Pancake Dinner (which is in the middle of the night). Hopefully, this event will happen every spring so keep your eyes open! All proceeds from the Pancake Dinner also go to St. Judes Childrens Cancer Research Hospital, so eat some pancakes and support a good cause!!
 DDD Snapshots