Initialize the state. If load file(start_from) is 0, then the state should be set to the infinity values. Otherwise, read the state_file to get the state values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(inout) | :: | files | Files' name and handler |
||
real(kind=wp), | intent(inout), | dimension(-2:dims%imx+2, -2:dims%jmx+2, -2:dims%kmx+2, 1:dims%n_var), target | :: | qp | Store primitive variable at cell center |
|
type(controltype), | intent(inout) | :: | control | Control parameters |
||
type(schemetype), | intent(in) | :: | scheme | finite-volume Schemes |
||
type(flowtype), | intent(in) | :: | flow | Information about fluid flow: freestream-speed, ref-viscosity,etc. |
||
type(extent), | intent(in) | :: | dims | Extent of the domain:imx,jmx,kmx |
subroutine initstate(files, qp, control, scheme, flow, dims)
!< Initialize the state.
!< If load file(start_from) is 0, then the state should be
!< set to the infinity values. Otherwise, read the state_file
!< to get the state values
!-----------------------------------------------------------
implicit none
type(filetype), intent(inout) :: files
!< Files' name and handler
type(extent), intent(in) :: dims
!< Extent of the domain:imx,jmx,kmx
type(controltype), intent(inout) :: control
!< Control parameters
type(schemetype), intent(in) :: scheme
!< finite-volume Schemes
type(flowtype), intent(in) :: flow
!< Information about fluid flow: freestream-speed, ref-viscosity,etc.
real(wp), dimension(-2:dims%imx+2, -2:dims%jmx+2, -2:dims%kmx+2, 1:dims%n_var), intent(inout), target :: qp
!< Store primitive variable at cell center
DebugCall("initstate")
call verify_write_control(control, scheme, flow)
if (control%start_from .eq. 0) then
! Set the state to the infinity values
call init_state_with_infinity_values(qp, scheme, flow, dims)
else
write(files%infile,'(a,i4.4,a,i2.2)') &
"time_directories/",control%start_from,"/process_",process_id
! Set the state to the infinity values so if some
! variable are not restart variable they get free_stream value
call init_state_with_infinity_values(qp, scheme, flow, dims)
call read_file(files, qp, control, scheme, dims)
end if
end subroutine initstate