Skip to content

Commit

Permalink
Changed 'tridag' to 'tridag-sch' to avoid conflicts with other ESMs
Browse files Browse the repository at this point in the history
  • Loading branch information
josephzhang8 committed Aug 15, 2023
1 parent 1ed11f1 commit a832e4f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Hydro/misc_subs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,7 @@ subroutine cubic_spline(npts,xcor,yy,yp1,yp2,ypp,yp)
endif
enddo !k

call tridag(npts,1,npts,1,alow,bdia,cupp,rrhs,ypp,gam)
call tridag_sch(npts,1,npts,1,alow,bdia,cupp,rrhs,ypp,gam)

yp(1)=yp1; yp(npts)=yp2
do k=2,npts-1
Expand Down
10 changes: 5 additions & 5 deletions src/Hydro/schism_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2964,7 +2964,7 @@ subroutine schism_step(it)
enddo !k=kbp(j)+1,nvrt

! Soln for q2 at new level
call tridag(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
call tridag_sch(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
q2tmp(nvrt)=q2fs
!Extrapolate to bottom mainly for diffusivities
q2tmp(kbp(j):kbp(j)+1)=q2bot
Expand Down Expand Up @@ -3044,7 +3044,7 @@ subroutine schism_step(it)
! enddo

! Soln for q2l and xl at new level
call tridag(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
call tridag_sch(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)

! write(90,*)'WOW6',it,j

Expand Down Expand Up @@ -3324,7 +3324,7 @@ subroutine schism_step(it)
!------------------------------------------before this line done

! Soln for q2 at new level
call tridag(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
call tridag_sch(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
q2tmp(nvrt)=q2fs
!Extrapolate to bottom mainly for diffusivities
q2tmp(kbp(j):kbp(j)+1)=q2bot
Expand Down Expand Up @@ -3420,7 +3420,7 @@ subroutine schism_step(it)
! enddo

! Soln for q2l and xl at new level
call tridag(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)
call tridag_sch(nvrt,1,nqdim,1,alow,bdia,cupp,gam2,soln2,gam)

! write(90,*)'WOW6',it,j

Expand Down Expand Up @@ -6575,7 +6575,7 @@ subroutine schism_step(it)
#endif /*USE_WWM*/
enddo !k=kbs(j)+1,nvrt

call tridag(nvrt,2,ndim,2,alow,bdia,cupp,rrhs,soln,gam)
call tridag_sch(nvrt,2,ndim,2,alow,bdia,cupp,rrhs,soln,gam)
do k=kbs(j)+1,nvrt
kin=k-kbs(j)
! Impose limits
Expand Down
8 changes: 4 additions & 4 deletions src/Hydro/solver_subs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
!
! subroutine solve_jcg
! subroutine solve_jcg_qnon (non-hydrostatic)
! subroutine tridag
! subroutine tridag_sch
!
!===============================================================================
!===============================================================================
Expand Down Expand Up @@ -393,7 +393,7 @@ subroutine solve_jcg_qnon(itime,moitn,mxitn,rtol,nvrt1,mnei1,np1,npa1,ihydro2,qm
rrhs(l,l)=1.d0
enddo !l

call tridag(nvrt,nvrt,ndim,ndim,alow,bdia,cupp,rrhs,soln,gam)
call tridag_sch(nvrt,nvrt,ndim,ndim,alow,bdia,cupp,rrhs,soln,gam)
!indice order of blockj: (row #, column #, node)
blockj(kbp_e(ip):(nvrt-1),kbp_e(ip):(nvrt-1),ip)=transpose(soln(1:ndim,1:ndim))

Expand Down Expand Up @@ -586,7 +586,7 @@ end subroutine solve_jcg_qnon

!===============================================================================
!===============================================================================
subroutine tridag(nmax,nvec,n,nc,a,b,c,r,u,gam)
subroutine tridag_sch(nmax,nvec,n,nc,a,b,c,r,u,gam)
!-------------------------------------------------------------------------------
! This program solves a tridiagonal system. It was adapted from "Numerical
! Recipes in FORTRAN (pp.43 ).
Expand Down Expand Up @@ -636,5 +636,5 @@ subroutine tridag(nmax,nvec,n,nc,a,b,c,r,u,gam)
u(1:nc,j)=u(1:nc,j)-gam(j+1)*u(1:nc,j+1)
enddo

end subroutine tridag
end subroutine tridag_sch

2 changes: 1 addition & 1 deletion src/Hydro/transport_TVD.F90.0
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@
if(k==kbe(i)+1) rrhs(1:ntr,kin)=rrhs(1:ntr,kin)-area(i)*dtb_by_bigv*flx_bt(1:ntr,i)
enddo !k=kbe(i)+1,nvrt

call tridag(nvrt,ntr,ndim,ntr,alow,bdia,cupp,rrhs,soln,gam)
call tridag_sch(nvrt,ntr,ndim,ntr,alow,bdia,cupp,rrhs,soln,gam)
do k=kbe(i)+1,nvrt
kin=k-kbe(i)
tr_el(:,k,i)=soln(:,kin)
Expand Down
4 changes: 2 additions & 2 deletions src/Hydro/transport_TVD_imp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ subroutine do_transport_tvd_imp(it,ntr,difnum_max_l) !,nvrt1,npa1,dfh1)
!write(12,*)'bdia:',bdia
!write(12,*)'cupp:',cupp

call tridag(nvrt,1,ndim,1,alow,bdia,cupp,rrhs,soln,gam)
call tridag_sch(nvrt,1,ndim,1,alow,bdia,cupp,rrhs,soln,gam)

!check convergence, based on increment
term1=sqrt(sum((soln(1,1:ndim)-tr_el(m,kbe(i)+1:nvrt,i))**2.d0))
Expand Down Expand Up @@ -2009,7 +2009,7 @@ subroutine do_transport_tvd_imp(it,ntr,difnum_max_l) !,nvrt1,npa1,dfh1)

enddo !k=kbe(i)+1,nvrt

call tridag(nvrt,1,ndim,1,alow,bdia,cupp,rrhs,soln,gam)
call tridag_sch(nvrt,1,ndim,1,alow,bdia,cupp,rrhs,soln,gam)

do k=kbe(i)+1,nvrt
kin=k-kbe(i)
Expand Down

0 comments on commit a832e4f

Please sign in to comment.