PGF90-W-0155 & PGF90-W-0171

Hi,

I’m testing CRTM 2.0 with different compilers on different platforms.

With PGI 8.0-4, there were NO compiling error messages except some warnning messages. But CRTM 2.0 will fail with crtm_kmatrix option enabled at runtime.

There was NO this sort issue with other compilers, such as ifort, gfortran and xlf. I wonder whether if some FORTRAN features are NOT supported by the PGI compiler and caused this sort of issue.

Could anyone tell me what do the warnning messages mean for?

Thanks

\

  1. pgf95 -c -g -fast -byteswapio -Mstandard CloudCoeff_Define.f90
    PGF90-W-0171-PGI Fortran extension: nonstandard statement type ALLOCATABLE within a derived type
REAL(Double), ALLOCATABLE :: Frequency_MW(:)
  1. PGF90-W-0155-Invalid type for STATUS specifier allocate_status
      ALLOCATE( PAFV%dPonG(n_ODPS_Layers), &
                PAFV%d_Absorber(n_ODPS_Layers), &
                PAFV%Int_vapor(n_ODPS_Layers), &
                PAFV%AveA(n_ODPS_Layers), &
                PAFV%Inverse(n_ODPS_Layers), &
                PAFV%s_t(n_ODPS_Layers), &
                PAFV%s_p(n_ODPS_Layers), &
                PAFV%Ap1(n_ODPS_Layers), &
                PAFV%b(n_ODPS_Layers, 0:MAX_OPTRAN_USED_PREDICTORS), &
                PAFV%LN_Chi(n_ODPS_Layers), &
                PAFV%Chi(n_ODPS_Layers), &
                STAT = Allocate_Status(1) )
  1. PGF90-W-0155-.nullify - must also have PURE attribute
1415   ELEMENTAL FUNCTION CRTM_Atmosphere_Add( atm1, atm2 ) RESULT( atmsum )
1416     TYPE(CRTM_Atmosphere_type), INTENT(IN) :: atm1, atm2
1417     TYPE(CRTM_Atmosphere_type) :: atmsum

... ... ...

1436     ! Copy the first structure
1437     atmsum = atm1

... ... ...

1459   END FUNCTION CRTM_Atmosphere_Add

I’m pretty sure PGI f95 v10.3 is fully Fortran95+TR15581 compliant (any bugs notwithstanding of course). The list of supported Fortran2003 features is growing (albeit a little slowly for my tastes…I mean, it’s 2010 already!)

Addressing your particular CRTM compilation warnings:

  1. pgf95 -c -g -fast -byteswapio -Mstandard CloudCoeff_Define.f90
    PGF90-W-0171-PGI Fortran extension: nonstandard statement type ALLOCATABLE within a derived type

REAL(Double), ALLOCATABLE :: Frequency_MW(:)

>

Using allocatable components in user defined derived types (UDDTs) is a Fortran95+TR15581  feature. The PGI compiler is listed as supporting the TR15581 extension to Fortran95 so the source does (should!) compile -- even though a warning is issued. Technically, the warning is not incorrect (since PGI is a f95 compiler) but is a little annoying.

The use of allocatables in UDDTs is in the Fortran2003 standard. This particular user is waiting waiting waiting for the slew of compilers out there to become fully Fortran2003 compliant (only Cray and IBM at the moment as far as I can tell).

This particular feature is very important in Fortran. It mitigates the possibility of memory leaks - which were a potential issue in earlier versions of the CRTM where I used POINTERs. The older CRTM code is rather anal about checking for pointer association so the risk is small. With CRTM 2.0, apart from compiler bugs, the risk (for those modules that have been updated to use allocatables) is zero and the module code base is reduced by about 60% so maintenance and/or enhancement is much simpler.

