From f99a5612be576d8a660a72ec845dd01fa2042f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20M=C3=B8yner?= Date: Mon, 16 Sep 2024 09:02:51 +0200 Subject: [PATCH] Handle arbitrary grid keywords in GRID/REGIONS --- src/InputParser/utils.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/InputParser/utils.jl b/src/InputParser/utils.jl index 15fd477..179ec86 100644 --- a/src/InputParser/utils.jl +++ b/src/InputParser/utils.jl @@ -422,15 +422,19 @@ function parse_keyword!(data, outer_data, units, cfg, f, v::Val{T}) where T end if !found + section = outer_data["CURRENT_SECTION"] if startswith(kw_str, "TVDP") parser_message(cfg, outer_data, kw_str, PARSER_MISSING_SUPPORT) read_record(f) - elseif startswith(kw_str, "FIP") + elseif section == :REGIONS data[kw_str] = parse_and_set_grid_data!(data, outer_data, units, cfg, f, T, T = Int) + elseif section == :GRID + data[kw_str] = parse_and_set_grid_data!(data, outer_data, units, cfg, f, T, T = Float64) else - error("Unhandled keyword $T encountered.") + error("Unhandled keyword $T in $section encountered.") end end + return data end function failure_print_line_context(f; kw = nothing)