|
[Sponsors] |
Compiling User Fortran with CFX 14.0 on Win64 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 20, 2013, 11:12 |
Compiling User Fortran with CFX 14.0 on Win64
|
#1 |
Member
JESS
Join Date: Nov 2010
Posts: 31
Rep Power: 16 |
I installed Microsoft Visual Studio 2012 and Intel Visual Fortran Composer XE 2013 on my PC.
I try to compile the TStat_Control.F (No.19 in tutorial file). I have added the enviroment variables as below: include: C:\Program Files (x86)\Intel\Composer XE 2013\compiler; C:\Program Files (x86)\Intel\Composer XE 2013\compiler\include\intel64 lib: C:\Program Files (x86)\Intel\Composer XE 2013\compiler\lib; C:\Program Files (x86)\Intel\Composer XE 2013\compiler\lib\intel64 path: C:\Program Files\ANSYS Inc\v140\CFX\bin; C:\Program Files (x86)\Intel\Composer XE 2013\bin; C:\Program Files (x86)\Intel\Composer XE 2013\bin\intel64; C:\Program Files (x86)\Intel\Composer XE 2013\redist; C:\Program Files (x86)\Intel\Composer XE 2013\redist\intel64; C:\Program Files (x86)\Intel\Composer XE 2013\redist\intel64compiler; C:\Program Files (x86)\Intel\Composer XE 2013\redist\intel64\mkl; C:\Program Files (x86)\Intel\Composer XE 2013\redist\intel64\mpirt; Then I run the "C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars" in command line, it appears: Then I type the following command in the Command Editor dialog box ! system ("cfx5mkext TStat_Control.F") == 0 or die "cfx5mkext failed"; The error message is like this: /*ERROR CCL parser failed with message: Perl Syntax errors detected: cfx5mkext failed at (eval 103) line 1.*/ Can someone help me ? Thanks a lot. |
|
December 20, 2013, 11:49 |
|
#2 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
2. Open Command Line (Tools -> Command Line) 3. Inside Command Line execute: call "C:\Program Files (x86)\Intel\Composer XE 2013\bin\ifortvars" Intel64 4. Inside Command Line change directory to that where your source file is located. 5. Execute cfx5mkext <your_source_file_name>.F |
||
December 20, 2013, 21:38 |
|
#3 | |
Member
JESS
Join Date: Nov 2010
Posts: 31
Rep Power: 16 |
Quote:
I do it in steps as you told me. A warning message is shown in the pic underlined with red color. Is this OK? Last edited by Raijin Thunderkeg; December 21, 2013 at 08:59. |
||
December 20, 2013, 22:57 |
|
#4 | |
Member
JESS
Join Date: Nov 2010
Posts: 31
Rep Power: 16 |
Quote:
Last edited by Raijin Thunderkeg; December 21, 2013 at 09:09. |
||
December 23, 2013, 16:03 |
|
#5 |
Senior Member
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18 |
Hey guys,
When I want to compile my fortran code in command editor I also receive this message. Seems that you have resolved it before. I am running CFX on a linux machine. p, li { white-space: pre-wrap; } ERROR CCL parser failed with message: Perl Syntax errors detected: cfx5mkext failed at (eval 106) line 1. Any ideas? |
|
May 14, 2015, 08:36 |
Fortran Compiler error
|
#6 |
Senior Member
sunil
Join Date: Jul 2012
Location: Bangalore
Posts: 179
Rep Power: 14 |
Hi,
I am trying to simulate Air conditioning simulation tutorial 19.I have installed visual studio 2015 and intel FORTRAN compiler. when i run "C:\Program Files (x86)\Intel\Composer XE 2015\bin\ifortvars.bat" from CFX command editor i get following error ERROR CCL parser failed with message: invalid object type ""C": leading character must be alphabetic or '_' and when i run cfx5mkext TStat_Control from the windows command prompt it again gives some error and i am unable to generate .dll file for my simulation. I have attached error message, please help me to solve this problem |
|
December 15, 2015, 04:43 |
|
#7 | |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Quote:
Working through tutorial 19, I have the same problem. Asking Google and searching through the forum, I've tried a lot of things but still can't compile the example-sorce code TStat_Control.F. I'm working on a win7 64bit machine with ANSYS 15. The Visual Fortran Compiler XE 12.0 is installed. Processing the command ! system ("cfx5mkext TStat_Control.F") == 0 or die "cfx5mkext failed"; in Command Editor gives me the error: ERROR CCL parser failed with message: Perl Syntax errors detected: cfx5mkext failed at (eval 548) line 1. Processing the command call "C:\Program Files (x86)\Intel\ComposerXE-2011\bin\ifortvars" Intel64 in Command Editor gives me the error: ERROR CCL parser failed with message: invalid object type "call "C": contains invalid character '"' Do I have to add any "enviroment variables" like Raijin Thunderkeg did? If yes, where? Do I have to make any changes in cfx5mkext.ccl? Please, can anyone help me? I'm dealing with this problem for days now. Best Regards, Emil |
||
December 15, 2015, 06:09 |
|
#8 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
|
||
December 15, 2015, 06:18 |
|
#9 | |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Quote:
Executing the ifortvars.bat in this window works. But I'm getting still the same error. I think the Environment variables are missing. Where and how do I have to set them? Edit: I've tried to add the Environment variables, therefore I typed into the command line (is this correct???): set include=C:\Program Files (x86)\Intel\ComposerXE-2011\compiler;C:\Program Files (x86)\Intel\ComposerXE-2011\compiler\include\intel64 set lib=C:\Program Files (x86)\Intel\ComposerXE-2011\compiler\lib;C:\Pr...... set path=C:\Prog.............. now the error after trying to compile is : ERROR CCL parser failed with message: Perl Syntax errors detected: cfx5mkext failed at (eval 14) line 5. Thanks for your help! |
||
December 15, 2015, 09:20 |
|
#10 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
||
December 15, 2015, 09:40 |
|
#11 | |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Quote:
I started CFX-Pre and used command Editor for compiling, as described in the tutorial. Now I've checked your recommended procedure: executing the ifortvars.bat and cfx5mkext TStat_Control.F, both in command line. In the attached Picture you can check the procedure an see the error. EDIT 2: I think I finally got it now!!!!! it works without error, I added Intel64 after the ifortvars.bat command and tried to compile again. In the working Directory the Folder winnt-amd64 was created. The ...dll file is the Thing I Need, correct? Do I Need the other filles ( .manifest .exp .lib .o ) as well? thanks a lot!!! Last edited by CFXNewbie; December 15, 2015 at 10:45. |
||
December 15, 2015, 11:31 |
|
#12 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
||
December 17, 2015, 07:57 |
|
#13 |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Thank you again for your answer.
After compiling some example-routines, unfortunately I have an other problem now. First of all, I want so start with a Routine which just gives one argument-value back. Therefore I copied the ucf_template.F. I didn't change anything but the calling name, filename and some comments. The code Looks like this: #include "cfx5ext.h" dllexport(sourcetest) SUBROUTINE SOURCETEST ( & NLOC, NRET, NARG, RET, ARGS, CRESLT, CZ,DZ,IZ,LZ,RZ ) C INTEGER NLOC,NARG,NRET C CHARACTER CRESLT*(*) C REAL ARGS(NLOC,NARG), RET(NLOC,NRET) C INTEGER IZ(*) CHARACTER CZ(*)*(1) DOUBLE PRECISION DZ(*) LOGICAL LZ(*) REAL RZ(*) C C Send any diagnostic messages via master process. CALL MESAGE( 'WRITE','Hello World!' ) C C Initialise RET(1:NLOC*NRET) to zero. CALL SET_A_0( RET, NLOC*NRET ) C C Copy first argument ARGS(1:NLOC,1) to RET(1:NLOC,1). CALL SET_A_B( RET, ARGS, NLOC ) C C Set success flag. CRESLT = 'GOOD' C C================================================= ====================== END If I insert the subroutine like this: gives me the following error (code 2) after starting the solver in workbench, although I didn't use the Routine anywhere in my modell so far. If I delete the Routine, the modell works as it did before. Any Ideas? EDIT: error in out file is: +================================================= ===================+ | ****** PROBLEM REPORT ****** | |--------------------------------------------------------------------| | Subsystem: Input and Output | | Subroutine name: ErrAction | | Severity level: Fatal Error | | Error message number: 001100279 | |--------------------------------------------------------------------| | Message: | | | | Unable to find library winnt-amd64/double/testreibw.dll on path "- | | D:\Benutzer\feld24\grob151125_pending_tasks\dp0_CF X_Solution-1\wi- | | nnt-amd64" | | | | | | | +================================================= ===================+ +================================================= ===================+ | ****** PROBLEM REPORT ****** | |--------------------------------------------------------------------| | Subsystem: Input and Output | | Subroutine name: ErrAction | | Severity level: Fatal Error | | Error message number: 001100279 | |--------------------------------------------------------------------| | Message: | | | | USER ROUTINE: sourcetry could not be loaded. Please check the Lib- | | rary Path, Library Name and Calling Name. For FORTRAN user routin- | | es, the Calling Name should be in lower case. | | | | | | | +================================================= ===================+ +================================================= ===================+ | ****** PROBLEM REPORT ****** | |--------------------------------------------------------------------| | Subsystem: Input and Output | | Subroutine name: ErrAction | | Severity level: Fatal Error | | Error message number: 001100279 | |--------------------------------------------------------------------| | Message: | | | | Stopped in routine UR_REGISTER | | | | | | | | | | | +================================================= ===================+ how can I compile with command line for double precision? Thanks a lot! Last edited by CFXNewbie; December 17, 2015 at 10:09. |
|
December 17, 2015, 10:08 |
|
#14 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
||
February 11, 2016, 08:03 |
|
#15 |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Thanks a lot for your help again! I've managed to run my subroutine now successfuly.
But I've got an other Problem now. In each iteration loop (im doing a steady state simulation) the solver is calling the subroutine many many times. As my routine is only calculating on single scalar value as a function of a temperature wich is a result of the cfx-calculation, it would be enough to call the subroutine once per iteration loop (as the calculated value is always the same). In terms of saving computing time, is there a posibility to call the subroutine only once per iteration loop? The same modell (same mesh) using Expressions (in CFX-Pre) ist about 25% faster than using the subroutine. As my task is to replace the confusing expressions by a subroutine, I cannot go back and use expressions. I've tried to use a junction box routine with location "Start of Coefficient Loop: Called at the start of each iteration loop. For a transient run, this relates to the inner loop.", but this isn't changing anything. Any ideas? Thanks a lot!! A part out of the *.out file looks like this: ================================================== ==================== OUTER LOOP ITERATION = 1 CPU SECONDS = 4.289E+02 ---------------------------------------------------------------------- | Equation | Rate | RMS Res | Max Res | Linear Solution | +----------------------+------+---------+---------+------------------+ | Wallscale-Luft | 0.00 | 6.1E-03 | 2.8E-02 | 10.4 4.6E-02 OK| +----------------------+------+---------+---------+------------------+ | Wallscale-Bulk-Oelra | 0.00 | 6.2E-03 | 1.7E-02 | 14.7 4.0E-02 OK| +----------------------+------+---------+---------+------------------+ | U-Mom-Luft | 0.00 | 1.1E-06 | 5.9E-05 | 1.2E+01 F | | V-Mom-Luft | 0.00 | 2.0E-02 | 2.1E-01 | 4.6E-03 OK| | W-Mom-Luft | 0.00 | 2.0E-02 | 2.1E-01 | 4.0E-03 OK| | P-Mass-Luft | 0.00 | 3.4E-11 | 4.1E-10 | 41.5 4.6E+01 F | +----------------------+------+---------+---------+------------------+ | U-Mom-Bulk-Oelraum | 0.00 | 1.2E-06 | 1.1E-05 | 1.6E+01 ok| | V-Mom-Bulk-Oelraum | 0.00 | 1.6E-02 | 1.8E-01 | 1.1E-02 ok| | W-Mom-Bulk-Oelraum | 0.00 | 1.6E-02 | 1.8E-01 | 9.4E-03 OK| | Mass-OelInOelraum-Oe | 0.00 | 8.8E-05 | 7.0E-04 | 5.1E-03 OK| | Mass-LuftInOelraum-O | 0.00 | 3.6E-04 | 4.5E-03 | 23.6 5.5E-03 OK| +----------------------+------+---------+---------+------------------+ Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" Call Subroutine "ReibwaermeModell" | H-Energy-Luft | 0.00 | 3.2E-02 | 5.6E-01 | 8.5E-02 OK| | T-Energy | 0.00 | 1.7E-02 | 4.8E-01 | 8.5E-02 OK| | H-Energy-OelInOelrau | 0.00 | 4.5E-08 | 2.1E-06 | 8.5E-02 OK| | H-Energy-LuftInOelra | 0.00 | 6.0E-08 | 1.2E-06 | 15.5 1.3E+03 ok| +----------------------+------+---------+---------+------------------+ | K-TurbKE-Luft | 0.00 | 3.5E-02 | 1.2E-01 | 5.7 2.1E-03 OK| | O-TurbFreq-Luft | 0.00 | 7.3E-02 | 1.0E+00 | 10.2 6.3E-03 OK| +----------------------+------+---------+---------+------------------+ | K-TurbKE-Bulk-Oelrau | 0.00 | 3.2E-02 | 1.2E-01 | 10.0 1.2E-02 OK| | O-TurbFreq-Bulk-Oelr | 0.00 | 7.1E-02 | 1.0E+00 | 8.4 2.9E-02 OK| +----------------------+------+---------+---------+------------------+ Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 2 Call Subroutine "ReibwaermeModell" Slave: 3 Call Subroutine "ReibwaermeModell" Slave: 3 Call Subroutine "ReibwaermeModell" Slave: 3 Call Subroutine "ReibwaermeModell" Slave: 3 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 4 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 5 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" Slave: 6 Call Subroutine "ReibwaermeModell" ================================================== ==================== OUTER LOOP ITERATION = 2 CPU SECONDS = 1.826E+03 |
|
February 11, 2016, 08:52 |
|
#16 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
Every Partition of your Simulation is calling the subroutine. To prevent this you can get the parallel information and only let the master node call your subroutine; i.e.:
CALL GET_PARALLEL_INFO('PARMOD',PARTIT,CNAME,CRESLT) IF(PARTIT==1) THEN |
|
February 11, 2016, 08:59 |
|
#17 | |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Quote:
Thanks a lot for your answer! where in my code do I have to apply this? My fist test doing it before executional statements gives the following error in the *.out file: ================================================== ==================== OUTER LOOP ITERATION = 1 CPU SECONDS = 3.604E+02 ---------------------------------------------------------------------- | Equation | Rate | RMS Res | Max Res | Linear Solution | +----------------------+------+---------+---------+------------------+ | Wallscale-Luft | 0.00 | 6.1E-03 | 2.8E-02 | 10.4 4.6E-02 OK| +----------------------+------+---------+---------+------------------+ | Wallscale-Bulk-Oelra | 0.00 | 6.2E-03 | 1.7E-02 | 14.7 4.0E-02 OK| +----------------------+------+---------+---------+------------------+ | U-Mom-Luft | 0.00 | 1.1E-06 | 5.9E-05 | 1.2E+01 F | | V-Mom-Luft | 0.00 | 2.0E-02 | 2.1E-01 | 4.6E-03 OK| | W-Mom-Luft | 0.00 | 2.0E-02 | 2.1E-01 | 4.0E-03 OK| | P-Mass-Luft | 0.00 | 3.4E-11 | 4.1E-10 | 41.5 4.6E+01 F | +----------------------+------+---------+---------+------------------+ | U-Mom-Bulk-Oelraum | 0.00 | 1.2E-06 | 1.1E-05 | 1.6E+01 ok| | V-Mom-Bulk-Oelraum | 0.00 | 1.6E-02 | 1.8E-01 | 1.1E-02 ok| | W-Mom-Bulk-Oelraum | 0.00 | 1.6E-02 | 1.8E-01 | 9.4E-03 OK| | Mass-OelInOelraum-Oe | 0.00 | 8.8E-05 | 7.0E-04 | 5.1E-03 OK| | Mass-LuftInOelraum-O | 0.00 | 3.6E-04 | 4.5E-03 | 23.6 5.5E-03 OK| +----------------------+------+---------+---------+------------------+ +--------------------------------------------------------------------+ | ERROR #001100279 has occurred in subroutine ErrAction. | | Message: | | Signal caught: Segmentation violation | | | | | | | | | | | +--------------------------------------------------------------------+ +--------------------------------------------------------------------+ | ERROR #001100279 has occurred in subroutine ErrAction. | | Message: | | Stopped in routine FPX: SIG_HANDLER | | | | | | | | | | | +--------------------------------------------------------------------+ +--------------------------------------------------------------------+ | An error has occurred in cfx5solve: | | | | The ANSYS CFX solver exited with return code 1. No results file | | has been created. | +--------------------------------------------------------------------+ End of solution stage. +--------------------------------------------------------------------+ | The following user files have been saved in the directory | | D:/Benutzer/feld24/20160202/sehrgrob20160121_pending_tasks/dp0_CF- | | X_Solution/Fluid Flow CFX_030: | | | | mon | +--------------------------------------------------------------------+ This run of the ANSYS CFX Solver has finished. |
||
February 11, 2016, 12:42 |
|
#18 |
Senior Member
Join Date: Jun 2009
Posts: 1,878
Rep Power: 33 |
Do you understand the fundamentals of how ANSYS CFX discretize the equations? If you read the documentation, you will notice that user subroutines are called on demand on group of elements or faces the software creates.
You can tell what group is the subroutine is called for. See USER_CALC_INFO documentation, and add the information returned to your print statements. The above applies to parallel and serial simulations. For parallel simulations, the software should only call the user subroutines on the partitions where the information is required. Bypassing the required values for such call will only corrupt the simulation because those partitions will have incomplete information. Hope the above helps, |
|
February 12, 2016, 09:22 |
|
#19 | |
New Member
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 11 |
Quote:
I understand, that the solution given by PeMo would prevent the solver from calling the subroutine in most cases, which would probably cause abortion of the run, as the result-value from the subroutine is required. But is there no way to store the result after the first run of the subroutine and use the stored value again always when needed inside current Iteration Loop? |
||
February 12, 2016, 11:21 |
|
#20 |
Member
Peter
Join Date: Sep 2011
Location: Germany
Posts: 39
Rep Power: 15 |
Jepp, sorry didn't think through and just adapted it from my project. I have two subroutines, the first is evaluating the requested scalar and store it in the Memory Managment System (MMS), and the second (called at the master node) is calling a 1D routine and return a value.
So it depends on your routine but to my understanding it should be possible to let CFX calculate the scalar (via cel), call the subroutine once per iteration and store the return value in the MMS. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importing external DLL to Ansys CFX using user Fortran | snpradeep | CFX | 2 | May 16, 2014 04:52 |
How to set environmental variables of Intel Fortran +CFX? | Christine MO | CFX | 0 | September 23, 2011 12:11 |
CFX User Fortran: Multiple Outputs | pingub | CFX | 1 | October 26, 2010 15:49 |
error msg when compiling user fortran | Ollimarc | CFX | 0 | March 13, 2008 19:16 |
how to use USER FORTRAN with CFX | cfd_99 | Main CFD Forum | 1 | June 4, 1999 06:42 |