alloc_rank5_real Subroutine

private subroutine alloc_rank5_real(var, start1, stop1, start2, stop2, start3, stop3, start4, stop4, start5, stop5, errmsg)

Allcoate 5-Dimensional array of type: real

Arguments

Type IntentOptional AttributesName
real, intent(inout), dimension(:, :, :, :, :), allocatable:: var

Variable to which memory is allocated

integer, intent(in) :: start1

Starting index of Var array's dimension

integer, intent(in) :: stop1

Last index of Var array's dimension

integer, intent(in) :: start2

Starting index of Var array's dimension

integer, intent(in) :: stop2

Last index of Var array's dimension

integer, intent(in) :: start3

Starting index of Var array's dimension

integer, intent(in) :: stop3

Last index of Var array's dimension

integer, intent(in) :: start4

Starting index of Var array's dimension

integer, intent(in) :: stop4

Last index of Var array's dimension

integer, intent(in) :: start5

Starting index of Var array's dimension

integer, intent(in) :: stop5

Last index of Var array's dimension

character(len=*), intent(in), optional :: errmsg

Error message to print if mem_stat is not 0(successful)


Called by

proc~~alloc_rank5_real~~CalledByGraph proc~alloc_rank5_real alloc_rank5_real interface~alloc alloc interface~alloc->proc~alloc_rank5_real proc~destroy_time destroy_time proc~destroy_time->interface~alloc proc~setup_interface setup_interface proc~setup_interface->interface~alloc proc~setup_gradients setup_gradients proc~setup_gradients->interface~alloc proc~setup_bc setup_bc proc~setup_bc->interface~alloc proc~setup_scheme setup_scheme proc~setup_scheme->interface~alloc proc~setup_interpolant_scheme setup_interpolant_scheme proc~setup_scheme->proc~setup_interpolant_scheme proc~allocate_memory allocate_memory proc~allocate_memory->interface~alloc proc~allocate_memory~3 allocate_memory proc~allocate_memory~3->interface~alloc proc~setup_state setup_state proc~setup_state->interface~alloc proc~setup_viscosity setup_viscosity proc~setup_viscosity->interface~alloc proc~find_wall_dist find_wall_dist proc~find_wall_dist->interface~alloc proc~setup_wall_dist setup_wall_dist proc~setup_wall_dist->interface~alloc proc~setup_lusgs setup_lusgs proc~setup_lusgs->interface~alloc proc~setup_update setup_update proc~setup_update->interface~alloc proc~setup_update->proc~setup_lusgs proc~setup_plusgs setup_plusgs proc~setup_update->proc~setup_plusgs proc~setupcc setupCC proc~setupcc->interface~alloc proc~setup_time setup_time proc~setup_time->interface~alloc proc~setup_plusgs->interface~alloc proc~setup_interpolant_scheme->interface~alloc proc~setup_solver setup_solver proc~setup_solver->proc~setup_interface proc~setup_solver->proc~setup_gradients proc~setup_solver->proc~setup_bc proc~setup_solver->proc~setup_scheme proc~setup_solver->proc~setup_state proc~setup_solver->proc~setup_viscosity proc~setup_solver->proc~find_wall_dist proc~setup_solver->proc~setup_wall_dist proc~setup_solver->proc~setup_update proc~setup_solver->proc~setupcc proc~setup_solver->proc~setup_time proc~setup_resnorm setup_resnorm proc~setup_solver->proc~setup_resnorm proc~write_surfnode write_surfnode proc~setup_solver->proc~write_surfnode proc~setup_resnorm->proc~allocate_memory proc~setup_surface setup_surface proc~setup_surface->proc~allocate_memory~3 proc~destroy_solver destroy_solver proc~destroy_solver->proc~destroy_time proc~finish_run finish_run proc~finish_run->proc~destroy_solver proc~write_surfnode->proc~setup_surface proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~finish_run program~main->proc~start_run proc~abort_run abort_run proc~abort_run->proc~finish_run

Contents

Source Code


Source Code

        subroutine alloc_rank5_real(var, start1, stop1, start2, stop2, &
                start3, stop3, start4, stop4, start5, stop5, errmsg)
          !< Allcoate 5-Dimensional array of type: real
            implicit none
            real, dimension(:, :, :, :, :), intent(inout), allocatable :: var
            !< Variable to which memory is allocated
            integer, intent(in) :: start1, start2, start3, start4, start5
            !< Starting index of Var array's dimension
            integer, intent(in) :: stop1, stop2, stop3, stop4, stop5
            !< Last index of Var array's dimension
            integer :: mem_stat
            !< Status of the memory allocation process
            character(len=*), intent(in), optional :: errmsg
            !< Error message to print if mem_stat is not 0(successful)
            allocate(var(start1:stop1, start2:stop2, start3:stop3, &
                    start4:stop4, start5:stop5), stat=mem_stat)
            if (mem_stat /= 0) then
                if (present(errmsg)) then
                    print *, errmsg
                else
                    print *, 'Error: Could not allocate memory.'
                end if
                print *, 'Required extent: ', stop1 - start1 + 1, &
                        stop2 - start2 + 1, stop3 - stop3 + 1, &
                        stop4 - start4 + 1, stop5 - start5 + 1
                stop
            end if
        end subroutine alloc_rank5_real