[Dart-dev] DART/branches Revision: 12800

dart at ucar.edu dart at ucar.edu
Fri Aug 31 09:25:24 MDT 2018


nancy at ucar.edu
2018-08-31 09:25:24 -0600 (Fri, 31 Aug 2018)
43
make these sets of files self-consistent.




Modified: DART/branches/recam/assimilation_code/location/threed_cartesian/xyz_location_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/location/threed_cartesian/xyz_location_mod.f90	2018-08-31 15:24:42 UTC (rev 12799)
+++ DART/branches/recam/assimilation_code/location/threed_cartesian/xyz_location_mod.f90	2018-08-31 15:25:24 UTC (rev 12800)
@@ -21,9 +21,18 @@
 implicit none
 private
 
-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
+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
 
 ! version controlled file description for error handling, do not edit
 character(len=256), parameter :: source   = &
@@ -36,10 +45,15 @@
    real(r8) :: x, y, z
 end type xyz_location_type
 
-! 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?
+! This version supports only regularly spaced boxes. it originally had code to
+! use an octree division of the space, but finding nearest boxes on each side
+! (where there might be multiples) was too complex.  i still think its a good
+! idea but need a better data structure to capture the relationships of leaving
+! any box via a face and listing all the other boxes that adjoin that face.
+!
+! the basic idea for octrees was to divide each dim in half until N numbers of filled 
+! boxes, or octree reaches some max 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
@@ -53,17 +67,17 @@
 
 type box_type
    private
-   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
+   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
    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
+   real(r8)          :: nboxes_x, nboxes_y, nboxes_z ! based on maxdist how far to search - unused FIXME
 end type box_type
 
-! Type to facilitate efficient computation of observations close to a given location
+! Type to facilitate efficient computation of locations close to a given location
 type xyz_get_close_type
    private
    integer           :: num
@@ -73,28 +87,20 @@
 
 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
 
 ! count of boxes (for box option) in each dim.
-integer :: nx               = 20
-integer :: ny               = 20
-integer :: nz               = 20
+integer :: nx         = 20
+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, &


More information about the Dart-dev mailing list