stochastic_physics.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! The are stubs for ocean stochastic physics
6! the fully functional code is available at
7! http://github.com/noaa-psd/stochastic_physics
9
10use mom_error_handler, only : mom_error, warning
11
12implicit none ; private
13
16
17contains
18
19!> Initializes the stochastic physics perturbations.
20subroutine init_stochastic_physics_ocn(delt, geoLonT, geoLatT, nxT, nyT, nz, &
21 geoLonB, geoLatB, nxB, nyB, &
22 pert_epbl_in, do_sppt_in, &
23 do_skeb_in, mpiroot, mpicomm, iret)
24 real, intent(in) :: delt !< timestep in seconds between calls to run_stochastic_physics_ocn [s]
25 integer, intent(in) :: nxt !< number of T gridpoints in the x-direction of the compute grid
26 integer, intent(in) :: nyt !< number of T gridpoints in the y-direction of the compute grid
27 integer, intent(in) :: nz !< number of gridpoints in the z-direction of the compute grid
28 real, intent(in) :: geolont(nxt,nyt) !< Longitude of T points in degrees
29 real, intent(in) :: geolatt(nxt,nyt) !< Latitude of T points in degrees
30 integer, intent(in) :: nxb !< number of B gridpoints in the x-direction of the compute grid
31 integer, intent(in) :: nyb !< number of B gridpoints in the y-direction of the compute grid
32 real, intent(in) :: geolonb(nxb,nyb) !< Longitude of B points in degrees
33 real, intent(in) :: geolatb(nxb,nyb) !< Latitude of B points in degrees
34 logical, intent(in) :: pert_epbl_in !< logical flag, if true generate random pattern for ePBL perturbations
35 logical, intent(in) :: do_sppt_in !< logical flag, if true generate random pattern for SPPT perturbations
36 logical, intent(in) :: do_skeb_in !< logical flag, if true generate random pattern for SKEB perturbations
37 integer, intent(in) :: mpiroot !< root processor
38 integer, intent(in) :: mpicomm !< mpi communicator
39 integer, intent(out) :: iret !< return code
40
41 iret=0
42 if (pert_epbl_in) then
43 call mom_error(warning, 'init_stochastic_physics_ocn: pert_epbl needs to be false if using the stub')
44 iret=-1
45 endif
46 if (do_sppt_in) then
47 call mom_error(warning, 'init_stochastic_physics_ocn: do_sppt needs to be false if using the stub')
48 iret=-1
49 endif
50 if (do_skeb_in) then
51 call mom_error(warning, 'init_stochastic_physics_ocn: do_skeb needs to be false if using the stub')
52 iret=-1
53 endif
54
55 ! This stub function does not actually do anything.
56 return
57end subroutine init_stochastic_physics_ocn
58
59
60!> Determines the stochastic physics perturbations.
61subroutine run_stochastic_physics_ocn(sppt_wts, skeb_wts, t_rp1, t_rp2)
62 real, intent(inout) :: sppt_wts(:,:) !< array containing random weights for SPPT range [0,2]
63 real, intent(inout) :: skeb_wts(:,:) !< array containing random weights for SKEB
64 real, intent(inout) :: t_rp1(:,:) !< array containing random weights for ePBL
65 !! perturbations (KE generation) range [0,2]
66 real, intent(inout) :: t_rp2(:,:) !< array containing random weights for ePBL
67 !! perturbations (KE dissipation) range [0,2]
68
69 ! This stub function does not actually do anything.
70 return
71end subroutine run_stochastic_physics_ocn
72
73end module stochastic_physics