Create a checkpoint dump file if the time has come
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(inout) | :: | files | |||
real(kind=wp), | intent(in), | dimension(-2:dims%imx+2,-2:dims%jmx+2,-2:dims%kmx+2, 1:dims%n_var) | :: | qp | ||
type(nodetype), | intent(in), | dimension(-2:dims%imx+3,-2:dims%jmx+3,-2:dims%kmx+3) | :: | nodes | ||
type(controltype), | intent(inout) | :: | control | |||
type(schemetype), | intent(in) | :: | scheme | |||
type(extent), | intent(in) | :: | dims |
subroutine checkpoint(files, qp, nodes, control, scheme, dims)
!< Create a checkpoint dump file if the time has come
!-----------------------------------------------------------
implicit none
type(filetype), intent(inout) :: files
type(extent), intent(in) :: dims
type(controltype), intent(inout) :: control
type(schemetype), intent(in) :: scheme
type(nodetype), dimension(-2:dims%imx+3,-2:dims%jmx+3,-2:dims%kmx+3), intent(in) :: nodes
real(wp), dimension(-2:dims%imx+2,-2:dims%jmx+2,-2:dims%kmx+2, 1:dims%n_var), intent(in) :: qp
DebugCall('checkpoint')
if (control%checkpoint_iter .ne. 0) then
if (mod(control%current_iter, control%checkpoint_iter) == 0 &
.or. control%current_iter == control%max_iters) then
call make_dump_dir(control)
call dump_data(files, qp, nodes, control, scheme, dims)
print*, "writing data at: ", control%current_iter, control%checkpoint_iter_count
call purge_dump_dir(control)
control%checkpoint_iter_count = control%checkpoint_iter_count + 1
end if
end if
end subroutine checkpoint