File: RELATIVE:/../../../mfix.git/model/location_check.f

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
63