MFIX  2016-1
location_check.f
Go to the documentation of this file.
1 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2 ! !
3 ! Subroutine: LOCATION_CHECK !
4 ! Author: P. Nicoletti Date: 02-DEC-91 !
5 ! !
6 ! Purpose: Check calculated and given cell locations for consistency !
7 ! !
8 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
9  SUBROUTINE location_check(CELL_SPECIFIED, CELL_CALCULATED, &
10  counter, message)
11 
12 ! Global variables:
13 !---------------------------------------------------------------------//
14 ! Runtime flags stating direction is not solved.
15  USE geometry, only: no_i, no_j, no_k
16 ! Flag for reinitializing a run.
17  use run, only: reinitializing
18 
19 ! Module procedure for error message management.
20  use error_manager
21 
22  IMPLICIT NONE
23 
24 ! Dummy arguments:
25 !---------------------------------------------------------------------//
26 ! Cell index specified in the input file.
27  INTEGER, INTENT(INOUT) :: CELL_SPECIFIED
28 ! Cell index calculated for location coordinate.
29  INTEGER, INTENT(IN) :: CELL_CALCULATED
30 ! Index for BC, IC, or IS
31  INTEGER, INTENT(IN) :: COUNTER
32 ! Error message to print out
33  CHARACTER(len=*) :: MESSAGE
34 !......................................................................!
35 
36 ! During a reinitializing, "old" data is in the I/J/K arrays. This check
37 ! overwrites the old data with the current calculated values.
38  IF(reinitializing) cell_specified = cell_calculated
39 
40 ! Check that the cell_specified in the data input equals to the cell
41 ! calculated.
42  IF(cell_specified == cell_calculated) RETURN
43 
44 
45  IF(no_k .AND. (message(6:6)=='b' .OR. message(6:6)=='t')) RETURN
46  IF(no_j .AND. (message(6:6)=='s' .OR. message(6:6)=='n')) RETURN
47  IF(no_i .AND. (message(6:6)=='w' .OR. message(6:6)=='e')) RETURN
48 
49  CALL init_err_msg('LOCATION_CHECK')
50 
51  WRITE(err_msg, 1000) message, counter, cell_specified, &
52  cell_calculated
53  CALL flush_err_msg(abort=.true.)
54 
55  1000 FORMAT('Error 1000: IC, BC, OR IS consistency error for: ',a,/, &
56  'IC/BC/IS No',5x,'= ',i6,/,'Cell specified',2x,'= ',i6,/, &
57  'Cell calculated',1x,'= ',i6)
58 
59  CALL finl_err_msg()
60 
61  RETURN
62  END SUBROUTINE location_check
subroutine finl_err_msg
logical no_i
Definition: geometry_mod.f:20
subroutine init_err_msg(CALLER)
Definition: run_mod.f:13
subroutine location_check(CELL_SPECIFIED, CELL_CALCULATED, COUNTER, MESSAGE)
logical no_k
Definition: geometry_mod.f:28
logical reinitializing
Definition: run_mod.f:208
logical no_j
Definition: geometry_mod.f:24
character(len=line_length), dimension(line_count) err_msg
subroutine flush_err_msg(DEBUG, HEADER, FOOTER, ABORT, LOG, CALL_TREE)