Skip to content

Commit

Permalink
fix: check for <=0 max dist 3d cartesian
Browse files Browse the repository at this point in the history
see #626
  • Loading branch information
hkershaw-brown committed Aug 9, 2024
1 parent 179b869 commit a66ce50
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assimilation_code/location/threed_cartesian/location_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,21 @@ subroutine get_close_init(gc, num, maxdist, locs, maxdist_list)

if ( .not. module_initialized ) call initialize_module

if (maxdist <= 0.0_r8) then
write(msgstring, *) 'bad maxdist value ', maxdist, ' , must be > 0'
call error_handler(E_ERR, 'get_close_init', msgstring, source)
endif

typecount = get_num_types_of_obs()
allocate(gc%type_to_cutoff_map(typecount))

if (present(maxdist_list)) then

if (any(maxdist_list <= 0.0_r8)) then
write(msgstring, *) 'bad maxdist_list value ', maxdist_list, ' , must be > 0'
call error_handler(E_ERR, 'get_close_init', msgstring, source)
endif

if (size(maxdist_list) .ne. typecount) then
write(msgstring,'(A,I8,A,I8)')'maxdist_list len must equal number of specific types, ', &
size(maxdist_list), ' /= ', typecount
Expand Down

0 comments on commit a66ce50

Please sign in to comment.