anchor.diff:              RETURN
            END IF      
   
  -         
  -      CALL MeshCopy ( SrcMesh      = u%Mesh                 &
  -                     ,DestMesh     = y%Mesh                 &
  -                     ,CtrlCode     = MESH_SIBLING           &
  -                     ,IOS          = COMPONENT_OUTPUT       &
  -                     ,ErrStat      = ErrStat2               &
  -                     ,ErrMess      = ErrMsg2                &
  -                     ,Force        = .TRUE.                 &
  -                     ,Moment       = .TRUE.                 )
  -     
  -         CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'WAMIT_Init')
  +        call MeshCopy ( SrcMesh   = u%Mesh           &
  +                       ,DestMesh  = y%Mesh           &
  +                       ,CtrlCode  = MESH_SIBLING     &
  +                       ,IOS       = COMPONENT_OUTPUT &
  +                       ,ErrStat   = ErrStat2         &
  +                       ,ErrMess   = ErrMsg2          &
  +                       ,Force     = .TRUE.           &
  +                       ,Moment    = .TRUE.           )
  +        
  +      CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'WAMIT_Init')
            IF ( ErrStat >= AbortErrLev ) THEN
               CALL Cleanup()
               RETURN
  -         END IF      
  -      
  -      
  +         END IF    
         u%Mesh%RemapFlag  = .TRUE.
         y%Mesh%RemapFlag  = .TRUE.
   
  
positive.code:         
     
  CONTAINS
  !----------------------------------------------------------------------------------------------------------------------------------
  !> This routine is called at the start of the simulation to perform initialization steps. 
  !! The parameters are set here and not changed during the simulation.
  
negative.code: 
        CLOSE ( UnW1 ) ! Close file.
  
           ! need to transform HdroAddMs and HdroDmpng when PtfmRefztRot is nonzero per plan
        do I = 1, NInpFreq
           call TransformWAMITMatrices( p%NBody, InitInp%PtfmRefztRot, HdroAddMs(I,:,:) )
           call TransformWAMITMatrices( p%NBody, InitInp%PtfmRefztRot, HdroDmpng(I,:,:) )
        end do
        
        
           ! Linear, frequency- and direction-dependent complex hydrodynamic wave
           !   excitation force per unit wave amplitude vector from the diffraction
           !   problem:
  