FMS  2026.01.01-dev
Flexible Modeling System
horiz_interp_mod

Data Types

interface  horiz_interp
 
interface  horiz_interp_read_weights
 Generic interface to horiz_interp_read_weights_r4 and horiz_interp_read_weights_r8 to read in weight files generated from fregrid for bilinear interpolation. Calls horiz_interp_read_weights_r4 if lat_out, lon_out, lat_in, and lon_in are 32-bit floating point representation. Calls horiz_interp_read_weights_r8 if the gridpoints are in 64-bit floating point representation. More...
 
interface  horiz_interp_solo_1d
 Old interfaces, not recommended. More...
 
interface  is_lat_lon
 Internally used subroutine to determine if the grid is a lat-lon grid. Calls is_lat_lon_r4 if grids are in 32-bit floating point precision. Calls is_lat_lon_r8 if grids are in 64-bit floating point precision. More...
 

Functions/Subroutines

 horiz_interp_base_2d_r4
 
 horiz_interp_base_2d_r8
 
 horiz_interp_base_3d_r4
 
 horiz_interp_base_3d_r8
 
subroutine, public horiz_interp_del (Interp)
 
subroutine, public horiz_interp_end
 
subroutine, public horiz_interp_init
 
 horiz_interp_new_1d_dst_r4
 
 horiz_interp_new_1d_dst_r8
 
 horiz_interp_new_1d_r4
 
 horiz_interp_new_1d_r8
 
 horiz_interp_new_1d_src_r4
 
 horiz_interp_new_1d_src_r8
 
 horiz_interp_new_2d_r4
 
 horiz_interp_new_2d_r8
 
 horiz_interp_read_weights_r4
 
 horiz_interp_read_weights_r8
 
 horiz_interp_solo_1d_dst_r4
 
 horiz_interp_solo_1d_dst_r8
 
 horiz_interp_solo_1d_r4
 
 horiz_interp_solo_1d_r4
 
 horiz_interp_solo_1d_r8
 
 horiz_interp_solo_1d_r8
 
 horiz_interp_solo_1d_src_r4
 
 horiz_interp_solo_1d_src_r8
 
 horiz_interp_solo_2d_r4
 
 horiz_interp_solo_2d_r8
 
 horiz_interp_solo_old_r4
 
 horiz_interp_solo_old_r8
 
 is_lat_lon_r4
 
 is_lat_lon_r8
 

Variables

logical module_is_initialized = .FALSE.
 is an internally used flag to prevent module re-initialization
 
logical reproduce_siena = .false.
 is a namelist flag to reproduces siena results if set to .true. Else, defaults to false to decrease truncation error in function poly_area in file mosaic_util.c. The truncation error of second order conservative remapping might be big for high resolution grid. This namelist flag will be removed soon.
 

Detailed Description

Author
Zhi Liang, Bruce Wyman
Horiz_interp_mod contains subroutines and derived types to interpolate data from any logically rectangular grid to any logically rectangular grid with the following interpolation schemes: conservative in horiz_interp_conserve_mod, bilinear in horiz_interp_bilinear_mod, bicubic in horiz_interp_bicubic_mod, and inverse of square distance weighted in horiz_interp_spherical.mod.

Data Type Documentation

◆ horiz_interp_mod::horiz_interp

