Skip to content

Commit 5aa1e87

Browse files
authored
Merge pull request #3099 from andrew-platt/f/FF_HR_bounds_box_corners
ifw flowfield: add box corners to out of bounds message on 4D
2 parents 1f74491 + 1850c1a commit 5aa1e87

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/inflowwind/src/IfW_FlowField.f90

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ subroutine Grid4DField_GetVel(G4D, Time, Position, Velocity, ErrStat, ErrMsg)
16281628
real(ReKi) :: P(3, 16) ! Point values
16291629
real(ReKi) :: tmp
16301630
integer(IntKi) :: i
1631-
character(60) :: PtLoc
1631+
character(60) :: PtLoc, BoxLL, BoxUR
16321632

16331633
ErrStat = ErrID_None
16341634
ErrMsg = ""
@@ -1665,12 +1665,16 @@ subroutine Grid4DField_GetVel(G4D, Time, Position, Velocity, ErrStat, ErrMsg)
16651665
do i = 1, 4
16661666
if (Indx_Lo(i) <= 0) then
16671667
Indx_Lo(i) = 1
1668-
write(PtLoc,'(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
1669-
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc), ErrStat, ErrMsg, RoutineName)
1668+
write(PtLoc, '(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
1669+
write(BoxLL, '(A1,3(f8.2,A1))') '(',G4D%pZero(1),',',G4D%pZero(2),',',G4D%pZero(3),')'
1670+
write(BoxUR, '(A1,3(f8.2,A1))') '(',G4D%pZero(1)+(G4D%n(1)-1)*G4D%delta(1),',',G4D%pZero(2)+(G4D%n(2)-1)*G4D%delta(2),',',G4D%pZero(3)+(G4D%n(3)-1)*G4D%delta(3),')'
1671+
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc)//'; box bounds: '//trim(BoxLL)//' to '//trim(BoxUR), ErrStat, ErrMsg, RoutineName)
16701672
return
16711673
elseif (Indx_Lo(i) >= G4D%n(i)) then
1672-
write(PtLoc,'(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
1673-
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc), ErrStat, ErrMsg, RoutineName)
1674+
write(PtLoc, '(A1,3(f8.2,A1))') '(',Position(1),',',Position(2),',',Position(3),')'
1675+
write(BoxLL, '(A1,3(f8.2,A1))') '(',G4D%pZero(1),',',G4D%pZero(2),',',G4D%pZero(3),')'
1676+
write(BoxUR, '(A1,3(f8.2,A1))') '(',G4D%pZero(1)+(G4D%n(1)-1)*G4D%delta(1),',',G4D%pZero(2)+(G4D%n(2)-1)*G4D%delta(2),',',G4D%pZero(3)+(G4D%n(3)-1)*G4D%delta(3),')'
1677+
call SetErrStat(ErrID_Fatal, 'Outside the grid bounds: '//trim(PtLoc)//'; box bounds: '//trim(BoxLL)//' to '//trim(BoxUR), ErrStat, ErrMsg, RoutineName)
16741678
return
16751679
end if
16761680
Indx_Hi(i) = min(Indx_Lo(i) + 1, G4D%n(i)) ! make sure it's a valid index

0 commit comments

Comments
 (0)