fortplot_streamplot_core Module

Streamplot implementation broken down for size compliance

Refactored from 253-line function into focused, testable components following SOLID principles and size constraints.



Subroutines

public subroutine setup_streamplot_parameters(self, x, y, u, v, density, color, linewidth, rtol, atol, max_time, arrowsize, arrowstyle)

Setup and validate streamplot parameters (focused on validation logic)

Arguments

Type IntentOptional Attributes Name
class(figure_t), intent(inout) :: self
real(kind=wp), intent(in) :: x(:)
real(kind=wp), intent(in) :: y(:)
real(kind=wp), intent(in) :: u(:,:)
real(kind=wp), intent(in) :: v(:,:)
real(kind=wp), intent(in), optional :: density
real(kind=wp), intent(in), optional :: color(3)
real(kind=wp), intent(in), optional :: linewidth
real(kind=wp), intent(in), optional :: rtol
real(kind=wp), intent(in), optional :: atol
real(kind=wp), intent(in), optional :: max_time
real(kind=wp), intent(in), optional :: arrowsize
character(len=*), intent(in), optional :: arrowstyle

public subroutine generate_streamlines(x, y, u, v, density, trajectories, n_trajectories, trajectory_lengths)

Generate streamlines using matplotlib-compatible algorithm

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x(:)
real(kind=wp), intent(in) :: y(:)
real(kind=wp), intent(in) :: u(:,:)
real(kind=wp), intent(in) :: v(:,:)
real(kind=wp), intent(in) :: density
real, intent(out), allocatable :: trajectories(:,:,:)
integer, intent(out) :: n_trajectories
integer, intent(out), allocatable :: trajectory_lengths(:)

public subroutine add_streamline_to_figure(fig, traj_x, traj_y, line_color)

Add streamline trajectory to figure as line plot

Arguments

Type IntentOptional Attributes Name
class(figure_t), intent(inout) :: fig
real(kind=wp), intent(in) :: traj_x(:)
real(kind=wp), intent(in) :: traj_y(:)
real(kind=wp), intent(in) :: line_color(3)