kinds.f90 Source File

Files Dependent On This One

sourcefile~~kinds.f90~~AfferentGraph sourcefile~kinds.f90 kinds.f90 sourcefile~testsparse.f90 testSparse.f90 sourcefile~kinds.f90->sourcefile~testsparse.f90 sourcefile~testkinds.f90 testKinds.f90 sourcefile~kinds.f90->sourcefile~testkinds.f90 sourcefile~testquaternion.f90 testQuaternion.f90 sourcefile~kinds.f90->sourcefile~testquaternion.f90 sourcefile~time.f90 time.f90 sourcefile~kinds.f90->sourcefile~time.f90 sourcefile~testexpression.f90 testExpression.f90 sourcefile~kinds.f90->sourcefile~testexpression.f90 sourcefile~iterate.f90 iterate.f90 sourcefile~kinds.f90->sourcefile~iterate.f90 sourcefile~testoptimize.f90 testOptimize.f90 sourcefile~kinds.f90->sourcefile~testoptimize.f90 sourcefile~stats.f90 stats.f90 sourcefile~kinds.f90->sourcefile~stats.f90 sourcefile~expression.f90 expression.f90 sourcefile~kinds.f90->sourcefile~expression.f90 sourcefile~testmesh.f90 testMesh.f90 sourcefile~kinds.f90->sourcefile~testmesh.f90 sourcefile~array.f90 array.f90 sourcefile~kinds.f90->sourcefile~array.f90 sourcefile~testiterate.f90 testIterate.f90 sourcefile~kinds.f90->sourcefile~testiterate.f90 sourcefile~spline.f90 spline.f90 sourcefile~kinds.f90->sourcefile~spline.f90 sourcefile~node.f90 node.f90 sourcefile~kinds.f90->sourcefile~node.f90 sourcefile~optimize.f90 optimize.f90 sourcefile~kinds.f90->sourcefile~optimize.f90 sourcefile~treevalue.f90 treeValue.f90 sourcefile~kinds.f90->sourcefile~treevalue.f90 sourcefile~fourier.f90 fourier.f90 sourcefile~kinds.f90->sourcefile~fourier.f90 sourcefile~treeoperator.f90 treeOperator.f90 sourcefile~kinds.f90->sourcefile~treeoperator.f90 sourcefile~autodifftype.f90 autoDiffType.f90 sourcefile~kinds.f90->sourcefile~autodifftype.f90 sourcefile~treeexponential.f90 treeExponential.f90 sourcefile~kinds.f90->sourcefile~treeexponential.f90 sourcefile~autodiffexponential.f90 autoDiffExponential.f90 sourcefile~kinds.f90->sourcefile~autodiffexponential.f90 sourcefile~treetrigonometric.f90 treeTrigonometric.f90 sourcefile~kinds.f90->sourcefile~treetrigonometric.f90 sourcefile~autodiff.f90 autoDiff.f90 sourcefile~kinds.f90->sourcefile~autodiff.f90 sourcefile~mesh.f90 mesh.f90 sourcefile~kinds.f90->sourcefile~mesh.f90 sourcefile~tensor.f90 tensor.f90 sourcefile~kinds.f90->sourcefile~tensor.f90 sourcefile~testtext.f90 testText.f90 sourcefile~kinds.f90->sourcefile~testtext.f90 sourcefile~solvers.f90 solvers.f90 sourcefile~kinds.f90->sourcefile~solvers.f90 sourcefile~testnetcdf.f90 testNetCDF.f90 sourcefile~kinds.f90->sourcefile~testnetcdf.f90 sourcefile~autodiffoperator.f90 autoDiffOperator.f90 sourcefile~kinds.f90->sourcefile~autodiffoperator.f90 sourcefile~examples.f90 examples.f90 sourcefile~kinds.f90->sourcefile~examples.f90 sourcefile~autodifftrigonometric.f90 autoDiffTrigonometric.f90 sourcefile~kinds.f90->sourcefile~autodifftrigonometric.f90 sourcefile~netcdf.f90 netCDF.f90 sourcefile~kinds.f90->sourcefile~netcdf.f90 sourcefile~autodiffarray.f90 autoDiffArray.f90 sourcefile~kinds.f90->sourcefile~autodiffarray.f90 sourcefile~animate.f90 animate.f90 sourcefile~kinds.f90->sourcefile~animate.f90 sourcefile~basicsolvers.f90 basicSolvers.f90 sourcefile~kinds.f90->sourcefile~basicsolvers.f90 sourcefile~logo.f90 logo.f90 sourcefile~kinds.f90->sourcefile~logo.f90 sourcefile~quaternion.f90 quaternion.f90 sourcefile~kinds.f90->sourcefile~quaternion.f90 sourcefile~basic.f90 basic.f90 sourcefile~kinds.f90->sourcefile~basic.f90 sourcefile~text.f90 text.f90 sourcefile~kinds.f90->sourcefile~text.f90 sourcefile~sparse.f90 sparse.f90 sourcefile~kinds.f90->sourcefile~sparse.f90 sourcefile~testtime.f90 testTime.f90 sourcefile~kinds.f90->sourcefile~testtime.f90 sourcefile~teststats.f90 testStats.f90 sourcefile~kinds.f90->sourcefile~teststats.f90 sourcefile~testconfig.f90 testConfig.f90 sourcefile~kinds.f90->sourcefile~testconfig.f90 sourcefile~testvtkio.f90 testVtkIO.f90 sourcefile~kinds.f90->sourcefile~testvtkio.f90 sourcefile~config.f90 config.f90 sourcefile~kinds.f90->sourcefile~config.f90 sourcefile~testfourier.f90 testFourier.f90 sourcefile~kinds.f90->sourcefile~testfourier.f90 sourcefile~vtkio.f90 vtkIO.f90 sourcefile~kinds.f90->sourcefile~vtkio.f90 sourcefile~testarray.f90 testArray.f90 sourcefile~kinds.f90->sourcefile~testarray.f90 sourcefile~testmatio.f90 testMatIO.f90 sourcefile~kinds.f90->sourcefile~testmatio.f90 sourcefile~testspline.f90 testSpline.f90 sourcefile~kinds.f90->sourcefile~testspline.f90 sourcefile~testtensor.f90 testTensor.f90 sourcefile~kinds.f90->sourcefile~testtensor.f90 sourcefile~plplotlib.f90 plplotlib.f90 sourcefile~kinds.f90->sourcefile~plplotlib.f90 sourcefile~testautodiff.f90 testAutoDiff.f90 sourcefile~kinds.f90->sourcefile~testautodiff.f90 sourcefile~time.f90->sourcefile~testiterate.f90 sourcefile~time.f90->sourcefile~solvers.f90 sourcefile~time.f90->sourcefile~text.f90 sourcefile~time.f90->sourcefile~testtime.f90 sourcefile~iterate.f90->sourcefile~testiterate.f90 sourcefile~stats.f90->sourcefile~teststats.f90 sourcefile~expression.f90->sourcefile~testexpression.f90 sourcefile~array.f90->sourcefile~testsparse.f90 sourcefile~array.f90->sourcefile~testexpression.f90 sourcefile~array.f90->sourcefile~testoptimize.f90 sourcefile~array.f90->sourcefile~spline.f90 sourcefile~array.f90->sourcefile~optimize.f90 sourcefile~array.f90->sourcefile~testnetcdf.f90 sourcefile~array.f90->sourcefile~examples.f90 sourcefile~array.f90->sourcefile~animate.f90 sourcefile~array.f90->sourcefile~logo.f90 sourcefile~array.f90->sourcefile~basic.f90 sourcefile~array.f90->sourcefile~sparse.f90 sourcefile~array.f90->sourcefile~testvtkio.f90 sourcefile~array.f90->sourcefile~testarray.f90 sourcefile~array.f90->sourcefile~testspline.f90 sourcefile~array.f90->sourcefile~plplotlib.f90 sourcefile~spline.f90->sourcefile~testspline.f90 sourcefile~node.f90->sourcefile~expression.f90 sourcefile~node.f90->sourcefile~treevalue.f90 sourcefile~node.f90->sourcefile~treeoperator.f90 sourcefile~node.f90->sourcefile~treeexponential.f90 sourcefile~node.f90->sourcefile~treetrigonometric.f90 sourcefile~optimize.f90->sourcefile~testoptimize.f90 sourcefile~treevalue.f90->sourcefile~expression.f90 sourcefile~fourier.f90->sourcefile~testfourier.f90 sourcefile~treeoperator.f90->sourcefile~expression.f90 sourcefile~autodifftype.f90->sourcefile~autodiffexponential.f90 sourcefile~autodifftype.f90->sourcefile~autodiff.f90 sourcefile~autodifftype.f90->sourcefile~autodiffoperator.f90 sourcefile~autodifftype.f90->sourcefile~autodifftrigonometric.f90 sourcefile~autodifftype.f90->sourcefile~autodiffarray.f90 sourcefile~treeexponential.f90->sourcefile~expression.f90 sourcefile~autodiffexponential.f90->sourcefile~autodiff.f90 sourcefile~treetrigonometric.f90->sourcefile~expression.f90 sourcefile~autodiff.f90->sourcefile~testautodiff.f90 sourcefile~mesh.f90->sourcefile~testmesh.f90 sourcefile~tensor.f90->sourcefile~quaternion.f90 sourcefile~tensor.f90->sourcefile~testtensor.f90 sourcefile~solvers.f90->sourcefile~testsparse.f90 sourcefile~autodiffoperator.f90->sourcefile~autodiff.f90 sourcefile~autodiffoperator.f90->sourcefile~autodiffarray.f90 sourcefile~autodifftrigonometric.f90->sourcefile~autodiff.f90 sourcefile~netcdf.f90->sourcefile~testnetcdf.f90 sourcefile~autodiffarray.f90->sourcefile~autodiff.f90 sourcefile~basicsolvers.f90->sourcefile~testsparse.f90 sourcefile~quaternion.f90->sourcefile~testquaternion.f90 sourcefile~text.f90->sourcefile~testoptimize.f90 sourcefile~text.f90->sourcefile~testiterate.f90 sourcefile~text.f90->sourcefile~node.f90 sourcefile~text.f90->sourcefile~testtext.f90 sourcefile~text.f90->sourcefile~solvers.f90 sourcefile~text.f90->sourcefile~basicsolvers.f90 sourcefile~text.f90->sourcefile~config.f90 sourcefile~text.f90->sourcefile~plplotlib.f90 sourcefile~sparse.f90->sourcefile~testsparse.f90 sourcefile~sparse.f90->sourcefile~solvers.f90 sourcefile~sparse.f90->sourcefile~basicsolvers.f90 sourcefile~config.f90->sourcefile~testconfig.f90 sourcefile~vtkio.f90->sourcefile~testvtkio.f90 sourcefile~plplotlib.f90->sourcefile~testsparse.f90 sourcefile~plplotlib.f90->sourcefile~testexpression.f90 sourcefile~plplotlib.f90->sourcefile~testoptimize.f90 sourcefile~plplotlib.f90->sourcefile~examples.f90 sourcefile~plplotlib.f90->sourcefile~animate.f90 sourcefile~plplotlib.f90->sourcefile~logo.f90 sourcefile~plplotlib.f90->sourcefile~basic.f90 sourcefile~plplotlib.f90->sourcefile~testspline.f90
Help

