From 472aa6c9921ad4101007e081caca89766a161c8d Mon Sep 17 00:00:00 2001 From: Cory Spencer Jones Date: Mon, 16 Oct 2023 11:33:26 -0500 Subject: [PATCH] +Add timestamp and directory to particles restart 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. --- config_src/external/drifters/MOM_particles.F90 | 7 ++++--- src/core/MOM.F90 | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config_src/external/drifters/MOM_particles.F90 b/config_src/external/drifters/MOM_particles.F90 index b86c720b75..95470e6510 100644 --- a/config_src/external/drifters/MOM_particles.F90 +++ b/config_src/external/drifters/MOM_particles.F90 @@ -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 diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 2af9ad40e1..b8926be01d 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -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