Sample model files with diagrams

Fortran model files with standardized descriptions.
Post Reply
User avatar
mneely
Site Admin
Posts: 233
Joined: Tue Nov 08, 2011 11:08 am
Contact:

Sample model files with diagrams

Post by mneely » Mon Mar 26, 2012 2:29 pm

Attached is a .zip archive with several example model files which can be used in Pmetrics. Each has a corresponding .jpg diagram. The files can be edited/customized using any text editor.
Attachments
Models.zip
Model templates
(626.34 KiB) Downloaded 803 times

User avatar
Andras Farkas
Posts: 53
Joined: Thu Nov 17, 2011 9:15 am
Location: Teaneck, NJ
Contact:

Re: Sample model files with diagrams

Post by Andras Farkas » Tue Apr 17, 2012 10:08 am

Michale,
couple of questions:

1. in the fortran model files, how many characters long can an equation be?
2. if the equation did not fit in 1 row, do we have to put in any special character either to the end of the first row or at the start of the second row or both?

thanks,

Andras

User avatar
uphill
Posts: 9
Joined: Wed Apr 18, 2012 8:59 am

Re: Sample model files with diagrams

Post by uphill » Wed Apr 18, 2012 10:08 am

Hi Andras,

Here are some answers to your questions:

The Fortran statements should be between columns 7 and 72 (inclusive), with the following exceptions:
Column 6 is reserved for a continuation character (e.g., "1" or "2" or "x") if the line is a continuation from
the previous line. Nothing in the previous line tells Fortran the line will be continued.
Columns 1 - 5 are used for numerical labels, which allow a line to be transferred to from another line.

Example:

IF(A .GT. B) GO TO 10

A = B * C - D
GO TO 20

10 A = B - D

20 CONTINUE


Note: Except for format statements, I almost never write code which continues from one line to the next, because
it can be very hard to verify the code is doing what it is supposed to do. The following example shows how
a long statement (which needs two lines) can be broken into smaller statements which are easier to understand:

A = ((B*COS(DEXP(-2.D0*3.14159))*5.784 + (C*SIN(DEXP(2.D0*3.14159
1))*6.9432)/(3.679 - 7.532*TAN(4.21*3.14159))


PI = 3.14159
F1 = B*COS(DEXP(-2.D0*PI))
F2 = C*SIN(DEXP(2.D0*PI))
TOP = F1*5.784 + F2*6.9432
BOT = 3.679 - 7.532*TAN(4.21*PI)
A = TOP/BOT

User avatar
mneely
Site Admin
Posts: 233
Joined: Tue Nov 08, 2011 11:08 am
Contact:

Re: Sample model files with diagrams

Post by mneely » Wed Apr 18, 2012 10:18 am

Also, a lot of modern text editors, if they detect fortran code, will indicate if you have gone over a line length, e.g. by italicizing or coloring your excess code differently. Mike can correct me if I'm wrong, but I've also seen "&" (ampersand) used as a continuation character in column 6.

Post Reply