append_singlega2d_real Subroutine

public subroutine append_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(out), optional :: pos2

the position in second dimension the element were added to

integer, intent(in), optional :: length

optional length to expand the array


Calls

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

Called by

proc~~append_singlega2d_real~~CalledByGraph proc~append_singlega2d_real append_singlega2d_real interface~append~23 append interface~append~23->proc~append_singlega2d_real proc~tem_opvar_fill_inputindex tem_opVar_fill_inputIndex proc~tem_opvar_fill_inputindex->interface~append~23 proc~tem_opvar_setupindices tem_opVar_setupIndices proc~tem_opvar_setupindices->interface~append~23 proc~tem_opvar_setupindices->proc~tem_opvar_fill_inputindex proc~tem_opvar_reduction_transient_init tem_opVar_reduction_transient_init proc~tem_opvar_reduction_transient_init->interface~append~23 proc~load_datafile load_datafile proc~load_datafile->interface~append~23 proc~tem_spatial_scalar_storeval tem_spatial_scalar_storeVal proc~tem_spatial_scalar_storeval->interface~append~23 proc~tem_refine_global_subtree tem_refine_global_subtree proc~tem_refine_global_subtree->interface~append~23 proc~tem_init_surfdata tem_init_surfData proc~tem_init_surfdata->interface~append~23 proc~tem_addface tem_addFace proc~tem_addface->interface~append~23 proc~tem_build_facerecvbuffers tem_build_faceRecvBuffers proc~tem_build_facerecvbuffers->interface~append~23 proc~append_intpmatrixlsf append_intpMatrixLSF proc~append_intpmatrixlsf->interface~append~23 proc~tem_spatial_vector_storeval tem_spatial_vector_storeVal proc~tem_spatial_vector_storeval->interface~append~23 proc~tem_dump_stlb tem_dump_stlb proc~tem_dump_stlb->interface~append~23 proc~tem_unify_surfacedata tem_unify_surfaceData proc~tem_unify_surfacedata->interface~append~23 proc~tem_build_facesendbuffers tem_build_faceSendBuffers proc~tem_build_facesendbuffers->interface~append~23 proc~load_temporal_from_file load_temporal_from_file proc~load_temporal_from_file->proc~load_datafile proc~tem_update_surfpos tem_update_surfPos proc~tem_update_surfpos->proc~tem_init_surfdata proc~tem_get_faces tem_get_faces proc~tem_get_faces->proc~tem_addface proc~tem_build_facebuffers tem_build_faceBuffers proc~tem_build_facebuffers->proc~tem_build_facerecvbuffers proc~tem_build_facebuffers->proc~tem_build_facesendbuffers interface~tem_spatial_storeval tem_spatial_storeVal interface~tem_spatial_storeval->proc~tem_spatial_scalar_storeval interface~tem_spatial_storeval->proc~tem_spatial_vector_storeval interface~append~44 append interface~append~44->proc~append_intpmatrixlsf proc~tem_readandunify_surfdata tem_readAndUnify_surfData proc~tem_readandunify_surfdata->proc~tem_unify_surfacedata proc~tem_load_temporal tem_load_temporal proc~tem_load_temporal->proc~load_temporal_from_file proc~tem_collect_faces tem_collect_faces proc~tem_collect_faces->proc~tem_get_faces proc~setup_indices_spacetime setup_indices_spacetime proc~setup_indices_spacetime->interface~tem_spatial_storeval proc~tem_build_face_info tem_build_face_info proc~tem_build_face_info->proc~tem_build_facebuffers

Contents


Source Code

  subroutine append_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
    !> optional length to expand the array
    integer, intent(in), optional :: length
    !> the position in second dimension the element were added to
    integer, intent(out), optional :: pos2
    ! --------------------------------------------------------------------------
    integer :: newpos
    ! --------------------------------------------------------------------------

    newpos = me%nvals + 1
    if (newpos > me%containersize) then
      ! expand the array, if its boundary is reached
      call expand( me = me, length = length )
    end if

    me%val(pos1, newpos) = val

    if( present( pos2 ) ) pos2 = newpos

  end subroutine append_singlega2d_real