Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_OpenStatsFileOLES.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: Open file for optimal LES statistics.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global type
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_OpenStatsFileOLES.F90,v 1.8 2008/12/06 08:44:30 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002-2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_openstatsfileoles(global)
45 
46  USE moddatatypes
47  USE moderror
48  USE modglobal, ONLY : t_global
49  USE modmpi
50  USE modparameters
51 
53 
54  IMPLICIT NONE
55 
56 ! ******************************************************************************
57 ! Declarations and definitions
58 ! ******************************************************************************
59 
60 ! ==============================================================================
61 ! Arguments
62 ! ==============================================================================
63 
64  TYPE(t_global), POINTER :: global
65 
66 ! ==============================================================================
67 ! Local variables
68 ! ==============================================================================
69 
70  CHARACTER(CHRLEN) :: fname,rcsidentstring
71  INTEGER :: errorflag
72 
73 ! ******************************************************************************
74 ! Start
75 ! ******************************************************************************
76 
77  rcsidentstring = '$RCSfile: RFLU_OpenStatsFileOLES.F90,v $ $Revision: 1.8 $'
78 
79  CALL registerfunction(global,'RFLU_OpenStatsFileOLES',&
80  'RFLU_OpenStatsFileOLES.F90' )
81 
82 ! ==============================================================================
83 ! Open file
84 ! ==============================================================================
85 
86  IF ( global%myProcid == masterproc ) THEN
87  CALL buildfilenameplain(global,filedest_outdir,'.oles',fname)
88 
89 ! ==============================================================================
90 ! Append to existing file (restart) or create new file
91 ! ==============================================================================
92 
93  IF ( global%currentTime > 0.0_rfreal ) THEN
94  OPEN(if_stats_oles,file=fname,form='FORMATTED',status='OLD', &
95  position='APPEND',iostat=errorflag)
96  ELSE
97  OPEN(if_stats_oles,file=fname,form='FORMATTED',status='UNKNOWN', &
98  iostat=errorflag)
99  END IF ! global
100 
101  global%error = errorflag
102  IF ( global%error /= 0 ) THEN
103  CALL errorstop(global,err_file_open,__line__,'File: '//trim(fname))
104  END IF ! global%error
105  END IF ! global%myProcid
106 
107 ! ******************************************************************************
108 ! End
109 ! ******************************************************************************
110 
111  CALL deregisterfunction(global)
112 
113 END SUBROUTINE rflu_openstatsfileoles
114 
115 ! ******************************************************************************
116 !
117 ! RCS Revision history:
118 !
119 ! $Log: RFLU_OpenStatsFileOLES.F90,v $
120 ! Revision 1.8 2008/12/06 08:44:30 mtcampbe
121 ! Updated license.
122 !
123 ! Revision 1.7 2008/11/19 22:17:42 mtcampbe
124 ! Added Illinois Open Source License/Copyright
125 !
126 ! Revision 1.6 2004/06/16 20:01:13 haselbac
127 ! Added use of ModBuildFileNames, cosmetics
128 !
129 ! Revision 1.5 2003/01/28 14:45:23 haselbac
130 ! Use common building of file name
131 !
132 ! Revision 1.4 2002/10/27 19:16:15 haselbac
133 ! Removed tabs
134 !
135 ! Revision 1.3 2002/10/08 15:49:29 haselbac
136 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
137 !
138 ! Revision 1.2 2002/10/05 19:24:26 haselbac
139 ! GENX integration: added outDir to file name
140 !
141 ! Revision 1.1 2002/09/09 16:28:02 haselbac
142 ! Initial revision
143 !
144 ! ******************************************************************************
145 
146 
147 
148 
149 
150 
151 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine buildfilenameplain(global, dest, ext, fileName)
subroutine rflu_openstatsfileoles(global)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469