PGF90-F-0010-File write error occurred

I’ve compiled this community radiative transfer model (CRTM) on SGI using IRIX, and on Linux using pgf95, but now am tyring to compile on my windoze machine with PGI workstation, it gets through the first few files and then:

PGF90-F-0010-File write error occurred (data init file) (Endian_Utility.f90)
PGF90/x86 nt86 6.0-5: compilation aborted
make[1]: *** [Endian_Utility.o] Error 2
make: *** [pgi] Error 2


Sorry I don’t know what else to say, but don’t know what to look for or how to look up “F-0010” or “Error 2” and ideas where to start?

Hi benrl,

This error occurs because the compiler is unable to write out a file (temporary, assembly, object, etc.) and is typically caused by lack of disk space. Other possible causes could be permission problems overwriting an exisiting file or the “TEMP” or local directory being full.

  • Mat

I will answer my own post.

Yes I know the error says something about write permission, but it has nothing to do with space or permissions.

The problem was in a declaration statement:

INTEGER :: i = 1

The compiler will return that crytic error without any line numbers or guidance, THIS IS A COMPILER ERROR!!!

I am using pgf95 and this should be working.

To make it work I changed the line in the declaration to either:

INTEGER, PARAMETER :: i = 1

or

INTEGER :: i

and put the data declaration later in the program when I tried to use the DATA statement it also DOES NOT WORK

DATA i/1/


again this is PGI workstation so compiling on windows, the PGI compiler works on linux but not workstation.


benrl

Hi benrl,

Can you please post sample code which illustrates the problem? At least in the following very simple case “integer :: i = 1” works fine.

Thanks,
Mat

PGI$ cat test.f90
     program x
     integer :: i = 1
     print *, i
     end program x
PGI$ pgf95 -V test.f90

pgf95 6.0-8 32-bit target on x86 Windows
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 nt86 6.0-8
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 nt86 6.0-8
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc.  All Rights Reserved.
PGI$ a.exe
            1

Thanks for the follow up Mat, this is as simple as I could get it and still reproduce the error. I pulled out parts of the type_kinds module because it played a part. Also, if I make this a main program instead of a module it wont reproduce (so I compile with -c).

The internal compiler error is triggered by the integer called ‘source.’ It can be remedied by switching to the two following uncommented lines. It now appears it’s something in the type_kinds, and in this code package everything uses it .

Good luck and thanks again for your interest,
benrl


!--------------------------------------------------------------------------------
MODULE test

! – Integer types
INTEGER, PARAMETER, PUBLIC :: Byte = SELECTED_INT_KIND(1) ! Byte integer
INTEGER, PARAMETER, PUBLIC :: Short = SELECTED_INT_KIND(4) ! Short integer
INTEGER, PARAMETER, PUBLIC :: Long = SELECTED_INT_KIND(8) ! Long integer
INTEGER, PARAMETER, PRIVATE :: LLong_t = SELECTED_INT_KIND(16) ! LLong integer
INTEGER, PARAMETER, PUBLIC :: LLong = &
( ( ( 1 + SIGN( 1, LLong_t ) ) / 2 ) * LLong_t ) + &
( ( ( 1 - SIGN( 1, LLong_t ) ) / 2 ) * Long )

! – Define arrays for default definition
INTEGER, PARAMETER, PRIVATE :: N_IP_KINDS = 4
INTEGER, PARAMETER, DIMENSION( N_IP_KINDS ), PRIVATE :: IP_KIND_TYPES = &
(/ Byte, Short, Long, LLong /)

CONTAINS

!----------------------------------------------
FUNCTION source()

INTEGER( Short ) :: Source = 1_Short

! INTEGER*2 :: Source
! Source = 1_Short

END FUNCTION source

END MODULE test
!--------------------------------------------------------------------------------



[102 lt-rusto:test]pgf95 -c -V test.f90

pgf95 6.0-5 32-bit target on x86 Windows
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 nt86 6.0-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-F-0010-File write error occurred (data init file) (test.f90)
PGF90/x86 nt86 6.0-5: compilation aborted

Hi Benrl,

The example code has an error since function results can not be initialized. The error message given by the Windows 6.0-8 compiler is also incorrect. However, if you rewrite the source to be:

 FUNCTION source()

INTEGER( Short ) :: Source 

! INTEGER*2 :: Source
Source = 1_Short

END FUNCTION source

END MODULE test

The source will compile correctly. Note that the PGI 6.2 Windows 32-bit compiler, scheduled to be released later this month, does give the correct error message and should be more helpful.

Thanks,
Mat

my mistake to rename the function but if you make the function:

FUNCTION big()

INTEGER( Short ) :: Source = 1_Short
LOGICAL big

big = .true.

END FUNCTION big

Removing the initialization of the output of the function, you still get the error:

PGF90-F-0010-File write error occurred (data init file) (test.f90)
PGF90/x86 nt86 6.0-2: compilation aborted


Also adding another array “a”, will cause errors both initializing in a single line OR using a data statement:

REAL :: a(3)=(/1,2,3/)

OR

REAL :: a(3)
DATA a /1,2,3/

\

I get none of these errors if I remove the “type_kinds” statements from the test MODULE:

INTEGER, PARAMETER, PUBLIC :: Byte = SELECTED_INT_KIND(1) ! Byte integer
INTEGER, PARAMETER, PUBLIC :: Short = SELECTED_INT_KIND(4) ! Short integer
INTEGER, PARAMETER, PUBLIC :: Long = SELECTED_INT_KIND(8) ! Long integer



This package of routines is robust and has compiled on many different platforms and compilers, including PGI on Linux which I’ve personally done, it seems to be something about the type_kinds statements. Sorry about misleading you with errors in my functions, but there is a bigger problem going on here it seems.

I’ve been rewriting routines as I get the compiler errors, but now am stuck on a routine which uses the DATA statement to initialize arrays and then uses the SAVE attribute, I am in the process of devising a workaround. But if there is someway to fix the type_kinds this seems like it would solve all the troubles that are cascading down.



benrl

Hi Benrl,

I can confirm that both bugs do exist in the Win32 6.0-8 release but have been fixed in the upcoming 6.2 release due out later this month.

Thanks,
Mat

thanks for looking through this, here’s to hoping it’s all fixed in PGI workstation 6.2…

the main issues seemed to be:

when creating a type in a module, cannot initialize the variable (a f95 exclusive feature)

the type_kinds module did something?? to corrupt the ability of variables in functions to be initialized at compile time, if the dependencies on the type_kinds module is removed this error disappears.


anyway I had to do a workaround because I need it ASAP, thanks again, benrl