-
Notifications
You must be signed in to change notification settings - Fork 1
/
CubedSphereTest2.f90
90 lines (77 loc) · 2.31 KB
/
CubedSphereTest2.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
program CubedSphereTest
!******************************************************************************
! Peter A. Bosler
! Department of Mathematics
! University of Michigan
!
!******************************************************************************
!
! This program is a unit test for a basic cubed sphere sphere, no time integration.
!
! Bosler, P.A., "Particle Methods for Geophysical Flow on the Sphere," PhD Thesis; the University of Michigan, 2013.
!
!----------------
use NumberKindsModule
use LoggerModule
use SphereMeshModule
use ParticlesModule
use EdgesModule
use PanelsModule
use VTKOutputModule
use AdvectionModule
implicit none
type(SphereMesh) :: sphere
integer(kint) :: panelKind, initNest, AMR, nTracer, problemKind
type(Particles), pointer :: sphereParticles
type(Edges), pointer :: sphereEdges
type(Panels), pointer :: spherePanels
type(VTKSource) :: vtkOut
character(len=56) :: testVTKfile
type(Logger) :: exeLog
character(len=56) :: logString
integer(kint) :: j
!
! set mesh parameters
!
initNest = 6
panelKind = 4
AMR = 0
nTracer = 1
problemKind = ADVECTION_SOLVER
call New(exeLog,DEBUG_LOGGING_LEVEL)
!
! Build a mesh
!
call New(sphere,panelKind,initNest,AMR,nTracer,problemKind)
sphereParticles => sphere%particles
sphereEdges => sphere%edges
spherePanels => sphere%panels
write(logString,'(A,I4,A)') 'Mesh at initNest = ',initNest,' returned : '
call LogStats(sphere,exeLog,trim(logString))
call LogMessage(exeLog,TRACE_LOGGING_LEVEL,'Surf. area should be = ',4.0_kreal*PI*EARTH_RADIUS*EARTH_RADIUS)
write(6,'(A,F24.15)') "surf area error = ",abs(4.0_kreal*PI*EARTH_RADIUS*EARTH_RADIUS - sum(spherePanels%area))
!
do j=1,sphereParticles%N
sphereParticles%u(:,j) = TestCase1Velocity(sphereParticles%x(:,j),0.0_kreal)
enddo
do j=1,spherePanels%N
if ( .NOT. spherePanels%hasChildren(j) ) then
spherePanels%u(:,j) = TestCase1Velocity(spherePanels%x(:,j),0.0_kreal)
endif
enddo
!
!
! Define VTKOutput
!
write(testVTKFile,'(A,I1,A)') 'bigCubedSphere',initNest,'.vtk'
call New(vtkOut,sphere,testVTKFile,'test1')
call vtkOutput(vtkOut,sphere)
call LogMessage(exeLog,TRACE_LOGGING_LEVEL,'VTKOutput : ',' done.')
!
! clean up
!
call Delete(vtkOut)
call Delete(sphere)
call Delete(exeLog)
end program