Merge branch 'subgrid_shift' into develop (PR #195)
This merge corrects a shift in the interpolated subgrid fields in geogrid.
TYPE: bug fix
KEYWORDS: subgrid, interpolation, indexing, fire
SOURCE: Angel Farguell and Adam Kochanski (San Jose State University),
Jan Mandel (University of Colorado Denver)
DESCRIPTION OF CHANGES:
Problem:
When processing data into WPS release-v4.3.1 using a geogrid option subgrid=yes,
the resulting variables inside WPS are generated with shifting errors of about
0.375·dx and 0.375·dy to x and y direction respectively, where dx and dy are the
atmospheric grid resolutions. The problem is a combination of the next two
problems:
* Subroutine get_lat_lon_fields from file geogrid/src/process_tile_module.F
and subroutine process_continuous_block from
metgrid/src/process_domain_module.F: Translates subgrid indexes [is,js] to
atmosphere indexes [(is-1)/sr_x+1.0,(js-1)/sr_y+1.0], where sr_x and sr_y are
the subgrid ratios.
* Subroutines process_categorical_block and process_continuous_block from file
geogrid/src/proc_point_module.F: Translates atmosphere indexes [i,j] to subgrid
indexes [(i-1)·sr_x+1.0,(j-1)·sr_y+1.0], where sr_x and sr_y are the subgrid
ratios.
Solution:
Replace the above expressions with the correct indexing:
* Subroutine get_lat_lon_fields from file geogrid/src/process_tile_module.F:
Replace expression [(is-1)/sr_x+1.0,(js-1)/sr_y+1.0] by
[(is-0.5)/sr_x+0.5,(js-0.5)/sr_y+0.5], where sr_x and sr_y are the subgrid
ratios.
* Subroutines process_categorical_block and process_continuous_block from file
geogrid/src/proc_point_module.F and subroutine process_continuous_block from
metgrid/src/process_domain_module.F: Replace expression
[(i-1)·sr_x+1.0,(j-1)·sr_y+1.0] by [(i-0.5)·sr_x+0.5,(j-0.5)·sr_y+0.5], where
sr_x and sr_y are the subgrid ratios.
LIST OF MODIFIED FILES:
M geogrid/src/proc_point_module.F
M geogrid/src/process_tile_module.F
M metgrid/src/process_domain_module.F
TESTS CONDUCTED:
Indexes case: create two incremental index arrays (one for each horizontal
direction). Feed them into WPS using 1 domain,
subgrid_ratio_x=subgrid_ratio_y=4, and creating 2 new variables for each array
(one with and without option subgrid=yes).
Real case: Feed high-resolution elevation and fuel categories from LANDFIRE
website into WPS in the 3rd domain using option subgrid=yes and
subgrid_ratio_x=subgrid_ratio_y=0, 0, 20.
* subgrid_shift:
adding subgrid shifting fix into metgrid
solve subgrid shifting