-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvariables_m.f90
39 lines (32 loc) · 1.25 KB
/
variables_m.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
!
! Copyright (C) 2013, Northwestern University
! See COPYRIGHT notice in top-level directory.
!
module variables_m
! module for variables
implicit none
! primitive variables
double precision, allocatable :: yspecies(:,:,:,:) !mass fractions for ALL species
double precision, allocatable :: u(:,:,:,:) !velocity vector (non-dimensional)
double precision, allocatable :: pressure(:,:,:) !pressure (non-dimensional)
double precision, allocatable :: temp(:,:,:) !temperature (non-dimensional)
contains
!----< allocate_variables_arrays() >-----------------------------
subroutine allocate_variables_arrays(flag)
! allocate variables arrays
use param_m, only : nx, ny, nz, nsc
implicit none
integer flag
if (flag .EQ. 1) then
allocate(yspecies(nx,ny,nz,nsc+1))
allocate( u(nx,ny,nz,3))
allocate(pressure(nx,ny,nz))
allocate( temp(nx,ny,nz))
elseif (flag .EQ. -1) then
deallocate(yspecies)
deallocate(u)
deallocate(pressure)
deallocate(temp)
endif
end subroutine allocate_variables_arrays
end module variables_m