subroutine WriteMemLogHeader(iunit)
integer, intent(in) :: iunit
write (iunit, *)
write (iunit, *) '================================================================'
write (iunit, *) 'Memory usage'
write (iunit, '(a34,f9.1)') ' Maximum memory defined is (MB) : ', real(MaxMemory, dp) / 1024.0_dp**2.0_dp
write (iunit, '(a34,f9.1)') ' Maximum memory used is (MB) : ', real(MaxMemoryUsed, dp) / 1024.0_dp**2.0_dp
if (nWarn > 0) then
write (iunit, *) 'Maximum memory exceeded ', nWarn, ' times.'
endif
write (iunit, *) ''
if (iunit == 6) then
write (iunit, *) 'Large memory allocations:'
write (iunit, *) ''
end if
write (iunit, *) 'Name Allocated in Deallocated in Size'
write (iunit, *) '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'
end subroutine WriteMemLogHeader