wiki:PDAFomi_get_interp_coeff_lin

Version 2 (modified by lnerger, 2 years ago) (diff)

--

PDAFomi_get_interp_coeff_lin

This page documents the routine PDAFomi_get_interp_coeff_lin of PDAF-OMI.

The routine is called in init_dim_obs_OBSTYPE of an obseration module to initialize interpolation coefficients in 1, 2, or 3 dimensions. It is used if the observation operator performs linear interpolation (usually PDAFomi_obs_op_interp_lin`).

See the page describing PDAF-OMI observation operators for a general overview.

The interface is:

  SUBROUTINE PDAFomi_get_interp_coeff_lin(num_gp, n_dim, gcoords, ocoord, icoeff)

    INTEGER, INTENT(in) :: num_gp         ! Length of icoeff
    INTEGER, INTENT(in) :: n_dim          ! Number of dimensions in interpolation
    REAL, INTENT(in)    :: gcoords(:,:)   ! Coordinates of grid points
    REAL, INTENT(in)    :: ocoord(:)      ! Coordinates of observation
    REAL, INTENT(inout) :: icoeff(:)      ! Interpolation coefficients (num_gp)

Notes:

  • It is required that num_gp=2 for n_dim=1; num_gp=4 for n_dim=2; num_gp=8 for n_dim=3.
  • In the array gcoords, the first index specifies the grid point while the second specifies the coordinate, thus gcoords(1,1) is the first coordinate for grid point 1, gcoords(1,2) is the second coordiate for grid point 1, while gcoords(2,1) is the first coordiate for grid point 2. The coordinates need to be consistent with the indices specified in thisobs%id_obs_p since these specify the elements of the state vector that are interpolated. Only the first n_dim entries of ocoord will be used for the interpolation.
  • ocoord(:,i) holds the list of the coordinates for the observation with index i (different from the use in gcoords)
  • The order of the coordinates and coefficients is the following:
                           (7)------(8) 
                           /|       /|    with
                         (5)+-----(6)|       - column 1
                          | |      | |       / column 2
                          |(3)-----+(4)      | column 3
                          |/       |/
                         (1) ---- (2)
    
       thus gcoords(1,1)/=gcoords(2,1),        but  gcoords(1,1)=gcoords(3,1)=gcoords(5,1),
            gcoords(1,2)/=gcoords(3,2),             gcoords(1,2)=gcoords(2,2)=gcoords(5,2), 
            gcoords(1,3)/=gcoords(5,3)              gcoords(1,3)=gcoords(2,3)=gcoords(3,3)
    
  • For 1D linear interpolation (n_dim=1) only the coordinates for grid points 1 and 2 are used to compute the coefficients
  • For bi-linear interpolation (n_dim=2) only the coordinates for grid points 1, 2, and 3 are used to compute the coefficients
  • For tri-linear interpolation (n_dim=3) only the coordinates for grid points 1, 2, 3, and 5 are used to compute the coefficients