"my" error ist the same, but ONLY when I call CFX subroutines like SET_A_0, ERRMSG, MESAGE etc. Is this correct? I am just trying to get a clear picture of what's happening, so I haven't tried anything yet. Ok so if that is true then you are saying we just need to (whenever calling a CFX utility routine) replace all of the variable length string arguments with fixed width arguments, and insert those string lengths (integers) as makeshift hidden arguments after every argument that is expected to be a variable string. So we have a problem because the subroutines we are calling expect that string lengths immediately follow strings, and there are no gfortran compiler options to tell gfortran to pass the hidden string lengths in a different way. Everything works well if the subroutine and the calling code are compiled with gfortran. When the calling code is compiled it also writes the instructions to append the string lengths (calculated at runtime) to the end of the list. Whenever the gfortran compiler encounters a variable length character string in an argument list, it does something similar except it appends the hidden string length list to the end of the argument list. If an intel compiler also compiles the calling code for the routine it will write instructions to calculate the length of the string that is being passed (at run time), and pass that length argument immediately following the string itself. Whenever the intel compiler encounters a variable-length character string in an argument list for a subroutine, it writes the machine instructions so that the length of the string is passed as an additional (hidden) variable which immediately follows the string itself. I am trying to understand the consequences, so please confirm my thinking or correct me if I'm wrong: I also changed the CRESULT argument length to fixed to satisfy the compiler. Your theory about the string lengths is intriguing. I assume this is the same segmentation fault that you have run into. | Signal caught: Segmentation violation | | ERROR #001100279 has occurred in subroutine ErrAction. Whenever I try and run something that uses the CFX utility routines I get the error: I'm on windows 7 64-bit with an Intel i7 cpu. I have been doing some testing and it has not been successful. The key to solve the entire problem is the correct number and order of the passed arguments, their bytelength I think is always 4 (pointer or integer)įor double precision in your ccl fflags should be the same plus -fdefault-real-8 You may verify if you include an additional arg NLNG after CRESLT and declare as INTEGER,VALUE :: NLNG. Whereas the -iface:qvf gives them immedeately following the string arg.Īs a consequence the different arg order or hidden additional args mess up the processor stack, which does not matter as long as these are not used in your program. In gfortran there is no such switch, I read somewhere, that the hidden strings lengths are appended to the argument list. The compiler argument -iface:qvf of Intel Fortran influences the order how the hidden length values are passed. The reason for it -I assume- is the different handling of character arguments. One thing that gave me a hint was that one has to change the definition of argument CRESLT form CHARACTER*(*) to fixed length. I did some further research, as my code crashes with segmentation fault, when using one of the CFX routines like SET_A_0, MESAGE etc. Yes the set_a_0 stuff is not needed, if it is not used.įirst: Does the example run in CFX? And what is your system when you use solver-hpmpi.lib? Time Integration itself can be done more consitently in the solver itself: Customize the paths in compile.bat to your paths and run it. In a DOS-Box (best with \bin in the PATH variable) 'cd' to the directory where you unpack the zip to. You need a installation of TDM64-GCC 4.8.1-3, include gfortran. Works in my environment ANSYS CFX 14.5.7 both single and double precision, no idea whether it works distributed, partitioned etc. And prohibit adding underscores to function names. The essential thing is to provide upper case aliases for the lowercase function names of Mingw, as CFX expects them in uppercase despite they appear lowercae in CFX-Pre. It is enough for storing a previous value, doing time integration or calculting a derivative of an expression. At least I succeded in implementing some subroutines with simple arithmetic, not using any of the CFX internal calls. It is a little tricky as the systems are not compatible concerning function names. As the fortran environment is complex and expensive I did some research (to be honest: more trial-and-error) with free Mingw64. When looking for a means for doing time integration of a expression, I read a little into user fortran. User Fortran with CFX 14.5.7 on winnt_amd64 - CFD Online Discussion Forums
0 Comments
Leave a Reply. |