From 70ddeee58d7c1330ba43a7e6d6cb4b1cba0e6d57 Mon Sep 17 00:00:00 2001 From: Michael Duda Date: Fri, 21 Mar 2014 23:26:58 +0000 Subject: [PATCH] Add an optional argument to ext_get_dom_ti_integer_scalar() in input_module.F to allow error messages to be suppressed. This is useful when querying an input file for global attributes that may or may not exist. M metgrid/src/input_module.F git-svn-id: https://svn-wrf-wps.cgd.ucar.edu/trunk@807 86b71a92-4018-0410-97f8-d555beccfc3a --- metgrid/src/input_module.F | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metgrid/src/input_module.F b/metgrid/src/input_module.F index d1a380e..563fdb6 100644 --- a/metgrid/src/input_module.F +++ b/metgrid/src/input_module.F @@ -592,13 +592,14 @@ module input_module ! ! Purpose: Read a domain time-independent integer attribute from input. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine ext_get_dom_ti_integer_scalar(var_name, var_value) + subroutine ext_get_dom_ti_integer_scalar(var_name, var_value, suppress_errors) implicit none ! Arguments integer, intent(out) :: var_value character (len=*), intent(in) :: var_name + logical, intent(in), optional :: suppress_errors ! Local variables integer :: istatus, outcount @@ -625,7 +626,11 @@ module input_module end if #endif - call mprintf((istatus /= 0),ERROR,'Error while reading domain time-independent attribute.') + if (present(suppress_errors)) then + call mprintf((istatus /= 0 .and. .not.suppress_errors),ERROR,'Error while reading domain time-independent attribute.') + else + call mprintf((istatus /= 0),ERROR,'Error while reading domain time-independent attribute.') + end if end subroutine ext_get_dom_ti_integer_scalar -- 2.11.4.GIT