setup_state Subroutine

public 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

Arguments

Type IntentOptional AttributesName
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


Calls

proc~~setup_state~~CallsGraph proc~setup_state setup_state aerrmsg aerrmsg proc~setup_state->aerrmsg proc~initstate initstate proc~setup_state->proc~initstate interface~alloc alloc proc~setup_state->interface~alloc proc~init_infinity_values init_infinity_values proc~setup_state->proc~init_infinity_values debugcall debugcall proc~setup_state->debugcall proc~set_n_var_value set_n_var_value proc~setup_state->proc~set_n_var_value proc~initstate->debugcall proc~verify_write_control verify_write_control proc~initstate->proc~verify_write_control proc~init_state_with_infinity_values init_state_with_infinity_values proc~initstate->proc~init_state_with_infinity_values proc~read_file~3 read_file proc~initstate->proc~read_file~3 proc~alloc_rank2_real alloc_rank2_real interface~alloc->proc~alloc_rank2_real proc~alloc_rank4_real alloc_rank4_real interface~alloc->proc~alloc_rank4_real proc~alloc_rank3_real alloc_rank3_real interface~alloc->proc~alloc_rank3_real proc~alloc_rank2_integer alloc_rank2_integer interface~alloc->proc~alloc_rank2_integer proc~alloc_rank1_integer alloc_rank1_integer interface~alloc->proc~alloc_rank1_integer proc~alloc_rank6_real alloc_rank6_real interface~alloc->proc~alloc_rank6_real proc~alloc_rank5_real alloc_rank5_real interface~alloc->proc~alloc_rank5_real proc~alloc_rank3_integer alloc_rank3_integer interface~alloc->proc~alloc_rank3_integer proc~alloc_rank1_real alloc_rank1_real interface~alloc->proc~alloc_rank1_real proc~init_infinity_values->debugcall proc~sound_speed_inf sound_speed_inf proc~init_infinity_values->proc~sound_speed_inf proc~set_n_var_value->debugcall proc~lcase lcase proc~verify_write_control->proc~lcase proc~init_state_with_infinity_values->debugcall proc~verify_read_control verify_read_control proc~read_file~3->proc~verify_read_control read_file_tec read_file_tec proc~read_file~3->read_file_tec proc~open_file~2 open_file proc~read_file~3->proc~open_file~2 proc~read_restart_file read_restart_file proc~read_file~3->proc~read_restart_file proc~close_file~2 close_file proc~read_file~3->proc~close_file~2 read_file_vtk read_file_vtk proc~read_file~3->read_file_vtk proc~setup_file~3 setup_file proc~read_file~3->proc~setup_file~3 proc~verify_read_control->proc~lcase proc~open_file~2->debugcall proc~close_file~2->debugcall proc~setup_file~3->debugcall

Called by

proc~~setup_state~~CalledByGraph proc~setup_state setup_state proc~setup_solver setup_solver proc~setup_solver->proc~setup_state proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

        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