diff --git a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 index ea805d1f90..03b33dc2b3 100644 --- a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 +++ b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 @@ -29,6 +29,7 @@ module MOM_stochastics public stochastics_init, update_stochastics +!> This control structure holds parameters for the MOM_stochastics module type, public:: stochastic_CS logical :: do_sppt !< If true, stochastically perturb the diabatic logical :: pert_epbl !! If true, then randomly perturb the KE dissipation and genration terms @@ -105,8 +106,8 @@ subroutine stochastics_init(dt, grid, GV, CS, param_file, diag, Time) allocate(pelist(num_procs)) call Get_PElist(pelist,commID = mom_comm) master=root_PE() - nx=grid%ied-grid%isd+1 - ny=grid%jed-grid%jsd+1 + nx = grid%ied - grid%isd + 1 + ny = grid%jed - grid%jsd + 1 call init_stochastic_physics_ocn(dt,grid%geoLonT,grid%geoLatT,nx,ny,GV%ke, & CS%pert_epbl,CS%do_sppt,master,mom_comm,iret) if (iret/=0) then @@ -115,7 +116,7 @@ subroutine stochastics_init(dt, grid, GV, CS, param_file, diag, Time) "not activated in stochastic_physics namelist ") return endif - + if (CS%do_sppt) allocate(CS%sppt_wts(grid%isd:grid%ied,grid%jsd:grid%jed)) if (CS%pert_epbl) then allocate(CS%epbl1_wts(grid%isd:grid%ied,grid%jsd:grid%jed)) diff --git a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 index f03f5283d3..89a6d43c4f 100644 --- a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 +++ b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 @@ -28,11 +28,14 @@ module MOM_stochastics public stochastics_init, update_stochastics +!> This control structure holds parameters for the MOM_stochastics module type, public:: stochastic_CS - logical :: do_sppt !< If true, stochastically perturb the diabatic - logical :: pert_epbl !! If true, then randomly perturb the KE dissipation and genration terms + logical :: do_sppt !< If true, stochastically perturb the diabatic + logical :: pert_epbl !< If true, then randomly perturb the KE dissipation and genration terms + !>@{ Diagnostic IDs integer :: id_sppt_wts = -1 integer :: id_epbl1_wts=-1,id_epbl2_wts=-1 + !>@} ! stochastic patterns real, allocatable :: sppt_wts(:,:) !< Random pattern for ocean SPPT !! tendencies with a number between 0 and 2 diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 514a8a8a33..fdb6f9b0a9 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -630,7 +630,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS call disable_averaging(CS%diag) endif endif - + if (CS%stoch_CS%do_sppt .OR. CS%stoch_CS%pert_epbl) call update_stochastics(CS%stoch_CS) if (do_dyn) then diff --git a/src/ocean_data_assim/MOM_oda_incupd.F90 b/src/ocean_data_assim/MOM_oda_incupd.F90 index 12d18587bf..334597cda7 100644 --- a/src/ocean_data_assim/MOM_oda_incupd.F90 +++ b/src/ocean_data_assim/MOM_oda_incupd.F90 @@ -450,7 +450,7 @@ subroutine calc_oda_increments(h, tv, u, v, G, GV, US, CS) enddo endif enddo; enddo - + ! remap u to h_obs to get increment if (CS%uv_inc) then call pass_var(h, G%Domain) diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index a9bb521570..21d27a6f4b 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -313,7 +313,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, & h_in(:,:,:)=h(:,:,:) t_in(:,:,:)=tv%T(:,:,:) s_in(:,:,:)=tv%S(:,:,:) - + if (stoch_CS%id_sppt_wts > 0) then call post_data(stoch_CS%id_sppt_wts, stoch_CS%sppt_wts, CS%diag) endif diff --git a/src/parameterizations/vertical/MOM_energetic_PBL.F90 b/src/parameterizations/vertical/MOM_energetic_PBL.F90 index e000f1972d..3828e9483b 100644 --- a/src/parameterizations/vertical/MOM_energetic_PBL.F90 +++ b/src/parameterizations/vertical/MOM_energetic_PBL.F90 @@ -301,7 +301,6 @@ subroutine energetic_PBL(h_3d, u_3d, v_3d, tv, fluxes, dt, Kd_int, G, GV, US, CS type(wave_parameters_CS), & optional, pointer :: Waves !< Wave CS type(stochastic_CS), pointer :: stoch_CS !< The control structure returned by a previous - ! This subroutine determines the diffusivities from the integrated energetics ! mixed layer model. It assumes that heating, cooling and freshwater fluxes