populate_grid_points Subroutine

private subroutine populate_grid_points(file_handler, nodes, dims)

Use the grid file to populate the grid points.

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: file_handler

(input)file handling unit

type(nodetype), intent(out), dimension(-2:dims%imx+3,-2:dims%jmx+3,-2:dims%kmx+3):: nodes

Grid points

type(extent), intent(in) :: dims

Extent of the domain:imx,jmx,kmx


Calls

proc~~populate_grid_points~~CallsGraph proc~populate_grid_points populate_grid_points debugcall debugcall proc~populate_grid_points->debugcall

Called by

proc~~populate_grid_points~~CalledByGraph proc~populate_grid_points populate_grid_points proc~setup_grid setup_grid proc~setup_grid->proc~populate_grid_points proc~setup_solver setup_solver proc~setup_solver->proc~setup_grid proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

        subroutine populate_grid_points(file_handler, nodes, dims)
            !< Use the grid file to populate the grid points.
            !-----------------------------------------------------------

            implicit none
            integer, intent(in) :: file_handler
            !< (input)file handling unit
            type(extent), intent(in) :: dims
            !< Extent of the domain:imx,jmx,kmx
            type(nodetype), dimension(-2:dims%imx+3,-2:dims%jmx+3,-2:dims%kmx+3), intent(out) :: nodes
            !< Grid points
            character(len=STRING_BUFFER_LENGTH) :: line
            !< store read line
            integer :: i, j, k
            integer :: ios  
            !< input/output  status

            DebugCall('populate_grid_point')
         !  print *, imx, jmx, kmx

            ! Read grid points from the grid file
            do k = 1, dims%kmx
                do j = 1, dims%jmx
                    do i = 1, dims%imx
                        read(file_handler, '(A)', iostat=ios) line
                        if (ios /= 0) then
                            print *, 'Error while reading grid line.'
                            print *, 'Current grid point: ', i, j, k
                            print *, 'Current buffer length is set to: ', &
                                     STRING_BUFFER_LENGTH
                            print *, 'Exiting program.'
                            !stop
                        end if
                        !call extract_grid_point(line, i, j, k)
                        read(line, *) nodes(i, j, k)%x, nodes(i, j, k)%y, nodes(i, j, k)%z
                    end do
                end do
            end do

        end subroutine populate_grid_points