adams-subroutine-writer

Cache Adams Solver state data in CBKSUB for reuse across subroutines.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/bthornton191/adams_skills --skill adams-subroutine-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adams-subroutine-writer
Source: https://github.com/bthornton191/adams_skills/tree/main/skills/adams-subroutine-writer
Command: npx skills add https://github.com/bthornton191/adams_skills --skill adams-subroutine-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill helps developers write, explain, and debug MSC Adams/Solver user subroutines in C, C++, and Fortran, covering common subroutines and usage patterns to reduce debugging time and errors.

Core Features & Use Cases

  • Cache and reuse Adams Solver state data across subroutines via CBKSUB caching to avoid repeated SYSARY calls.
  • Provide complete, correct examples for CBKSUB, VFOSUB, GFOSUB, SFOSUB, and other subroutines with guidance on including the SDK headers, event constants, and build process.
  • Offer end-to-end workflow guidance from code generation to building the DLL with mdi.

Quick Start

Ask it to generate a complete CBKSUB caching example and a compatible VFOSUB that reads the cached value, then build using mdi.

Frequently Asked Questions about adams-subroutine-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache Adams Solver state data to avoid repeated SYSARY calls?

You can cache Adams Solver state data by implementing CBKSUB to store values during iteration beginnings and Jacobian passes, allowing other subroutines like VFOSUB and GFOSUB to reuse the cached data without redundant SYSARY calls.

What Adams Solver subroutines are supported for writing and debugging?

Supported Adams Solver subroutines include CBKSUB, VFOSUB, GFOSUB, SFOSUB, and DIFSUB, with complete examples covering SDK headers, event constants like ev_* and am_*, and the mdi build process.

How do I build an Adams user subroutine DLL using the mdi toolchain?

To build an Adams user subroutine DLL, generate your C, C++, or Fortran code with proper SDK headers and event constants, then compile the DLL end-to-end using the mdi build toolchain.

Do I need the Adams SDK headers to write VFOSUB and GFOSUB subroutines?

Yes, writing VFOSUB and GFOSUB subroutines requires Adams SDK headers to properly access ev_*, am_*, and cm_* constants and to wrap SYSARY and SYSFNC calls correctly during solver iterations.

Why does my CBKSUB caching fail during Jacobian passes and differencing scenarios?

CBKSUB caching can fail during Jacobian passes if state data is not properly initialized at iteration beginnings or if differencing scenarios overwrite cached values before VFOSUB or GFOSUB can read them.

Can I use Fortran instead of C for Adams Solver subroutines with CBKSUB caching?

Yes, Adams Solver subroutines with CBKSUB caching support C, C++, and Fortran, all utilizing the same SDK headers, SYSARY wrappers, and mdi build toolchain to generate compatible DLLs.