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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Use<br />

Corresponding Command<br />

Calling Sequence<br />

SUBROUTINE RELSUB(iunit, errflg)<br />

Input Argument<br />

Output Argument<br />

Structure<br />

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

iunit An integer variable that contains the FORTRAN IO unit of the<br />

<strong>Adams</strong>/<strong>Solver</strong> save file. <strong>Adams</strong>/<strong>Solver</strong> opens the save file as sequential<br />

and unformatted. If SAVSUB has written data <strong>to</strong> the save file, the RELSUB<br />

may read it from this unit with an unformatted FORTRAN READ<br />

statement.<br />

errflg A logical variable that indicates <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> that an error has occurred<br />

while reading user data. If you set errflg <strong>to</strong> true, <strong>Adams</strong>/<strong>Solver</strong> writes an<br />

error message <strong>to</strong> the screen and <strong>to</strong> the message file.<br />

Tip: The most straightforward way <strong>to</strong> reinitialize user-written subroutines may be <strong>to</strong> collect the<br />

necessary variables in a COMMON block, use SAVSUB <strong>to</strong> write them <strong>to</strong> the save file, and<br />

RELSUB <strong>to</strong> read them back from the save file.<br />

Caution: RELSUB must read data from the save file in the same order in which SAVSUB wrote the<br />

data.<br />

A sample structure for RELSUB is shown next. The comments describe how the subroutine works.<br />

SUBROUTINE RELSUB(IUNIT, ERRFLG)<br />

C<br />

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

C<br />

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

C<br />

INTEGER IUNIT<br />

LOGICAL ERRFLG<br />

C<br />

C IUNIT FORTRAN IO unit attached <strong>to</strong> Save File<br />

C ERRLFG used <strong>to</strong> signal problems back <strong>to</strong> ADAMS<br />

C<br />

189

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

Saved successfully!

Ooh no, something went wrong!