02.04.2013 Views

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FORTRAN - Pro<strong>to</strong>type<br />

<strong>Welcome</strong> <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> <strong>Subroutines</strong><br />

A sample structure for the SPLINE_READ subroutine follows next. The comments explain the activities<br />

that the subroutine performs.<br />

SUBROUTINE SPLINE_READ (ID, FILE_NAME, BLOCK_NAME, STATUS)<br />

C<br />

C === Type and dimension statements ===================<br />

C<br />

C Note: For machines with 60 or more bits per word,<br />

C substitute "REAL" for "DOUBLE PRECISION".<br />

C<br />

C - External variable definitions ---------<br />

C<br />

INTEGERID<br />

CHARACTER*132FILE_NAME<br />

CHARACTER*132BLOCK_NAME<br />

LOGICALSTATUS<br />

C<br />

C IDIdentifier of calling SPLINE statement<br />

C FILE_NAMEName of file containing data <strong>to</strong> define spline<br />

C BLOCK_NAMEName of named block within the file <strong>to</strong> be<br />

C used for this spline<br />

C STATUS Error status flag<br />

C<br />

C - Local variable definitions -----------<br />

C<br />

...<br />

C<br />

C === Executable code =================================<br />

C<br />

C open file, check validity, type... and read data in<strong>to</strong> local<br />

variables<br />

C<br />

...<br />

CALL PUT_SPLINE(ID,NX,NZ,X,Y,Z,ERRFLG)<br />

C<br />

C check ERRFLG, clean-up (release memory if necessary, close<br />

file...), and set STATUS<br />

C<br />

...<br />

C<br />

RETURN<br />

END<br />

C Style - Pro<strong>to</strong>type<br />

typedef void adams_c_SPLINE_READ(const struct s<strong>Adams</strong>Spline* spline,<br />

int* IERR);<br />

/*<br />

* SPLINE -------------------------------------------------<br />

----------------<br />

*/<br />

struct s<strong>Adams</strong>Spline<br />

207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!