Skip to content

Commit

Permalink
greg
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Dec 18, 2024
1 parent 9e162b6 commit 05b17f3
Show file tree
Hide file tree
Showing 6 changed files with 5,526 additions and 25 deletions.
8 changes: 4 additions & 4 deletions example/extra/taperobinson.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MODULE autodiff_tapenade_pr76_demo
procedure :: ar_b
procedure :: ar_d_b
procedure :: ar_d_d
procedure :: v0 => VOLUME_INITALIZER
procedure :: get_v0 => VOLUME_INITALIZER
end type TPR76

CONTAINS
Expand Down Expand Up @@ -1352,15 +1352,15 @@ SUBROUTINE AR(model, n, v, t, arval)
& arg11))*(r*t)
end subroutine AR

PURE FUNCTION VOLUME_INITALIZER(model, n, p, t) RESULT (v0)
FUNCTION VOLUME_INITALIZER(self, n, p, t) RESULT (v0)
IMPLICIT NONE
class(TPR76), INTENT(IN) :: model
class(TPR76), INTENT(IN) :: self
REAL(pr), INTENT(IN) :: n(:)
REAL(pr), INTENT(IN) :: p
REAL(pr), INTENT(IN) :: t
REAL(pr) :: v0
INTRINSIC SUM
v0 = SUM(n*model%b)/SUM(model%b)
v0 = SUM(n*self%b)/SUM(self%b)
end function VOLUME_INITALIZER

end module autodiff_tapenade_pr76_demo
Expand Down
17 changes: 0 additions & 17 deletions src/adiff/autodiff_api/tapenade_ar_api.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ module yaeos__tapenade_ar_api
procedure(tapenade_ar_b), deferred :: ar_b
procedure(tapenade_ar_d_b), deferred :: ar_d_b
procedure(tapenade_ar_d_d), deferred :: ar_d_d
procedure(tapenade_v0), deferred :: v0
procedure :: residual_helmholtz => residual_helmholtz
procedure :: get_v0 => get_v0
end type

abstract interface
Expand Down Expand Up @@ -73,13 +71,6 @@ subroutine tapenade_ar_d_d(model, n, nd, v, vd0, vd, t, td0, td, &
real(pr), intent(in) :: nd(:), vd, td
real(pr), intent(out) :: arval, arvald0, arvald, arvaldd
end subroutine

pure function tapenade_v0(model, n, p, t)
import pr, ArModelTapenade
class(ArModelTapenade), intent(in) :: model
real(pr), intent(in) :: n(:), p, t
real(pr) :: tapenade_v0
end function
end interface

contains
Expand Down Expand Up @@ -217,12 +208,4 @@ function get_ArnX(var)
get_ArnX = nb
end function
end subroutine

function get_v0(self, n, p, t)
class(ArModelTapenade), intent(in) :: self
real(pr), intent(in) :: n(:), p, t
real(pr) :: get_v0

get_v0 = self%v0(n, p, t)
end function
end module
Loading

0 comments on commit 05b17f3

Please sign in to comment.