MOM_particles.F90
1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> A set of dummy interfaces for compiling the MOM6 drifters code
6module mom_particles_mod
7
8use mom_grid, only : ocean_grid_type
9use mom_time_manager, only : time_type, get_date, operator(-)
10use mom_variables, only : thermo_var_ptrs
11use particles_types_mod, only : particles, particles_gridded
12
13implicit none ; private
14
16public particles_to_k_space, particles_to_z_space
17
18contains
19
20!> Initializes particles container "parts"
21subroutine particles_init(parts, Grid, Time, dt, u, v, h)
22 ! Arguments
23 type(particles), pointer, intent(out) :: parts !< Container for all types and memory
24 type(ocean_grid_type), target, intent(in) :: grid !< Grid type from parent model
25 type(time_type), intent(in) :: time !< Time type from parent model
26 real, intent(in) :: dt !< particle timestep in seconds [T ~> s]
27 real, dimension(:,:,:),intent(in) :: u !< Zonal velocity field [L T-1 ~> m s-1]
28 real, dimension(:,:,:),intent(in) :: v !< Meridional velocity field [L T-1 ~> m s-1]
29 real, dimension(:,:,:),intent(in) :: h !< Thickness of each layer [H ~> m or kg m-2]
30end subroutine particles_init
31
32!> The main driver the steps updates particles
33subroutine particles_run(parts, time, uo, vo, ho, tv, dt_adv, use_uh)
34 ! Arguments
35 type(particles), pointer :: parts !< Container for all types and memory
36 type(time_type), intent(in) :: time !< Model time
37 real, dimension(:,:,:), intent(in) :: uo !< If use_uh is false, ocean zonal velocity [L T-1 ~>m s-1].
38 !! If use_uh is true, accumulated zonal thickness fluxes
39 !! that are used to advect tracers [H L2 ~> m3 or kg]
40 real, dimension(:,:,:), intent(in) :: vo !< If use_uh is false, ocean meridional velocity [L T-1 ~>m s-1].
41 !! If use_uh is true, accumulated meridional thickness fluxes
42 !! that are used to advect tracers [H L2 ~> m3 or kg]
43 real, dimension(:,:,:), intent(in) :: ho !< Ocean layer thickness [H ~> m or kg m-2]
44 type(thermo_var_ptrs), intent(in) :: tv !< structure containing pointers to available thermodynamic fields
45 real, intent(in) :: dt_adv !< timestep for advecting particles [s]
46 logical :: use_uh !< Flag for whether u and v are weighted by thickness
47
48end subroutine particles_run
49
50
51!>Save particle locations (and sometimes other vars) to restart file
52subroutine particles_save_restart(parts, h, directory, time, time_stamped)
53 ! Arguments
54 type(particles), pointer :: parts !< Container for all types and memory
55 real, dimension(:,:,:),intent(in) :: h !< Thickness of each layer [H ~> m or kg m-2]
56 character(len=*), intent(in) :: directory !< The directory where the restart files are to be written
57 type(time_type), intent(in) :: time !< The current model time
58 logical, optional, intent(in) :: time_stamped !< If present and true, add time-stamp to the restart file names
59
60end subroutine particles_save_restart
61
62!> Deallocate all memory and disassociated pointer
63subroutine particles_end(parts, h, temp, salt)
64 ! Arguments
65 type(particles), pointer :: parts !< Container for all types and memory
66 real, dimension(:,:,:),intent(in) :: h !< Thickness of each layer [H ~> m or kg m-2]
67 real, dimension(:,:,:), optional, intent(in) :: temp !< Optional container for temperature [C ~> degC]
68 real, dimension(:,:,:), optional, intent(in) :: salt !< Optional container for salinity [S ~> ppt]
69
70end subroutine particles_end
71
72subroutine particles_to_k_space(parts, h)
73 ! Arguments
74 type(particles), pointer :: parts !< Container for all types and memory
75 real, dimension(:,:,:),intent(in) :: h !< Thickness of layers [H ~> m or kg m-2]
76
77end subroutine particles_to_k_space
78
79
80subroutine particles_to_z_space(parts, h)
81 ! Arguments
82 type(particles), pointer :: parts !< Container for all types and memory
83 real, dimension(:,:,:),intent(in) :: h !< Thickness of layers [H ~> m or kg m-2]
84
85end subroutine particles_to_z_space
86
87end module mom_particles_mod