[Dart-dev] DART/branches Revision: 12817

dart at ucar.edu dart at ucar.edu
Mon Sep 10 15:36:56 MDT 2018


nancy at ucar.edu
2018-09-10 15:36:55 -0600 (Mon, 10 Sep 2018)
150
add more context to errors when reading in an obs_seq file.
the old messages said the string it wanted but didn't print
the string it actually read.




Modified: DART/branches/rma_trunk/observations/forward_operators/DEFAULT_obs_def_mod.F90
===================================================================
--- DART/branches/rma_trunk/observations/forward_operators/DEFAULT_obs_def_mod.F90	2018-09-07 23:38:28 UTC (rev 12816)
+++ DART/branches/rma_trunk/observations/forward_operators/DEFAULT_obs_def_mod.F90	2018-09-10 21:36:55 UTC (rev 12817)
@@ -607,6 +607,7 @@
 integer           :: o_index
 logical           :: is_ascii
 character(len=32) :: fileformat   ! here for backwards compatibility only
+character(len=256) :: errstring
 character(len=11) :: header_external_FO 
 integer           :: ii, secs,days 
 character(len=128) :: string 
@@ -632,8 +633,10 @@
 if (is_ascii) then
    read(ifile, '(a5)') header
    if(header /= 'obdef') then
+      write(errstring, *) 'read "//header//" instead'
       call error_handler(E_ERR,'read_obs_def', &
-         'Expected header "obdef" in input file', source, revision, revdate)
+         'Expected header "obdef" in input file', &
+          source, revision, revdate, text2=errstring)
    endif
 endif
 
@@ -642,9 +645,10 @@
 if (is_ascii) then
    read(ifile, '(a5)' ) header
    if(header /= 'kind ') then
+      write(errstring, *) 'read "//header//" instead'
       call error_handler(E_ERR,'read_kind', &
          'Expected kind header "kind " in input file', &
-          source, revision, revdate)
+          source, revision, revdate, text2=errstring)
    endif
    read(ifile, *) o_index
 else
@@ -672,9 +676,10 @@
       continue
 
    case DEFAULT
+      write(errstring, *) 'unknown type number was ', obs_def%kind
       call error_handler(E_ERR, 'read_obs_def', &
          'Attempt to read for undefined obs_kind type.', &
-         source, revision, revdate)
+         source, revision, revdate, text2=errstring)
 end select
 
 ! We need to see whether there is external prior metadata.


More information about the Dart-dev mailing list