Skip to content

Commit

Permalink
+Add timestamp and directory to particles restart
Browse files Browse the repository at this point in the history
The directory, time and timestamp variables are needed by the particle code in order to write better restart files. I have changed the particles_save_restart interface to add these variables. I have also removed the option to pass temperature and salinity to particles_save_restart, because these variables are not useful for restart.
  • Loading branch information
cspencerjones committed Oct 16, 2023
1 parent 0c491ce commit 472aa6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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 @@ -4021,8 +4021,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

0 comments on commit 472aa6c

Please sign in to comment.