From a66ce505c3d87e39da5f03d9d39a372ff7d53be4 Mon Sep 17 00:00:00 2001 From: Helen Kershaw Date: Fri, 9 Aug 2024 10:17:41 -0400 Subject: [PATCH] fix: check for <=0 max dist 3d cartesian see #626 --- .../location/threed_cartesian/location_mod.f90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assimilation_code/location/threed_cartesian/location_mod.f90 b/assimilation_code/location/threed_cartesian/location_mod.f90 index 32c712d165..7afa4722d4 100644 --- a/assimilation_code/location/threed_cartesian/location_mod.f90 +++ b/assimilation_code/location/threed_cartesian/location_mod.f90 @@ -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