autoDiffTrigonometric.f90 Source File

This File Depends On

sourcefile~~autodifftrigonometric.f90~~EfferentGraph sourcefile~autodifftrigonometric.f90 autoDiffTrigonometric.f90 sourcefile~kinds.f90 kinds.f90 sourcefile~kinds.f90->sourcefile~autodifftrigonometric.f90 sourcefile~autodifftype.f90 autoDiffType.f90 sourcefile~kinds.f90->sourcefile~autodifftype.f90 sourcefile~autodifftype.f90->sourcefile~autodifftrigonometric.f90
Help

Files Dependent On This One

sourcefile~~autodifftrigonometric.f90~~AfferentGraph sourcefile~autodifftrigonometric.f90 autoDiffTrigonometric.f90 sourcefile~autodiff.f90 autoDiff.f90 sourcefile~autodifftrigonometric.f90->sourcefile~autodiff.f90 sourcefile~testautodiff.f90 testAutoDiff.f90 sourcefile~autodiff.f90->sourcefile~testautodiff.f90
Help


Source Code

module autoDiffTrigonometric_mod
	!! @todo
	!! Add inverse operators
	use kinds_mod
	use autoDiffType_mod
	implicit none
	private
	
	! Sine
	interface sin
		module procedure sin_a
	end interface
	public::sin_a
	
	! Cosine
	interface cos
		module procedure cos_a
	end interface
	public::cos_a
	
	! Tangent
	interface tan
		module procedure tan_a
	end interface
	public::tan_a
	
contains

	!========!
	!= Sine =!
	!========!

	function sin_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( sin(u%val()) , cos(u%val())*u%grad() )
	end function sin_a

	!==========!
	!= Cosine =!
	!==========!

	function cos_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( cos(u%val()) , -sin(u%val())*u%grad() )
	end function cos_a

	!===========!
	!= Tangent =!
	!===========!

	function tan_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( tan(u%val()) , (tan(u%val())**2+1.0_wp)*u%grad() )
	end function tan_a

end module autoDiffTrigonometric_mod