[Dart-dev] [7303] DART/trunk/obs_def/obs_def_radar_mod.f90: addresses user support request DARTSUP-126.

nancy at ucar.edu nancy at ucar.edu
Fri Dec 12 15:21:25 MST 2014


Revision: 7303
Author:   nancy
Date:     2014-12-12 15:21:25 -0700 (Fri, 12 Dec 2014)
Log Message:
-----------
addresses user support request DARTSUP-126.  if you create
synthetic radar observations with the 'create_obs_sequence' program,
the default is to use 'missing_r8' as the nyquist velocity.  the intent
was that no doppler radar unfolding would be needed for these observations.
but in fact the existing code threw a fatal error when reading in the
missing_r8 value since it was negative.  

i added code to print a warning message the first time an observation
with a missing nyquist velocity is read in, in case none are expected,
but then it goes ahead and reads the rest without complaint, and it will
ignore them when doing the doppler unfolding in filter.

Modified Paths:
--------------
    DART/trunk/obs_def/obs_def_radar_mod.f90

-------------- next part --------------
Modified: DART/trunk/obs_def/obs_def_radar_mod.f90
===================================================================
--- DART/trunk/obs_def/obs_def_radar_mod.f90	2014-12-12 18:29:06 UTC (rev 7302)
+++ DART/trunk/obs_def/obs_def_radar_mod.f90	2014-12-12 22:21:25 UTC (rev 7303)
@@ -152,7 +152,7 @@
 integer :: velkeycount = 0 
 
 ! For error message content
-character(len=129) :: msgstring
+character(len=256) :: msgstring
 
 ! Values which are initialized at run time so some can be changed by
 ! namelist.  After initialization, treated as parameters (values not changed).
@@ -621,6 +621,8 @@
 logical, intent(in) :: is_asciiformat
 real(r8)            :: read_nyquist_velocity
 
+logical, save :: first_time = .true.
+
 if ( .not. module_initialized ) call initialize_module
 
 if (is_asciiformat) then
@@ -629,12 +631,27 @@
    read(ifile)    read_nyquist_velocity
 endif
 
-! Check for illegal values; must be non-negative.
-if (read_nyquist_velocity < 0.0_r8) then
+! idealized obs leave the nyquist velocity as missing_r8.
+! warn the user (once) but allow it.  they will not be unfolded
+! at assimilation time, which is usually the desired behavior
+! for an idealized ob.
+
+if (read_nyquist_velocity == missing_r8 .and. first_time) then
+   write(msgstring, *) "no doppler velocity unfolding can be done on these observations"
+   call error_handler(E_MSG, 'read_nyquist_velocity:', &
+                      "radar observation(s) with missing nyquist velocities encountered on read", &
+                      source, revision, revdate, text2=msgstring)
+ 
+   first_time = .false.
+endif
+
+! Check for illegal values; must be non-negative (missing is ok).
+if (read_nyquist_velocity < 0.0_r8 .and. read_nyquist_velocity /= missing_r8) then
    write(msgstring,*) "bad value for nyquist velocity: ", read_nyquist_velocity
-   call error_handler(E_ERR, 'read_nyquist_velocity', msgstring, &
-                      source, revision, revdate)
+   call error_handler(E_ERR, 'read_nyquist_velocity:', msgstring, &
+                      source, revision, revdate, text2="nyquist velocity must be non-negative")
 endif
+
 end function read_nyquist_velocity
 
 !----------------------------------------------------------------------


More information about the Dart-dev mailing list