placeat_singlega2d_real Subroutine

public subroutine placeat_singlega2d_real(me, val, pos1, pos2, length)

append a single value to the growing 2d array.

Arguments

Type IntentOptional Attributes Name
type(grw_real2darray_type) :: me

array to append the value to

real(kind=rk), intent(in) :: val

value to append

integer, intent(in) :: pos1

position in first dimension (cannot grow)

integer, intent(in) :: pos2

position in second dimension (can grow)

integer, intent(in), optional :: length

optional length to expand the array


Calls

proc~~placeat_singlega2d_real~~CallsGraph proc~placeat_singlega2d_real placeat_singlega2d_real interface~expand~22 expand proc~placeat_singlega2d_real->interface~expand~22 proc~expand_ga2d_real expand_ga2d_real interface~expand~22->proc~expand_ga2d_real

Called by

proc~~placeat_singlega2d_real~~CalledByGraph proc~placeat_singlega2d_real placeat_singlega2d_real interface~placeat~35 placeat interface~placeat~35->proc~placeat_singlega2d_real proc~tem_unify_surfacedata tem_unify_surfaceData proc~tem_unify_surfacedata->interface~placeat~35 proc~tem_readandunify_surfdata tem_readAndUnify_surfData proc~tem_readandunify_surfdata->proc~tem_unify_surfacedata

Contents


Source Code

  subroutine placeat_singlega2d_real(me, val, pos1, pos2, length)
    ! --------------------------------------------------------------------------
    !> array to append the value to
    type(grw_real2darray_type) :: me
    !> value to append
    real(kind=rk), intent(in) :: val
    !> position in first dimension (cannot grow)
    integer, intent(in) :: pos1
    !> position in second dimension (can grow)
    integer, intent(in) :: pos2
    !> optional length to expand the array
    integer, intent(in), optional :: length
    ! --------------------------------------------------------------------------
    integer :: expandlength
    ! --------------------------------------------------------------------------

    if (pos2 > me%containersize) then
      expandlength = pos2 - me%containersize
      if( present( length ) ) expandlength = max(expandlength, length)
      ! expand the array, if its boundary is reached
      call expand( me = me, length = expandlength )
    end if
    me%nvals = max(pos2, me%nvals)
    me%val(pos1,pos2) = val

  end subroutine placeat_singlega2d_real