Assert
Assertion related methods.
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Assert(Mat, s, msg, file, line, routine)
REAL(DFP), INTENT(IN) :: Mat(:, :)
INTEGER(I4B), INTENT(IN) :: s(2)
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE
END INTERFACE
If shape of Mat
is not same as s
, then this routine prints error and stop program.
program main
use easifemBase
implicit none
real(dfp) :: mat(4,4)
CALL Assert( &
& mat=mat, &
& s=[4,4], &
& msg="shape of mat is not same as [4,4]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
CALL Assert( &
& mat=mat, &
& s=[5,5], &
& msg="shape of mat is not same as [5,5]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
end program main
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Assert(Mat, s, msg, file, line, routine)
REAL(DFP), INTENT(IN) :: Mat(:, :, :)
INTEGER(I4B), INTENT(IN) :: s(3)
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE
END INTERFACE
program main
use easifemBase
implicit none
real(dfp) :: mat(4,4,2)
CALL Assert( &
& mat=mat, &
& s=[4,4,2], &
& msg="shape of mat is not same as [4,4,2]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
CALL Assert( &
& mat=mat, &
& s=[5,5,2], &
& msg="shape of mat is not same as [5,5,2]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
end program main
Interface 3
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Assert(Mat, s, msg, file, line, routine)
REAL(DFP), INTENT(IN) :: Mat(:, :, :, :)
INTEGER(I4B), INTENT(IN) :: s(4)
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE
END INTERFACE
program main
use easifemBase
implicit none
real(dfp) :: mat(4,4,2,2)
CALL Assert( &
& mat=mat, &
& s=[4,4,2,2], &
& msg="shape of mat is not same as [4,4,2,2]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
CALL Assert( &
& mat=mat, &
& s=[5,5,2,2], &
& msg="shape of mat is not same as [5,5,2,2]", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
end program main
Interface 4
- ܀ Interface
- ܀ Interface
- ܀ Interface
- ܀ interface
- ️܀ See example
- ↢
MODULE SUBROUTINE Assert(n1, n2, msg, file, line, routine)
INTEGER(I4B), INTENT(IN) :: n1, n2
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE Assert
MODULE SUBROUTINE Assert(n1, n2, n3, msg, file, line, routine)
INTEGER(I4B), INTENT(IN) :: n1, n2, n3
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE Assert
MODULE SUBROUTINE Assert(n1, n2, n3, n4, msg, file, line, routine)
INTEGER(I4B), INTENT(IN) :: n1, n2, n3, n4
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE Assert
MODULE SUBROUTINE Assert(nn, msg, file, line, routine)
INTEGER(I4B), DIMENSION(:), INTENT(IN) :: nn
INTEGER(I4B), INTENT(IN) :: line
CHARACTER(*), INTENT(IN) :: msg, file, routine
END SUBROUTINE Assert
program main
use easifemBase
implicit none
CALL Assert( &
& n1 = 1, n2 = 2, &
& msg="n1 and n2 are not same", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
CALL Assert( &
& n1 = 1, n2 = 1, n3=1, &
& msg="n1, n2, n3 are not same", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
CALL Assert( &
& n1 = 1, n2 = 1, n3=1, n4=1, &
& msg="n1, n2, n3, n4 are not same", &
& line=__LINE__, &
& file=__FILE__, &
& routine="main()")
end program main