Please explain what does 0.0_p2 and 1.0_p2 mean here.
0.0_p2
1.0_p2
integer , parameter :: sp = kind(1.0) integer , parameter :: p2 = selected_real_kind(2*precision(1.0_sp)) real(p2), parameter :: zero = 0.0_p2, & one = 1.0_p2
The term
is the real number 0.0 with kind p2. The snippet you've posted tells us that p2 denotes the kind returned by the expression
0.0
p2
selected_real_kind(2*precision(1.0_sp))
so p2 is probably the same as double precision, and also probably a 64-bit real number.
double precision
The term
is the real number
0.0with kindp2. The snippet you've posted tells us thatp2denotes the kind returned by the expressionso
p2is probably the same asdouble precision, and also probably a 64-bit real number.