Is there any way to force a variable to be constant even if a subroutine (part of a standard library) tries to change it? Obviously intent(in)
throws an error.
Pass a copy of the variable to the library.
Or pass to your subroutine by VALUE
instead of INTENT(IN)
. It will be changed, but only inside your own subroutine.