Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Ubound gives incorrect result

William_S_1
Beginner
886 Views

The two Dim array should give 29x5, it gives 5x5.

Notice that SIZE does give the correct count = 29*5 =145

0 Kudos
15 Replies
William_S_1
Beginner
886 Views

Why is it that when I uploaded 2 files, it only shows one file ?

Did the other file actually get loaded? It said that it uploaded 2 files.

Dont they test this stuff?

0 Kudos
Steven_L_Intel1
Employee
886 Views

I see only one file. Upload the second one. My guess is that UBOUND is correct but I need to see the rest.

0 Kudos
WSinc
New Contributor I
886 Views

Ok, are we allowed only one file upload per visit?

I will upload the 2nd one later.

But if it displays 2 files when I upload it,

why doesn't it show both to you?

 

actually, it tried to upload the main routine 3 times, and gave a different name to the same file, rather than replacing it.

 

Thats why we see Main, main-1 ,and main-2.

0 Kudos
Steven_L_Intel1
Employee
886 Views

One can upload multiple files and it is done often. I don't know how you tried to do the upload. There are two steps - first you have to select the files and then click "Upload". Yes, it will rename files if there are duplicates (or sometimes even if there aren't.) 

0 Kudos
William_S_1
Beginner
886 Views

WELL, THAT IS EXACTLY WHAT I DID -

I SELECTED TWO FILES TWO BE UPLOADED,

and then said "begin upload." It said two files uploaded. 

But then when I displayed it, it only showed one file.

So what happened to the other file?

I am going to do it again, but this time will put the other

file FIRST in the list.

Now this should have two files attached, according to what I see on the screen for "preview."

0 Kudos
William_S_1
Beginner
886 Views

OK, it did it again. I saw two files on the PREVIEW, but when I display it, it only shows ONE file.

How many files actually got uploaded ?

0 Kudos
William_S_1
Beginner
886 Views

OK, out of sheer desperation, I will upload just one file, lets see what happens then.

This one is called MYFUNCTS.F90

0 Kudos
William_S_1
Beginner
886 Views

One point of confusion -

when you say "upload files" your choices are "NEXT and CANCEL".

Shouldn't it say "DONE?" A minor point, but it could fool some people.

What would be "NEXT?"

0 Kudos
mecej4
Honored Contributor III
886 Views

Uploading and attaching are separate, if related, activities. To attach a file, it is required that the file be present in your file storage area.

If you have files already present in your storage area, you can select and attach them without any uploading; conversely you may upload files without posting a message, or you may post a message without attaching a file.

Files that have been uploaded remain in your file storage area forever, pending Intel's granting users the ability and means to delete uploaded files that are no longer needed.

0 Kudos
Steven_L_Intel1
Employee
886 Views

It uploaded two this time - thanks.

In aver2d, you used UBOUND(a,2). This returns a scalar that is the upper bound of dimension 2. You then assigned this to a two-element array so you got 5 in both elements. What you wanted instead was UBOUND(a).

Next brings you back to the post so you can continue editing.

0 Kudos
William_S_1
Beginner
886 Views

The problem was originally caused by a compiler error when I leave off the 2nd argument (#6366.)

But it does NOT occur for 2d and3d arrays, only 1d arrays.

So I assumed that has to be supplied for a 2d or 3d array. apparently the usage is not consistent.

I am uploading another main program main_48.f90 that includes a 3d array.

and an enhanced version of myfuncts.f90

 

did you get two files this time? It said two files - - 

 

BTW it says "file attachments may not load with IE 8."

But I am using CHROME for my browser.

How do I send a screen shot? I would like you to see what it does.

 

One thing that looks suspicious: The order for one of them says "0"

Is that acceptable?

0 Kudos
William_S_1
Beginner
886 Views

Check out lines 42 and 43, those are related to the compiler issue error 6366.

Of myfuncts_1.f90 that is.

0 Kudos
Steven_L_Intel1
Employee
886 Views

Ok. In the case of aver1d, you have declared lba and uba to be scalars. LBOUND and UBOUND, when DIM is not supplied, return arrays. You're not allowed to assign an array to a scalar.

One fix is to make lba and uba arrays with one element and call LBOUND and UBOUND without the DIM argument. This is probably the best choice as it means the code is pretty much the same other than the rank of the arguments and dimensions of the lba/uba variables.

0 Kudos
William_S_1
Beginner
886 Views

OK I will try that.

It would nice if they gave us better examples.

0 Kudos
Steven_L_Intel1
Employee
886 Views

This is a fundamental aspect of the Fortran language. We provide reference documentation, but aren't trying to teach you Fortran. There are some excellent books out there that do that, the most popular of which is Modern Fortran Explained.

0 Kudos
Reply