A collection of useful general-purpose numerical routines, including a bisect function and linear interpolation routines.
fms_mod
subroutine lin_int(data, xx, x, res) real, intent(in) :: data(:) ! data to interpolate real, intent(in) :: xx(:) ! coord. corresponding to data real, intent(in) :: x ! coord to interpolate to real, intent(inout) :: res ! result of interpolation |
subroutine lin_int(data, xx, x, res) real, intent(in) :: data(:,:) ! data to interpolate real, intent(in) :: xx(:) ! coord. corresponding to data real, intent(in) :: x ! coord to interpolate to real, intent(inout) :: res(:) ! result of interpolation |
subroutine lin_int(data, tt, t, res) real, intent(in) :: data(:,:,:) ! data to interpolate real, intent(in) :: tt(:) ! time moments corresponding to data points real, intent(in) :: t ! time to interpolate to real, intent(inout) :: res(:,:) ! result |
subroutine lin_int(data, xx, x, res, mask) real, intent(in) :: data(:,:) ! data to interpolate real, intent(in) :: xx(:) ! coord. corresponding to data real, intent(in) :: x ! coord to interpolate to real, intent(inout) :: res(:) ! result of interpolation logical, intent(in) :: mask(:) ! valid data mask |
subroutine lin_int(data, tt, t, res, mask) real, intent(in) :: data(:,:,:) ! data to interpolate real, intent(in) :: tt(:) ! time moments corresponding to data points real, intent(in) :: t ! time to interpolate to real, intent(inout) :: res(:,:) ! result logical, intent(in) :: mask(:,:) ! interpolation mask |
function bisect(xx, x1, periodic) real, intent(in) :: xx(:) ! array of boundaries real, intent(in) :: x1 ! point to locate logical, intent(in), optional :: periodic ! if present and true, the data ! domain is assumed to be periodic
value= bisect ( xx, x1, periodic )
subroutine my_error(mod_name, message, mode, file, line) character(len=*), intent(in) :: mod_name character(len=*), intent(in) :: message integer, intent(in) :: mode character(len=*), intent(in) :: file integer, intent(in) :: line
call my_error (mod_name, message, mode, file, line)