Skip to content

Commit eb88219

Browse files
committed
clean up of code for MOM6 coding standards
1 parent 6e3ea1b commit eb88219

4 files changed

Lines changed: 24 additions & 23 deletions

File tree

config_src/nuopc_driver/mom_ocean_model_nuopc.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,10 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn, i
455455
return
456456
endif
457457

458-
if (OS%do_sppt) allocate(OS%stochastics%sppt_wts(OS%grid%isd:OS%grid%ied,OS%grid%jsd:OS%grid%jed))
458+
if (OS%do_sppt) allocate(OS%stochastics%sppt_wts(OS%grid%isd:OS%grid%ied, OS%grid%jsd:OS%grid%jed))
459459
if (OS%pert_epbl) then
460-
allocate(OS%stochastics%t_rp1(OS%grid%isd:OS%grid%ied,OS%grid%jsd:OS%grid%jed))
461-
allocate(OS%stochastics%t_rp2(OS%grid%isd:OS%grid%ied,OS%grid%jsd:OS%grid%jed))
460+
allocate(OS%stochastics%t_rp1(OS%grid%isd:OS%grid%ied, OS%grid%jsd:OS%grid%jed))
461+
allocate(OS%stochastics%t_rp2(OS%grid%isd:OS%grid%ied, OS%grid%jsd:OS%grid%jed))
462462
endif
463463
endif
464464
call close_param_file(param_file)
@@ -632,7 +632,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
632632

633633
! update stochastic physics patterns before running next time-step
634634
if (OS%do_sppt .OR. OS%pert_epbl ) then
635-
call run_stochastic_physics_ocn(OS%stochastics%sppt_wts,OS%stochastics%t_rp1,OS%stochastics%t_rp2)
635+
call run_stochastic_physics_ocn(OS%stochastics%sppt_wts, OS%stochastics%t_rp1, OS%stochastics%t_rp2)
636636
endif
637637

638638
if (OS%offline_tracer_mode) then

src/core/MOM.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ module MOM
123123
use MOM_variables, only : surface, allocate_surface_state, deallocate_surface_state
124124
use MOM_variables, only : thermo_var_ptrs, vertvisc_type
125125
use MOM_variables, only : accel_diag_ptrs, cont_diag_ptrs, ocean_internal_state
126-
use MOM_variables, only : rotate_surface_state,stochastic_pattern
126+
use MOM_variables, only : rotate_surface_state, stochastic_pattern
127127
use MOM_verticalGrid, only : verticalGrid_type, verticalGridInit, verticalGridEnd
128128
use MOM_verticalGrid, only : fix_restart_scaling
129129
use MOM_verticalGrid, only : get_thickness_units, get_flux_units, get_tr_flux_units

src/parameterizations/vertical/MOM_diabatic_driver.F90

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &
300300

301301
! save copy of the date for SPPT
302302
if (CS%do_sppt) then
303-
h_in=h
304-
t_in=tv%T
305-
s_in=tv%S
303+
h_in(:,:,:)=h(:,:,:)
304+
t_in(:,:,:)=tv%T(:,:,:)
305+
s_in(:,:,:)=tv%S(:,:,:)
306306

307307
if (CS%id_sppt_wts > 0) then
308308
call post_data(CS%id_sppt_wts, stochastics%sppt_wts, CS%diag)
@@ -456,23 +456,24 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &
456456
if (CS%debugConservation) call MOM_state_stats('leaving diabatic', u, v, h, tv%T, tv%S, G, GV, US)
457457

