initialize the type functional with number of elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_functional), | intent(inout), | ALLOCATABLE | :: | sf |
self |
|
| integer, | intent(in) | :: | which_functional |
SUBROUTINE InitFunctional(sf, which_functional) ! MODULES USE MODgvec_MHD3D, ONLY :t_functional_mhd3d IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES INTEGER , INTENT(IN ) :: which_functional !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES CLASS(t_functional), ALLOCATABLE,INTENT(INOUT) :: sf !! self !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES !=================================================================================================================================== SELECT CASE(which_functional) CASE(1) ALLOCATE(t_functional_mhd3d :: sf) CASE DEFAULT CALL abort(__STAMP__, & "this functional choice does not exist (MHD3D=1) !") END SELECT sf%which_functional=which_functional CALL sf%init() END SUBROUTINE InitFunctional