subroutine forces(xf,uf,vf,wf,grav,fict) C C Calculate both real (ie, gravity and whatnot) C and fictitious (ie, coriolis and centrifugal) forces. C include 'global.h' include 'sweep.h' C integer n real grav(maxsweep), fict(maxsweep), xf(maxsweep), & uf(maxsweep), vf(maxsweep), wf(maxsweep) C C-------------------------------------------------------------- C if(sweep.eq.'x') then if(ngeomx.eq.0 .and. ngeomy.eq.0) then C Cartesian do 10 n = nmin, nmax+1 grav(n) = 0. fict(n) = 0. 10 continue C else if(ngeomx.eq.0 .and. ngeomy.eq.1) then C Cylindrical radial do 12 n = nmin, nmax+1 grav(n) = 0. fict(n) = wf(n)*wf(n)/xf(n) 12 continue C else if(ngeomx.eq.1 .and. ngeomy.eq.3) then C Cylindrical polar do 14 n = nmin, nmax+1 grav(n) = 0. fict(n) = vf(n)*vf(n)/xf(n) 14 continue C else if(ngeomx.eq.2) then C Spherical do 16 n = nmin, nmax+1 grav(n) = 0. fict(n) = (wf(n)*wf(n)+vf(n)*vf(n))/xf(n) 16 continue endif endif C Ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc C if(sweep.eq.'y') then if(ngeomy.eq.0) then C Cartesian do 20 n = nmin, nmax+1 grav(n) = 0. fict(n) = 0. 20 continue C else if(ngeomy.eq.1) then C Cylindrical radial do 22 n = nmin, nmax+1 grav(n) = 0. fict(n) = wf(n)*wf(n)/xf(n) 22 continue else if(ngeomy.eq.3 .and. ngeomx.eq.1) then C Cylindrical polar (2D) do 24 n = nmin, nmax+1 grav(n) = 0. fict(n) = -uf(n)*wf(n) / radius 24 continue C else if(ngeomy.eq.3 .and. ngeomx.eq.2) then C Spherical equator (2D) do 26 n = nmin, nmax+1 grav(n) = 0. fict(n) = -uf(n)*wf(n) / radius 26 continue C else if(ngeomy.eq.4 .and. ngeomx.eq.2) then C Spherical do 28 n = nmin, nmax+1 if(xf(n).eq.0.0) then xf0 = small else xf0 = xf(n) endif grav(n) = 0. fict(n) = -uf(n)*wf(n) / radius & +vf(n)*vf(n) / radius * cos(xf(n)) / sin(xf0) if(xf(n) .eq. 0.0) fict(n) = 0.0 28 continue endif endif C Ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc C if(sweep.eq.'z') then if(ngeomz.eq.0) then C Cartesian do 30 n = nmin, nmax+1 grav(n) = 0. fict(n) = 0. 30 continue C else if(ngeomz.eq.3) then C Cylindrical do 32 n = nmin, nmax+1 grav(n) = 0. fict(n) = -uf(n)*wf(n) / radius 32 continue else if(ngeomz.eq.5) then C Spherical do 34 n = nmin, nmax+1 grav(n) = 0. fict(n) = -uf(n)*wf(n) / radius & -uf(n)*vf(n) / radius * cos(theta) / stheta 34 continue endif endif C return end