Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rocflu/RFLU_WriteVersionString.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: Write file with version string.
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_WriteVersionString.F90,v 1.3 2008/12/06 08:44:30 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflu_writeversionstring(global)
45 
46  USE moddatatypes
47  USE moderror
48  USE modglobal, ONLY: t_global
49  USE modparameters
50  USE modmpi
51 
52  IMPLICIT NONE
53 
54 ! ******************************************************************************
55 ! Definitions and declarations
56 ! ******************************************************************************
57 
58 ! ==============================================================================
59 ! Arguments
60 ! ==============================================================================
61 
62  TYPE(t_global), POINTER :: global
63 
64 ! ==============================================================================
65 ! Locals
66 ! ==============================================================================
67 
68  CHARACTER(CHRLEN) :: ifilename,modulestring,rcsidentstring,versionstring
69  INTEGER :: errorflag,versionwidth
70 
71 ! ******************************************************************************
72 ! Start
73 ! ******************************************************************************
74 
75  rcsidentstring = '$RCSfile: RFLU_WriteVersionString.F90,v $ $Revision: 1.3 $'
76 
77  CALL registerfunction(global,'RFLU_WriteVersionString',&
78  'RFLU_WriteVersionString.F90')
79 
80 ! ******************************************************************************
81 ! Build strings
82 ! ******************************************************************************
83 
84  CALL buildversionstring(versionstring)
85 
86 #ifndef CHARM
87  modulestring = 'rflump'
88  ifilename = trim(global%outDir)//'rflump.vrs'
89 #else
90  modulestring = 'rflump_charm'
91  ifilename = trim(global%outDir)//'rflump_charm.vrs'
92 #endif
93 
94 ! ******************************************************************************
95 ! Open file, write string, close file
96 ! ******************************************************************************
97 
98  IF ( global%myProcid == masterproc ) THEN
99  OPEN(if_vrs,file=ifilename,form='FORMATTED',status='UNKNOWN', &
100  position='APPEND',iostat=errorflag)
101  global%error = errorflag
102  IF ( global%error /= err_none ) THEN
103  CALL errorstop(global,err_file_open,__line__)
104  END IF ! global%error
105 
106  WRITE(if_vrs,'(A)') trim(modulestring)//" "//versionstring
107 
108  CLOSE(if_vrs,iostat=errorflag)
109  global%error = errorflag
110  IF ( global%error /= err_none ) THEN
111  CALL errorstop(global,err_file_close,__line__)
112  END IF ! global%error
113  END IF ! global%myProcid
114 
115 ! *****************************************************************************
116 ! End
117 ! *****************************************************************************
118 
119  CALL deregisterfunction(global)
120 
121 END SUBROUTINE rflu_writeversionstring
122 
123 ! ******************************************************************************
124 !
125 ! RCS Revision history:
126 !
127 ! $Log: RFLU_WriteVersionString.F90,v $
128 ! Revision 1.3 2008/12/06 08:44:30 mtcampbe
129 ! Updated license.
130 !
131 ! Revision 1.2 2008/11/19 22:17:43 mtcampbe
132 ! Added Illinois Open Source License/Copyright
133 !
134 ! Revision 1.1 2003/03/31 16:06:12 haselbac
135 ! Initial revision
136 !
137 ! ******************************************************************************
138 
139 
140 
141 
142 
143 
144 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine buildversionstring(versionString)
**********************************************************************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
subroutine rflu_writeversionstring(global)