Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_TestIsFirstRegion.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 ! ******************************************************************************
24 !
25 ! Purpose: Determine whether region is first one.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region data
31 !
32 ! Output:
33 ! RFLU_TestIsFirstRegion = .TRUE. if region is first region
34 ! RFLU_TestIsFirstRegion = .FALSE. if region is not first region
35 !
36 ! Notes:
37 ! 1. First region has index 0 for serial runs, and 1 for parallel runs.
38 !
39 ! ******************************************************************************
40 !
41 ! $Id: RFLU_TestIsFirstRegion.F90,v 1.3 2008/12/06 08:44:13 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2004 by the University of Illinois
44 !
45 ! ******************************************************************************
46 
47 LOGICAL FUNCTION rflu_testisfirstregion(pRegion)
48 
49  USE moddatatypes
50  USE modglobal, ONLY: t_global
51  USE moddatastruct, ONLY: t_region
52 
53  IMPLICIT NONE
54 
55 ! ******************************************************************************
56 ! Declarations and definitions
57 ! ******************************************************************************
58 
59 ! ==============================================================================
60 ! Arguments
61 ! ==============================================================================
62 
63  TYPE(t_region), POINTER :: pregion
64 
65 ! ==============================================================================
66 ! Locals
67 ! ==============================================================================
68 
69  CHARACTER(CHRLEN) :: rcsidentstring
70  TYPE(t_global), POINTER :: global
71 
72 ! ******************************************************************************
73 ! Start
74 ! ******************************************************************************
75 
76  rcsidentstring = '$RCSfile: RFLU_TestIsFirstRegion.F90,v $ $Revision: 1.3 $'
77 
78  global => pregion%global
79 
80 ! ******************************************************************************
81 ! Test whether is first region
82 ! ******************************************************************************
83 
84  rflu_testisfirstregion = .false.
85 
86  IF ( global%nRegions > 1 ) THEN
87  IF ( pregion%iRegionGlobal == 1 ) THEN
88  rflu_testisfirstregion = .true.
89  END IF ! pRegion%iRegionGlobal
90  ELSE
91  IF ( pregion%iRegionGlobal == 0 ) THEN
92  rflu_testisfirstregion = .true.
93  END IF ! pRegion%iRegionGlobal
94  END IF ! global%nRegions
95 
96 ! ******************************************************************************
97 ! End
98 ! ******************************************************************************
99 
100 END FUNCTION rflu_testisfirstregion
101 
102 !*******************************************************************************
103 !
104 ! RCS Revision history:
105 !
106 ! $Log: RFLU_TestIsFirstRegion.F90,v $
107 ! Revision 1.3 2008/12/06 08:44:13 mtcampbe
108 ! Updated license.
109 !
110 ! Revision 1.2 2008/11/19 22:17:26 mtcampbe
111 ! Added Illinois Open Source License/Copyright
112 !
113 ! Revision 1.1 2004/10/19 19:23:51 haselbac
114 ! Initial revision
115 !
116 !*******************************************************************************
117 
118 
119 
120 
121 
122 
LOGICAL function rflu_testisfirstregion(pRegion)