Allocate memory to variables required based on the time-integration scheme.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(in) | :: | 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 setup_update(control, scheme,flow, dims)
!< Allocate memory to variables required based
!< on the time-integration scheme.
implicit none
type(controltype), intent(in) :: 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
imx = dims%imx
jmx = dims%jmx
kmx = dims%kmx
n_var = control%n_var
call alloc(u1,1,n_var)
call alloc(u2,1,n_var)
call alloc(R ,1,n_var)
call alloc(aux,-2,imx+2,-2,jmx+2,-2,kmx+2,1,n_var)
select case (scheme%time_step_accuracy)
case ("none")
! Do nothing
continue
case ("RK2", "RK4")
call alloc(U_store,-2,imx+2,-2,jmx+2,-2,kmx+2,1,n_var)
call alloc(R_store, 1,imx-1, 1,jmx-1, 1,kmx-1,1,n_var)
case ("TVDRK2", "TVDRK3")
call alloc(U_store,-2,imx+2,-2,jmx+2,-2,kmx+2,1,n_var)
case ("implicit")
call setup_lusgs(control, scheme, flow, dims)
case ("plusgs")
call setup_plusgs(control, scheme, flow, dims)
case default
Fatal_error
end select
end subroutine setup_update