Exodus  7.22
/exodus_for/test/testcpd.f
1 C Copyright (c) 2005-2017 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C Redistribution and use in source and binary forms, with or without
6 C modification, are permitted provided that the following conditions are
7 C met:
8 C
9 C * Redistributions of source code must retain the above copyright
10 C notice, this list of conditions and the following disclaimer.
11 C
12 C * Redistributions in binary form must reproduce the above
13 C copyright notice, this list of conditions and the following
14 C disclaimer in the documentation and/or other materials provided
15 C with the distribution.
16 C
17 C * Neither the name of NTESS nor the names of its
18 C contributors may be used to endorse or promote products derived
19 C from this software without specific prior written permission.
20 C
21 C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 C "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 C LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 C A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 C OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 C SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 C LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 C DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 C THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 C (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 C OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 C
33 
34  program testcpd
35 
36 c
37 c This is a test program for the Fortran binding of the EXODUS II
38 c database copy function (excopy).
39 c
40  implicit none
41 
42  include 'exodusII.inc'
43 
44  integer iin, iout, exoid, exoid1, ierr, cpu_ws, io_ws
45 
46  real vers
47 
48  data iin /5/, iout /6/
49 
50 c
51 c open EXODUS II input file
52 c
53 
54 c the setting of cpu_ws isn't used in copying but will test the
55 c conversion routines
56 
57  cpu_ws = 8
58  io_ws = 0
59 
60  exoid = exopen("test.exo", exread, cpu_ws, io_ws, vers, ierr)
61  write (iout, '(/"after exopen, error = ",i3)')
62  1 ierr
63 
64  write (iout, '("test.exo is an EXODUSII file; version ",
65  1 f4.2)') vers
66  write (iout, '(" I/O word size: ",i4)') io_ws
67 
68 c
69 c create EXODUS II output file with 8-byte reals
70 c
71 c the setting of cpu_ws isn't used in copying but will test the
72 c conversion routines
73 
74  cpu_ws = 8
75  io_ws = 8
76 
77  exoid1 = excre("testcpd.exo",
78  1 exclob, cpu_ws, io_ws, ierr)
79  write (iout,'("after excre, id = ", i3, ", error = ",i3)')
80  1 exoid1, ierr
81  write (iout,'(" I/O word size: ",i4)') io_ws
82 
83  write (iout,'("after excre, error = ", i4)') ierr
84 
85  call excopy (exoid, exoid1, ierr)
86  write (iout, '(/"after excopy, error = ", i3)' ) ierr
87 
88  call exclos (exoid, ierr)
89  write (iout, '(/"after exclos, error = ", i3)' ) ierr
90 
91  call exclos (exoid1, ierr)
92  write (iout, '(/"after exclos, error = ", i3)' ) ierr
93 
94  stop
95  end
96 
exclos
void exclos(int *idexo, int *ierr)
Definition: exo_jack.c:234
excopy
void excopy(int *idexo_in, int *idexo_out, int *ierr)
Definition: exo_jack.c:2571
exopen
int exopen(char *path, int *mode, int *cpu_word_size, int *io_word_size, float *version, int *ierr, int pathlen)
Definition: exo_jack.c:208
excre
int excre(char *path, int *clobmode, int *cpu_word_size, int *io_word_size, int *ierr, int pathlen)
Definition: exo_jack.c:182