Let's say if I want a double-precision real, what is the correct way to set the precision of the variable? But not just limited to double precision. I am trying to teach myself Fortran. I have been looking at books, websites and codes. And everywhere I look, I see contradicting stuff, which might indicate that the websites have not been updated.
I have seen:
real*8 :: var
real(8) :: var
real(kind=dp) :: var
All of these seem to do the same thing (I might be wrong). Which is the standard way of doing this for any type of variable (real, integer, complex, logical, etc.)?
Like for complex numbers:
complex(16) :: var
complex(kind(0d0)) :: var
which also seem to be the same (I might be wrong again), but do appear differently in different resources.