Depth-integrated state on an Arakawa C-grid for the ocean dynamical core.
C-grid layout:
* Scalars (h, b, flux divergence) at cell centres, (nx_total, ny_total).
* x-velocity/momentum at east faces, (nx_total+1, ny_total).
* y-velocity/momentum at north faces, (nx_total, ny_total+1).
Lives at ocean_state%barotropic for sim_type='ocean'.
Depth-integrated state on an Arakawa C-grid (face-located velocities as continuity-PPM produces/consumes; cell-centred h-update by flux div).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public, | allocatable | :: | b(:,:) |
Reference column DEPTH at cell centre (m, positive down):
a 4000 m deep cell holds |
||
| real(kind=wp), | public | :: | coriolis_f | = | 0.0_wp |
Beta-plane / f-plane Coriolis parameter (1/s). |
|
| real(kind=wp), | public, | allocatable | :: | flux_h(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | h(:,:) |
Water depth at cell centre (m), shape (nx_total, ny_total) |
||
| real(kind=wp), | public, | allocatable | :: | h0(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | hu_face_x(:,:) |
Face-thickness x momentum h*u (m^2/s) |
||
| real(kind=wp), | public, | allocatable | :: | hv_face_y(:,:) |
Face-thickness y momentum h*v (m^2/s) |
||
| logical, | public | :: | is_init | = | .false. |
True between |
|
| real(kind=wp), | public | :: | manning_n | = | 0.0_wp |
Manning roughness for shelf-side bottom drag. |
|
| real(kind=wp), | public, | allocatable | :: | mass_flux_x(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | mass_flux_y(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | u_face_x(:,:) |
x-velocity at east face of each cell (m/s) |
||
| real(kind=wp), | public, | allocatable | :: | u_face_x0(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | v_face_y(:,:) |
y-velocity at north face of each cell (m/s) |
||
| real(kind=wp), | public, | allocatable | :: | v_face_y0(:,:) |
| procedure, public, non_overridable :: bytes => barotropic_state_bytes | |
| procedure, public, non_overridable :: destroy => barotropic_state_destroy | |
| procedure, public, non_overridable :: enter_data => barotropic_state_enter_data | |
| procedure, public, non_overridable :: exit_data => barotropic_state_exit_data | |
| procedure, public, non_overridable :: init => barotropic_state_init |
Counted allocatable footprint of the ocean C-grid barotropic slot.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_state_t), | intent(in) | :: | this |
Tear down host allocations. Call exit_data first — destroying a
still-device-mapped state leaks device memory silently.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_state_t), | intent(inout) | :: | this |
Attach the C-grid barotropic allocatables to the device. The parent
struct is mapped by the orchestrating routine. Read+write fields use
copyin; pure-workspace fields use create.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_state_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(barotropic_state_t), | intent(inout) | :: | this |
Reverse of enter_data — copy out prognostic fields, drop scratch.
Caller detaches the parent struct after this returns.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_state_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(barotropic_state_t), | intent(inout) | :: | this |
Allocate every C-grid barotropic array zero-filled. East-face arrays
are (nx+1, ny), north-face (nx, ny+1). Scalars (manning_n, coriolis_f)
are populated by state_init_from_config afterwards.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_state_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid |