---
# System prepended metadata

title: 't_patch fields needed in dycore, diffusion, interpolation'
tags: [ICON, discussion]

---

# grid_manager,icon4py: t_patch fields needed in dycore, diffusion, interpolation


| Field                                                                   | category | grid manager                     | icon4py                       | namelist |
|:----------------------------------------------------------------------- |:-------- |:-------------------------------- |:----------------------------- | -------- |
| num_cells,        (for global and local patch)                          |          | available, tbd for global ones   |                               |          |
| nlev                                                                    |          |                                  |                               | y        |
| num_edges  (for global and local patch)                                 |          | available, tbd for global ones   |                               |          |
| num_verts     (for global and local patch)                              |          | available, tbd for global ones   |                               |          |
| cell_areas=p_patch(jg)%cells%area(:,:)                                  | derived  | available, derived               |                               |          |
| mean_cell_area                                                          | derived  |                                  | y , involves global reduction |          |
| c2e=p_patch(jg)%cells%edge_idx                                          |          | available                        |                               |          |
| c2e2c=p_patch(jg)%cells%neighbor_idx                                    |          | available                        |                               |          |
| c2v=p_patch(jg)%cells%vertex_idx                                        |          | available                        |                               |          |
| c,e,v_start_index                                                       |          | available                        |                               |          |
| c, e, v_end_index                                                       |          | available                        |                               |          |
| c, e, v_refin_ctl                                                       |          | tbd, needed?                     |                               |          |
| c_owner_mask                                                            |          | available                        |                               |          |
| e, v_owner_mask                                                         |          | tbd                              |                               |          |
| c_glb_index                                                             |          | available                        |                               |          |
| e,v_glb_index                                                           |          | available                        |                               |          |
| c_decomp_domain                                                         |          | available                        |                               |          |
| e,v_decomp_domain                                                       |          | avaible                          |                               |          |
| cells%center                                                            |          | availble                         |                               |          |
| cells_edge_orientation=cells%edge_orientation                           |          | available, derived               |                               |          |
| edges%area_edge                                                         |          |                                  | y                             |          |
| tangent_orientation=p_patch(jg)%edges%tangent_orientation               |          | == 1 everywhere, in grid_manager |                               |          |
| edges%inv_primal_edge_length                                            |          |                                  | y                             |          |
| edges%primal_edge_length                                                |          | available, derived               |                               |          |
| edges%edge_cell_length                                                  |          | available, derived               |                               |          |
| edges%cartesian_center                                                  |          | available, derived               | y                             |          |
| edges%edge_vert_length                                                  |          |                                  | y                             |          |
| edges%edge_cell_length                                                  |          | tbd, derived                     |                               | y        |
| edges%center                                                            |          | available                        |                               |          |
| edges%dual_edge_length                                                  |          | available, derived               |                               |          |
| edges%inv_dual_edge_length                                              |          |                                  | y                             |          |
| edges%vert_vert_length                                                  |          |                                  | y                             |          |
| edges%inv_vert_vert_length                                              |          |                                  | y                             |          |
| edges%primal_normal_vert_x,y                                            |          |                                  | y                             |          |
| edges%dual_normal_vert_x,y                                              |          |                                  | y                             |          |
| edges%dual_normal_cell_x,y                                              |          |                                  | y                             |          |
| edges%primal_normal_cell                                                |          |                                  | y                             |          |
| edges%dual_normal                                                       |          | available, derived               |                               |          |
| edges%primal_cart_normal    (cartesian verions for edges%primal_normal) |          | available, derived               | y                             |          |
| edges%primal_normal                                                     |          | available, derived               |                               |          |
| edges%primal_cart_normal                                                |          | tbd, derived                     |                               |          |
| e2v, e2c2v=p_patch(jg)%edges%vertex_idx(:,1,:)                          |          | available                        |                               |          |
| e2c                                                                     |          | available                        |                               |          |
| e2c2e , edges%quad_idx(                                                 |          | tbd                              |                               |          |
| edges%f_e                                                               |          |                                  | y                             |          |
| v2e                                                                     |          | tbd                              |                               |          |
| v2c                                                                     |          |                                  | tbd                           |          |
| verts%num_edges                                                         |          | tbd                              |                               |          |
| verts%dual_area                                                         |          |                                  | y                             |          |
| verts%edge_orientation                                                  |          | tbd                              |                               |          |
| verts%cartesian                                                         |          | available, derived               | y                             |          |
| verts%vertex                                                            |          | available,                       |                               |          |
| p_patch(jg)%boundary_depth_index                                        |          |                                  |                               | y        |
|                                                                         |          |                                  |                               |          |
|                                                                         |          |                                  |                               |          |

## open
     !$ser data nshift_total=p_patch(jg)%nshift_total
    !$ser data nshift=p_patch(jg)%nshift
- can this 2 be set to 0 for exclaim, are they ever going to be used

### all fields from t_patch
```
    !$ser data num_cells=p_patch(jg)%n_patch_cells
    !$ser data num_edges=p_patch(jg)%n_patch_edges
    !$ser data num_vert=p_patch(jg)%n_patch_verts
    !$ser data nlev=p_patch(jg)%nlev
    !$ser data nshift_total=p_patch(jg)%nshift_total
    !$ser data nshift=p_patch(jg)%nshift
    !$ser data mean_cell_area=p_patch(jg)%geometry_info%mean_cell_area

    !$ser data cell_areas=p_patch(jg)%cells%area(:,:)
    !$ser data c2e=p_patch(jg)%cells%edge_idx(:,1,:)
    !$ser data c2e2c=p_patch(jg)%cells%neighbor_idx(:,1,:)
    !$ser data c2v=p_patch(jg)%cells%vertex_idx(:,1,:)
    !$ser data c_start_index=p_patch(jg)%cells%start_index
    !$ser data c_end_index=p_patch(jg)%cells%end_index
    !$ser data c_refin_ctl=p_patch(jg)%cells%refin_ctrl
    !$ser data c_owner_mask=p_patch(jg)%cells%decomp_info%owner_mask
    !$ser data c_glb_index=p_patch(jg)%cells%decomp_info%glb_index
    !$ser data c_decomp_domain=p_patch(jg)%cells%decomp_info%decomp_domain
    !$ser data cells_edge_orientation=p_patch(jg)%cells%edge_orientation


    !$ser data edge_areas=p_patch(jg)%edges%area_edge(:,:)
    !$ser data tangent_orientation=p_patch(jg)%edges%tangent_orientation(:,:)
    !$ser data inv_primal_edge_length=p_patch(jg)%edges%inv_primal_edge_length(:,:)
    !$ser data edge_cell_length=p_patch(jg)%edges%edge_cell_length
    !$ser data primal_edge_length=p_patch(jg)%edges%primal_edge_length(:,:)
    !$ser data inv_dual_edge_length=p_patch(jg)%edges%inv_dual_edge_length(:,:)
    !$ser data dual_edge_length=p_patch(jg)%edges%dual_edge_length(:,:)
    !$ser data inv_vert_vert_length=p_patch(jg)%edges%inv_vert_vert_length(:,:)
    !$ser data primal_normal_vert_x=p_patch(jg)%edges%primal_normal_vert_x(:,:,:)
    !$ser data primal_normal_vert_y=p_patch(jg)%edges%primal_normal_vert_y(:,:,:)
    !$ser data dual_normal_vert_x=p_patch(jg)%edges%dual_normal_vert_x(:,:,:)
    !$ser data dual_normal_vert_y=p_patch(jg)%edges%dual_normal_vert_y(:,:,:)
    !$ser data e2v=p_patch(jg)%edges%vertex_idx(:,1,:)
    !$ser data e2c2v=p_patch(jg)%edges%vertex_idx(:,1,:)
    !$ser data e2c=p_patch(jg)%edges%cell_idx(:,1,:)
    !$ser data e_owner_mask=p_patch(jg)%edges%decomp_info%owner_mask
    !$ser data e_glb_index=p_patch(jg)%edges%decomp_info%glb_index
    !$ser data e_decomp_domain=p_patch(jg)%edges%decomp_info%decomp_domain
    !$ser data e_start_index=p_patch(jg)%edges%start_index
    !$ser data e_end_index=p_patch(jg)%edges%end_index
    !$ser data e_refin_ctl=p_patch(jg)%edges%refin_ctrl
    !$ser data e2c2e=p_patch(jg)%edges%quad_idx(:,1,:)
    !$ser data f_e=p_patch(jg)%edges%f_e
    !$ser data dual_normal_cell_x=p_patch(jg)%edges%dual_normal_cell_x
    !$ser data dual_normal_cell_y=p_patch(jg)%edges%dual_normal_cell_y
    !$ser data primal_normal_cell_x=p_patch(jg)%edges%primal_normal_cell_x
    !$ser data primal_normal_cell_y=p_patch(jg)%edges%primal_normal_cell_y


    !$ser data v2e=p_patch(jg)%verts%edge_idx(:,1,:)
    !$ser data v2c=p_patch(jg)%verts%cell_idx(:,1,:)
     !$ser data v_num_edges=p_patch(jg)%verts%num_edges
     !$ser data v_dual_area=p_patch(jg)%verts%dual_area
     !$ser data v_edge_orientation=p_patch(jg)%verts%edge_orientation
    !$ser data v_start_index=p_patch(jg)%verts%start_index
    !$ser data v_end_index=p_patch(jg)%verts%end_index
    !$ser data v_refin_ctl=p_patch(jg)%verts%refin_ctrl
    !$ser data v_owner_mask=p_patch(jg)%verts%decomp_info%owner_mask
    !$ser data v_glb_index=p_patch(jg)%verts%decomp_info%glb_index
    !$ser data v_decomp_domain=p_patch(jg)%verts%decomp_info%decomp_domain

    !$ser data boundary_depth_index=p_patch(jg)%boundary_depth_index
   
 
    !$ser data n_patch_cells_g=p_patch(jg)%n_patch_cells_g
    !$ser data n_patch_edges_g=p_patch(jg)%n_patch_edges_g
    !$ser data n_patch_verts_g=p_patch(jg)%n_patch_verts_g
```

### interpolation 


| Field                                                     | dimensions                     | dependencies                        | icon4py   |
|:--------------------------------------------------------- |:------------------------------ |:----------------------------------- |:--------- |
| ~p_int_state(jg)%rbf_vec_idx_v_1, v_2~~                   | [VertexDim, V2EDim]            |                                     |           |
| p_int_state(jg)%rbf_vec_coeff_v_1, v_2                    | [VertexDim, V2EDim]            | edges%cartesian_center,edges%center |          |
| p_int_state(jg)%rbf_vec_coeff_e_dsl                       | [EdgeDim, E2C2EDim]            |                                     |           |
| p_int_state(jg)%geofac_div                                | [CEDim] = [CellDim, C2EDim]    |                                     |           |
| p_int_state(jg)%geofac_n2s, separate into centers and nbh | [CellDim], [CellDim, C2E2CDim] |                                     |           |
| p_int_state(jg)%geofac_grg                                | 2x [CellDim, C2E2CODim]        |                                     |           |
| p_int_state(jg)%geofac_rot                                | [VertexDim, V2EDim]            |                                     |           |
| p_int_state(jg)%geofac_grdiv                              | [EdgeDim, E2C2EODim]           |                                     |           |
| p_int_state(jg)%nudgecoeff_e                              | [EdgeDim]                      |                                     |           |
| p_int_state(jg)%c_lin_e                                   |                                |                                     | available |
| p_int_state(jg)%cells_aw_verts                            |                                |                                     |           |
| p_int_state(jg)%pos_on_tplane_e_x, y                      | [ECDim] = [EdgeDim, E2CDim]    |                                     |           |
| p_int_state(jg)%e_flx_avg                                 | [EdgeDim, E2C2EODim]           |                                     |           |
| p_int_state(jg)%e_bln_c_s                                 | [CellDim, C2EDim]              |                                     |           |

### metrics


| Field                   | Dimensions             | dependencies                                              | used in    |
|:----------------------- |:---------------------- |:--------------------------------------------------------- |:---------- |
| wgtfac_c                | [CellDim, KDim] nlevp1 | metrics%z_ifc,                                            | diffusion, |
| wgtfacq_c,wgtfacq_c_dsl | [CellDim, KDim]        | metrics%z_ifc                                             | dycore     |
| wgtfacq_e_dsl           | [EdgeDim, KDim]        |                                                           | dycore     |
| wgtfac_e                | [EdgeDim, KDim]        |                                                           | dycore     |
| exner_exfac             | [CellDim, KDim]        | metrics%ddxn_z_full, metrics%z_ifc                        | dycore     |
| exner_ref_mc            | [CellDim, KDim]        |                                                           |            |
| rho_ref_mc              | [CellDim, KDim]        |                                                           |            |
| rho_ref_me              | [CellDim, KDim]        |                                                           |            |
| theta_ref_mc            | [CellDim, KDim]        |                                                           |            |
| theta_ref_me            | [EdgeDim, KDim]        |                                                           |            |
| theta_ref_ic            | [CellDim, KDim]        |                                                           |            |
| d_exner_dz_ref_ic       | [CellDim, KDim]        |                                                           |            |
| ddqz_z_half             | [CellDim, KDim]        |                                                           |            |
| d2dexdz2_fac1_mc        | [CellDim, KDim]        |                                                           |            |
| ddxn_z_full             | [EdgeDim, KDim]        |                                                           |            |
| ddqz_z_full_e           | [EdgeDim, KDim]        |                                                           |            |
| ddxt_z_full             | [EdgeDim, KDim]        |                                                           |            |
| inv_ddqz_z_full         | [CellDim, KDim]        |                                                           |            |
| coeff1_dwdz             | [CellDim, KDim]        |                                                           |            |
| scalfac_dd3d            | [KDim]                 |                                                           |            |
| hmask_dd3d              | [EdgeDim]              |                                                           |            |
| vwind_impl_wgt          | [CellDim]              |                                                           |            |
| vwind_expl_wgt          | [CellDim]              |                                                           |            |
| pg_exdist               | [EdgeDim, KDim]        |                                                           |            |
| ipeidx_dsl              | [EdgeDim, KDim]        |                                                           |            |
| mask_hdiff              | [CellDim, KDim]        |                                                           | diffusion  |
| zd_diffcoef             | [CellDim, KDim]        |                                                           | diffusion  |
| theta_ref_mc            | [CellDim, KDim]        | T                                                         | diffusion  |
| bdy_halo_c              | [CellDim]              |                                                           | dycore     |
| mask_prog_halo_c        | [CellDim, KDim]        |                                                           |            |
| coeff2_dwdz             | [CellDim, KDim]        |                                                           |            |
| rayleigh_w              | [KDim]                 |                                                           |            |
|                         |                        |                                                           |            |
| zd_intcoef              | [CECDim, KDim]         |                                                           |            |
| zd_vertoffset           | [CECDim, KDim]         |                                                           | diffusion  |
| coeff_gradekin          | [ECDim]                | edges%edge_cell_length, edges%inv_dual_edge_length(je,jb) |            |
| vertoffset_gradp        | [ECDim, KDim]          |                                                           |            |
| zdiff_gradp             | [ECDim, KDim]          |                                                           |            |
|                         |                        |                                                           |            |
|                         |                        |                                                           |            |

   
 ## serialization
 metrics%z_ifc

