Setup the state module. This subroutine should be run before the state variables are initilized. This subroutine allocates the memory for state variables and sets up the aliases to refer to the components of the state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(inout) | :: | files | Files' name and handler |
||
real(kind=wp), | intent(inout), | dimension(:,:,:,:), allocatable, 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(inout) | :: | flow | Information about fluid flow: freestream-speed, ref-viscosity,etc. |
||
type(extent), | intent(inout) | :: | dims | Extent of the domain:imx,jmx,kmx |
subroutine setup_state(files, qp, control, scheme, flow, dims)
!< Setup the state module.
!< This subroutine should be run before the state variables
!< are initilized. This subroutine allocates the memory for
!< state variables and sets up the aliases to refer to the
!< components of the state
!-----------------------------------------------------------
implicit none
type(filetype), intent(inout) :: files
!< Files' name and handler
type(controltype), intent(inout) :: control
!< Control parameters
type(schemetype), intent(in) :: scheme
!< finite-volume Schemes
type(flowtype), intent(inout) :: flow
!< Information about fluid flow: freestream-speed, ref-viscosity,etc.
type(extent), intent(inout) :: dims
!< Extent of the domain:imx,jmx,kmx
real(wp), dimension(:,:,:,:), allocatable, intent(inout), target :: qp
!< Store primitive variable at cell center
DebugCall("setup_state")
n_var = control%n_var
imx = dims%imx
jmx = dims%jmx
kmx = dims%kmx
call set_n_var_value(control, scheme)
dims%n_var = control%n_var
!call allocate_memory(qp)
call alloc(qp, -2, imx+2, -2, jmx+2, -2, kmx+2, 1, n_var, AErrMsg("qp"))
allocate(control%previous_res(1:control%n_var+1))
!call link_aliases(scheme)
call init_infinity_values(scheme, flow)
call initstate(files, qp, control, scheme, flow, dims)
end subroutine setup_state