hexagon logo

Yet Another Legacy Fortran Question

O Learned Denizens, I humbly prostrate myself before your collected wisdom, as ever.
 
I want to compile some legacy Fortran for a user TYR501 that I successfully compiled as recently as 2019. I note with interest that Intel decline to sell me anything other than "oneAPI" these days. I further note that MSC insists I use Intel Fortran XE 2019 Update 4. This dance happens every time and is becoming tedious.
 
But enough whining.
 
I note that Microsoft Visual Studio 2017 Community Edition is free and will successfully compile and link sample routines like sfosub.c provided with the installation. Interestingly it still seems to call some Intel Fortran libraries, but that's a topic for another day.
 
So, it occurs to me that sooner or later I need to get myself out of the 1970s and move to C. However, I am not seeing any sample code for TYR501 and/or RPF501 in C (though the fortran examples are still there).
 
Is there a TYR501 C example anywhere? Any pointers in generating one?
 
Damian
  • c'mon Damian. What you really need at CEE is not Fortran or C on Windows but FTire Sunglasses
  • I think the TYR501 is the most outdated code I stumbled across in the last 20 years or so.
    (I admit still keeping it as a reference for a tire usersub)
    There wouldn't be a big problem to C'ify the Fortan code, if it was pure Fortan.
    Unfortunately there's a lot of stuff that's acar solver utilities like fialafx and as long as nobody tells you the excat calling sequence for C, you'd be pretty lost.
     
    Nevertheless:
    All "free" compilers have culprits and/or involve a lot of hacks to make them work.
    The least pricey solution is to bite the bullet for a Intel Parallel Studio & Visual Studio.
    Using these, you can still compile "old" Fortan sources on windows.
    Last time I ran that was 5 min ago to compile our plugin solvers for brand new ADAMS 2021.1.
     
    How abvout MSC offering a compiling service for their customers ?
    At least over here it's easier to spend 10k on a consulting contract than getting 200 bucks to buy a compiler license.
  • Thanks for your candour, Martin, appreciated as ever. :-)
     
    On the Intel side, I can't see how to square the version available from Intel ("oneAPI") and the version required by MSC (XE 2019 Update 4). Previously I was able to download legacy versions but I can't see that capability any more - is it there but I just need to look harder?
  • Dunno. My machine is about 3 years old, so I'm lucky to thave a 3 year old Intel Parallel Studio XE2016 which still works even for the latest ADAMS version.
    Ask again at the end of 2021, when it'll be exchanged with a new one. Then I'll have exactly your problem, too.
     
    I agree that getting the "right" Version is a major PITA and once again I only can advise MSC to become a reseller for these dreaded compiler stuff and to deliver them with their ADAMS distributions on demand.
  • OK, I can report that Intel oneAPI as currently downloaded from their website successfully compiles and links the legacy code. It was less traumatic than it has been in the past:
     
    • Download Microsoft Visual Studio 2017 and install (note that this is all you need to compile the sample subroutines in C)
    • Download and install Intel oneAPI Base Toolkit
    • Modify (under "Apps and features" in Windows 10) the installation to connect it with VS2017
    • Download and install Intel oneAPI HPC Toolkit
    • Modify (under "Apps and features" in Windows 10) the installation to connect it with VS2017
     
    At this point you're ready to go:
     
    "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
     
    (sets up the compilation target architecture to suit the current machine - all that 32/64 nonsense is gone)
     
    "C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64\ifort.exe" /c /Ob2 /MD /Gm tyr501Harty_2013.f
    "C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\bin\intel64\ifort.exe" /c /Ob2 /MD /Gm rpf501Harty_2013.f
     
    dir /b *.obj > build.lst
     
    "C:\Program Files\MSC.Software\Adams\2021_0_1_784690\common\mdi.bat" cr-us n @build.lst HTire501_2013.dll
     
    copy HTire501_2013.dll "C:\Program Files\MSC.Software\Adams\2021_0_1_784690\win64"
     
    Tested with all my normal regression tests and, right or wrong, the model returns what it always did. This note is as much for future Damian as anyone else. ;-)
     
    My next step is to wait for the trial license to expire to see if I *really* need to buy the compiler. I think having 30+GB of developer environment is enough of a cost...