OpenMP private variable initialization

MARGUINAUD Philippe philippe.marguinaud@meteo.fr
Thu Mar 28 08:48:00 GMT 2013


Hi all,

I have a problem with the initialization of a private variable in an
OpenMP loop. I do not know whether this is really a bug, but I would
have expected a different behaviour.

$ cat a.F90
MODULE A

TYPE TA
  INTEGER :: ILMESS = 1024
END TYPE

END MODULE
$ cat main.F90
PROGRAM MAIN

USE A

TYPE (TA) :: YA

PRINT *, YA%ILMESS

!$OMP PARALLEL PRIVATE (YA)

PRINT *, YA%ILMESS

!$OMP END PARALLEL


END PROGRAM

$ gfortran -fopenmp a.F90 main.F90 -o main-GNU472.x
$ ./main-GNU472.x
        1024
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
           0
...

What do you think ? Is this a bug or does it conform to the standard ?

Best regards,

Philippe



More information about the Fortran mailing list