458458
if (CS%do_sppt) then
459+
! perturb diabatic tendecies
459460
do k=1,nz
460461
do j=js,je
461462
do i=is,ie
462-
h_tend = (h(i,j,k)-h_in(i,j,k))*stochastics%sppt_wts(i,j)
463-
t_tend = (tv%T(i,j,k)-t_in(i,j,k))*stochastics%sppt_wts(i,j)
464-
s_tend = (tv%S(i,j,k)-s_in(i,j,k))*stochastics%sppt_wts(i,j)
465-
h_pert=h_tend+h_in(i,j,k)
466-
t_pert=t_tend+t_in(i,j,k)
467-
s_pert=s_tend+s_in(i,j,k)
463+
h_tend = (h(i,j,k) - h_in(i,j,k)) * stochastics%sppt_wts(i,j)
464+
t_tend = (tv%T(i,j,k) - t_in(i,j,k)) * stochastics%sppt_wts(i,j)
465+
s_tend = (tv%S(i,j,k) - s_in(i,j,k)) * stochastics%sppt_wts(i,j)
466+
h_pert = h_tend + h_in(i,j,k)
467+
t_pert = t_tend + t_in(i,j,k)
468+
s_pert = s_tend + s_in(i,j,k)
468469
if (h_pert > GV%Angstrom_H) then
469-
h(i,j,k)=h_pert
470+
h(i,j,k) = h_pert
470471
else
471-
h(i,j,k)=GV%Angstrom_H
472+
h(i,j,k) = GV%Angstrom_H
472473
endif
473-
tv%T(i,j,k)=t_pert
474+
tv%T(i,j,k) = t_pert
474475
if (s_pert > 0.0) then
475-
tv%S(i,j,k)=s_pert
476+
tv%S(i,j,k) = s_pert
476477
endif
477478
enddo
478479
enddo

src/parameterizations/vertical/MOM_energetic_PBL.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ module MOM_energetic_PBL
196196
integer :: id_TKE_mech_decay = -1, id_TKE_conv_decay = -1
197197
integer :: id_Mixing_Length = -1, id_Velocity_Scale = -1
198198
integer :: id_MSTAR_mix = -1, id_LA_mod = -1, id_LA = -1, id_MSTAR_LT = -1
199-
integer :: id_t_rp1=-1,id_t_rp2=-1
199+
integer :: id_t_rp1=-1, id_t_rp2=-1
200200
!>@}
201201
end type energetic_PBL_CS
202202

@@ -539,8 +539,8 @@ subroutine energetic_PBL(h_3d, u_3d, v_3d, tv, fluxes, dt, Kd_int, G, GV, US, CS
539539
! only write random patterns if running with stochastic physics, otherwise the
540540
! array is unallocated and will give an error
541541
if (CS%pert_epbl) then
542-
if (CS%id_t_rp1 > 0) call post_data(CS%id_t_rp1, stochastics%t_rp1, CS%diag)
543-
if (CS%id_t_rp2 > 0) call post_data(CS%id_t_rp2, stochastics%t_rp2, CS%diag)
542+
if (CS%id_t_rp1 > 0) call post_data(CS%id_t_rp1, stochastics%t_rp1, CS%diag)
543+
if (CS%id_t_rp2 > 0) call post_data(CS%id_t_rp2, stochastics%t_rp2, CS%diag)
544544
endif
545545
endif
546546

@@ -895,7 +895,7 @@ subroutine ePBL_column(h, u, v, T0, S0, dSV_dT, dSV_dS, TKE_forcing, B_flux, abs
895895
mech_TKE = MSTAR_total * (dt*GV%Rho0* u_star**3)
896896
endif
897897
! stochastically pertrub mech_TKE in the UFS
898-
if (CS%pert_epbl) mech_TKE=mech_TKE*stochastics%t_rp1(i,j)
898+
if (CS%pert_epbl) mech_TKE = mech_TKE * stochastics%t_rp1(i,j)
899899

900900
if (CS%TKE_diagnostics) then
901901
eCD%dTKE_conv = 0.0 ; eCD%dTKE_mixing = 0.0
@@ -978,7 +978,7 @@ subroutine ePBL_column(h, u, v, T0, S0, dSV_dT, dSV_dS, TKE_forcing, B_flux, abs
978978
if (Idecay_len_TKE > 0.0) exp_kh = exp(-h(k-1)*Idecay_len_TKE)
979979
if (CS%TKE_diagnostics) &
980980
eCD%dTKE_mech_decay = eCD%dTKE_mech_decay + (exp_kh-1.0) * mech_TKE * I_dtdiag
981-
if (CS%pert_epbl) then ! perturb the TKE destruction
981+
if (CS%pert_epbl) then ! perturb the TKE dissipation
982982
mech_TKE = mech_TKE * (1+(exp_kh-1) * stochastics%t_rp2(i,j))
983983
else
984984
mech_TKE = mech_TKE * exp_kh

0 commit comments

Comments
 (0)