CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

can't compile subroutine.....

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2012, 08:18
Default can't compile subroutine.....
  #1
Member
 
Hai Yu
Join Date: Mar 2009
Location: Harbin
Posts: 67
Rep Power: 17
yuhai is on a distinguished road
Dear CFXer,

I can't compile my subroutine, I hope if you can give me some hints on it....


this is my code:
---------------------------
#include "cfx5ext.h"
#include "stack_point.h"
dllexport(USER_SOURCE2)
SUBROUTINE USER_SOURCE2 (NLOC,NRET,RET,CRESLT,CZ,DZ,IZ,LZ,RZ)
INTEGER NLOC,NRET
CHARACTER CRESLT*(*)
REAL RET(NLOC,NRET)
INTEGER IZ(*)
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
LOGICAL LZ(*)
REAL RZ(*),RZ2(*)

INTEGER LENACT
EXTERNAL LENACT

__stack_point__ pGRAD_V
__stack_point__ p_HL


CALL USER_GETVAR ('Water.Velocity.Gradient', CRESLT, pGRAD_V,
& CZ,DZ,IZ,LZ,RZ)
CALL USER_GETVAR ('Water.HL', CRESLT, p_HL,
& CZ,DZ,IZ,LZ,RZ)

CALL cH (RET(1,1), RZ(pGRAD_V), RZ2(p_HL), NLOC)

END




SUBROUTINE cH (SOURCE, GRAD_V, HL, NLOC)

INTEGER NLOC
REAL GRAD_V(3,NLOC,3)
REAL HL

REAL SOURCE(NLOC), tau(NLOC), tau11(NLOC), tau12(NLOC),
& tau13(NLOC), tau22(NLOC), tau23(NLOC), tau33(NLOC)
INTEGER ILOC

DO ILOC = 1, NLOC
tau11(ILOC) = 0.007 * GRAD_V(1,ILOC,1)
tau12(ILOC) = 0.0035 * (GRAD_V(1,ILOC,2) + GRAD_V(2,ILOC,1))
tau13(ILOC) = 0.0035 * (GRAD_V(3,ILOC,1) + GRAD_V(3,ILOC,1))
tau22(ILOC) = 0.007 * GRAD_V(2,ILOC,2)
tau23(ILOC) = 0.0035 * (GRAD_V(2,ILOC,3) + GRAD_V(3,ILOC,2))
tau33(ILOC) = 0.007 * GRAD_V(3,ILOC,3)
tau(ILOC) = (0.3333*(tau11(ILOC)**2 + tau22(ILOC)**2 +
& tau33(ILOC)**2) +
& 0.3333*(tau11(ILOC)*tau22(ILOC) + tau11(ILOC)*tau33(ILOC) +
& tau22(ILOC)*tau33(ILOC)) +
& (tau12(ILOC)**2 + tau23(ILOC)**2 + tau13(ILOC)**2))**0.5

IF ( tau(ILOC) /= 0 ) THEN
SOURCE(ILOC) = 3.62e-05 * (tau(ILOC)**3.07771)*(1-HL)
ELSE
SOURCE(ILOC) = 0
END IF

END DO

END
------------------------------------

and this is the error:
------------------------------------
D:\UF>cfx5mkext -fpp aa.f
E:\Program Files (x86)\Intel\Compiler\11.0\061\fortran\Bin\intel64\ ifort -Qvec-
-iface:cvf -MD -fpp -object:winnt-amd64\\aa.o -c aa.f
Intel(R) Visual Fortran Intel(R) 64 Compiler Professional for applications runni
ng on Intel(R) 64, Version 11.0 Build 20080930 Package ID: w_cprof_p_11.0.061

Copyright (C) 1985-2008 Intel Corporation. All rights reserved.
aa.f(4): error #6218: This statement is positioned incorrectly and/or has syntax
errors.
SUBROUTINE USER_SOURCE2 (NLOC,NRET,RET,CRESLT,CZ,DZ,IZ,LZ,RZ)
------^
aa.f(6): error #6219: A specification expression object must be a dummy argument
, a COMMON block object, or an object accessible through host or use association
[NLOC]
INTEGER NLOC,NRET
--------------^
aa.f(6): error #6219: A specification expression object must be a dummy argument
, a COMMON block object, or an object accessible through host or use association
[NRET]
INTEGER NLOC,NRET
-------------------^
aa.f(8): error #6591: An automatic object is invalid in a main program. [RET]
REAL RET(NLOC,NRET)
-----------^
aa.f(7): error #6832: This passed length character name has been used in an inva
lid context. [CRESLT]
CHARACTER CRESLT*(*)
----------------^
aa.f(10): error #6221: The assumed-size array must be a dummy argument. [CZ]
CHARACTER CZ(*)*(1)
----------------^
aa.f(11): error #6221: The assumed-size array must be a dummy argument. [DZ]
DOUBLE PRECISION DZ(*)
-----------------------^
aa.f(9): error #6221: The assumed-size array must be a dummy argument. [IZ]
INTEGER IZ(*)
--------------^
aa.f(12): error #6221: The assumed-size array must be a dummy argument. [LZ]
LOGICAL LZ(*)
--------------^
aa.f(13): error #6221: The assumed-size array must be a dummy argument. [RZ]
REAL RZ(*),RZ2(*)
-----------^
aa.f(13): error #6221: The assumed-size array must be a dummy argument. [RZ2]
REAL RZ(*),RZ2(*)
-----------------^
compilation aborted for aa.f (code 1)
An error has occurred in cfx5mkext:

E:\Program Files (x86)\Intel\Compiler\11.0\061\fortran\Bin\intel64\ ifort
exited with return code 1.

-----------------






Thanks in advance.

H.Y.
yuhai is offline   Reply With Quote

Old   July 12, 2012, 17:39
Default
  #2
Member
 
Hai Yu
Join Date: Mar 2009
Location: Harbin
Posts: 67
Rep Power: 17
yuhai is on a distinguished road
now I have only one problem (the uppers are solved):

LINK: fatal error LNK1104: cannot open file 'ifconsol.lib'
yuhai is offline   Reply With Quote

Old   July 18, 2012, 11:43
Default
  #3
Member
 
Hai Yu
Join Date: Mar 2009
Location: Harbin
Posts: 67
Rep Power: 17
yuhai is on a distinguished road
nolange problem......

solved
yuhai is offline   Reply With Quote

Old   March 14, 2014, 10:10
Default
  #4
New Member
 
Bi Zhishui
Join Date: Mar 2014
Posts: 3
Rep Power: 12
jmaxime is on a distinguished road
Hi yuhai,
I have also encountered this kind of problem, " error #6591: An automatic object is invalid in a main program. "
Can you tell me how you finally solve it?
Thanks in advance.

jmaxime
jmaxime is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 18:22
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51
error on CFX compile fortran subroutine billpeace CFX 0 May 18, 2006 05:44
Compile Subroutine Mgtripple CFX 3 April 6, 2006 09:52
Compile message for user subroutine??? bk Siemens 0 July 28, 2004 22:02


All times are GMT -4. The time now is 12:36.