(j3.2006) f08/0079 example 2

Bill Long longb
Thu Sep 20 17:25:43 EDT 2012



On 9/20/12 12:39 AM, Malcolm Cohen wrote:
>> The beginning of the code for Q2 in f08/0079 is
>>
>>    Module m198_002b
>>      Use Iso_Fortran_Env
>>      Type t(p)
>>        Integer,Kind :: p
>>        Real(Selected_Real_Kind(p)) c
> ...
>>      Subroutine fwrite_t(dtv,unit,iotype,v_list,iostat,iomsg)
>>        Class(t),Intent(In) :: dtv
>> .....
>>
>>
>> Doesn't the t in class(t) in the last line need to have a kind type
>> parameter specified?
>
> Yes.  Judging by the main program unit immediately following, it should be
> Class(t(6)).
>
> BTW, Q4 seems to have the same problem with a length type parameter, it looks
> like that one should be Class(t(*)).

Getting farther, it seems there are more typos in the test cases:

in Q2:

Allocate(x, Source=t(6)(1.5)      !  B

is missing a ) after the (1.5).

in Q3:

Allocate(x, Source=t(6)(1.5)      !  B

is missing a ) after the (1.5).

in Q4:

Allocate(x,Source=t(1,[15]))     ! B

should be

Allocate(x,Source=t(1)([15]))

- original was missing the type parameter because of wrong syntax.

Cheers,
Bill

>
> Cheers,
>

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





More information about the J3 mailing list