forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMOM_particles.F90
59 lines (44 loc) · 2.47 KB
/
MOM_particles.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
!> A set of dummy interfaces for compiling the MOM6 drifters code
module MOM_particles_mod
use MOM_grid, only : ocean_grid_type
use MOM_time_manager, only : time_type, get_date, operator(-)
use MOM_variables, only : thermo_var_ptrs
use particles_types_mod, only: particles, particles_gridded
public particles_run, particles_init, particles_save_restart, particles_end
contains
!> Initializes particles container "parts"
subroutine particles_init(parts, Grid, Time, dt, u, v)
! Arguments
type(particles), pointer, intent(out) :: parts !< Container for all types and memory
type(ocean_grid_type), target, intent(in) :: Grid !< Grid type from parent model
type(time_type), intent(in) :: Time !< Time type from parent model
real, intent(in) :: dt !< particle timestep in seconds
real, dimension(:,:,:),intent(in) :: u !< Zonal velocity field
real, dimension(:,:,:),intent(in) :: v !< Meridional velocity field
end subroutine particles_init
!> The main driver the steps updates particles
subroutine particles_run(parts, time, uo, vo, ho, tv, stagger)
! Arguments
type(particles), pointer :: parts !< Container for all types and memory
type(time_type), intent(in) :: time !< Model time
real, dimension(:,:,:),intent(in) :: uo !< Ocean zonal velocity (m/s)
real, dimension(:,:,:),intent(in) :: vo !< Ocean meridional velocity (m/s)
real, dimension(:,:,:),intent(in) :: ho !< Ocean layer thickness [H ~> m or kg m-2]
type(thermo_var_ptrs), intent(in) :: tv !< structure containing pointers to available thermodynamic fields
integer, optional, intent(in) :: stagger !< Flag for whether velocities are staggered
end subroutine particles_run
!>Save particle locations (and sometimes other vars) to restart file
subroutine particles_save_restart(parts,temp,salt)
! Arguments
type(particles), pointer :: parts !< Container for all types and memory
real,dimension(:,:,:),optional,intent(in) :: temp !< Optional container for temperature
real,dimension(:,:,:),optional,intent(in) :: salt !< Optional container for salinity
end subroutine particles_save_restart
!> Deallocate all memory and disassociated pointer
subroutine particles_end(parts,temp,salt)
! Arguments
type(particles), pointer :: parts !< Container for all types and memory
real,dimension(:,:,:),optional,intent(in) :: temp !< Optional container for temperature
real,dimension(:,:,:),optional,intent(in) :: salt !< Optional container for salinity
end subroutine particles_end
end module MOM_particles_mod