- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have a 1024 character.
i call int x = getcwd(DIR)
dir = "/home/mydirectory/"
If i run the same code, the only difference is, i use the assume nounderscore flag,
dir = "home/mydirectory " with spaces all the way up to 1024.
Why does the flag make a difference? Is there a way i can get the assume nounderscore flag,
make it have the spaces just like without the assume nounderscore flag?
i call int x = getcwd(DIR)
dir = "/home/mydirectory/"
If i run the same code, the only difference is, i use the assume nounderscore flag,
dir = "home/mydirectory " with spaces all the way up to 1024.
Why does the flag make a difference? Is there a way i can get the assume nounderscore flag,
make it have the spaces just like without the assume nounderscore flag?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.
im having to use assume nounderscore since its part of a whole library, i just isolated the problem to this. for some reason also, with the assume nounderscore flag, the value returns is non 0, but with the flag it returns 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.
you were right, i traced both version of the code, one with the assume nounderscore and one without it, and looked at the assembly level calls to getcwd, and they were calling different functions. So i added a underscore to the getcwd call and it worked. Thanks Steve, btw, how was japan?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose that's another way to do it, though it's not what I would recommend. I hope you add a comment explaining it.
Japan was wonderful. Pictures are here - I'm still working on a travelogue.
Japan was wonderful. Pictures are here - I'm still working on a travelogue.

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