Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PREP_RocstarWriteRocinout.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: mkdir Rocin/out if not exist and write Rocin control files.
26 !
27 ! Description: regions mapping info and initial solution file names are
28 ! written into mapping files
29 !
30 ! Input: global = global data, to support MP prep.
31 !
32 ! Output: mapping files.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PREP_GenxWriteRocinout.F90,v 1.8 2008/12/06 08:44:50 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE genxwriterocinout( global )
45 
46  USE moddatatypes
47  USE modglobal, ONLY : t_global
48  USE moderror
49  USE modparameters
50  IMPLICIT NONE
51  include "roccomf90.h"
52 
53 ! ... parameters
54  TYPE(t_global), POINTER :: global
55 
56 ! ... local variables
57  CHARACTER(2*CHRLEN+17) :: mapfname, solfname
58  LOGICAL :: direxist
59  INTEGER :: errflg, testflg
60 
61 !******************************************************************************
62 
63  CALL registerfunction( global,'GenxWriteRocinout',&
64  'PREP_RocstarWriteRocinout.F90' )
65 
66 ! open files and write mapping info ------------------------------------------
67 
68 ! mixture volume mapping file:
69 
70  direxist = .false.
71  testflg = com_call_system( "cd ../Rocout") ! Intel-Fortran INQUIRE problem
72  INQUIRE (file=trim('../Rocout'), exist=direxist)
73  IF ((.NOT. direxist) .AND. (testflg /= 0)) THEN
74  errflg = com_call_system( "mkdir ../Rocout")
75  global%error = errflg
76  IF (global%error /= 0) &
77  CALL errorstop( global,err_system_command,__line__,'mkdir ../Rocout' )
78  ENDIF
79 
80  direxist = .false.
81  testflg = com_call_system( "cd ../Rocin") ! Intel-Fortran INQUIRE problem
82  INQUIRE (file=trim('../Rocin'), exist=direxist)
83  IF ((.NOT. direxist) .AND. (testflg /= 0)) THEN
84  errflg = com_call_system( "mkdir ../Rocin")
85  global%error = errflg
86  IF (global%error /= 0) &
87  CALL errorstop( global,err_system_command,__line__,'mkdir ../Rocin' )
88  ENDIF
89 
90  WRITE(mapfname,1000)'../Rocin/fluid_in_00.000000.txt'
91  !WRITE(solfname,1000)'fluid_%5b.hdf'
92 
93  WRITE(solfname,1000)'fluid_%5b.cgns'
94  OPEN(if_regmap,file=mapfname,form='formatted',status='unknown',iostat=errflg)
95  global%error = errflg
96  IF (global%error /= 0) &
97  CALL errorstop( global,err_file_open,__line__,'File: '//trim(mapfname) )
98 
99  WRITE(if_regmap,1000) '@Proc: *'
100  WRITE(if_regmap,1010) '@Files: '//trim(solfname)
101  WRITE(if_regmap,1000) '@Panes: @Block ',global%nRegions,' 100 100'
102  CLOSE(if_regmap)
103 
104 ! mixture surface mapping file:
105 
106  WRITE(mapfname,1000)'../Rocin/ifluid_in_00.000000.txt'
107  !WRITE(solfname,1000)'ifluid_%5b.hdf'
108  WRITE(solfname,1000)'ifluid_%5b.cgns'
109  OPEN(if_regmap,file=mapfname,form='formatted',status='unknown',iostat=errflg)
110  global%error = errflg
111  IF (global%error /= 0) &
112  CALL errorstop( global,err_file_open,__line__,'File: '//trim(mapfname) )
113 
114  WRITE(if_regmap,1000) '@Proc: *'
115  WRITE(if_regmap,1010) '@Files: '//trim(solfname)
116  WRITE(if_regmap,1000) '@Panes: @Block ',global%nRegions,' 100 100'
117  CLOSE(if_regmap)
118 
119 ! MP mapping files:
120 
121  WRITE(mapfname,1000)'../Rocin/fluid_plag_in_00.000000.txt'
122  WRITE(solfname,1000)'fluid_plag_%5b.hdf'
123  OPEN(if_regmap,file=mapfname,form='formatted',status='unknown',iostat=errflg)
124  global%error = errflg
125  IF (global%error /= 0) &
126  CALL errorstop( global,err_file_open,__line__,'File: '//trim(mapfname) )
127 
128  WRITE(if_regmap,1000) '@Proc: *'
129  WRITE(if_regmap,1010) '@Files:'
130  WRITE(if_regmap,1000) '@Panes: @Block ',global%nRegions,' 100 100'
131  CLOSE(if_regmap)
132 
133 ! notes
134 
135  WRITE(mapfname,1000)'../RocfloNotes.txt'
136  OPEN(if_regmap,file=mapfname,form='formatted',status='unknown',iostat=errflg)
137  global%error = errflg
138  IF (global%error /= 0) &
139  CALL errorstop( global,err_file_open,__line__,'File: '//trim(mapfname) )
140 
141  WRITE(if_regmap,1000) 'Dataset generated using Rfloprep pre version 2.3.0.0'
142  WRITE(if_regmap,1000) 'must be run with Rocstar compiled with'
143  WRITE(if_regmap,1000) 'PRE_RFLOPREP_V2300=1 flag'
144  CLOSE(if_regmap)
145 
146 1000 FORMAT(a,i10,a)
147 1010 FORMAT(a,a)
148 
149 ! finalize --------------------------------------------------------------------
150 
151  CALL deregisterfunction( global )
152 
153 END SUBROUTINE genxwriterocinout
154 
155 !******************************************************************************
156 !
157 ! RCS Revision history:
158 !
159 ! $Log: PREP_GenxWriteRocinout.F90,v $
160 ! Revision 1.8 2008/12/06 08:44:50 mtcampbe
161 ! Updated license.
162 !
163 ! Revision 1.7 2008/11/19 22:18:00 mtcampbe
164 ! Added Illinois Open Source License/Copyright
165 !
166 ! Revision 1.6 2005/05/11 19:56:32 wasistho
167 ! modified RocfloNotes.txt
168 !
169 ! Revision 1.5 2005/04/20 02:58:16 wasistho
170 ! modified text in RocfloNotes.txt
171 !
172 ! Revision 1.4 2005/04/20 02:51:17 wasistho
173 ! added text in RocfloNotes.txt
174 !
175 ! Revision 1.3 2005/04/19 18:41:47 wasistho
176 ! added RocfloNotes.txt
177 !
178 ! Revision 1.2 2005/01/11 01:35:17 wasistho
179 ! added testFlag due to Intel-Fortran problem with INQUIRE to directory
180 !
181 ! Revision 1.1 2004/12/03 02:20:08 wasistho
182 ! added prefix
183 !
184 ! Revision 1.1 2004/12/03 00:40:49 wasistho
185 ! lower to upper case
186 !
187 ! Revision 1.5 2004/10/13 16:20:34 jiao
188 ! Updated to write the Rocin control files using the %5b placeholder.
189 !
190 ! Revision 1.4 2004/10/12 04:32:36 wasistho
191 ! split to one block per HDF file
192 !
193 ! Revision 1.3 2004/10/09 19:41:26 jiao
194 ! Changed the definition of offset for BlockCyclic and BlockBlockCyclic mapping.
195 !
196 ! Revision 1.2 2004/10/07 04:25:31 jiao
197 ! Fixed Rocin control files.
198 !
199 ! Revision 1.1 2004/07/27 03:39:05 wasistho
200 ! initial import genxWriteRocinout and printPrepInput
201 !
202 !
203 !******************************************************************************
204 
205 
206 
207 
208 
209 
210 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine genxwriterocinout(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
RT a() const
Definition: Line_2.h:140