28 module horiz_interp_spherical_mod
30 use platform_mod,
only : r4_kind, r8_kind
32 use mpp_mod,
only : mpp_root_pe,
mpp_pe
33 use mpp_mod,
only : input_nml_file
36 use constants_mod,
only : pi
46 module procedure horiz_interp_spherical_r4
47 module procedure horiz_interp_spherical_r8
54 module procedure horiz_interp_spherical_new_r4
55 module procedure horiz_interp_spherical_new_r8
60 module procedure horiz_interp_spherical_wght_r4
61 module procedure horiz_interp_spherical_wght_r8
72 module procedure full_search_r4
73 module procedure full_search_r8
81 module procedure radial_search_r4
82 module procedure radial_search_r8
89 module procedure spherical_distance_r4
90 module procedure spherical_distance_r8
99 real(r8_kind),
parameter ::
large=1.e20_r8_kind
100 real(r8_kind),
parameter ::
epsln=1.e-10_r8_kind
102 integer :: pe, root_pe
116 #include<file_version.h>
117 logical :: module_is_initialized = .false.
130 if(module_is_initialized)
return
131 call write_version_number(
"horiz_interp_spherical_mod", version)
132 read (input_nml_file, horiz_interp_spherical_nml, iostat=io)
135 module_is_initialized = .true.
149 if(interp%horizInterpReals4_type%is_allocated)
then
150 if(
allocated(interp%horizInterpReals4_type%src_dist))
deallocate(interp%horizInterpReals4_type%src_dist)
151 else if (interp%horizInterpReals8_type%is_allocated)
then
152 if(
allocated(interp%horizInterpReals8_type%src_dist))
deallocate(interp%horizInterpReals8_type%src_dist)
154 if(
allocated(interp%num_found))
deallocate(interp%num_found)
155 if(
allocated(interp%i_lon))
deallocate(interp%i_lon)
156 if(
allocated(interp%j_lat))
deallocate(interp%j_lat)
158 interp%horizInterpReals4_type%is_allocated = .false.
159 interp%horizInterpReals8_type%is_allocated = .false.
165 #include "horiz_interp_spherical_r4.fh"
166 #include "horiz_interp_spherical_r8.fh"
168 end module horiz_interp_spherical_mod
integer function, public check_nml_error(IOSTAT, NML_NAME)
Checks the iostat argument that is returned after reading a namelist and determines if the error code...
subroutine, public write_version_number(version, tag, unit)
Prints to the log file (or a specified unit) the version id string and tag name.
real(r8_kind), parameter large
is a large number
subroutine, public horiz_interp_spherical_init
subroutine, public horiz_interp_spherical_del(Interp)
real(r8_kind), parameter max_dist_default
is the maximum angular distance in radians for input and output grid cells to neighbor.
real(r8_kind), parameter epsln
is a small number
character(len=32) search_method
is a namelist flag to set the nearest neighbor searching method to either "radial_search" (default) o...
integer, parameter max_neighbors
is the maximum number of neighboring input grid cells around output grid cell.
integer, parameter num_nbrs_default
is the minimum number of neighbors to compute for each output grid cell.
Generic interface used internally when search_method = "full_search" to search for nearest neighbors....
Generic interface to compute interpolation weights and mapping indices. Calls horiz_interp_spherical_...
Generic interface used internally when search_method = "radial_search" to search for nearest neighbor...
Generic inteface used internally in full_search and radial_search. Calls spherical_distance_r4 when t...
integer, parameter, public spherical
is an internally used parameter to mark spherical interpolation
Generic interfaces to compute statistics for bilinear and spherical interpolation Calls stats_r4 when...
Datatype holding interpolation weights, mapping indices, and metadata for horizontal interpolation....
integer function stdout()
This function returns the current standard fortran unit numbers for output.
integer function mpp_pe()
Returns processor ID.
Generic interface to interpolate data from source grid to target grid from the weights stored in Inte...