Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/2d/shallow/flag2refine2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ subroutine flag2refine2(mx,my,mbc,mbuff,meqn,maux,xlower,ylower,dx,dy,t,level, &
! the storm and refine if we are
if (storm_specification_type /= 0) then
R_eye = storm_location(t)
do m=1,size(R_refine,1)
do m=1,min(size(R_refine), mxnest)
if (coordinate_system == 2) then
ds = spherical_distance(x_c, y_c, R_eye(1), R_eye(2))
else
Expand All @@ -116,7 +116,7 @@ subroutine flag2refine2(mx,my,mbc,mbuff,meqn,maux,xlower,ylower,dx,dy,t,level, &
! Refine based on wind speed
if (wind_forcing) then
wind_speed = sqrt(aux(wind_index,i,j)**2 + aux(wind_index+1,i,j)**2)
do m=1,size(wind_refine,1)
do m=1,min(size(wind_refine), mxnest)
if ((wind_speed > wind_refine(m)) .and. (level <= m)) then
amrflags(i,j) = DOFLAG
cycle x_loop
Expand Down Expand Up @@ -147,7 +147,7 @@ subroutine flag2refine2(mx,my,mbc,mbuff,meqn,maux,xlower,ylower,dx,dy,t,level, &
! also have a per layer criteria since this is not
! gradient based
speed = sqrt(q(2,i,j)**2 + q(3,i,j)**2) / q(1,i,j)
do m=1,min(size(speed_tolerance),mxnest)
do m=1,min(size(speed_tolerance), mxnest)
if (speed > speed_tolerance(m) .and. level <= m) then
amrflags(i,j) = DOFLAG
cycle x_loop
Expand Down
23 changes: 14 additions & 9 deletions src/2d/shallow/utility_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,21 @@ integer function get_value_count(line) result(count)

search_buffer = trim(line(1:index(line,"=:") - 2))

do i=1,len_trim(search_buffer)
if (search_buffer(i:i) == " ") then
if (.not. found) then
found = .true.
count = count + 1
if (len_trim(search_buffer) == 0 .or. &
trim(search_buffer) == "None") then
count = 0
else
do i=1,len_trim(search_buffer)
if (search_buffer(i:i) == " ") then
if (.not. found) then
found = .true.
count = count + 1
endif
else
found = .false.
endif
else
found = .false.
endif
enddo
enddo
end if

end function get_value_count

Expand Down
6 changes: 3 additions & 3 deletions src/python/geoclaw/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self):

# Refinement controls
self.add_attribute('wave_tolerance',1.0e-1)
self.add_attribute('speed_tolerance',[1.0e12]*6)
self.add_attribute('speed_tolerance', None)
self.add_attribute('deep_depth',None) # deprecated
self.add_attribute('max_level_deep',None) # deprecated
self.add_attribute('variable_dt_refinement_ratios',False)
Expand All @@ -144,7 +144,7 @@ def write(self,data_source='setrun.py', out_file='refinement.data'):
w = '\n *** WARNING: max_level_deep parameter ignored as of v5.8.0'
warnings.warn(w, UserWarning)

if not isinstance(self.speed_tolerance,list):
if isinstance(self.speed_tolerance, float):
self.speed_tolerance = [self.speed_tolerance]
self.data_write('speed_tolerance')
self.data_write()
Expand Down Expand Up @@ -569,7 +569,7 @@ def __init__(self):

# AMR parameters
self.add_attribute('wind_refine', [20.0,40.0,60.0])
self.add_attribute('R_refine', [60.0e3,40e3,20e3])
self.add_attribute('R_refine', [60.0e3, 40e3, 20e3])

# Storm parameters
self.add_attribute('storm_type', None) # Backwards compatibility
Expand Down
Loading