Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_DecideWrite.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 write data to files.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global data
31 !
32 ! Output:
33 ! RFLU_DecideWrite = .TRUE. If should write to files
34 ! RFLU_DecideWrite = .FALSE. If should not write to files
35 !
36 ! Notes: None.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RFLU_DecideWrite.F90,v 1.5 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_decidewrite(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
73 
74 ! *****************************************************************************
75 ! Start
76 ! *****************************************************************************
77 
78  rcsidentstring = '$RCSfile: RFLU_DecideWrite.F90,v $ $Revision: 1.5 $'
79 
80  CALL registerfunction(global,'RFLU_DecideWrite',&
81  'RFLU_DecideWrite.F90')
82 
83 ! *****************************************************************************
84 ! Initialize
85 ! *****************************************************************************
86 
87  rflu_decidewrite = .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%timeSinceWrite-global%writeTime) &
99  < 0.1_rfreal*global%dtMin
100  logical2 = (global%timeSinceWrite > global%writeTime)
101 
102  IF ( logical1 .OR. logical2 ) THEN
103  rflu_decidewrite = .true.
104  END IF ! logical1
105 
106 ! =============================================================================
107 ! Steady flow
108 ! =============================================================================
109 
110  ELSE
111  rflu_decidewrite = (mod(global%currentIter,global%writeIter) == 0)
112  END IF ! global%flowType
113 
114 ! *****************************************************************************
115 ! End
116 ! *****************************************************************************
117 
118  CALL deregisterfunction(global)
119 
120 END FUNCTION rflu_decidewrite
121 
122 !******************************************************************************
123 !
124 ! RCS Revision history:
125 !
126 ! $Log: RFLU_DecideWrite.F90,v $
127 ! Revision 1.5 2008/12/06 08:44:12 mtcampbe
128 ! Updated license.
129 !
130 ! Revision 1.4 2008/11/19 22:17:25 mtcampbe
131 ! Added Illinois Open Source License/Copyright
132 !
133 ! Revision 1.3 2006/04/07 15:19:16 haselbac
134 ! Removed tabs
135 !
136 ! Revision 1.2 2004/01/29 22:56:29 haselbac
137 ! Removed setting of timeSinceWrite to make routine more usable
138 !
139 ! Revision 1.1 2003/10/29 21:36:58 haselbac
140 ! Initial revision
141 !
142 !******************************************************************************
143 
144 
145 
146 
147 
148 
149 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
LOGICAL function rflu_decidewrite(global)
subroutine deregisterfunction(global)
Definition: ModError.F90:469