Source Code


Source Code

module kinds_mod
	!! Module to manage real kinds and basic constants
	implicit none
	
	!==============!
	!= Real Kinds =!
	!==============!
	
	integer,parameter::sp = selected_real_kind(6)
		!! Single precision
	integer,parameter::dp = selected_real_kind(15)
		!! Double precision
	integer,parameter::ep = selected_real_kind(18)
		!! Extended precision
	integer,parameter::qp = selected_real_kind(32)
		!! Quad precision
	
	integer,dimension(4),parameter::rkinds = [sp,dp,ep,qp]
		!! List of real kinds
	
	integer,parameter::wp = dp
		!! Set working precision to double
	
	!==================!
	!= Math Constants =!
	!==================!
	
	real(wp),parameter::PI = 4.0_wp*atan(1.0_wp)
		!! Archimedes' constant
	real(wp),parameter::E  = exp(1.0_wp)
		!! Euler's constant
	
	!===========!
	!= Exports =!
	!===========!
	
	public::sp,dp,ep,qp,wp
	public::PI,E
	
	public::printTypes
	public::arg
	
contains

	subroutine printTypes
		!! Print the integer kinds for each real type
		write(*,*) 'sp: ',sp
		write(*,*) 'dp: ',dp
		write(*,*) 'ep: ',ep
		write(*,*) 'qp: ',qp
		write(*,*) 'wp: ',wp
	end subroutine printTypes

	elemental function arg(z) result(v)
		!! Compute the argument of a complex number
		complex(wp),intent(in)::z
		real(wp)::v
		
		v = atan2(aimag(z),real(z))
	end function arg

end module kinds_mod