[Dart-dev] DART/branches Revision: 12895
dart at ucar.edu
dart at ucar.edu
Mon Oct 8 15:27:32 MDT 2018
nancy at ucar.edu
2018-10-08 15:27:32 -0600 (Mon, 08 Oct 2018)
262
add a better test case for the quad interp code to
the roms branch. this one is driven by a text file
that controls the data grid, which is then sampled
by a regular grid which is easy to plot. will
add the matlab script used for plotting in the
next commit.
Added: DART/branches/roms_interpolation/developer_tests/interpolation/test_quad_interp.f90
===================================================================
--- DART/branches/roms_interpolation/developer_tests/interpolation/test_quad_interp.f90 (rev 0)
+++ DART/branches/roms_interpolation/developer_tests/interpolation/test_quad_interp.f90 2018-10-08 21:27:32 UTC (rev 12895)
@@ -0,0 +1,792 @@
+! 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
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+!
+! DART $Id: test_quad_interp.f90 12852 2018-09-25 20:32:09Z thoar at ucar.edu $
+
+! test cases for the quad interpolation routines.
+!
+! eventually, want to support all of these combinations, but
+! not there yet.
+!
+! data grids:
+!
+! global grid, fully regular
+! global grid, semi regular
+! global grid, irregular
+!
+! regional grid, fully regular
+! regional grid, semi regular
+! regional grid, irregular
+!
+! with regional grids that:
+!
+! cover poles
+! cross greenwich line
+! are cyclic in longitude
+! are rotated
+!
+! and data:
+!
+! sin/cos pattern
+! moving average (rows/cols)
+! lon or lat vals (lon+lat?)
+!
+!
+! notes:
+!
+! generating output suitable for plotting:
+!
+! generate a sampling grid that's fully regular
+! for ease in plotting. make it higher density
+! than the data grid to ensure smooth interpolation
+! across the original cells.
+!
+! automating tests more:
+!
+! interpolate from data grid to sample grid, and
+! then interpolate back to original data grid and
+! quantify the residuals. no plot output but print
+! high and low values.
+!
+!
+! make sampling grids that:
+!
+! cover poles (regional)
+! cross greenwich line (regional)
+! are cyclic in longitude (regional)
+! are global
+!
+
+program test_quad_interp
+
+
+use types_mod, only : r8, i8, MISSING_R8, deg2rad, rad2deg
+use utilities_mod, only : error_handler, initialize_utilities, finalize_utilities, &
+ find_namelist_in_file, check_namelist_read, open_file, close_file, &
+ nmlfileunit, do_output, do_nml_file, do_nml_term
+use random_seq_mod, only : init_random_seq, random_seq_type, random_uniform, random_gaussian
+use parse_args_mod, only : get_args_from_string
+use quad_utils_mod, only : quad_interp_handle, init_quad_interp, finalize_quad_interp, set_quad_coords, &
+ quad_lon_lat_locate, quad_lon_lat_evaluate, GRID_QUAD_FULLY_REGULAR, &
+ GRID_QUAD_IRREG_SPACED_REGULAR, GRID_QUAD_FULLY_IRREGULAR, GRID_QUAD_UNKNOWN_TYPE, &
+ QUAD_LOCATED_UNKNOWN, QUAD_LOCATED_CELL_CENTERS, QUAD_LOCATED_LON_EDGES, &
+ QUAD_LOCATED_LAT_EDGES, QUAD_LOCATED_CELL_CORNERS
+
+
+implicit none
+
+! make a derived type to hold configs for a list of test cases
+! always sampled on regular grid (for ease in plotting)
+!
+! for fully regular, need delta lon,lat and rep count or extents
+! for partially regular, need full 1d lon,lat arrays
+! for fully irregular, need full 2d lon,lat arrays
+
+! source data grid to be sampled
+type src_testtype
+ integer :: grid_type
+ integer :: relative_cell_location
+ integer :: lon_count, lat_count
+ real(r8) :: lon_start, lon_end
+ real(r8) :: lat_start, lat_end
+ real(r8), allocatable :: lon_1d_array(:), lat_1d_array(:)
+ real(r8), allocatable :: lon_2d_array(:,:), lat_2d_array(:,:)
+ real(r8), allocatable :: grid_2d_array(:,:)
+ integer :: data_pattern
More information about the Dart-dev
mailing list