Appearance
heat_solver_m
A 1-D heat solver whose state lives on the device.
Source: src/third_party/FUNDAL/docs/examples/snippets/heat_4-module.F90
Dependencies
Contents
Derived Types
heat_solver
Explicit solver of the 1-D heat equation, temperature with ghost cells 0 and n+1.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
n | integer(kind=I4P) | ||
r | real(kind=R8P) | ||
t_dev | real(kind=R8P) | pointer | |
tn_dev | real(kind=R8P) | pointer |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
init | pass(self) | |
run | pass(self) | |
get | pass(self) | |
destroy | pass(self) |
Subroutines
init
Allocate the device state and upload the initial condition t(0:n+1).
fortran
subroutine init(self, t, r, ierr)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(heat_solver) | inout | ||
t | real(kind=R8P) | in | ||
r | real(kind=R8P) | in | ||
ierr | integer(kind=I4P) | out |
Call graph
run
Advance some steps on the device.
fortran
subroutine run(self, steps)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(heat_solver) | inout | ||
steps | integer(kind=I4P) | in |
Call graph
get
Download the temperature, ghost cells included.
fortran
subroutine get(self, t)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(heat_solver) | in | ||
t | real(kind=R8P) | out |
Call graph
destroy
Release the device state.
fortran
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(heat_solver) | inout |
Call graph
diffuse
One explicit step: the device arrays are dummy arguments, as OpenACC deviceptr requires.
fortran
subroutine diffuse(n, r, t, tn)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | ||
r | real(kind=R8P) | in | ||
t | real(kind=R8P) | in | ||
tn | real(kind=R8P) | inout |
Call graph