Skip to content

Commit 4d4ca14

Browse files
Copilotivan-pi
andauthored
style: align nonautonomous naming with solver conventions
Agent-Logs-Url: https://github.com/ivan-pi/stiff3/sessions/67f692d9-43f0-4337-94d3-193b5edcdf71 Co-authored-by: ivan-pi <21085643+ivan-pi@users.noreply.github.com>
1 parent fc99e3c commit 4d4ca14

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

src/stiff3_solver.f90

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ subroutine stiff3_nonautonomous(n,fun,dfun,dfdx,out,nprint,x0,x1,h0,eps,w,y)
302302

303303
contains
304304

305+
! Augmented rhs: x' = 1 and y' = f(x,y)
305306
subroutine fun_aug(naug,yi,fi)
306307
integer, intent(in) :: naug
307308
real(wp), intent(in) :: yi(naug)
@@ -310,6 +311,9 @@ subroutine fun_aug(naug,yi,fi)
310311
call fun(n,yi(1),yi(2:),fi(2:))
311312
end subroutine
312313

314+
! Augmented Jacobian:
315+
! [0 0 ]
316+
! [df/dx df/dy]
313317
subroutine jac_aug(naug,yi,dfi)
314318
integer, intent(in) :: naug
315319
real(wp), intent(in) :: yi(naug)
@@ -319,12 +323,12 @@ subroutine jac_aug(naug,yi,dfi)
319323
call dfun(n,yi(1),yi(2:),dfi(2:,2:))
320324
end subroutine
321325

322-
subroutine out_aug(x,yi,iha,qa)
326+
subroutine out_aug(x,yi,ih,qa)
323327
real(wp), intent(in) :: x
324328
real(wp), intent(in) :: yi(:)
325-
integer, intent(in) :: iha
329+
integer, intent(in) :: ih
326330
real(wp), intent(in) :: qa
327-
call out(x,yi(2:),iha,qa)
331+
call out(x,yi(2:),ih,qa)
328332
end subroutine
329333

330334
end subroutine

test/nonautonomous.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ program nonautonomous
2424

2525
contains
2626

27-
subroutine fun(n,t,y,f)
27+
subroutine fun(n,x,y,f)
2828
integer, intent(in) :: n
29-
real(wp), intent(in) :: t
29+
real(wp), intent(in) :: x
3030
real(wp), intent(in) :: y(n)
3131
real(wp), intent(inout) :: f(n)
32-
f(1) = -y(1) + sin(t)
32+
f(1) = -y(1) + sin(x)
3333
end subroutine
3434

35-
subroutine jac(n,t,y,df)
35+
subroutine jac(n,x,y,df)
3636
integer, intent(in) :: n
37-
real(wp), intent(in) :: t
37+
real(wp), intent(in) :: x
3838
real(wp), intent(in) :: y(n)
3939
real(wp), intent(inout) :: df(n,n)
4040
df(1,1) = -1.0_wp
4141
end subroutine
4242

43-
subroutine dfdx(n,t,y,fx)
43+
subroutine dfdx(n,x,y,fx)
4444
integer, intent(in) :: n
45-
real(wp), intent(in) :: t
45+
real(wp), intent(in) :: x
4646
real(wp), intent(in) :: y(n)
4747
real(wp), intent(inout) :: fx(n)
48-
fx(1) = cos(t)
48+
fx(1) = cos(x)
4949
end subroutine
5050

5151
subroutine out(t,y,ih,qa)

0 commit comments

Comments
 (0)