Close the diag NetCDF stream (if one was opened), release the
process-global ocean-halo and fold-exchange module state, then release host-side
allocations. Call after engine_exit_data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_engine_t), | intent(inout) | :: | engine |
subroutine engine_teardown(engine) !! Close the diag NetCDF stream (if one was opened), release the !! process-global ocean-halo and fold-exchange module state, then release host-side !! allocations. Call after `engine_exit_data`. type(ocean_engine_t), intent(inout) :: engine #ifndef RDB_NO_NETCDF if (engine%diag_enabled) call close_stream(engine%state%diag) #endif call ocean_halo_destroy() call ocean_fold_exchange_destroy() call engine%geo%destroy() call engine%state%destroy() engine%is_setup = .false. engine%warm_restart = .false. end subroutine engine_teardown