Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
writegrdb.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
53 !******************************************************************************
54 !
55 ! Purpose: store x-,y-,z-coordinates of grid nodes in binary format.
56 !
57 ! Notes: only the finest grid is stored.
58 !
59 !
60 ! Copyright: (c) 2001 by the University of Illinois
61 !
62 !******************************************************************************
63 
64 SUBROUTINE write_grdb(iblock,ni,nj,nk,x,y,z,F_name)
65 
66  IMPLICIT NONE
67  INTEGER :: iblock,ni,nj,nk
68  DOUBLE PRECISION :: time,x(ni,nj,nk),y(ni,nj,nk),z(ni,nj,nk)
69  INTEGER :: i,j,k
70  CHARACTER (LEN=500) :: f_name,filnam
71  INTEGER :: if_grid = 17
72 
73 ! open file; write time stamp
74 
75  IF (abs(iblock) == 1) THEN
76  WRITE(filnam,11) f_name(1:index(f_name,' ')-1)
77  OPEN (if_grid,file=filnam,form='unformatted',status='unknown')
78  time = 0.0
79  WRITE(if_grid) time
80  ENDIF
81 
82 ! write block number and dimensions
83 
84  WRITE(if_grid) abs(iblock),ni-1,nj-1,nk-1
85 
86 ! write coordinates
87 
88  WRITE(if_grid) &
89  (((x(i,j,k), i=1,ni), j=1,nj), k=1,nk),&
90  (((y(i,j,k), i=1,ni), j=1,nj), k=1,nk),&
91  (((z(i,j,k), i=1,ni), j=1,nj), k=1,nk)
92 
93 ! close file
94 
95  IF (iblock < 0) THEN
96  CLOSE(if_grid)
97  ENDIF
98 
99 11 FORMAT(a)
100 
101 END SUBROUTINE
102 
103 
j indices k indices k
Definition: Indexing.h:6
void int int REAL REAL * y
Definition: read.cpp:74
subroutine write_grdb(iblock, ni, nj, nk, x, y, z, F_name)
Definition: writegrdb.f90:64
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
void int int int REAL REAL REAL * z
Definition: write.cpp:76
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
**********************************************************************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
int index() const
void int int * nk
Definition: read.cpp:74
j indices j
Definition: Indexing.h:6
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
void int * nj
Definition: read.cpp:74
RT a() const
Definition: Line_2.h:140