[J3] SYSTEM_CLOCK

Steven G. Kargl kargl at uw.edu
Thu Jan 28 17:53:13 UTC 2021


On Thu, Jan 28, 2021 at 10:37:21AM -0500, Vipul Parekh via J3 wrote:
> 
> The practitioner who submitted the PR with a code snippet such as above
> states, that per his/her understanding, the verbiage in the current Fortran
> standard does not support the behavior where the basis for clock COUNT when
> the OPTIONAL COUNT_RATE is included on the argument list is *different*
> from the second call where the OPTIONAL COUNT_RATE is omitted.  Note the
> values of 't1' and 't2' in the above shown program output.  However the
> gfortran developer disagrees with the practitioner.
> 

I suppose the gfortran developer would be me (although I
no longer contribute to gfortran).  I pointed out more than
once to the individual, who reported the bug, that he is
seeing processor-dependent behavior as described by the 
Fortran standard.  I also pointed the individual to the
gfortran documentation where its choice for this processor-
dependent behavior is described.

gfortran's choice differs from Intel Fortran.  The bug
reporter is/was insisting that Intel's choice is the correct
behavior and gfortran was wrong.  He maintains the clock rate
is selected by the type of the first argument to SYSTEM_CLOCK,
where it seems he is unaware of the use of keywords.

As the Fortran standard permits multiple clock rates, it 
seems to me that SYSTEM_CLOCK needs an additional INTENT(IN)
INTEGER argument to select a specific clock, says,

   call system_clock(clk=1, count=cnt)  ! Use clock 1

I suspect the details for such a change are beyond the
scope of an interpretation request.

-- 
Steve


More information about the J3 mailing list