C INTERNATIONAL AVS CENTER C (This disclaimer must remain at the top of all files) C C WARRANTY DISCLAIMER C C This module and the files associated with it are distributed free of charge. C It is placed in the public domain and permission is granted for anyone to use, C duplicate, modify, and redistribute it unless otherwise noted. Some modules C may be copyrighted. You agree to abide by the conditions also included in C the AVS Licensing Agreement, version 1.0, located in the main module C directory located at the International AVS Center ftp site and to include C the AVS Licensing Agreement when you distribute any files downloaded from C that site. C C The International AVS Center, MCNC, the AVS Consortium and the individual C submitting the module and files associated with said module provide absolutely C NO WARRANTY OF ANY KIND with respect to this software. The entire risk as to C the quality and performance of this software is with the user. IN NO EVENT C WILL The International AVS Center, MCNC, the AVS Consortium and the individual C submitting the module and files associated with said module BE LIABLE TO C ANYONE FOR ANY DAMAGES ARISING FROM THE USE OF THIS SOFTWARE, INCLUDING, C WITHOUT LIMITATION, DAMAGES RESULTING FROM LOST DATA OR LOST PROFITS, OR ANY C SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES. C C This AVS module and associated files are public domain software unless C otherwise noted. Permission is hereby granted to do whatever you like with C it, subject to the conditions that may exist in copyrighted materials. Should C you wish to make a contribution toward the improvement, modification, or C general performance of this module, please send us your comments: why you C liked or disliked it, how you use it, and most important, how it helps your C work. We will receive your comments at avs@ncsc.org. C C Please send AVS module bug reports to avs@ncsc.org. C C "@(#)reads.f 1.1 Stardent 90/03/23" C Copyright (c) 1989 by C Stardent Computer Inc. C All Rights Reserved C C c *--------------------------------------------------------* c * * c * * c * reads.f * c *--------------------------------------------------------* subroutine read_states (num_nodes, num_states, node_data, & data_ranges, num_node_values, num_node_data, bin_file) include 'read_dyna3d.h' integer num_nodes, num_node_data, num_states, num_node_values, & bin_file real node_data(num_nodes, num_node_data, num_states), 1 data_ranges(2, num_node_data, num_states) character*7 dummy, string*180 integer i, j, k, state_num, state, index real time, xmin, xmax, ymin, ymax, zmin, zmax, vmax, vmin, & x, y, z, mag, val c ************** c *** body *** c ************** if (bin_file) then read (input) node_data, data_ranges else do state = 1, num_states read (input, 10) dummy, state_num, dummy, time write (0, *) '======== state =========' , state_num, time do j = 1, num_nodes read (input, *) (node_data(j, i, state), i = 2, 4) end do do j = 5, num_node_data read (input, *) (node_data(i, j, state), i = 1, num_nodes) end do end do c determine max/min of the data. do state = 1, num_states do i = 1, num_node_data if (i .eq. 1) then x = node_data(1, 2, state) y = node_data(1, 3, state) z = node_data(1, 4, state) mag = sqrt(x * x + y * y + z * z) node_data(1, 1, state) = mag vmax = mag vmin = vmax do j = 2, num_nodes x = node_data(j, 2, state) y = node_data(j, 3, state) z = node_data(j, 4, state) mag = sqrt(x * x + y * y + z * z) node_data(j, 1, state) = mag if (mag .lt. vmin) vmin = mag if (mag .gt. vmax) vmax = mag end do else vmax = node_data(1, i, state) vmin = vmax do j = 2, num_nodes val = node_data(j, i, state) if (val .lt. vmin) vmin = val if (val .gt. vmax) vmax = val end do end if data_ranges(1, i, state) = vmin data_ranges(2, i, state) = vmax end do end do end if 10 format (a7, i5, a7, e14.5) return end