Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_OpenConverFile.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 convergence history.
26 !
27 ! Description: None.
28 !
29 ! Input: None.
30 !
31 ! Output: None.
32 !
33 ! Notes: None.
34 !
35 ! ******************************************************************************
36 !
37 ! $Id: RFLU_OpenConverFile.F90,v 1.8 2008/12/06 08:44:30 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2002-2004 by the University of Illinois
40 !
41 ! ******************************************************************************
42 
43 SUBROUTINE rflu_openconverfile(global)
44 
45  USE moddatatypes
46  USE moderror
47  USE modglobal, ONLY : t_global
48  USE modmpi
49  USE modparameters
50 
52 
53  IMPLICIT NONE
54 
55 ! ******************************************************************************
56 ! Declarations and definitions
57 ! ******************************************************************************
58 
59 ! ==============================================================================
60 ! Arguments
61 ! ==============================================================================
62 
63  TYPE(t_global), POINTER :: global
64 
65 ! ==============================================================================
66 ! Local variables
67 ! ==============================================================================
68 
69  CHARACTER(CHRLEN) :: fname,rcsidentstring
70  INTEGER :: errorflag
71 
72 ! ******************************************************************************
73 ! Start
74 ! ******************************************************************************
75 
76  rcsidentstring = '$RCSfile: RFLU_OpenConverFile.F90,v $ $Revision: 1.8 $'
77 
78  CALL registerfunction(global,'RFLU_OpenConverFile',&
79  'RFLU_OpenConverFile.F90')
80 
81 ! ==============================================================================
82 ! Open file
83 ! ==============================================================================
84 
85  IF ( global%myProcid == masterproc ) THEN
86  CALL buildfilenameplain(global,filedest_outdir,'.con',fname)
87 
88 ! ==============================================================================
89 ! Append to existing file (restart) or create new file
90 ! ==============================================================================
91 
92  IF ( ( global%flowType == flow_unsteady .AND. &
93  global%currentTime > 0.0_rfreal ) .OR. &
94  ( global%flowType == flow_steady .AND. &
95  global%currentIter>1 ) ) THEN
96  OPEN(if_conver,file=fname,form='FORMATTED',status='OLD', &
97  position='APPEND',iostat=errorflag)
98  ELSE
99  OPEN(if_conver,file=fname,form='FORMATTED',status='UNKNOWN', &
100  iostat=errorflag)
101  END IF ! global
102 
103  global%error = errorflag
104  IF ( global%error /= 0 ) THEN
105  CALL errorstop(global,err_file_open,__line__,'File: '//trim(fname))
106  END IF ! global%error
107  END IF ! global%myProcid
108 
109 ! ******************************************************************************
110 ! End
111 ! ******************************************************************************
112 
113  CALL deregisterfunction(global)
114 
115 END SUBROUTINE rflu_openconverfile
116 
117 ! ******************************************************************************
118 !
119 ! RCS Revision history:
120 !
121 ! $Log: RFLU_OpenConverFile.F90,v $
122 ! Revision 1.8 2008/12/06 08:44:30 mtcampbe
123 ! Updated license.
124 !
125 ! Revision 1.7 2008/11/19 22:17:42 mtcampbe
126 ! Added Illinois Open Source License/Copyright
127 !
128 ! Revision 1.6 2004/06/16 20:01:10 haselbac
129 ! Added use of ModBuildFileNames, cosmetics
130 !
131 ! Revision 1.5 2003/01/28 14:44:07 haselbac
132 ! Use common building of file name
133 !
134 ! Revision 1.4 2002/10/08 15:49:29 haselbac
135 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
136 !
137 ! Revision 1.3 2002/10/05 19:24:07 haselbac
138 ! GENX integration: added outDir to file name
139 !
140 ! Revision 1.2 2002/09/09 15:51:56 haselbac
141 ! global now under region
142 !
143 ! Revision 1.1 2002/05/04 17:01:59 haselbac
144 ! Initial revision
145 !
146 ! ******************************************************************************
147 
148 
149 
150 
151 
152 
153 
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)
**********************************************************************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 rflu_openconverfile(global)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469