Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Is this legal?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Salvatore  
View profile  
 More options May 29 2008, 10:07 am
Newsgroups: comp.lang.fortran
From: Salvatore <sfilipp...@uniroma2.it>
Date: Thu, 29 May 2008 07:07:47 -0700 (PDT)
Local: Thurs, May 29 2008 10:07 am
Subject: Re: Is this legal?
Before someone asks, the error is about the renaming of the specific
versions of foobar
as in
use foo_mod, protect => s_foobar

all three compilers support ALLOCATABLEs in derived types as per
tr15581
Thanks

On 29 Mag, 16:03, Salvatore <sfilipp...@uniroma2.it> wrote:

> Hi,
> subject says all: is the attached code legal? two compilers accept it,
> one does not.

> Thanks
> Salvatore
>  ---------------------------------------- usemod2.f90
> -------------------
> module s_type_mod
>   type s_foo_type
>     real(kind(1.e0)), allocatable :: v(:)
>   end type s_foo_type
> end module s_type_mod
> module s_foo_mod
>   use s_type_mod
>   interface foobar
>     subroutine s_foobar(x)
>       use s_type_mod
>       type(s_foo_type), intent (inout) :: x
>     end subroutine s_foobar
>   end interface
> end module s_foo_mod

> module d_type_mod
>   type d_foo_type
>     real(kind(1.d0)), allocatable :: v(:)
>   end type d_foo_type
> end module d_type_mod

> module d_foo_mod
>   use d_type_mod

>   interface foobar
>     subroutine d_foobar(x)
>       use d_type_mod
>       type(d_foo_type), intent (inout) :: x
>     end subroutine d_foobar
>   end interface
> end module d_foo_mod

> module foo_mod
>   use s_foo_mod
>   use d_foo_mod
> end module foo_mod

> subroutine s_foobar(x)
>   use foo_mod, protect => s_foobar
>   type(s_foo_type), intent (inout) :: x

>   if (.not.allocated(x%v)) allocate(x%v(10))
> end subroutine s_foobar

> subroutine d_foobar(x)
>   use foo_mod, protect => d_foobar
>   type(d_foo_type), intent (inout) :: x

>   if (.not.allocated(x%v)) allocate(x%v(10))
> end subroutine d_foobar

> program test
>   use foo_mod
>   type(d_foo_type) :: z

>   call foobar(z)

> end program test


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.