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.

232<br />

<strong>Adams</strong>/<strong>Solver</strong><br />

C<br />

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

C ...<br />

C<br />

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

C<br />

C Assign readable variable names <strong>to</strong> passed parameters<br />

C<br />

...<br />

C<br />

C Call SYSFNC and/or SYSARY <strong>to</strong> collect information for<br />

C the calculations below. Note: if IFLAG is true, these<br />

C calls are actually setting functional dependencies.<br />

C<br />

CALL SYSFNC (...)<br />

C<br />

C Check SYSFNC call through ERRMES utility routine<br />

C<br />

CALL ERRMES (...)<br />

C<br />

C Repeat for all required SYSFNC or SYSARY calls<br />

C<br />

...<br />

C<br />

IF (IFLAG) THEN<br />

C<br />

C - Subroutine initialization -------------<br />

C<br />

...<br />

C<br />

ENDIF<br />

C<br />

C - Evaluate VFORCE components ------------<br />

C<br />

C Your algorithms<br />

C<br />

...<br />

C<br />

C Assign values <strong>to</strong> the RESULT array<br />

C<br />

RESULT(1) = ...<br />

RESULT(2) = ...<br />

RESULT(3) = ...<br />

C<br />

RETURN<br />

END<br />

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

typedef void adams_c_VFOSUB(const struct s<strong>Adams</strong>Vforce* vfo, double<br />

TIME, int DFLAG, int IFLAG, double* RESULT);<br />

/*<br />

* VFORCE -------------------------------------------------<br />

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

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

Saved successfully!

Ooh no, something went wrong!