Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModTime.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: Suite of routines to manage time.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModTime.F90,v 1.4 2008/12/06 08:44:24 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY: t_global
42  USE modparameters
43  USE moddatatypes
44  USE moderror
45  USE moddatastruct, ONLY: t_region
46  USE modmpi
47 
48  IMPLICIT NONE
49 
50  PRIVATE
51  PUBLIC :: rflu_gettimerk, &
53 
54 ! ******************************************************************************
55 ! Declarations and definitions
56 ! ******************************************************************************
57 
58  CHARACTER(CHRLEN) :: &
59  RCSIdentString = '$RCSfile: RFLU_ModTime.F90,v $ $Revision: 1.4 $'
60 
61 ! ******************************************************************************
62 ! Routines
63 ! ******************************************************************************
64 
65  CONTAINS
66 
67 
68 
69 
70 
71 
72 
73 ! ******************************************************************************
74 !
75 ! Purpose: Get time within RK stages.
76 !
77 ! Description: None.
78 !
79 ! Input:
80 ! global Pointer to global data
81 !
82 ! Output: None.
83 !
84 ! Notes: None.
85 !
86 ! ******************************************************************************
87 
88  FUNCTION rflu_gettimerk(global)
89 
90  IMPLICIT NONE
91 
92 ! ******************************************************************************
93 ! Declarations and definitions
94 ! ******************************************************************************
95 
96 ! ==============================================================================
97 ! Function
98 ! ==============================================================================
99 
100  REAL(RFREAL) :: rflu_gettimerk
101 
102 ! ==============================================================================
103 ! Parameters
104 ! ==============================================================================
105 
106  TYPE(t_global), POINTER :: global
107 
108 ! ******************************************************************************
109 ! Start
110 ! ******************************************************************************
111 
112  rflu_gettimerk = global%currentTimeRK
113 
114 ! ******************************************************************************
115 ! End
116 ! ******************************************************************************
117 
118  END FUNCTION rflu_gettimerk
119 
120 
121 
122 
123 
124 ! ******************************************************************************
125 !
126 ! Purpose: Set time within RK stages.
127 !
128 ! Description: None.
129 !
130 ! Input:
131 ! pRegion Pointer to region
132 ! iStage Index of RK stage
133 !
134 ! Output: None.
135 !
136 ! Notes: None.
137 !
138 ! ******************************************************************************
139 
140  SUBROUTINE rflu_settimerk(pRegion,iStage)
141 
142  IMPLICIT NONE
143 
144 ! ******************************************************************************
145 ! Declarations and definitions
146 ! ******************************************************************************
147 
148 ! ==============================================================================
149 ! Parameters
150 ! ==============================================================================
151 
152  INTEGER, INTENT(IN) :: istage
153  TYPE(t_region), POINTER :: pregion
154 
155 ! ==============================================================================
156 ! Locals
157 ! ==============================================================================
158 
159  TYPE(t_global), POINTER :: global
160 
161 ! ******************************************************************************
162 ! Start
163 ! ******************************************************************************
164 
165  global => pregion%global
166 
167  CALL registerfunction(global,'RFLU_SetTimeRK',&
168  'RFLU_ModTime.F90')
169 
170 ! ******************************************************************************
171 !
172 ! ******************************************************************************
173 
174  global%currentTimeRK = &
175  global%currentTime + global%dtMin*(pregion%mixtInput%trk(istage) &
176  - pregion%mixtInput%trk( 1))
177 
178 ! ******************************************************************************
179 ! End
180 ! ******************************************************************************
181 
182  CALL deregisterfunction(global)
183 
184  END SUBROUTINE rflu_settimerk
185 
186 
187 
188 
189 
190 ! ******************************************************************************
191 ! End
192 ! ******************************************************************************
193 
194 END MODULE rflu_modtime
195 
196 
197 ! ******************************************************************************
198 !
199 ! RCS Revision history:
200 !
201 ! $Log: RFLU_ModTime.F90,v $
202 ! Revision 1.4 2008/12/06 08:44:24 mtcampbe
203 ! Updated license.
204 !
205 ! Revision 1.3 2008/11/19 22:17:35 mtcampbe
206 ! Added Illinois Open Source License/Copyright
207 !
208 ! Revision 1.2 2006/04/07 15:19:20 haselbac
209 ! Removed tabs
210 !
211 ! Revision 1.1 2005/03/31 17:22:54 haselbac
212 ! Initial revision
213 !
214 ! ******************************************************************************
215 
216 
217 
218 
219 
220 
221 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
real(rfreal) function, public rflu_gettimerk(global)
subroutine, public rflu_settimerk(pRegion, iStage)
subroutine deregisterfunction(global)
Definition: ModError.F90:469