From 237a5109b474e9849d67c6f07595fb85b7fbaed7 Mon Sep 17 00:00:00 2001 From: pjpegion Date: Wed, 28 Jul 2021 19:40:29 +0000 Subject: [PATCH] add comments --- .../MOM_stochastics.F90 | 16 +++------------- .../MOM_stochastics_stub.F90 | 17 +++++++++-------- src/core/MOM.F90 | 4 +--- .../vertical/MOM_diabatic_driver.F90 | 2 +- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 index ab33a17c29..427b3c754b 100644 --- a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 +++ b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics.F90 @@ -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 @@ -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 @@ -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 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 89a6d43c4f..349d56c0c7 100644 --- a/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 +++ b/config_src/external/OCEAN_stochastic_phyiscs/MOM_stochastics_stub.F90 @@ -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 @@ -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 diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index fdb6f9b0a9..3b6974ec1b 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 - + ! 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 @@ -2380,8 +2380,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. diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index 21d27a6f4b..83d817c0d2 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -305,7 +305,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))