msg-byu / symlib

Spacegroup finder. Includes symmetry-related routines for cluster expansion and other codes that rely on symmetries of lattices and crystals.
MIT License
12 stars 15 forks source link

Non standard function outputs in rational_mathematics.f90 and utilities.f90 #2

Closed wsmorgan closed 9 years ago

wsmorgan commented 9 years ago

In rational_mathematics.f90 the gcd functions don't return their own name, i.e. the have no type, but instead return an integer divisor. In utilities.f90 the ralloc functions have no type since the real output for comparison is the pointer p. In either case fortpy can't compile an executable because it tries to save the function to a variable of the same type.

glwhart commented 9 years ago

They do have return types---look at the types specified for the result. The syntax may be a little different than what you are used to but they are specified

wsmorgan commented 9 years ago

This is actually a fortpy issue, I can tell that the function gcd_2ints returns divisor which has a type of integer. The problem is that fortpy does'n know that. It tries to create a variable fpy_gcd_2ints and give it the same type as the function gcd_2ints, since the function doesn't have a variable of that name fortpy can't find the appropriate type to give it's variable fpy_gcd_2ints. It defaults to giving the new variable no type and can't compile/run the unit test. This comment was mostly to keep track of where errors like this are holding us up so that we can fix the unit tests once fortpy's support for them improves.

Wiley Morgan http://hagrid.byu.edu/Wiley#Bio

On Wed, May 27, 2015 at 3:07 PM, Gus Hart notifications@github.com wrote:

They do have return types---look at the types specified for the result. The syntax may be a little different than what you are used to but they are specified

— Reply to this email directly or view it on GitHub https://github.com/msg-byu/symlib/issues/2#issuecomment-106076792.