Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_DecidePrint.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 to print data to screen.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global data
31 !
32 ! Output:
33 ! RFLU_DecidePrint = .TRUE. If should print to screen
34 ! RFLU_DecidePrint = .FALSE. If should not print to screen
35 !
36 ! Notes: None.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RFLU_DecidePrint.F90,v 1.6 2008/12/06 08:44:12 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2003-2004 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 LOGICAL FUNCTION rflu_decideprint(global)
47 
48  USE moddatatypes
49  USE moderror
50  USE modparameters
51  USE modglobal, ONLY: t_global
52  USE moddatastruct, ONLY: t_region
53  USE modgrid, ONLY: t_grid
54 
55  IMPLICIT NONE
56 
57 ! *****************************************************************************
58 ! Declarations and definitions
59 ! *****************************************************************************
60 
61 ! =============================================================================
62 ! Arguments
63 ! =============================================================================
64 
65  TYPE(t_global), POINTER :: global
66 
67 ! =============================================================================
68 ! Locals
69 ! =============================================================================
70 
71  CHARACTER(CHRLEN) :: rcsidentstring
72  LOGICAL :: logical1,logical2,logical3
73 
74 ! *****************************************************************************
75 ! Start
76 ! *****************************************************************************
77 
78  rcsidentstring = '$RCSfile: RFLU_DecidePrint.F90,v $ $Revision: 1.6 $'
79 
80  CALL registerfunction(global,'RFLU_DecidePrint',&
81  'RFLU_DecidePrint.F90')
82 
83 ! *****************************************************************************
84 ! Initialize
85 ! *****************************************************************************
86 
87  rflu_decideprint = .false.
88 
89 ! *****************************************************************************
90 ! Determine whether should print to screen
91 ! *****************************************************************************
92 
93 ! =============================================================================
94 ! Unsteady flow
95 ! =============================================================================
96 
97  IF ( global%flowType == flow_unsteady ) THEN
98  logical1 = abs(global%timeSincePrint-global%printTime) &
99  < 0.1_rfreal*global%dtMin
100  logical2 = (global%timeSincePrint > global%printTime)
101  logical3 = (global%iterSinceRestart == 1)
102 
103  IF ( logical1 .OR. logical2 .OR. logical3 ) THEN
104  rflu_decideprint = .true.
105  END IF ! logical1
106 
107 ! =============================================================================
108 ! Steady flow. NOTE must have RFLU_DecidePrint be TRUE if currentIter == 1
109 ! because only then will RFLU_ResidualNorm be called from RFLU_TimeStepping,
110 ! and at the first iteration, this is needed to get a residual for correct
111 ! normalization.
112 ! =============================================================================
113 
114  ELSE
115  rflu_decideprint = (mod(global%currentIter,global%printIter) == 0)
116 
117  IF ( global%currentIter == 1 ) THEN
118  rflu_decideprint = .true.
119  END IF ! global%currentIter
120  END IF ! global%flowType
121 
122 ! *****************************************************************************
123 ! End
124 ! *****************************************************************************
125 
126  CALL deregisterfunction(global)
127 
128 END FUNCTION rflu_decideprint
129 
130 !******************************************************************************
131 !
132 ! RCS Revision history:
133 !
134 ! $Log: RFLU_DecidePrint.F90,v $
135 ! Revision 1.6 2008/12/06 08:44:12 mtcampbe
136 ! Updated license.
137 !
138 ! Revision 1.5 2008/11/19 22:17:25 mtcampbe
139 ! Added Illinois Open Source License/Copyright
140 !
141 ! Revision 1.4 2006/04/07 15:19:16 haselbac
142 ! Removed tabs
143 !
144 ! Revision 1.3 2004/01/31 03:56:54 haselbac
145 ! Added explanatory comment
146 !
147 ! Revision 1.2 2004/01/29 22:56:28 haselbac
148 ! Removed setting of timeSincePrint to make routine more usable
149 !
150 ! Revision 1.1 2003/10/29 21:36:58 haselbac
151 ! Initial revision
152 !
153 !******************************************************************************
154 
155 
156 
157 
158 
159 
160 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
LOGICAL function rflu_decideprint(global)
subroutine deregisterfunction(global)
Definition: ModError.F90:469