user_revise_forcing.F90
1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> Provides a template for users to code updating the forcing fluxes.
6module user_revise_forcing
7
8use mom_domains, only : pass_var, pass_vector, agrid
9use mom_error_handler, only : mom_error, fatal, warning, is_root_pe
10use mom_file_parser, only : get_param, log_version, param_file_type
11use mom_forcing_type, only : forcing
12use mom_grid, only : ocean_grid_type
13use mom_io, only : file_exists, mom_read_data
14use mom_restart, only : register_restart_field, mom_restart_cs
15use mom_time_manager, only : time_type, operator(+), operator(/)
16use mom_tracer_flow_control, only : call_tracer_set_forcing
17use mom_tracer_flow_control, only : tracer_flow_control_cs
18use mom_variables, only : surface
19
20implicit none ; private
21
22public user_alter_forcing, user_revise_forcing_init
23
24!> Control structure for user_revise_forcing
25type, public :: user_revise_forcing_cs ; private
26 real :: cdrag !< The quadratic bottom drag coefficient [nondim]
27end type user_revise_forcing_cs
28
29contains
30
31!> This subroutine sets the surface wind stresses.
32subroutine user_alter_forcing(sfc_state, fluxes, day, G, CS)
33 type(surface), intent(in) :: sfc_state !< A structure containing fields that
34 !! describe the surface state of the ocean.
35 type(forcing), intent(inout) :: fluxes !< A structure containing pointers to any
36 !! possible forcing fields. Unused fields
37 !! have NULL ptrs.
38 type(time_type), intent(in) :: day !< Time of the fluxes.
39 type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
40 type(user_revise_forcing_cs), pointer :: cs !< A pointer to the control structure
41 !! returned by a previous call to
42 !! surface_forcing_init.
43 return
44
45end subroutine user_alter_forcing
46
47!> Initialize the user_revise_forcing control structure
48subroutine user_revise_forcing_init(param_file,CS)
49 type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to
50 !! parse for model parameter values.
51 type(user_revise_forcing_cs), pointer :: cs !< A pointer to the control structure
52 !! returned by a previous call to
53 !! surface_forcing_init.
54
55 ! This include declares and sets the variable "version".
56# include "version_variable.h"
57 character(len=40) :: mdl = "user_revise_forcing" !< This module's name.
58
59 call log_version(param_file, mdl, version)
60
61end subroutine user_revise_forcing_init
62
63end module user_revise_forcing