Read the grid file and initialize the grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(in) | :: | files | Files' name and handler |
||
type(nodetype), | intent(out), | dimension(:,:,:), allocatable | :: | nodes | Grid points |
|
type(controltype), | intent(in) | :: | control | Control parameters |
||
type(boundarytype), | intent(inout) | :: | bc | boundary conditions and fixed values |
||
type(extent), | intent(out) | :: | dims | Extent of the domain:imx,jmx,kmx |
subroutine setup_grid(files, nodes, control, bc, dims)
!< Read the grid file and initialize the grid
!-----------------------------------------------------------
implicit none
type(filetype), intent(in) :: files
!< Files' name and handler
type(controltype), intent(in) :: control
!< Control parameters
type(boundarytype), intent(inout) :: bc
!< boundary conditions and fixed values
type(nodetype), dimension(:,:,:), allocatable, intent(out) :: nodes
!< Grid points
type(extent), intent(out) :: dims
!< Extent of the domain:imx,jmx,kmx
DebugCall('setup_grid')
open(files%GRID_FILE_UNIT, file=files%gridfile)
call extract_grid_size(files%GRID_FILE_UNIT, dims)
! allocate memory for storing grid points
allocate(nodes(-2:dims%imx+3, -2:dims%jmx+3, -2:dims%kmx+3))
!read interface mapping
call read_interface_map(files, control, bc, dims)
! ghost grid exchange
call populate_grid_points(files%GRID_FILE_UNIT, nodes, dims)
close(files%GRID_FILE_UNIT)
! populate ghost grid points
call ghost_grid(nodes, dims)
end subroutine setup_grid