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

User Fortran script failures

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2016, 09:01
Default User Fortran script failures
  #1
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
Hi everyone,

I'm trying to implement a user subroutine that applies momentum at specific locations in the mesh. I'm using the MomentumSource1.F and ucf_template.F as a guide.

One of the things I need are matrices, I've done a little bit of fortran tutorials before starting on this but they seem pointless.

For instance I thought I should define a matrix like

real dimension(4,4) :: MyMatrix

or

real (kind=ikind),dimension(4,4) :: MyMatrix

but when I compile it using cfx5mkext and pgf95 it says there is a syntax error in this line. Are there different rules for these types of code?
honcho62 is offline   Reply With Quote

Old   January 11, 2016, 10:02
Default
  #2
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
In my Fortran code I define arrays as
Code:
 REAL mk(3,10)
Im not sure if higher dimensions work differently, but this works as intended.
Lance is offline   Reply With Quote

Old   January 12, 2016, 03:46
Default
  #3
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
thanks for the answer.

the definition actually does work but you need to put the comma after REAL. So that's solved I guess.
honcho62 is offline   Reply With Quote

Reply

Tags
cfx-pre, fortran, user subroutine


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
CFX User Fortran: Particle User Sources hustxinxin CFX 0 March 8, 2012 09:37
CFX User Fortran: Particle User Sources hustxinxin CFX 0 March 8, 2012 09:31
Particle Transport & Termination Control with User FORTRAN Julian K. CFX 3 January 12, 2012 10:48
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 01:52
User Fortran and interior node information John CFX 0 August 26, 2008 23:24


All times are GMT -4. The time now is 16:18.