FMS
2024.03
Flexible Modeling System
|
Performs spatial interpolation between grids using bilinear interpolation. More...
Data Types | |
interface | horiz_interp_bilinear_new |
Creates a horiz_interp_type for bilinear interpolation. More... | |
interface | horiz_interp_read_weights_bilinear |
Subroutines for reading in weight files and using that to fill in the horiz_interp type instead calculating it. More... | |
interface | intersect |
Functions/Subroutines | |
subroutine | find_neighbor_ (Interp, lon_in, lat_in, lon_out, lat_out, src_modulo) |
this routine will search the source grid to fine the grid box that encloses each destination grid. | |
subroutine | find_neighbor_new_ (Interp, lon_in, lat_in, lon_out, lat_out, src_modulo, no_crash) |
this routine will search the source grid to fine the grid box that encloses each destination grid. | |
subroutine | horiz_interp_bilinear_ (Interp, data_in, data_out, verbose, mask_in, mask_out, missing_value, missing_permit, new_handle_missing) |
Subroutine for performing the horizontal interpolation between two grids. More... | |
subroutine, public | horiz_interp_bilinear_del (Interp) |
Deallocates memory used by "horiz_interp_type" variables. More... | |
subroutine, public | horiz_interp_bilinear_init |
Initialize this module and writes version number to logfile. | |
subroutine | horiz_interp_bilinear_new_1d_ (Interp, lon_in, lat_in, lon_out, lat_out, verbose, src_modulo) |
subroutine | horiz_interp_bilinear_new_2d_ (Interp, lon_in, lat_in, lon_out, lat_out, verbose, src_modulo, new_search, no_crash_when_not_found) |
Initialization routine. More... | |
subroutine | horiz_interp_read_weights_bilinear_ (Interp, weight_filename, lon_out, lat_out, lon_in, lat_in, weight_file_source, interp_method, isw, iew, jsw, jew, nglon, nglat) |
Subroutine for reading a weight file and use it to fill in the horiz interp type for the bilinear interpolation method. More... | |
logical function | inside_polygon_ (polyx, polyy, x, y) |
The function will return true if the point x,y is inside a polygon, or false if it is not. If the point is exactly on the edge of a polygon, the function will return .true. More... | |
real(fms_hi_kind_) function | intersect_ (x1, y1, x2, y2, x) |
intersect_r4 | |
intersect_r8 | |
Variables | |
integer, parameter | dummy = -999 |
real(r8_kind), parameter | epsln =1.e-10_r8_kind |
logical | module_is_initialized = .FALSE. |
Performs spatial interpolation between grids using bilinear interpolation.
interface horiz_interp_bilinear_mod::horiz_interp_bilinear_new |
Creates a horiz_interp_type for bilinear interpolation.
Definition at line 50 of file horiz_interp_bilinear.F90.
Private Member Functions | |
horiz_interp_bilinear_new_1d_r4 | |
horiz_interp_bilinear_new_1d_r8 | |
horiz_interp_bilinear_new_2d_r4 | |
horiz_interp_bilinear_new_2d_r8 | |
interface horiz_interp_bilinear_mod::horiz_interp_read_weights_bilinear |
Subroutines for reading in weight files and using that to fill in the horiz_interp type instead calculating it.
Definition at line 60 of file horiz_interp_bilinear.F90.
Private Member Functions | |
horiz_interp_read_weights_bilinear_r4 | |
horiz_interp_read_weights_bilinear_r8 | |
interface horiz_interp_bilinear_mod::intersect |
Definition at line 77 of file horiz_interp_bilinear.F90.
Private Member Functions | |
intersect_r4 | |
intersect_r8 | |
subroutine horiz_interp_bilinear_ | ( | type (horiz_interp_type), intent(in) | Interp, |
real(fms_hi_kind_), dimension(:,:), intent(in) | data_in, | ||
real(fms_hi_kind_), dimension(:,:), intent(out) | data_out, | ||
integer, intent(in), optional | verbose, | ||
real(fms_hi_kind_), dimension(:,:), intent(in), optional | mask_in, | ||
real(fms_hi_kind_), dimension(:,:), intent(out), optional | mask_out, | ||
real(fms_hi_kind_), intent(in), optional | missing_value, | ||
integer, intent(in), optional | missing_permit, | ||
logical, intent(in), optional | new_handle_missing | ||
) |
Subroutine for performing the horizontal interpolation between two grids.
horiz_interp_bilinear_new must be called before calling this routine.
[in] | interp | Derived type variable containing interpolation indices and weights. Returned by a previous call to horiz_interp_bilinear_new |
[in] | data_in | input data on source grid |
[out] | data_out | output data on source grid |
[in] | verbose | 0 = no output; 1 = min,max,means; 2 = all output |
[in] | mask_in | Input mask, must be the same size as the input data. The real(FMS_HI_KIND_) value of mask_in must be in the range (0.,1.). Set mask_in=0.0 for data points that should not be used or have missing data |
[out] | mask_out | output mask that specifies whether data was computed |
Definition at line 903 of file horiz_interp_bilinear.inc.
subroutine, public horiz_interp_bilinear_mod::horiz_interp_bilinear_del | ( | type (horiz_interp_type), intent(inout) | Interp | ) |
Deallocates memory used by "horiz_interp_type" variables.
Must be called before reinitializing with horiz_interp_bilinear_new.
[in,out] | interp | A derived-type variable returned by previous call to horiz_interp_bilinear_new. The input variable must have allocated arrays. The returned variable will contain deallocated arrays |
Definition at line 101 of file horiz_interp_bilinear.F90.
subroutine horiz_interp_bilinear_new_2d_ | ( | type(horiz_interp_type), intent(inout) | Interp, |
real(fms_hi_kind_), dimension(:,:), intent(in) | lon_in, | ||
real(fms_hi_kind_), dimension(:,:), intent(in) | lat_in, | ||
real(fms_hi_kind_), dimension(:,:), intent(in) | lon_out, | ||
real(fms_hi_kind_), dimension(:,:), intent(in) | lat_out, | ||
integer, intent(in), optional | verbose, | ||
logical, intent(in), optional | src_modulo, | ||
logical, intent(in), optional | new_search, | ||
logical, intent(in), optional | no_crash_when_not_found | ||
) |
Initialization routine.
Allocates space and initializes a derived-type variable that contains pre-computed interpolation indices and weights.
[in,out] | interp | A derived type variable containing indices and weights for subsequent interpolations. To reinitialize for different grid-to-grid interpolation horiz_interp_del must be used first. |
[in] | lon_in | Latitude (radians) for source data grid |
[in] | lat_in | Longitude (radians) for source data grid |
[in] | lon_out | Longitude (radians) for output data grid |
[in] | lat_out | Latitude (radians) for output data grid |
[in] | verbose | flag for amount of print output |
[in] | src_modulo | indicates if the boundary condition along zonal boundary is cyclic or not. Cyclic when true |
Definition at line 207 of file horiz_interp_bilinear.inc.
subroutine horiz_interp_read_weights_bilinear_ | ( | type(horiz_interp_type), intent(inout) | Interp, |
character(len=*), intent(in) | weight_filename, | ||
real(fms_hi_kind_), dimension(:,:), intent(in), target | lon_out, | ||
real(fms_hi_kind_), dimension(:,:), intent(in), target | lat_out, | ||
real(fms_hi_kind_), dimension(:), intent(in) | lon_in, | ||
real(fms_hi_kind_), dimension(:), intent(in) | lat_in, | ||
character(len=*), intent(in) | weight_file_source, | ||
character(len=*), intent(in) | interp_method, | ||
integer, intent(in) | isw, | ||
integer, intent(in) | iew, | ||
integer, intent(in) | jsw, | ||
integer, intent(in) | jew, | ||
integer, intent(in) | nglon, | ||
integer, intent(in) | nglat | ||
) |
Subroutine for reading a weight file and use it to fill in the horiz interp type for the bilinear interpolation method.
[in,out] | interp | Horiz interp time to fill |
[in] | weight_filename | Name of the weight file |
[in] | lat_out | Output (model) latitude |
[in] | lon_out | Output (model) longitude |
[in] | lat_in | Input (data) latitude |
[in] | lon_in | Input (data) longitude |
[in] | weight_file_source | Source of the weight file |
[in] | interp_method | The interp method to use |
[in] | jew | Starting and ending indices of the compute domain |
[in] | nglon | Number of longitudes in the global domain |
[in] | nglat | Number of latitudes in the globl domain |
Definition at line 1215 of file horiz_interp_bilinear.inc.
logical function inside_polygon_ | ( | real(fms_hi_kind_), dimension(:), intent(in) | polyx, |
real(fms_hi_kind_), dimension(:), intent(in) | polyy, | ||
real(fms_hi_kind_), intent(in) | x, | ||
real(fms_hi_kind_), intent(in) | y | ||
) |
The function will return true if the point x,y is inside a polygon, or false if it is not. If the point is exactly on the edge of a polygon, the function will return .true.
[in] | polyx | longitude coordinates of corners |
[in] | polyy | latitude coordinates of corners |
[in] | x | x coordinate of point to be tested |
[in] | y | y coordinate of point to be tested |
Definition at line 654 of file horiz_interp_bilinear.inc.