Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Mike_Z_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-01-2016
12:10 PM

lbound and ubound

I transfer to the following subroutine array C as argument with bounds (0:450):

subroutine A(B,C)

real*8 B, C(:)

integer LB, UB

...

LB=lbound(C)

UB=ubound(C)

...

end subroutine A

But in fact, lb=1, and ub=451.

What's wrong? I suspect myself...

2 Replies

Highlighted
##

Steven_L_Intel1

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-01-2016
12:38 PM

That's the definition in the

That's the definition in the standard. Think about what LBOUND and UBOUND might be if you passed C([2,17.24,6]) or C(4:45:3). Unless the dummy argument is a pointer and you pass a pointer, LBOUND will always be 1 and UBOUND always the extent of the associated actual argument. (Unless you specify a different lower bound on the dummy, of course.)

Retired 12/31/2016

Highlighted
##

Mike_Z_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-01-2016
01:18 PM

Thank you, Steve!

Thank you, Steve!

For more complete information about compiler optimizations, see our Optimization Notice.