MFIX  2016-1
ambm_mod.f
Go to the documentation of this file.
1 ! -*- f90 -*-
2 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
3 ! !
4 ! Module: ambm !
5 ! Purpose: !
6 ! IMPORTANT: For using these arrays in a subroutine !
7 ! -lock the module in the beginning of the subroutine !
8 ! call lock_ambm !
9 ! -and unlock the module at the end of the subroutine !
10 ! call unlock_ambm !
11 ! Contains the following subroutines: !
12 ! lock_ambm, unlock_ambm !
13 ! !
14 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
15 
16  MODULE ambm
17 
18 !-----------------------------------------------
19 ! Modules
20 !-----------------------------------------------
21  USE compar
22  USE exit, only: mfix_exit
23  USE funits
24 !-----------------------------------------------
25 
26 ! linear equation matrix and vector
27  DOUBLE PRECISION, DIMENSION(:, :, :), ALLOCATABLE :: a_m
28  DOUBLE PRECISION, DIMENSION(:, :), ALLOCATABLE :: b_m
29 
30  LOGICAL :: ambm_locked = .false.
31 
32  CONTAINS
33 
34 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
35 ! !
36 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
37  SUBROUTINE lock_ambm
38  IMPLICIT NONE
39  IF(ambm_locked) THEN
40  IF (dmp_log) WRITE(*,*) &
41  'Error: Multiple use of ambm (ambm_mod.f)'
42  CALL mfix_exit(mype)
43  ELSE
44  ambm_locked = .true.
45  ENDIF
46  END SUBROUTINE lock_ambm
47 
48 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
49 ! !
50 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
51  SUBROUTINE unlock_ambm
52  ambm_locked = .false.
53  END SUBROUTINE unlock_ambm
54 
55  END MODULE ambm
double precision, dimension(:,:,:), allocatable a_m
Definition: ambm_mod.f:27
logical dmp_log
Definition: funits_mod.f:6
Definition: ambm_mod.f:16
subroutine mfix_exit(myID, normal_termination)
Definition: exit.f:5
Definition: exit.f:2
subroutine lock_ambm
Definition: ambm_mod.f:38
logical ambm_locked
Definition: ambm_mod.f:30
integer mype
Definition: compar_mod.f:24
double precision, dimension(:,:), allocatable b_m
Definition: ambm_mod.f:28
subroutine unlock_ambm
Definition: ambm_mod.f:52