Debian Codegraph @

src/contours.f90

raw
1 !-----------------------------------------------------------------
2 !
3 ! This file is (or was) part of SPLASH, a visualisation tool
4 ! for Smoothed Particle Hydrodynamics written by Daniel Price:
5 !
6 ! http://users.monash.edu.au/~dprice/splash
7 !
8 ! SPLASH comes with ABSOLUTELY NO WARRANTY.
9 ! This is free software; and you are welcome to redistribute
10 ! it under the terms of the GNU General Public License
11 ! (see LICENSE file for details) and the provision that
12 ! this notice remains intact. If you modify this file, please
13 ! note section 2a) of the GPLv2 states that:
14 !
15 ! a) You must cause the modified files to carry prominent notices
16 ! stating that you changed the files and the date of any change.
17 !
18 ! Copyright (C) 2005-2011 Daniel Price. All rights reserved.
19 ! Contact: [email protected]
20 !
21 ! This module contributed by Andrew McLeod
22 !-----------------------------------------------------------------
23
24 module contours_module
25 implicit none
26 integer, parameter, private :: maxcontours = 50
27 integer, parameter, public :: lencontourtitles = 60
28 real, dimension(maxcontours), public :: contours_list
29 character(len=lencontourtitles), dimension(maxcontours), public :: contourtitles
30 logical, public :: fixed_contours
31 public :: read_contours
32
33 private
34
35 contains
36 !
37 !--reads a list of contours (one per line), to be used on contour plots
38 !
39 subroutine read_contours(ncontours,ierr)
40 use asciiutils, only:read_asciifile
41 use filenames, only:fileprefix
42 integer, intent(out) :: ncontours, ierr
43 character(len=50) :: contourfile
44 logical :: iexist
45
46 contourfile = trim(fileprefix)//'.contours'
47 ncontours = 0
48 ierr = 0
49 inquire(file=contourfile,exist=iexist)
50 if (iexist) then
51 call read_asciifile(contourfile,ncontours,contours_list,contourtitles)
52 else
53 contours_list(:) = 0.
54 contourtitles(:) = ''
55 ierr = 1
56 endif
57 if (ncontours > 0) then
58 print "(1x,a)",'read contours and titles from file '//trim(contourfile)
59 else
60 ierr = -1
61 endif
62
63 return
64 end subroutine read_contours
65
66 end module contours_module