anchor.diff:  END SUBROUTINE FAST_EndMods
   !----------------------------------------------------------------------------------------------------------------------------------
   !> This routine calls the destroy routines for each module. (It is basically a duplicate of FAST_DestroyTurbineType().)
  -SUBROUTINE FAST_DestroyAll( p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, IfW, OpFM, HD, SD, ExtPtfm, &
  -                            MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg )
  +SUBROUTINE FAST_DestroyAll( p_FAST, y_FAST, m_FAST, ED, BD, SrvD, AD14, AD, IfW, OpFM, HD, SD, MAPp, FEAM, MD, Orca, IceF, IceD, MeshMapData, ErrStat, ErrMsg )
   
      TYPE(FAST_ParameterType), INTENT(INOUT) :: p_FAST              !< Parameters for the glue code
      TYPE(FAST_OutputFileType),INTENT(INOUT) :: y_FAST              !< Output variables for the glue code
  
positive.code:       IF ( PRESENT(ExternInitData) ) THEN
           InitInData_OpFM%NumSC2Ctrl = ExternInitData%NumSC2Ctrl
           InitInData_OpFM%NumCtrl2SC = ExternInitData%NumCtrl2SC  
           InitInData_OpFM%NumActForcePtsBlade = ExternInitData%NumActForcePtsBlade
           InitInData_OpFM%NumActForcePtsTower = ExternInitData%NumActForcePtsTower 
        ELSE
           CALL SetErrStat( ErrID_Fatal, 'OpenFOAM integration can be used only with external input data (not the stand-alone executable).', ErrStat, ErrMsg, RoutineName )
           CALL Cleanup()
           RETURN         
        END IF
        InitInData_OpFM%BladeLength = InitOutData_ED%BladeLength
        InitInData_OpFM%TowerHeight = InitOutData_ED%TowerHeight
        ALLOCATE(InitInData_OpFM%StructBldRNodes( SIZE(InitOutData_ED%BldRNodes)),  STAT=ErrStat2)
        InitInData_OpFM%StructBldRNodes(:) = InitOutData_ED%BldRNodes(:)
        ALLOCATE(InitInData_OpFM%StructTwrHNodes( SIZE(InitOutData_ED%TwrHNodes)),  STAT=ErrStat2)
        InitInData_OpFM%StructTwrHNodes(:) = InitOutData_ED%TwrHNodes(:)
        IF (ErrStat2 /= 0) THEN
           CALL SetErrStat(ErrID_Fatal,"Error allocating OpFM%InitInput.",ErrStat,ErrMsg,RoutineName)
           CALL Cleanup()
           RETURN
        END IF
           ! set up the data structures for integration with OpenFOAM
        CALL Init_OpFM( InitInData_OpFM, p_FAST, AirDens, AD14%Input(1), AD%Input(1), InitOutData_AD, AD%y, ED%Output(1), OpFM, InitOutData_OpFM, ErrStat2, ErrMsg2 )
           CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
        
        IF (ErrStat >= AbortErrLev) THEN
  
negative.code: 
     p%KMax = 1                 ! after more checking, we may put this in the input file...
     !IF (p%CompIce == Module_IceF) p%KMax = 2
     p%SizeJac_ED_SD_HD_BD_Orca = 0  ! initialize this vector to zero; after we figure out what size the ED/SD/HD/BD meshes are, we'll fill this
     
     p%numIceLegs = 0           ! initialize number of support-structure legs in contact with ice (IceDyn will set this later)
     
  