| 1 | = PDAFomi_get_interp_coeff_lin = |
| 2 | |
| 3 | This page documents the routine `PDAFomi_get_interp_coeff_lne` of PDAF-OMI. |
| 4 | |
| 5 | 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`). |
| 6 | |
| 7 | || See the [wiki:OMI_observation_operators page describing PDAF-OMI observation operators] for a general overview.|| |
| 8 | |
| 9 | The interface is: |
| 10 | {{{ |
| 11 | SUBROUTINE PDAFomi_get_interp_coeff_lin(num_gp, n_dim, gcoords, ocoord, icoeff) |
| 12 | |
| 13 | INTEGER, INTENT(in) :: num_gp ! Length of icoeff |
| 14 | INTEGER, INTENT(in) :: n_dim ! Number of dimensions in interpolation |
| 15 | REAL, INTENT(in) :: gcoords(:,:) ! Coordinates of grid points |
| 16 | REAL, INTENT(in) :: ocoord(:) ! Coordinates of observation |
| 17 | REAL, INTENT(inout) :: icoeff(:) ! Interpolation coefficients (num_gp) |
| 18 | }}} |
| 19 | |
| 20 | '''Notes:''' |
| 21 | * 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. |
| 22 | * 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. |
| 23 | * `ocoord(:,i)` holds the list of the coordinates for the observation with index i (different from the use in `gcoords`) |
| 24 | * The order of the coordinates and coefficients is the following: |
| 25 | {{{ |
| 26 | (7)------(8) |
| 27 | /| /| with |
| 28 | (5)+-----(6)| - column 1 |
| 29 | | | | | / column 2 |
| 30 | |(3)-----+(4) | column 3 |
| 31 | |/ |/ |
| 32 | (1) ---- (2) |
| 33 | |
| 34 | thus gcoords(1,1)/=gcoords(2,1), but gcoords(1,1)=gcoords(3,1)=gcoords(5,1), |
| 35 | gcoords(1,2)/=gcoords(3,2), gcoords(1,2)=gcoords(2,2)=gcoords(5,2), |
| 36 | gcoords(1,3)/=gcoords(5,3) gcoords(1,3)=gcoords(2,3)=gcoords(3,3) |
| 37 | }}} |
| 38 | * For 1D linear interpolation (n_dim=1) only the coordinates for grid points 1 and 2 are used to compute the coefficients |
| 39 | * For bi-linear interpolation (n_dim=2) only the coordinates for grid points 1, 2, and 3 are used to compute the coefficients |
| 40 | * For tri-linear interpolation (n_dim=3) only the coordinates for grid points 1, 2, 3, and 5 are used to compute the coefficients |