PGF90-W-0194 warning message

Hi there,

Two months ago, I asked a question about compiling a research model. The model was originally compiled using intel fortran compiler, and when we have to use pgi compiler, there are some issues but now all got solved.

However, with our system upgraded and replaced, the compiler of previous version (6.1) is no longer available now, and I have to do the compilation using version 11.4. And this is where I have encountered another problem.

The warning message showed up when I compile the model :
PGF90-W-0194-INTENT(IN) argument cannot be defined - land (/xxx/flux_exchange.F90: 328)
0 inform, 1 warnings, 0 severes, 0 fatal for flux_exchange_init

which I have never seen when the last time I compiled the model. However, the compilation can still be done. But when I try to run the executable file, the model crashes with this error message:
PGFIO-F-212/formatted write/unit=-1/invalid unit number.
In source file /xxx/flux_exchange.F90, at line number 1584

I think these two warning/error messages are related, but I couldn’t figure out where went wrong.

All inputs are appreciated. Thanks.


Can you post the following lines of code:

*) /xxx/flux_exchange.F90, line 328
*) /xxx/flux_exchange.F90, line 1584


Thanks for the reply.
Here are the related lines:

328 subroutine flux_exchange_init ( Time, Atm, Land, land_ice_atmos_boundary, dt_atmos, dt_cpld )

329 type(time_type), intent(in) :: Time
330 type(atmos_data_type), intent(inout) :: Atm
331 type(land_data_type), intent(in) :: Land

1577 !------- tracer fluxes ------------
1578 ! tr_mol_flux diagnostic will be correct for co2 tracer only.
1579 ! will need update code to use correct molar mass for tracers other than co2
1580 do tr=1,n_exch_tr
1581 if ( id_tr_flux(tr) > 0 .or. id_tr_mol_flux(tr) > 0 ) then
1582 diag_atm(1,1) = ex_flux_tr(1,tr)
1583 write(id_tr_flux(tr), diag_format) year, month, day, hour, minute, second, diag_atm
1584 write(id_tr_mol_flux(tr), diag_format) year, month, day, hour, minute, second, diag_atm*1000./WTMCO2
1585 endif
1586 enddo


The warning message refer’s to the INTENT(IN) argument Land which is either be
written to in the subroutine, or is being passed as an argument to another routine which uses it as INTENT(OUT) or INTENT(INOUT).

The runtime error is stating that the formatted write failed because the unit number is
equal to -1. Based on that line of source, the variable id_tr_mol_flux(tr) has a value of -1.

Certainly, this could be a bug in the 11.4 compilers which is causing this error. Is it possible to try the latest compiler, 12.5? If not, is it possible to send the code and a testcase that I could try with the 12.5 compiler?


For the INTENT(inout) issue, we tried to simply delete the INTENT(in), INTENT(out), and INTENT(inout) argument, and the warning is now disappeared.

Also, we have installed a trial version of pgi compiler 12.5, and made some runs. Sadly, the error is still there.

PGFIO-F-212/formatted write/unit=-1/invalid unit number.
In source file /xxx/flux_exchange.F90, at line number 1584

At the mean time, we have also went back to compiler version 6.1 in an about-to-retire cluster to do the compilation again, and we did not encounter this error.