Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmo_get_info return of REAL looks wrong #241

Open
millerta opened this issue Apr 11, 2022 · 2 comments
Open

cmo_get_info return of REAL looks wrong #241

millerta opened this issue Apr 11, 2022 · 2 comments

Comments

@millerta
Copy link
Collaborator

millerta commented Apr 11, 2022

A few strange things.

REAL value is being assigned to returning ipout as integer value.
Is this intentional (and will give wrong values)
or just never used and never noticed?
I removed the nint() for REAL, it might have come from cmo_get_intinfo code copy.

cmo_get_info() returns mesh object values correctly for INT, VINT, and VDOUBLE
but fails for REAL values such as epsilonl

Note this should be resolved, but for now is just a user caution.
lagrit codes do not use cmo_get_info to get REAL values from mesh object.
Instead codes use cmo_get_attinfo()

@millerta
Copy link
Collaborator Author

cmo_get_info is used throughout lagrit codes to get mesh data for both integer and real8 memory arrays including imt1 and xic. It is also used to return integer values such as nnodes and nelements. All through argument declared as:
pointer (ipout,out) real
8 out(*)

cmo_get_info works
for arguments defined as pointer (ipout,out) real8 out() for memory arrays VINT and VDOUBLE
for arguments passed as integer and returning INT
but gets wrong result passed as real8 or real8 pointer returning REAL

Correct result for INT nnodes where ipout is called with integer iout:

 Size of cmo_get_info parameters.
 cray pointer ipout:        8
 return nnodes:             27
ilen,ityp,ierr:     1    1       0

Wrong result for REAL epsilonl where ipout is called as real8 or pointer (ipout,out) real8 out(*)

cray pointer ipout:        8
value :    1.9229626863835638E-013
ilen,ityp,ierr:    1     2     0

@millerta
Copy link
Collaborator Author

cleaned code and changed to avoid multiple line calculations by using variable iindex.
The values within cmo_get_info for REAL look good in print statements, but returned value outside routine is garbage.

cmo_get_info REAL ------------------------------
 REAL cmo_get_info: xmax
 mmfindbk icscode :                     0
 attparam:    1.5000000000000000
 out val :                     1
 lout,itype:                   1                 2

return: xmax: real*8 xreal   4.9406564584124654E-324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant