Read the layout file for particular processor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(inout) | :: | files | Files' name and handler |
||
type(controltype), | intent(in) | :: | control | Processor id for current block |
||
type(boundarytype), | intent(inout) | :: | bc | boundary conditions and fixed values |
subroutine read_layout_file(files,control, bc)
!< Read the layout file for particular processor
implicit none
type(filetype), intent(inout) :: files
!< Files' name and handler
type(boundarytype), intent(inout) :: bc
!< boundary conditions and fixed values
character(len=STRING_BUFFER_LENGTH) :: buf
!< read buffer
character(len=128) :: grid_file_buf
!< Name of the gridfile to load
character(len=128) :: bc_file
!< Name of the boundary condition file to load.
type(controltype) ,intent(in)::control
!< Processor id for current block
integer :: total_entries
!< Total enteries in layout.md for each processorS
integer :: i,buf_id
DebugCall('read_layout_file')
open(files%CONFIG_FILE_UNIT, file=files%layout_file)
! Read the parameters from the file
call get_next_token_parallel(files%CONFIG_FILE_UNIT, buf)
read(buf,*)!control%total_process
call get_next_token_parallel(files%CONFIG_FILE_UNIT, buf)
read(buf,*)total_entries
i = 0
!print *, process_id
call get_next_token_parallel(files%CONFIG_FILE_UNIT, buf)
do while(i < control%process_id)
call get_next_token_parallel(files%CONFIG_FILE_UNIT, buf)
i = i+1
end do
read(buf,*) buf_id, grid_file_buf, bc_file, bc%imin_id, bc%imax_id, bc%jmin_id,bc%jmax_id,bc%kmin_id,bc%kmax_id
write(files%gridfile, '(A)') 'system/mesh/gridfiles/'//trim(grid_file_buf)
write(files%bcfile, '(A)') 'system/mesh/bc/'//trim(bc_file)
end subroutine read_layout_file