@@ -34,7 +34,7 @@ module MOM_stochastics
34
34
! > This control structure holds parameters for the MOM_stochastics module
35
35
type, public :: stochastic_CS
36
36
logical :: do_sppt ! < If true, stochastically perturb the diabatic
37
- logical :: do_skeb ! < If true, stochastically perturb the diabatic
37
+ logical :: do_skeb ! < If true, stochastically perturb the horizontal velocity
38
38
logical :: skeb_use_gm ! < If true, adds GM work to the amplitude of SKEBS
39
39
logical :: skeb_use_frict ! < If true, adds viscous dissipation rate to the amplitude of SKEBS
40
40
logical :: pert_epbl ! < If true, then randomly perturb the KE dissipation and genration terms
@@ -155,29 +155,29 @@ subroutine stochastics_init(dt, grid, GV, CS, param_file, diag, Time)
155
155
default= .false. )
156
156
157
157
if (CS% do_sppt .OR. CS% pert_epbl .OR. CS% do_skeb) then
158
- num_procs = num_PEs()
159
- allocate (pelist(num_procs))
160
- call Get_PElist(pelist,commID = mom_comm)
161
- pe_zero = root_PE()
162
- nxT = grid% ied - grid% isd + 1
163
- nyT = grid% jed - grid% jsd + 1
164
- nxB = grid% iedB - grid% isdB + 1
165
- nyB = grid% jedB - grid% jsdB + 1
166
- call init_stochastic_physics_ocn(dt, grid% geoLonT, grid% geoLatT, nxT, nyT, GV% ke, &
167
- grid% geoLonBu, grid% geoLatBu, nxB, nyB, &
168
- CS% pert_epbl, CS% do_sppt, CS% do_skeb, pe_zero, mom_comm, iret)
169
- if (iret/= 0 ) then
170
- call MOM_error(FATAL, " call to init_stochastic_physics_ocn failed" )
171
- return
172
- endif
173
-
174
- if (CS% do_sppt) allocate (CS% sppt_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
175
- if (CS% do_skeb) allocate (CS% skeb_wts(grid% isdB:grid% iedB,grid% jsdB:grid% jedB))
176
- if (CS% do_skeb) allocate (CS% skeb_diss(grid% isd:grid% ied,grid% jsd:grid% jed,GV% ke), source= 0 .)
177
- if (CS% pert_epbl) then
178
- allocate (CS% epbl1_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
179
- allocate (CS% epbl2_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
180
- endif
158
+ num_procs = num_PEs()
159
+ allocate (pelist(num_procs))
160
+ call Get_PElist(pelist,commID = mom_comm)
161
+ pe_zero = root_PE()
162
+ nxT = grid% ied - grid% isd + 1
163
+ nyT = grid% jed - grid% jsd + 1
164
+ nxB = grid% iedB - grid% isdB + 1
165
+ nyB = grid% jedB - grid% jsdB + 1
166
+ call init_stochastic_physics_ocn(dt, grid% geoLonT, grid% geoLatT, nxT, nyT, GV% ke, &
167
+ grid% geoLonBu, grid% geoLatBu, nxB, nyB, &
168
+ CS% pert_epbl, CS% do_sppt, CS% do_skeb, pe_zero, mom_comm, iret)
169
+ if (iret/= 0 ) then
170
+ call MOM_error(FATAL, " call to init_stochastic_physics_ocn failed" )
171
+ return
172
+ endif
173
+
174
+ if (CS% do_sppt) allocate (CS% sppt_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
175
+ if (CS% do_skeb) allocate (CS% skeb_wts(grid% isdB:grid% iedB,grid% jsdB:grid% jedB))
176
+ if (CS% do_skeb) allocate (CS% skeb_diss(grid% isd:grid% ied,grid% jsd:grid% jed,GV% ke), source= 0 .)
177
+ if (CS% pert_epbl) then
178
+ allocate (CS% epbl1_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
179
+ allocate (CS% epbl2_wts(grid% isd:grid% ied,grid% jsd:grid% jed))
180
+ endif
181
181
endif
182
182
183
183
CS% id_sppt_wts = register_diag_field(' ocean_model' , ' sppt_pattern' , CS% diag% axesT1, Time, &
@@ -279,22 +279,20 @@ subroutine apply_skeb(grid,GV,CS,uc,vc,thickness,tv,dt,Time_end)
279
279
type (time_type), intent (in ) :: Time_end ! < Time at the end of the interval
280
280
! locals
281
281
282
- real ALLOCABLE_, dimension (NIMEMB_PTR_,NJMEMB_PTR_,NKMEM_) :: psi
283
- real ALLOCABLE_, dimension (NIMEMB_PTR_,NJMEM_,NKMEM_) :: ustar
284
- real ALLOCABLE_, dimension (NIMEM_,NJMEMB_PTR_,NKMEM_) :: vstar
285
- real ALLOCABLE_, dimension (NIMEM_,NJMEM_) :: diss_tmp
286
-
287
- real , dimension (3 ,3 ) :: local_weights
282
+ real , dimension (SZIB_(grid),SZJB_(grid),SZK_(GV)) :: psi ! < Streamfunction for stochastic velocity increments
283
+ ! ! [L2 T-1 ~> m2 s-1]
284
+ real , dimension (SZIB_(grid),SZJ_(grid) ,SZK_(GV)) :: ustar ! < Stochastic u velocity increment [L T-1 ~> m s-1]
285
+ real , dimension (SZI_(grid) ,SZJB_(grid),SZK_(GV)) :: vstar ! < Stochastic v velocity increment [L T-1 ~> m s-1]
286
+ real , dimension (SZI_(grid),SZJ_(grid)) :: diss_tmp ! < Temporary array used in smoothing skeb_diss
287
+ ! ! [L2 T-3 ~> m2 s-2]
288
+ real , dimension (3 ,3 ) :: local_weights ! < 3x3 stencil weights used in smoothing skeb_diss
289
+ ! ! [L2 ~> m2]
288
290
289
291
real :: shr,ten,tot,kh
290
292
integer :: i,j,k,iter
291
293
integer , dimension (2 ) :: EOSdom ! The i-computational domain for the equation of state
292
294
293
295
call callTree_enter(" apply_skeb(), MOM_stochastics.F90" )
294
- ALLOC_(diss_tmp(grid% isd:grid% ied,grid% jsd:grid% jed))
295
- ALLOC_(psi(grid% isdB:grid% iedB,grid% jsdB:grid% jedB,GV% ke))
296
- ALLOC_(ustar(grid% isdB:grid% iedB,grid% jsd:grid% jed,GV% ke))
297
- ALLOC_(vstar(grid% isd:grid% ied,grid% jsdB:grid% jedB,GV% ke))
298
296
299
297
if ((.not. CS% skeb_use_gm) .and. (.not. CS% skeb_use_frict)) then
300
298
! fill in halos with zeros
@@ -382,10 +380,6 @@ subroutine apply_skeb(grid,GV,CS,uc,vc,thickness,tv,dt,Time_end)
382
380
call post_data(CS% id_psi, psi(:,:,:), CS% diag)
383
381
endif
384
382
call disable_averaging(CS% diag)
385
- DEALLOC_(diss_tmp)
386
- DEALLOC_(ustar)
387
- DEALLOC_(vstar)
388
- DEALLOC_(psi)
389
383
CS% skeb_diss(:,:,:) = 0.0 ! Must zero before next time step.
390
384
391
385
call callTree_leave(" apply_skeb(), MOM_stochastics.F90" )
0 commit comments