Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+Add timestamp and directory to particles restart #505

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions config_src/external/drifters/MOM_particles.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ end subroutine particles_run


!>Save particle locations (and sometimes other vars) to restart file
subroutine particles_save_restart(parts, h, temp, salt)
subroutine particles_save_restart(parts, h, directory, time, time_stamped)
! Arguments
type(particles), pointer :: parts !< Container for all types and memory
real, dimension(:,:,:),intent(in) :: h !< Thickness of each layer [H ~> m or kg m-2]
real, dimension(:,:,:), optional, intent(in) :: temp !< Optional container for temperature [C ~> degC]
real, dimension(:,:,:), optional, intent(in) :: salt !< Optional container for salinity [S ~> ppt]
character(len=*), intent(in) :: directory !< The directory where the restart files are to be written
type(time_type), intent(in) :: time !< The current model time
logical, optional, intent(in) :: time_stamped !< If present and true, add time-stamp to the restart file names

end subroutine particles_save_restart

Expand Down
3 changes: 1 addition & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4022,8 +4022,7 @@ subroutine save_MOM_restart(CS, directory, time, G, time_stamped, filename, &
time_stamped=time_stamped, filename=filename, GV=GV, &
num_rest_files=num_rest_files, write_IC=write_IC)

! TODO: Update particles to use Time and directories
if (CS%use_particles) call particles_save_restart(CS%particles, CS%h)
if (CS%use_particles) call particles_save_restart(CS%particles, CS%h, directory, time, time_stamped)
end subroutine save_MOM_restart


Expand Down