| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | degree |
spline degree |
||
| integer, | intent(in) | :: | bc_xmin |
boundary condition type at left boundary (x=xmin) |
||
| integer, | intent(in) | :: | bc_xmax |
boundary condition type at right boundary (x=xmax) |
||
| integer, | intent(in) | :: | nipts |
desired number of interpolation points |
||
| integer, | intent(out) | :: | ncells |
calculated number of cells in domain |
subroutine sll_s_spline_1d_compute_num_cells( & degree , & bc_xmin, & bc_xmax, & nipts , & ncells ) integer, intent(in ) :: degree integer, intent(in ) :: bc_xmin integer, intent(in ) :: bc_xmax integer, intent(in ) :: nipts integer, intent( out) :: ncells ! Sanity checks SLL_ASSERT( degree > 0 ) SLL_ASSERT( any( bc_xmin == allowed_bcs ) ) SLL_ASSERT( any( bc_xmax == allowed_bcs ) ) if (any( [bc_xmin,bc_xmax]==sll_p_periodic ) .and. bc_xmin /= bc_xmax) then SLL_ERROR( "sll_s_spline_1d_compute_num_cells", "Incompatible BCs" ) end if if (bc_xmin == sll_p_periodic) then ncells = nipts else associate( nbc_xmin => merge( degree/2, 0, bc_xmin == sll_p_hermite ), & nbc_xmax => merge( degree/2, 0, bc_xmax == sll_p_hermite ) ) ncells = nipts + nbc_xmin + nbc_xmax - degree end associate end if end subroutine sll_s_spline_1d_compute_num_cells