[Dart-dev] DART/releases Revision: 12939

dart at ucar.edu dart at ucar.edu
Tue Nov 27 08:34:34 MST 2018


nancy at ucar.edu
2018-11-27 08:34:34 -0700 (Tue, 27 Nov 2018)
100
roll back changes committed to the manhattan release that were
supposed to go on a branch.  sorry.




Modified: DART/releases/Manhattan/assimilation_code/location/threed_cartesian/xyz_location_mod.f90
===================================================================
--- DART/releases/Manhattan/assimilation_code/location/threed_cartesian/xyz_location_mod.f90	2018-11-26 23:32:23 UTC (rev 12938)
+++ DART/releases/Manhattan/assimilation_code/location/threed_cartesian/xyz_location_mod.f90	2018-11-27 15:34:34 UTC (rev 12939)
@@ -21,18 +21,9 @@
 implicit none
 private
 
-public :: xyz_location_type,         &
-          xyz_get_location,          &
-          xyz_set_location,          &
-          xyz_get_close_type,        &
-          xyz_get_close_init,        &
-          xyz_get_close_destroy,     &
-          xyz_find_nearest,          &
-          xyz_find_nearest_N,        &
-          xyz_use_great_circle_dist, &
-          xyz_get_dist,              &
-          xyz_get_ll_location,       &
-          xyz_write_location
+public :: xyz_location_type, xyz_get_location, xyz_set_location, &
+          xyz_get_close_maxdist_init, xyz_get_close_obs_init, xyz_get_close_type, &
+          xyz_find_nearest, xyz_get_close_obs_destroy, xyz_get_dist, xyz_get_ll_location
 
 ! version controlled file description for error handling, do not edit
 character(len=256), parameter :: source   = &
@@ -45,20 +36,34 @@
    real(r8) :: x, y, z
 end type xyz_location_type
 
-! This version supports regularly spaced boxes.
+! This version supports both regularly spaced boxes, and octree division
+! of the space.  for octrees, divide each dim in half until N numbers of filled 
+! boxes, or octree reaches some depth?  give some threshold where you don't
+! divide a box with less than N points in it?
 
+! contrast with kD-trees (divide along dimensions, not points), and there are
+! two types of octrees - PR (point region) where the regions split at an
+! explicit point, vs MX tree where the split is defined to be at the center
+! of the region.
+
+! if the underlying geometry is spherical, there will be many many empty boxes 
+! if we uniformly divide up space, and worse, existing locations will be 
+! clustered in a few boxes.
+
+
 type box_type
    private
-   integer, pointer  :: loc_box(:)           ! (nloc); List of loc indices in boxes
-   integer, pointer  :: count(:, :, :)       ! (nx, ny, nz); # of loc in each box
-   integer, pointer  :: start(:, :, :)       ! (nx, ny, nz); Start of list of loc in this box
+   integer, pointer  :: obs_box(:)           ! (nobs); List of obs indices in boxes
+   integer, pointer  :: count(:, :, :)       ! (nx, ny, nz); # of obs in each box
+   integer, pointer  :: start(:, :, :)       ! (nx, ny, nz); Start of list of obs in this box
    real(r8)          :: bot_x, top_x         ! extents in x, y, z
    real(r8)          :: bot_y, top_y 
    real(r8)          :: bot_z, top_z 
    real(r8)          :: x_width, y_width, z_width    ! widths of boxes in x,y,z
+   real(r8)          :: nboxes_x, nboxes_y, nboxes_z ! based on maxdist how far to search
 end type box_type
 
-! Type to facilitate efficient computation of locations close to a given location
+! Type to facilitate efficient computation of observations close to a given location
 type xyz_get_close_type
    private
    integer           :: num
@@ -68,11 +73,10 @@
 
 logical, save         :: module_initialized = .false.
 
-real(r8) :: sphere_radius          = -1.0_r8
-logical  :: line_of_sight_distance = .true.    ! alternative: great circle
-
 character(len = 512) :: errstring
 
+!real(r8) :: radius     ! used only for converting points on a sphere into x,y,z and back
+
 !-----------------------------------------------------------------
 ! Namelist with default values
 
@@ -81,7 +85,16 @@
 integer :: ny               = 20
 integer :: nz               = 20
 
+! tuning options
+integer :: filled           = 10   ! threshold at which you quit splitting
+logical :: use_octree       = .false.  ! if false, use regular boxes
+
+! extensible options - these may be useful for tuning the octree 
+! integer :: nboxes           = 1000 ! suggestion for max number of nodes
+! integer :: maxdepth         = 4    ! suggestion for max tree depth
+
 namelist /xyz_location_nml/ &
+   filled, use_octree, &
    nx, ny, nz
 
 !-----------------------------------------------------------------
@@ -88,7 +101,7 @@
 
 interface xyz_set_location
    module procedure set_location_single


More information about the Dart-dev mailing list