mapl-error-handling

Document MAPL error handling macros and return code conventions in Fortran.

43|25|Updated Jul 3, 2019
One-click install
npx skills add https://github.com/GEOS-ESM/MAPL --skill mapl-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mapl-error-handling
Source: https://github.com/GEOS-ESM/MAPL/tree/main/.opencode/skills/mapl-error-handling
Command: npx skills add https://github.com/GEOS-ESM/MAPL --skill mapl-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for implementing robust error handling within the MAPL (Modeling Analysis and Prediction Layer) framework, ensuring code reliability and maintainability.

Core Features & Use Cases

  • Error Handling Macros: Detailed explanations and usage examples for core macros like _RC, _VERIFY, _ASSERT, _FAIL, _RETURN, _SUCCESS, _FAILURE, _STAT, _IOSTAT, and _HERE.
  • Best Practices: Clear guidelines on checking return codes, validating inputs, handling allocations and file operations, and providing informative error messages.
  • Use Case: When developing new Fortran modules for GEOS, developers can consult this Skill to ensure all potential errors are caught and handled according to MAPL conventions, preventing runtime failures and simplifying debugging.

Quick Start

Use the mapl-error-handling skill to understand how to implement error checking in your Fortran code.

Frequently Asked Questions about mapl-error-handling

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

FAQPage Schema
How do I handle errors in Fortran when developing GEOS-ESM components?

MAPL error handling macros in Fortran work by wrapping return code checks, such as using `_RC` to capture errors and `_VERIFY` to assert success. They enforce return code standards and provide informative error messages for GEOS-ESM modules.

What is the best way to debug return code failures in MAPL?

The best way to debug return code failures in MAPL is to use the `_FAIL` and `_HERE` macros. `_FAIL` outputs informative error messages when an error condition is met, while `_HERE` pinpoints the exact source file and line number during execution.

How do I validate allocations and file operations in Fortran using MAPL?

To validate allocations and file operations in Fortran using MAPL, apply the `_IOSTAT` and `_STAT` macros to capture operation statuses. Follow this with `_VERIFY` or `_ASSERT` to immediately catch and handle any runtime failures according to MAPL conventions.

What are common pitfalls to avoid with MAPL error handling conventions?

Common pitfalls with MAPL error handling conventions include skipping return code checks on allocations and file I/O, or using uninformative error messages. Avoid these by consistently applying `_RC` and `_VERIFY` to ensure all potential errors are caught and reported.