Debian Codegraph @

src/exact_gresho.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) 2012 Daniel Price. All rights reserved.
19 ! Contact: [email protected]
20 !
21 !-----------------------------------------------------------------
22
23 ! ----------------------------------------------------------------------
24 ! compute exact solution for gresho vortex problem
25 ! ----------------------------------------------------------------------
26 module gresho
27 implicit none
28
29 contains
30
31 subroutine exact_gresho(iplot,xplot,yplot,ierr)
32 integer, intent(in) :: iplot
33 real, intent(in), dimension(:) :: xplot
34 real, intent(out), dimension(size(xplot)) :: yplot
35 integer, intent(out) :: ierr
36
37 print*,'plotting gresho vortex '
38 !
39 ! check for errors
40 !
41 ierr = 0
42 select case(iplot)
43 case(2) ! pressure
44 where (xplot < 0.2)
45 yplot = 5. + 12.5*xplot**2
46 elsewhere (xplot < 0.4)
47 yplot = 9. + 12.5*xplot**2 - 20.*xplot + 4.*log(5.*xplot)
48 elsewhere
49 yplot = 3. + 4.*log(2.)
50 end where
51 case(1) ! vphi
52 where (xplot < 0.2)
53 yplot = 5.*xplot
54 elsewhere (xplot < 0.4)
55 yplot = 2. - 5.*xplot
56 elsewhere
57 yplot = 0.
58 end where
59 end select
60
61 return
62 end subroutine exact_gresho
63
64 end module gresho