init_ga2d_real Subroutine

public subroutine init_ga2d_real(me, width, length)

Arguments

Type IntentOptional Attributes Name
type(grw_real2darray_type), intent(out) :: me

dynamic array to init

integer, intent(in) :: width

width of the container

integer, intent(in), optional :: length

initial length of the container


Called by

proc~~init_ga2d_real~~CalledByGraph proc~init_ga2d_real init_ga2d_real interface~init~22 init interface~init~22->proc~init_ga2d_real

Contents

Source Code


Source Code

  subroutine init_ga2d_real(me, width, length)
    ! --------------------------------------------------------------------------
    !> dynamic array to init
    type(grw_real2darray_type), intent(out) :: me
    !> width of the container
    integer, intent(in)           :: width
    !> initial length of the container
    integer, intent(in), optional :: length
    ! --------------------------------------------------------------------------

    me%containerwidth = width
    if (present(length)) me%containersize = length

    allocate(me%val(me%containerwidth,me%containersize))
    ! reset all values (only positive values are valid)
    me%val(:,:) = -1.0_rk
    me%nvals = 0

  end subroutine init_ga2d_real