init_ga2d_int Subroutine

public subroutine init_ga2d_int(me, width, length)

Arguments

Type IntentOptional Attributes Name
type(grw_int2darray_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_int~~CalledByGraph proc~init_ga2d_int init_ga2d_int interface~init~21 init interface~init~21->proc~init_ga2d_int

Contents

Source Code


Source Code

  subroutine init_ga2d_int(me, width, length)
    ! --------------------------------------------------------------------------
    !> dynamic array to init
    type(grw_int2darray_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
    me%nvals = 0

  end subroutine init_ga2d_int