mcrouch
mcrouch

Reputation: 41

Integer / in fortran

Hi I have come across something in a code like,

  Integer x/0/
  Real y/0.05/

My question is what does the /number/ represent? Does that mean that that is the value of that integer?

Upvotes: 1

Views: 86

Answers (1)

Stefan
Stefan

Reputation: 2518

The notation, you have given, is indeed a possible form of initialization. x will be initialized with 0 and y will be initialized with 0.05.

Please note, that this notation is not conforming to the standard (thanks IanH).

Better possibilities mentioned in Fortran 2008 are (see 5.2.3 and 5.4.7):

integer x = 0
real y = 0.05

and

integer x
real y
data x /0/
data y /0.05/

Upvotes: 2

Related Questions