[Dart-dev] DART/branches Revision: 12322

dart at ucar.edu dart at ucar.edu
Fri Jan 12 11:36:34 MST 2018


thoar at ucar.edu
2018-01-12 11:36:33 -0700 (Fri, 12 Jan 2018)
619
Making the coamps_interp_mod:interpolate() routine return an integer
error code instead of a logical to enable diagnosing forward operator errors.

model_interpolate():status     has these values:
     all 0s if interpolation was successful
     900 unspecified failure
     901 where the location is not in domain or on an unsupported level type
     902 where there are not enough vertical levels
     903 where the location is too high or too low (extrapolation)
     904 where unable to interpolate to a single level
     915 where altimeter is unrealistic
     999 vortex obs ... untested at this point, skipping




Modified: DART/branches/coamps/assimilation_code/location/threed_sphere/location_mod.f90
===================================================================
--- DART/branches/coamps/assimilation_code/location/threed_sphere/location_mod.f90	2018-01-12 17:30:58 UTC (rev 12321)
+++ DART/branches/coamps/assimilation_code/location/threed_sphere/location_mod.f90	2018-01-12 18:36:33 UTC (rev 12322)
@@ -1095,7 +1095,7 @@
    case ("SCALE_HEIGHT")
       is_vertical = (VERTISSCALEHEIGHT == location%which_vert)
    case default
-      write(msgstring, *) 'unrecognized key for vertical type: ', which_vert, location%which_vert
+      write(msgstring, *) 'unrecognized key for vertical type: "', trim(which_vert)//'"', location%which_vert
       call error_handler(E_ERR, 'is_vertical', msgstring, source, revision, revdate)
 end select
 

Modified: DART/branches/coamps/assimilation_code/modules/assimilation/filter_mod.f90
===================================================================
--- DART/branches/coamps/assimilation_code/modules/assimilation/filter_mod.f90	2018-01-12 17:30:58 UTC (rev 12321)
+++ DART/branches/coamps/assimilation_code/modules/assimilation/filter_mod.f90	2018-01-12 18:36:33 UTC (rev 12322)
@@ -1891,7 +1891,7 @@
 integer,             intent(in)    :: ens_size
 integer,             intent(in)    :: keys(:) ! I think this is still var size
 
-character*12 :: task
+character(len=12) :: task
 integer :: j, i
 integer :: forward_unit
 

Modified: DART/branches/coamps/assimilation_code/modules/observations/forward_operator_mod.f90
===================================================================
--- DART/branches/coamps/assimilation_code/modules/observations/forward_operator_mod.f90	2018-01-12 17:30:58 UTC (rev 12321)
+++ DART/branches/coamps/assimilation_code/modules/observations/forward_operator_mod.f90	2018-01-12 18:36:33 UTC (rev 12322)
@@ -59,15 +59,15 @@
 
 !------------------------------------------------------------------------------
 ! version controlled file description for error handling, do not edit
-character(len=256), parameter :: source   = &
+character(len=*), parameter :: source   = &
    "$URL$"
-character(len=32 ), parameter :: revision = "$Revision$"
-character(len=128), parameter :: revdate  = "$Date$"
+character(len=*), parameter :: revision = "$Revision$"
+character(len=*), parameter :: revdate  = "$Date$"
 !------------------------------------------------------------------------------
 
 
 ! Module storage for writing error messages
-character(len = 255) :: msgstring
+character(len=512) :: msgstring
 
 contains
 
@@ -133,6 +133,9 @@
 allocate(expected_obs(num_copies_to_calc))
 allocate(my_copy_indices(num_copies_to_calc))
 
+istatus = 999123
+expected_obs = MISSING_R8
+
 ! FIXME: these no longer do anything?
 ! call prepare_to_write_to_vars(obs_fwd_op_ens_handle)
 ! call prepare_to_write_to_vars(qc_ens_handle)
@@ -213,6 +216,8 @@
             obs_fwd_op_ens_handle%vars(j, 1:num_copies_to_calc) = expected_obs
       else ! need to know whether it was assimilate or evaluate this ob.
 
+         ! TJH istatus is not set in here, yet it is in the other half of the if statement.
+         ! TJH Consequently, initializing it after it gets allocated.
          call assim_or_eval(seq, thiskey(1), ens_handle%num_vars, assimilate_this_ob, evaluate_this_ob)
 
       endif
@@ -233,6 +238,7 @@
          endif
       enddo
 
+      ! TJH if qc_ens_handle%my_num_copies <= 0) istatus was not defined
       qc_ens_handle%vars(j, 1:num_copies_to_calc) = istatus(:)
 
       call check_forward_operator_istatus(num_copies_to_calc, assimilate_this_ob, &

Modified: DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90
===================================================================
--- DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90	2018-01-12 17:30:58 UTC (rev 12321)
+++ DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90	2018-01-12 18:36:33 UTC (rev 12322)
@@ -277,7 +277,11 @@
     !   IN  obs_loc           DART location structure to interpolate to
     !   IN  obs_kind          integer version of raw variable type
     !   OUT obs_value         result of interpolation
-    !   OUT interp_worked     true if interpolation was successful
+    !   OUT interp_worked       0 if interpolation was successful
+    !                         901 if the location is not in domain or on an unsupported level type
+    !                         902 if there are not enough vertical levels
+    !                         903 if the location is too high or too low (extrapolation)
+    !                         904 unable to interpolate to a single level
     subroutine interpolate(state_handle, ens_size, ens_num, domain, state_def, obs_loc, obs_kind, &
                            obs_value, interp_worked)
         type(ensemble_type),         intent(in)  :: state_handle
@@ -288,7 +292,7 @@
         type(location_type),         intent(in)  :: obs_loc
         integer,                     intent(in)  :: obs_kind
         real(kind=r8),               intent(out) :: obs_value


More information about the Dart-dev mailing list