> 2. PGF90-W-0155-Invalid type for STATUS specifier allocate_status
>
> ```text
      ALLOCATE( PAFV%dPonG(n_ODPS_Layers), &
                PAFV%d_Absorber(n_ODPS_Layers), &
                PAFV%Int_vapor(n_ODPS_Layers), &
                PAFV%AveA(n_ODPS_Layers), &
                PAFV%Inverse(n_ODPS_Layers), &
                PAFV%s_t(n_ODPS_Layers), &
                PAFV%s_p(n_ODPS_Layers), &
                PAFV%Ap1(n_ODPS_Layers), &
                PAFV%b(n_ODPS_Layers, 0:MAX_OPTRAN_USED_PREDICTORS), &
                PAFV%LN_Chi(n_ODPS_Layers), &
                PAFV%Chi(n_ODPS_Layers), &
                STAT = Allocate_Status(1) )

I have only seen this warning with PGI when I use an array element with the STAT specifier. I believe it’s a warning issued in error since the array “Allocate_Status” is declared as integer in the procedure in which the above code resides.

  1. PGF90-W-0155-.nullify - must also have PURE attribute

1415 ELEMENTAL FUNCTION CRTM_Atmosphere_Add( atm1, atm2 ) RESULT( atmsum )
1416 TYPE(CRTM_Atmosphere_type), INTENT(IN) :: atm1, atm2
1417 TYPE(CRTM_Atmosphere_type) :: atmsum

… … …

1436 ! Copy the first structure
1437 atmsum = atm1

… … …

1459 END FUNCTION CRTM_Atmosphere_Add

>

This one would appear to be a bug in the compiler. The compiler folks will have to verify, but from a purely Fortran95/2003 standpoint, use of the ELEMENTAL attribute on a procedure implies said procedure is PURE.

Since the assignment statement is also in the above quote, I assume the warning is issued because the code uses intrinsic assignment (rather than me writing an explicit elemental procedure to do it). By default, intrinsic assignment should be elemental -- even for UDDTs.... and even for UDDTs with ALLOCATABLE components (of which the CRTM_Atmosphere_type structure contains plenty).

cheers,

paulv

Hi Paulv,

I will ask our engineers to remove the -Mstandard warnings concerning F95 extensions that are now supported in F2003.

For what it’s worth, I thought I would include a list of F2003 features supported thus far and the release where support first appears. We will continue to add F2003 features throughout the year and plan on being fully compliant by November.

Thanks for the feedback,
Mat

Currently support F2003 Features (as of Release 10.5)

abstract interfaces 10.3
Access = ‘stream’ 10.0 or earlier
Access to environment 10.0 or earlier
Allocatable Array Extensions 10.0 or earlier
allocatable scalars 10.0 or earlier
Allow NAMELIST w/internal file 10.2
Asynchronous I/O’ 10.0 or earlier
c_associated 10.0 or earlier
c_f_pointer 10.0 or earlier
c_f_procpointer 10.0 or earlier
Classes 10.3
Enumerators 10.0 or earlier
EXTENDS_TYPE_OF intrinsic 10.3
IEEE_ARITHMETIC large arrays 10.2
IEEE_ARITHMETIC module 10.0 or earlier
IEEE_EXCEPTIONS module 10.0 or earlier
IMPORT statement 10.0 or earlier
Inheritance association 10.3
Interface procedure 10.0 or earlier
IOSTAT kind in all i/o stmts 10.1
IS_IOSTAT_END intrinsic 10.3
IS_IOSTAT_EOR intrinsic 10.3
ISO_C_Binding 10.0 or earlier
iso_fortran_env module 10.0 or earlier
Length of names and statements 10.0 or earlier
move_alloc() 10.0 or earlier
NEW_LINE intrinsic 10.3
NOPASS attribute in 10.5
Optional Kind to Intrinsics 10.0 or earlier
Pass and Nopass Attribute 10.0 or earlier
PASS attribute in 10.5
PENDING specifier for INQUIRE 10.0 or earlier
Pointer Reshaping 10.0 or earlier
polymorphic entities 10.3
POS specifier for INQUIRE … 10.1
Procedure Pointers 10.0 or earlier
READ blank specifier 10.3
READ pad specifier 10.3
SAME_TYPE_AS intrinsic 10.3
SIZE kind in read/write stmts 10.1
Square brackets 10.0 or earlier
SYSTEM_CLOCK COUNT_RATE is real 10.3
Type Extension(not polymorphic) 10.3
type uses CONTAINS declaration 10.3
Type-bound procedures in 10.5
Typed allocation 10.3
volatile attribute and stmt 10.0 or earlier
Wait Statement 10.0 or earlier
WRITE delim specifer 10.3

Thanks for all kind help.

Best Regards