---
# System prepended metadata

title: '[Greenline] Remaining stencils: Interpolation'
tags: [cycle20]

---

# [Greenline] remaining interpolation fields

<!-- Add the tag for the current cycle number in the top bar -->

- Shaped by: Magdalena
- Appetite (FTEs, weeks):
- Developers: AJ <!-- Filled in at the betting table unless someone is specifically required here -->

## Problem
<!-- The raw idea, a use case, or something we’ve seen that motivates us to work on this -->
Over the last cycles most of the precomputed interpolation coefficients needed in dycore or diffusion have been ported to Python (gt4py or numpy). We want to port the remaining ones except for the RBF coefficients which should be looked at in a separate project.


## Appetite
<!-- Explain how much time we want to spend and how that constrains the solution -->
Andreas J. already started to work on this (or continued his cycle 19 project). To finish and merge interplation fields we need half cycle. 

## Solution
<!-- The core elements we came up with, presented in a form that’s easy for people to immediately understand -->

@magdalena: can projections be used from [cartopy](https://scitools.org.uk/cartopy/docs/v0.15/_modules/cartopy/crs.html#Gnomonic), [pygmt](https://www.pygmt.org/latest/index.html)?

###  `t_int_state%cells_aw_verts`
Computed in `mo_intp_coeffs_lsq_bln.f90`.
Depends on 
- `ptr_patch%verts%dual_area`
- `ptr_patch%edges%edge_vert_length`
- `ptr_patch%edges%edge_cell_length`
### `p_int_state%pos_on_tplane_e_x`, `p_int_state%pos_on_tplane_e_y`
Calculated in `mo_intp_coeffs.f90` : `SUBROUTINE calculate_tangent_plane_at_edge` uses gnomomic projection.

Depends on 
-  `p_patch%cells%center%lat`, `p_patch%cells%center%lon`
- `p_patch%edges%center(je,jb)%lat`,  `p_patch%edges%center(je,jb)%lon`
- `ptr_patch%edges%primal_normal`,
- `ptr_patch%edges%dual_normal`


###  `p_int_state%e_bln_c_s` 
Calculated in `mo_intp_coeffs_lsq_bln.f90` : `SUBROUTINE spherical_scalar_coeffs`
uses`mo_math_utilities.f90` :`SUBROUTINE rotate_latlon`
Depends on
- `p_patch%cells%center(jc,jb)%lat`, `cells%center(jc,jb)%lon`
- `p_patch%edges%center(je, jb)%lat`, `p_patch%edges%center(je, jb)%lon`


## Rabbit holes
<!-- Details about the solution worth calling out to avoid problems -->
RBF interpolation

## No-gos
<!-- Anything specifically excluded from the concept: functionality or use cases we intentionally aren’t covering to fit the ## appetite or make the problem tractable -->

## Progress
<!-- Don't fill during shaping. This area is for collecting TODOs during building. As first task during building add a preliminary list of coarse-grained tasks for the project and refine them with finer-grained items when it makes sense as you work on them. -->

- [ ] cells_aw_verts ([PR#417](https://github.com/C2SM/icon4py/pull/417))
    - [x] ported 
    - [ ] integrated in icon4py
- [ ] pos_on_tplane_e_x, _y
    - [x] ported
    - [ ] integraged/merged in icon4py
- [ ] e_bln_c_s
    - [x] ported 
    - [ ] integrated in icon4py  
