Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TUV-x grid data to be updated through the API #120

Closed
Tracked by #40
mattldawson opened this issue May 20, 2024 · 0 comments · Fixed by #140
Closed
Tracked by #40

Allow TUV-x grid data to be updated through the API #120

mattldawson opened this issue May 20, 2024 · 0 comments · Fixed by #140
Assignees

Comments

@mattldawson
Copy link
Collaborator

mattldawson commented May 20, 2024

Add the ability for host applications to update grid data at runtime.

Acceptance Criteria

  • Users can set the edge and mid-point values for any grid in the TUV-x configuration (heights, wavelengths(read-only))

Ideas

  • Add grid_map_t and grid_t types to the tuvx_interface module, something like:
type :: grid_map_t
  type(c_ptr) :: ptr_ ! Pointer to internal tuvx_core%grid_warehouse_
end type

type :: grid_t
  type(c_ptr) :: ptr_ ! Pointer to specific grid in tuvx_core%grid_warehouse_
end type
  • Add internal_get_grids_tuvx function to module tuvx_interface:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    function internal_get_grids_tuvx(tuvx) result(grids)
      use iso_c_binding, only: c_ptr, c_f_pointer
      type(c_ptr), intent(in) :: tuvx
      type(grid_map_t) :: grids

      type(core_t), pointer :: core

      call c_f_pointer(tuvx, core)
      grids%ptr_ = c_loc( core%grid_warehouse_ )

    end function internal_get_grids_tuvx

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • do something similar for grid_t that looks up grids by name and units
  • add grid_t::update_edges() and grid_t::update_mid_points()
  • a user could do something like this:
   tuvx => tuvx_t( config_path )
   grids = tuvx%create_grids( )
   grid = grids%get( "height", "m" )
   call grid%update_edges( new_edge_data_array )
   call grid%update_mid_points( new_mid_point_data_array )

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants