| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | solver_status_ok | = | 0 |
Operation completed successfully. |
| integer, | public, | parameter | :: | solver_status_invalid_argument | = | 1 |
Caller supplied an invalid handle, key, buffer, or scalar argument. |
| integer, | public, | parameter | :: | solver_status_invalid_state | = | 2 |
Operation requires an initialised runtime, but the session is not ready. |
| integer, | public, | parameter | :: | solver_status_config_error | = | 3 |
Config loading or validation failed. |
| integer, | public, | parameter | :: | solver_status_io_error | = | 4 |
File I/O or other runtime setup/output work failed. |
| integer, | public, | parameter | :: | solver_status_busy | = | 5 |
Reserved for adapters that need to report temporary v1 exclusivity/busy state. |
Polling-friendly runtime summary exposed to adapters.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | iteration | = | 0 | ||
| integer, | public | :: | n_point | = | 0 | ||
| logical, | public | :: | is_initialized | = | .false. | ||
| logical, | public | :: | is_finished | = | .false. | ||
| real(kind=wp), | public | :: | sim_time | = | 0.0_wp | ||
| real(kind=wp), | public | :: | time_stop | = | 0.0_wp | ||
| real(kind=wp), | public | :: | dt | = | 0.0_wp | ||
| real(kind=wp), | public | :: | residual | = | 0.0_wp |
Mutable solver session that owns one configuration and, optionally, one runtime.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(config_t), | public | :: | cfg | ||||
| type(solver_run_context_t), | public | :: | ctx | ||||
| logical, | public | :: | has_runtime | = | .false. | ||
| character(len=512), | public | :: | last_error | = | '' |
Reset a session to its default empty state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(out) | :: | session |
Tear down any live runtime allocations and clear the last error.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session |
Load configuration from a namelist file into the session.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | filename | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Validate the current configuration and allocate the runtime context.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Advance the runtime by at most max_steps iterations.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| integer, | intent(in) | :: | max_steps | |||
| integer, | intent(out) | :: | steps_taken | |||
| logical, | intent(out) | :: | finished | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Run the current session until time_stop is reached.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Copy out a lightweight progress snapshot for polling clients.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| type(solver_progress_t), | intent(out) | :: | progress | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Return the current grid-point count expected by solution copy-out buffers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| integer, | intent(out) | :: | n_point | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Copy the current primitive-variable solution into caller-owned arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| real(kind=wp), | intent(out) | :: | x(:) | |||
| real(kind=wp), | intent(out) | :: | rho(:) | |||
| real(kind=wp), | intent(out) | :: | u(:) | |||
| real(kind=wp), | intent(out) | :: | p(:) | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Write the current solution in the standard result.dat-style text format.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in), | optional | :: | filename | ||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Force an immediate checkpoint write using the configured or overridden base name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in), | optional | :: | base | ||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Copy the last stored writable-operation error message.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(out) | :: | message |
Read an integer configuration field by canonical schema key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| integer, | intent(out) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Read a scalar real configuration field by canonical schema key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=wp), | intent(out) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Read a logical configuration field by canonical schema key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| logical, | intent(out) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Read a string or choice-token configuration field by canonical schema key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| character(len=*), | intent(out) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Read a real-3 configuration field by canonical schema key.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=wp), | intent(out) | :: | value(3) | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Set an integer configuration field and invalidate any live runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| integer, | intent(in) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Set a scalar real configuration field and invalidate any live runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=wp), | intent(in) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Set a logical configuration field and invalidate any live runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| logical, | intent(in) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Set a string or choice-token configuration field and invalidate any runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| character(len=*), | intent(in) | :: | value | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Set a real-3 configuration field and invalidate any live runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| real(kind=wp), | intent(in) | :: | value(3) | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Tear down the live runtime context while keeping editable config state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session |
Store the last writable-operation error and mirror it to optional outputs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| integer, | intent(in) | :: | status_code | |||
| character(len=*), | intent(in) | :: | err | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |
Mirror readonly-operation status without mutating the session state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | status_code | |||
| character(len=*), | intent(in) | :: | err | |||
| integer, | intent(out), | optional | :: | status | ||
| character(len=*), | intent(out), | optional | :: | message |