Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pjpegion authored and kshedstrom committed Jan 28, 2022
1 parent 15e4029 commit 59e733f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
16 changes: 3 additions & 13 deletions config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ module MOM_stochastics
! This file is part of MOM6. See LICENSE.md for the license.

! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, termination and update of ocean model state. This
! for initialization, update, and writing restart of stochastic physics. This
! particular version wraps all of the calls for MOM6 in the calls that had
! been used for MOM4.
!
! This code is a stop-gap wrapper of the MOM6 code to enable it to be called
! in the same way as MOM4.

use MOM_diag_mediator, only : register_diag_field, diag_ctrl, time_type
use MOM_grid, only : ocean_grid_type
use MOM_verticalGrid, only : verticalGrid_type
Expand Down Expand Up @@ -45,17 +42,9 @@ module MOM_stochastics
type(time_type), pointer :: Time !< Pointer to model time (needed for sponges)
end type stochastic_CS

!> This type is used for communication with other components via the FMS coupler.
!! The element names and types can be changed only with great deliberation, hence
!! the persistnce of things like the cutsy element name "avg_kount".
contains

!> ocean_model_init initializes the ocean model, including registering fields
!! for restarts and reading restart files if appropriate.
!!
!! This subroutine initializes both the ocean state and the ocean surface type.
!! Because of the way that indicies and domains are handled, Ocean_sfc must have
!! been used in a previous call to cean_type.
!! This subroutine initializes the stochastics physics control structure.
subroutine stochastics_init(dt, grid, GV, CS, param_file, diag, Time)
real, intent(in) :: dt !< time step [T ~> s]
type(ocean_grid_type), intent(in) :: grid ! horizontal grid information
Expand Down Expand Up @@ -135,6 +124,7 @@ subroutine stochastics_init(dt, grid, GV, CS, param_file, diag, Time)
write(*,'(/12x,a/)') '=== COMPLETED MOM STOCHASTIC INITIALIZATION ====='

call callTree_leave("ocean_model_init(")
return
end subroutine stochastics_init

!> update_ocean_model uses the forcing in Ice_ocean_boundary to advance the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ module MOM_stochastics

! This file is part of MOM6. See LICENSE.md for the license.

! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, termination and update of ocean model state. This
! particular version wraps all of the calls for MOM6 in the calls that had
! been used for MOM4.
!
! This code is a stop-gap wrapper of the MOM6 code to enable it to be called
! in the same way as MOM4.
! This is the top level module for the MOM6 ocean model. It contains
! placeholder for initialization, update, and writing restarts of ocean stochastic physics.
! The actualy stochastic physics is available at
! https://github.com/ufs-community/ufs-weather-model
!

use MOM_diag_mediator, only : register_diag_field, diag_ctrl, time_type
use MOM_grid, only : ocean_grid_type
Expand Down Expand Up @@ -62,6 +60,9 @@ subroutine update_stochastics(CS)
type(stochastic_CS), intent(inout) :: CS !< diabatic control structure
return
end subroutine update_stochastics

subroutine write_mom_restart_stoch(filename)
character(len=*) :: filename
return
end subroutine write_mom_restart_stoch
end module MOM_stochastics

4 changes: 1 addition & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
call disable_averaging(CS%diag)
endif
endif

! advance the random pattern if stochastic physics is active
if (CS%stoch_CS%do_sppt .OR. CS%stoch_CS%pert_epbl) call update_stochastics(CS%stoch_CS)

if (do_dyn) then
Expand Down Expand Up @@ -2495,8 +2495,6 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &

if (.not. CS%rotate_index) &
G => G_in
! initialize stochastic physics
!call stochastics_init(CS%dt_therm, CS%G, CS%GV, CS%stoch_CS, param_file, diag, Time)
! Set a few remaining fields that are specific to the ocean grid type.
call set_first_direction(G, first_direction)
! Allocate the auxiliary non-symmetric domain for debugging or I/O purposes.
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &

if (G%ke == 1) return

! save copy of the date for SPPT
! save copy of the date for SPPT if active
if (stoch_CS%do_sppt) then
allocate(h_in(G%isd:G%ied, G%jsd:G%jed,G%ke))
allocate(t_in(G%isd:G%ied, G%jsd:G%jed,G%ke))
Expand Down

0 comments on commit 59e733f

Please sign in to comment.