anchor.diff:                       'found in the WAMIT data file '//TRIM(NewmanAppData%Filename)//' for the second wave direction.', &
                        ErrStat, ErrMsg, RoutineName)
               ENDIF
  -            IF ( InitInp%WaveDirMax < MAXVAL(NewmanAppData%Data4D%WvDir2) ) THEN
  +            IF ( InitInp%WaveDirMax > MAXVAL(NewmanAppData%Data4D%WvDir2) ) THEN
                  CALL SetErrStat( ErrID_Fatal,' Maximum wave direction required of '//TRIM(Num2LStr(InitInp%WaveDirMax))//' is not'//&
                        'found in the WAMIT data file '//TRIM(NewmanAppData%Filename)//' for the second wave direction.', &
                        ErrStat, ErrMsg, RoutineName)
  
positive.code:                      'found in the WAMIT data file '//TRIM(NewmanAppData%Filename)//' for the first wave direction.', &
                       ErrStat, ErrMsg, RoutineName)
              ENDIF
              IF ( InitInp%WaveDirMax < MAXVAL(NewmanAppData%Data3D%WvDir1) ) THEN
                 CALL SetErrStat( ErrID_Fatal,' Maximum wave direction required of '//TRIM(Num2LStr(InitInp%WaveDirMax))//' is not'//&
                       'found in the WAMIT data file '//TRIM(NewmanAppData%Filename)//' for the first wave direction.', &
                       ErrStat, ErrMsg, RoutineName)
  
negative.code:                   'found in the WAMIT data file '//TRIM(DiffQTFData%Filename)//' for the first wave direction.', &
                    ErrStat, ErrMsg, RoutineName)
           ENDIF
           IF ( InitInp%WaveDirMax > MAXVAL(DiffQTFData%Data4D%WvDir1) ) THEN
              CALL SetErrStat( ErrID_Fatal,' Maximum wave direction required of '//TRIM(Num2LStr(InitInp%WaveDirMax))//' is not'//&
                    'found in the WAMIT data file '//TRIM(DiffQTFData%Filename)//' for the first wave direction.', &
                    ErrStat, ErrMsg, RoutineName)
  