[Dart-dev] DART/branches Revision: 11721

dart at ucar.edu dart at ucar.edu
Tue Jun 13 16:39:27 MDT 2017


nancy at ucar.edu
2017-06-13 16:39:26 -0600 (Tue, 13 Jun 2017)
311
first pass at updated interpolation routine.
i believe i've removed the dependency on passing
subarrays of the state vector around, but there is
still work to be done since now the return is
ensemble sized instead of a scalar.

i haven't added the call for add_domain() yet in
the static_init_model() routine.




Modified: DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90
===================================================================
--- DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90	2017-06-13 22:37:51 UTC (rev 11720)
+++ DART/branches/coamps/models/coamps_nest/coamps_interp_mod.f90	2017-06-13 22:39:26 UTC (rev 11721)
@@ -27,7 +27,8 @@
                                      get_nest_size, get_nest_level,             &
                                      in_this_nest
 
-    use coamps_statevar_mod,  only : state_variable, get_var_substate, is_sigma_level
+    use coamps_statevar_mod,  only : state_variable, get_var_substate, is_sigma_level, &
+                                     state_limits
 
     use coamps_statevec_mod,  only : state_vector, find_state_variable
 
@@ -45,11 +46,7 @@
   
     use location_mod,         only : location_type,    &
                                      query_location,   &
-                                     vert_is_height,   &
-                                     vert_is_undef,    &
-                                     vert_is_level,    &
-                                     vert_is_pressure, &
-                                     vert_is_surface
+                                     is_vertical
     use obs_kind_mod
     use types_mod,            only : MISSING_I,        &
                                      MISSING_R8,       &
@@ -60,6 +57,7 @@
                                      E_WARN,           &
                                      error_handler,    &
                                      register_module 
+    use ensemble_manager_mod, only : ensemble_type
   
     implicit none
   
@@ -172,10 +170,15 @@
         private
 
         ! Shortcut references
-        real(kind=r8), dimension(:), pointer :: model_state 
+        ! ORIGINAL:
+        !real(kind=r8), dimension(:), pointer :: model_state 
+        ! NEW:
+        type(ensemble_handle),       pointer :: state_handle
+        integer                              :: ensemble_size
         type(coamps_domain),         pointer :: model_domain
         type(coamps_nest),           pointer :: interp_nest
         type(state_vector),          pointer :: state_definition
+        type(state_limits)                   :: state_limits 
 
         ! Location (horizontal and vertical) of where we will interpolate
         type(nest_point)  :: interp_point
@@ -186,9 +189,10 @@
         integer, dimension(NUM_NEIGHBORS) :: neighbors_i
         integer, dimension(NUM_NEIGHBORS) :: neighbors_j
 
-        ! Raw values - indexed by (neighbor, sigma level)
-        real(kind=r8), dimension(:,:), pointer :: target_values
-        real(kind=r8), dimension(:,:), pointer :: vcoord_values
+        ! OLD Raw values - indexed by (neighbor, sigma level)
+        ! Raw values - indexed by (ens_size, neighbor, sigma level)
+        real(kind=r8), dimension(:,:,:), pointer :: target_values
+        real(kind=r8), dimension(:,:,:), pointer :: vcoord_values
 
         ! Variable availability is stored as an (# of levels) x (# of vars)
         ! array - if the value at (level, variable) is .true., then that
@@ -199,8 +203,8 @@
         integer                          :: num_levels_available
 
         ! Filtered raw values only on levels that have all data available
-        real(kind=r8), dimension(:,:), pointer :: available_target_values
-        real(kind=r8), dimension(:,:), pointer :: available_vcoord_values
+        real(kind=r8), dimension(:,:,:), pointer :: available_target_values
+        real(kind=r8), dimension(:,:,:), pointer :: available_vcoord_values
 
         ! Results of vertical interpolation
         real(kind=r8), dimension(:,:),          pointer :: vinterp_values
@@ -254,6 +258,8 @@
     ! Driver for interpolation calculation
     !  PARAMETERS
     !   IN  state             big ol' DART state vector
+    ! NOW: state_handle       handle to entire ensemble of state
+    !   IN  ens_size          ensemble size
     !   IN  domain            COAMPS domain to interpolate on
     !   IN  state_def         COAMPS state vector definition
     !   IN  obs_loc           DART location structure to interpolate to
@@ -260,15 +266,16 @@
     !   IN  obs_kind          integer version of raw variable type
     !   OUT obs_value         result of interpolation
     !   OUT interp_worked     true if interpolation was successful
-    subroutine interpolate(state, domain, state_def, obs_loc, obs_kind, &
+    subroutine interpolate(state_handle, ens_size, domain, state_def, obs_loc, obs_kind, &
                            obs_value, interp_worked)
-        real(kind=r8), dimension(:), intent(in)  :: state
+        type(ensemble_type),         intent(in)  :: state_handle
+        integer,                     intent(in)  :: ens_size
         type(coamps_domain),         intent(in)  :: domain
         type(state_vector),          intent(in)  :: state_def
         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