[Dart-dev] DART/branches Revision: 11896

dart at ucar.edu dart at ucar.edu
Wed Aug 9 17:16:39 MDT 2017


thoar at ucar.edu
2017-08-09 17:16:36 -0600 (Wed, 09 Aug 2017)
319
Removed some hardcoded 'stop' calls with error_handler(), added some comments,
made some routines have doxygen-style documentation.
At this point, there are some peculiarities in the ROMS input file 
(grid-level chatter) that prevents us from knowing if we are smoothly 
interpolating across the irregular grid quads.




Modified: DART/branches/quad_interp/models/utilities/quad_utils_mod.f90
===================================================================
--- DART/branches/quad_interp/models/utilities/quad_utils_mod.f90	2017-08-09 21:13:28 UTC (rev 11895)
+++ DART/branches/quad_interp/models/utilities/quad_utils_mod.f90	2017-08-09 23:16:36 UTC (rev 11896)
@@ -1,8 +1,8 @@
-! DART software - Copyright 2004 - 2013 UCAR. This open source software is
-! provided by UCAR, "as is", without charge, subject to all terms of use at
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
 ! http://www.image.ucar.edu/DAReS/DART/DART_download
 !
-! $Id$
+! DART $Id$
 
 !> Search and interpolation routines for grids which are logically rectangular
 !> but may have irregular spacings along each axis, or may be warped so that
@@ -21,6 +21,13 @@
 !> might need to know which quad first, then build a height column, then do
 !> the interpolation.  so maybe it can't be a completely generic interp routine
 !> but it could be a simple skeleton and call the same routines as much as possible.
+!>
+!> The basic flow is this ... create a coarse regular rectangular grid and create
+!> a list of (irregular) quads for each grid cell. We use that regular grid
+!> to quickly search the subset of quads. Any variable names with "reg_box"
+!> refers to the regular rectangular grid. Only _valid_ quads get put in
+!> the regular box list of quads (i.e. if one corner of a quad is masked,
+!> it is not a valid quad).
 
 module quad_utils_mod
 
@@ -37,12 +44,12 @@
 implicit none
 private
 
-public :: quad_interp_handle,            & ! type - will need one for T grid, one for V grid
-          init_quad_interp,              & ! pass in grid type and counts here
-          finalize_quad_interp,          & ! release storage and reset vals
-          set_quad_coords,               & ! overload these 3: set_reg_xx, set_1d_xx, set_2d_xx
-          quad_lon_lat_locate,           & ! given lat,lon return above and below Is and Js
-          quad_lon_lat_evaluate,         & !given i,j and all 4 corner values, return interp val
+public :: quad_interp_handle,              & ! type - will need one for T grid, one for V grid
+          init_quad_interp,                & ! pass in grid type and counts here
+          finalize_quad_interp,            & ! release storage and reset vals
+          set_quad_coords,                 & ! overload these 3: set_reg_xx, set_1d_xx, set_2d_xx
+          quad_lon_lat_locate,             & ! given lat,lon return above and below Is and Js
+          quad_lon_lat_evaluate,           & !given i,j and all 4 corner values, return interp val
           GRID_QUAD_FULLY_REGULAR,         &
           GRID_QUAD_IRREG_SPACED_REGULAR,  &
           GRID_QUAD_FULLY_IRREGULAR,       &
@@ -64,14 +71,13 @@
 character(len=128), parameter :: revdate  = "$Date$"
 
 ! message strings
-character(len=512) :: msgstring, string1, string2
+character(len=512) :: string1, string2, string3
 
 logical, save :: module_initialized = .false.
 
 integer  :: debug = 0   ! turn up for more and more debug messages
 
-namelist /quad_interpolate_nml/  &
-   debug
+namelist /quad_interpolate_nml/ debug
 
 !> @todo FIXME internal routines should use h for the handle; externally callable
 !> routines should use interp_handle for clarity in the interface.
@@ -79,21 +85,21 @@
 ! the grid must always be logically rectangular, so knowing the i and j of a
 ! quad corner, the next quad starts at index i+1 and j+1.
 
-! 2d grid types:  
+! 2d grid types:
 !  can lats/lons be defined by giving only start, delta?  type 1
 !  are they each 1d arrays and the grid is defined by the cross product?  type 2
 !  are lat and lon both full 2d arrays, so completely irregular?  type 3
-integer, parameter :: GRID_QUAD_FULLY_REGULAR        =  1   
+integer, parameter :: GRID_QUAD_FULLY_REGULAR        =  1
 integer, parameter :: GRID_QUAD_IRREG_SPACED_REGULAR =  2
 integer, parameter :: GRID_QUAD_FULLY_IRREGULAR      =  3
 integer, parameter :: GRID_QUAD_UNKNOWN_TYPE         = -1
 
 ! where the locations are relative to each grid cell
-integer, parameter :: QUAD_LOCATED_UNKNOWN       =  -1   
-integer, parameter :: QUAD_LOCATED_CELL_CENTERS  =   1   
-integer, parameter :: QUAD_LOCATED_LON_EDGES     =   2   
-integer, parameter :: QUAD_LOCATED_LAT_EDGES     =   3   
-integer, parameter :: QUAD_LOCATED_CELL_CORNERS  =   4   
+integer, parameter :: QUAD_LOCATED_UNKNOWN       =  -1
+integer, parameter :: QUAD_LOCATED_CELL_CENTERS  =   1
+integer, parameter :: QUAD_LOCATED_LON_EDGES     =   2
+integer, parameter :: QUAD_LOCATED_LAT_EDGES     =   3
+integer, parameter :: QUAD_LOCATED_CELL_CORNERS  =   4
 
 ! data struct question - does this go directly into handle?
 ! right now it's in each option.
@@ -218,7 +224,7 @@
 
 ! NOTE (dipole/tripole grids): since both of the dipole and tripole
 ! grids are logically rectangular we can use the same interpolation
-! scheme originally implemented for the dipole grid. Here we can 
+! scheme originally implemented for the dipole grid. Here we can


More information about the Dart-dev mailing list