(j3.2006) (SC22WG5.5253) J3/14-168 for meeting #204: F2015: allow non-default kinds in arguments to intrinsics

Lionel, Steve steve.lionel
Mon Jun 9 09:22:36 EDT 2014


Here's my take on these questions:

RANDOM_SEED(SIZE=K) would return the number of integers of kind K.

RANDOM_SEED should not accept scalars, that's somewhat non-portable unless
we're going to redefine the arguments as being assumed-rank. It's also a
needless complication in use.

As for changing the kinds, I assume that RANDOM_SEED would just interpret
the storage in whatever kind it really wants. It's not as if the user has
visibility into the internal algorithm used and can carefully pick the
seeds. (Or if they think they can do that, I don't want to use their
application.)

Steve

-----Original Message-----
From: j3-bounces at mailman.j3-fortran.org
[mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of Bill Long
Sent: Monday, June 09, 2014 8:41 AM
To: robert.corbett at oracle.com; fortran standards email list for J3
Subject: Re: (j3.2006) (SC22WG5.5253) J3/14-168 for meeting #204: F2015:
allow non-default kinds in arguments to intrinsics


On Jun 9, 2014, at 6:25 AM, Robert Corbett <robert.corbett at oracle.com>
wrote:

> Would RANDOM_SEED(SIZE=K) return the number of default integers the 
> processor uses to hold the value of the seed?


Good question.  The options that come to mind first are either default
integer, or integer of the same kind as KIND(K).  But something needs to be
said, since the meaning of N is otherwise ambiguous.   It would be
convenient to have it be KIND(K) integers for the arrays since one assumes
that is how you would be declaring the arrays for PUT and GET.  And that
avoids the current silliness of splitting the seeds in half and storing each
half in a default integer.  Which raises another question of whether we
should also allow scalar arguments for GET and PUT.  Similar to Bob's
original question:  What happens if the user calls RANDOM_SEED with a GET
array of kind=4, later copies the values to another array of kind=8, and
then calls again with the new array as the PUT argument?  Or what happens if
the user calls with kind=2 or kind=1 integer arrays for GET/PUT?   A careful
implementation could work around all these issues, but is it worth the
benefit to the user?


Cheers,
Bill

> 
> Robert Corbett
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long
longb at cray.com
Fortran Technical Suport  &                                  voice:
651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101


_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6616 bytes
Desc: not available
Url : http://mailman.j3-fortran.org/pipermail/j3/attachments/20140609/d55c0013/attachment.bin 



More information about the J3 mailing list