Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Clean up some SW on the sphere example code. #734

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/shallow_sphere/Rossby_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def setup(use_petsc=False,solver_type='classic',outdir='./_output', disable_outp
# Set initial conditions
# ======================
# 1) Call fortran function
qtmp = np.ndarray(shape=(solver.num_eqn,mx+2*num_ghost,my+2*num_ghost), dtype=float, order='F')
qtmp = np.zeros(shape=(solver.num_eqn,mx+2*num_ghost,my+2*num_ghost), dtype=float, order='F')
qtmp = sw_sphere_problem.qinit(mx,my,num_ghost,mx,my,xlower,ylower,dx,dy,qtmp,auxtmp,Rsphere)
state.q[:,:,:] = qtmp[:,num_ghost:-num_ghost,num_ghost:-num_ghost]

Expand Down
20 changes: 11 additions & 9 deletions examples/shallow_sphere/src2.f90
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
! =======================================================
subroutine src2(maxmx,maxmy,num_eqn,num_ghost,mx,my,xlower,ylower, &
dx,dy,q,num_aux,aux,t,dt,Rsphere)
! =======================================================

subroutine src2(maxmx,maxmy,num_eqn,num_ghost,mx,my,xlower,ylower, &
dx,dy,q,num_aux,aux,t,dt,Rsphere)

! # Compute source term for Rossby-Haurwitz wave.
! # The source term models the Coriolis force using a 4-stage RK method
! # and the projection of the velocity components to the tangent plane.

implicit none

implicit double precision (a-h,o-z)
dimension q(num_eqn, 1:mx, 1:my)
dimension aux(num_aux, 1:mx, 1:my)
double precision :: RK(4,3)
real(kind=8) :: q(num_eqn, 1:mx, 1:my)
real(kind=8) :: aux(num_aux, 1:mx, 1:my)
real(kind=8) :: RK(4,3)
real(kind=8) :: a, Omega, df, erx, ery, erz, qn, xc, yc, rad, theta
real(kind=8) :: xp, yp, zp, phi, fcor, hu, hv, hw
integer :: num_eqn, num_ghost, mx, my, num_aux, maxmx, maxmy
integer :: i, j, m
real(kind=8) :: xlower, ylower, dx, dy, t, dt, Rsphere

!f2py integer intent(in) maxmx
!f2py integer intent(in) maxmy
Expand Down
Loading