- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any allocatation size limit for allocatable variables ? In my program alloc variable(KV) is declaraed as follows in the body of program:
[bash]INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15) INTEGER::............. REAL(iwp)::................. -----------------------dynamic arrays------------------------------------ INTEGER,ALLOCATABLE::................... REAL(iwp),ALLOCATABLE::.........km(:,:),kv(:)[/bash]
and later in program allocation for that variable is performed in that form:
[bash]ALLOCATE(kv(kdiag(neq)))[/bash]so the weirdness is that : When I try to debug step by step I found that kv variables size is limited to 1000 nodes, where it should be 1492.
Any help in advance will be appreciated!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more thing, after running program succesfully (w/o not complaints from compiler) in outputs, probably due toill-conditioned source code or really is something wrong with code, almost all of them is NaN. It is hard for me to spot where actually vars, argsetc are getting the NaN value, but I've break it down to the malfunctioning subroutine. My question, before delving deep down, what isactually causing the variables getting NaNs?
---division by zero
--- uninitialized variable
---
Kind Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can try this - set the project property Fortran > Floating Point > Floating Point Exception Handling to "Underflow gives 0.0; Abort on other IEEE exceptions (/fpe:0)". This may give you an error at the point where a NaN is introduced.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've introduced a negative value check to eliminate that. Which still leaves, worm gnawing in my heart that I'm altering whole algorithm and this is the cause for the wrong outputs.SQRT of a negative value is another.
Ihave also seen datatype mismatches across calls cause this.
Is that Intel VF or MS VStudio issue? by chance Check Routine Interfacesis correct Yes (/warn:interfaces)
By chance I got that Floating Point Exception Handling set to correct as well (/fpe:0)
Actually it's a structural eng. FEM analyse program, and these are the FEM linear equation solutions, and I'm getting the error exactly when trying to reduce the global stifness matrix. Most of the gurus say that I should never get the negative value in Cholesky factorisation( which is stil unclear for me, so many lines todebug) if so then my input data is ill-organized and error prone. I'm not the original writer so I'm not even sure that error isbefore the global stifness formations formation subroutines or after that.
Kind Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you identify the particular operation that is resulting in a NaN?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]IMPLICIT NONE INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15) REAL(iwp),INTENT(IN)::kv(:) REAL(iwp),INTENT(IN OUT)::loads(0:) INTEGER,INTENT(IN)::kdiag(:) INTEGER::n,i,ki,l,m,j,it,k REAL(iwp)::x n=UBOUND(kdiag,1) loads(1)=loads(1)/kv(1) DO i=2,n ki=kdiag(i)-i l=kdiag(i-1)-ki+1 x=loads(i) IF(l/=i)THEN m=i-1 DO j=l,m x=x-kv(ki+j)*loads(j) END DO END IF loads(i)=x/kv(ki+i) ! I THINK IT'S HERE BUT NOT SURE END DO[/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...
loads(1)=loads(1)/kv(1)
...
and use of loads(?) elsewhere
loads is declared with lower bound of 0
yet, on cursory look at the code, it appears that you are using a lower bound of 1
Is this a problem, or a misunderstanding on my part?
If you are inconsistent on the lower bound, you may very well generate/use junk data which may generate NaN's (in addition to incorrect results).
Jim Dempsey

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