interface horiz_interp_mod::horiz_interp
Generic interface to interpolate data on input (source) grid to output (target) grid. Calls horiz_interp_base_2d_r4, horiz_interp_base_2d_r8, horiz_interp_base_3d_r4, or horiz_interp_base_3d_r8 are if Interp (populated from horiz_interp_new) is the first argument. Else, if Interp is not provided, calls horiz_interp_solo_* blackbox methods: Following captures the main input arguments for each subroutine: horiz_interp_base_2d_r4: 2d input data to 2d output data in 32-bit floating point precision. Takes Interp as first argument. horiz_interp_base_2d_r8: 2d input data to 2d output data in 64-bit floating point precision. Takes Interp as first argument. horiz_interp_base_3d_r4: 3d input data to 3d output data in 32-bit floating point precision. Takes Interp as first argument. horiz_interp_base_3d_r8: 3d input data to 3d output data in 64-bit floating point precision. Takes Interp as first argument. horiz_interp_solo_1d_r4: input and output grids provided as 1D arrays to interpolate 32-bit 2D data. Does not take Interp as argument. horiz_interp_solo_1d_r8: input and output grids provided as 1D arrays to interpolate 64-bit 2D data. Does not take Interp as argument. horiz_interp_solo_1d_src_r4: input grid provided as 32-bit 1D arrays, output as 2D arrays to interpolate 32-bit 2D data. Does not take Inerp as argument. horiz_interp_solo_1d_src_r8: input grid provided as 64-bit 1D arrays, output as 2D arrays to interpolate 32-bit 2D data. Does not take Interp as argument. horiz_interp_solo_2d_r4: input and output grids provided as 32-bit 2D arrays to interpolate 32-bit 2d data. Does not take Interp as argument. horiz_interp_solo_2d_r8: input and output grids provided as 64-bit 2D arrays to interpolate 64-bit 2d data. Does not take Interp as argument. horiz_interp_solo_1d_dst_r4: input grid provided as 32-bit 2D arrays, input as 1D arrays to interpolate 32-bit 2D data. Does not take Interp as argument. horiz_interp_solo_1d_dst_r8 input grid provided as 64-bit 2D arrays, input as 1D arrays to interpolate 64-bit 2D data. Does not take Interp as argument.

Definition at line 150 of file horiz_interp.F90.

Private Member Functions

 horiz_interp_base_2d_r4
 
 horiz_interp_base_2d_r8
 
 horiz_interp_base_3d_r4
 
 horiz_interp_base_3d_r8
 
 horiz_interp_solo_1d_dst_r4
 
 horiz_interp_solo_1d_dst_r8
 
 horiz_interp_solo_1d_r4
 
 horiz_interp_solo_1d_r8
 
 horiz_interp_solo_1d_src_r4
 
 horiz_interp_solo_1d_src_r8
 
 horiz_interp_solo_2d_r4
 
 horiz_interp_solo_2d_r8
 
 horiz_interp_solo_old_r4
 
 horiz_interp_solo_old_r8
 

◆ horiz_interp_mod::horiz_interp_read_weights

interface horiz_interp_mod::horiz_interp_read_weights

Generic interface to horiz_interp_read_weights_r4 and horiz_interp_read_weights_r8 to read in weight files generated from fregrid for bilinear interpolation. Calls horiz_interp_read_weights_r4 if lat_out, lon_out, lat_in, and lon_in are 32-bit floating point representation. Calls horiz_interp_read_weights_r8 if the gridpoints are in 64-bit floating point representation.

Definition at line 106 of file horiz_interp.F90.

Private Member Functions

 horiz_interp_read_weights_r4
 
 horiz_interp_read_weights_r8
 

◆ horiz_interp_mod::horiz_interp_solo_1d

interface horiz_interp_mod::horiz_interp_solo_1d

Old interfaces, not recommended.

Definition at line 177 of file horiz_interp.F90.

Private Member Functions

 horiz_interp_solo_1d_r4
 
 horiz_interp_solo_1d_r8
 

◆ horiz_interp_mod::is_lat_lon

interface horiz_interp_mod::is_lat_lon

Internally used subroutine to determine if the grid is a lat-lon grid. Calls is_lat_lon_r4 if grids are in 32-bit floating point precision. Calls is_lat_lon_r8 if grids are in 64-bit floating point precision.

Definition at line 171 of file horiz_interp.F90.

Private Member Functions

 is_lat_lon_r4
 
 is_lat_lon_r8
 

Function/Subroutine Documentation

◆ horiz_interp_del()

subroutine, public horiz_interp_mod::horiz_interp_del ( type (horiz_interp_type), intent(inout)  Interp)
Deallocates memory in Interp holding the weights and mapping indices for the interpolation method in Interpinterp_method.
Parameters
[in,out]interpwill be reset after arrays holding interpolation weights and mapping indices are deallocated and is_allocated is set to .false.

Definition at line 238 of file horiz_interp.F90.

◆ horiz_interp_end()

subroutine, public horiz_interp_mod::horiz_interp_end
Dummy routine

Definition at line 269 of file horiz_interp.F90.

◆ horiz_interp_init()

subroutine, public horiz_interp_mod::horiz_interp_init
Initializes horiz_interp_mod and writes version number to the logfile

Definition at line 205 of file horiz_interp.F90.