[Dart-dev] [3421] DART/trunk/ncep_obs/real_obs_mod.f90: Avoid giving unrecognized record types a wrong

nancy at ucar.edu nancy at ucar.edu
Tue Jun 3 16:38:15 MDT 2008


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20080603/20c7d475/attachment.html
-------------- next part --------------
Modified: DART/trunk/ncep_obs/real_obs_mod.f90
===================================================================
--- DART/trunk/ncep_obs/real_obs_mod.f90	2008-06-03 21:36:56 UTC (rev 3420)
+++ DART/trunk/ncep_obs/real_obs_mod.f90	2008-06-03 22:38:15 UTC (rev 3421)
@@ -219,9 +219,14 @@
 
    obs_prof = rcount/1000000
 
+
 !   assign each observation the correct observation type
 !------------------------------------------------------------------------------
 
+   ! make sure we do not fall through the code below without setting
+   ! a valid obs kind (e.g. the obstype is one not listed)
+   obs_kind = -1
+
    if(obs_prof == 1) then
      obs_kind_gen = KIND_TEMPERATURE
      if(obstype == 120 .or. obstype == 132) obs_kind = RADIOSONDE_TEMPERATURE
@@ -275,6 +280,17 @@
     if(obstype == 281 .or. obstype == 284) obs_kind = LAND_SFC_V_WIND_COMPONENT
    endif
 
+   if (obs_kind < 0) then
+      ! the "real" fix here if the record type is not found might actually be to
+      ! accept all record types here within valid ranges, and depend on the first
+      ! preprocessing steps (in the prepbufr converter) to remove obs record
+      ! types which are not desired.  for now, avoid giving them the wrong type
+      ! and quietly loop.
+      !print *, 'unrecognized obs_prof or obstype, skipping', obs_prof, obstype
+      iskip = iskip + 1
+      cycle obsloop 
+   endif
+
 !   check to see if this observation is desired
 !------------------------------------------------------------------------------
 


More information about the Dart-dev mailing list