Skip to content

Commit

Permalink
Merge pull request mom-ocean#816 from adcroft/more-final-doxy
Browse files Browse the repository at this point in the history
More "final" doxygen fixes
  • Loading branch information
Hallberg-NOAA authored Jul 11, 2018
2 parents a929cae + ec4fe6e commit 922be4f
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 217 deletions.
7 changes: 4 additions & 3 deletions config_src/solo_driver/Neverland_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ module Neverland_surface_forcing
public Neverland_surface_forcing_init

!> This control structure should be used to store any run-time variables
!! associated with the Neverland forcing. It can be readily modified
!! for a specific case, and because it is private there will be no changes
!! needed in other code (although they will have to be recompiled).
!! associated with the Neverland forcing.
!!
!! It can be readily modified for a specific case, and because it is private there
!! will be no changes needed in other code (although they will have to be recompiled).
type, public :: Neverland_surface_forcing_CS ; private

logical :: use_temperature !< If true, use temperature and salinity.
Expand Down
73 changes: 29 additions & 44 deletions config_src/solo_driver/user_surface_forcing.F90
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
!> Template for user to code up surface forcing.
module user_surface_forcing

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

!********+*********+*********+*********+*********+*********+*********+**
!* *
!* Rewritten by Robert Hallberg, June 2009 *
!* *
!* This file contains the subroutines that a user should modify to *
!* to set the surface wind stresses and fluxes of buoyancy or *
!* temperature and fresh water. They are called when the run-time *
!* parameters WIND_CONFIG or BUOY_CONFIG are set to "USER". The *
!* standard version has simple examples, along with run-time error *
!* messages that will cause the model to abort if this code has not *
!* been modified. This code is intended for use with relatively *
!* simple specifications of the forcing. For more complicated forms, *
!* it is probably a good idea to read the forcing from input files *
!* using "file" for WIND_CONFIG and BUOY_CONFIG. *
!* *
!* USER_wind_forcing should set the surface wind stresses (taux and *
!* tauy) perhaps along with the surface friction velocity (ustar). *
!* *
!* USER_buoyancy forcing is used to set the surface buoyancy *
!* forcing, which may include a number of fresh water flux fields *
!* (evap, lprec, fprec, lrunoff, frunoff, and *
!* vprec) and the surface heat fluxes (sw, lw, latent and sens) *
!* if temperature and salinity are state variables, or it may simply *
!* be the buoyancy flux if it is not. This routine also has coded a *
!* restoring to surface values of temperature and salinity. *
!* *
!* Macros written all in capital letters are defined in MOM_memory.h. *
!* *
!* A small fragment of the grid is shown below: *
!* *
!* j+1 x ^ x ^ x At x: q *
!* j+1 > o > o > At ^: v, tauy *
!* j x ^ x ^ x At >: u, taux *
!* j > o > o > At o: h, fluxes. *
!* j-1 x ^ x ^ x *
!* i-1 i i+1 At x & ^: *
!* i i+1 At > & o: *
!* *
!* The boundaries always run through q grid points (x). *
!* *
!********+*********+*********+*********+*********+*********+*********+**
use MOM_diag_mediator, only : post_data, query_averaging_enabled
use MOM_diag_mediator, only : register_diag_field, diag_ctrl, safe_alloc_ptr
use MOM_domains, only : pass_var, pass_vector, AGRID
Expand All @@ -62,9 +22,10 @@ module user_surface_forcing
public USER_wind_forcing, USER_buoyancy_forcing, USER_surface_forcing_init

!> This control structure should be used to store any run-time variables
!! associated with the user-specified forcing. It can be readily modified
!! for a specific case, and because it is private there will be no changes
!! needed in other code (although they will have to be recompiled).
!! associated with the user-specified forcing.
!!
!! It can be readily modified for a specific case, and because it is private there
!! will be no changes needed in other code (although they will have to be recompiled).
type, public :: user_surface_forcing_CS ; private
! The variables in the cannonical example are used for some common
! cases, but do not need to be used.
Expand Down Expand Up @@ -360,4 +321,28 @@ subroutine USER_surface_forcing_init(Time, G, param_file, diag, CS)

end subroutine USER_surface_forcing_init

!! \namespace user_surface_forcing
!!
!! This file contains the subroutines that a user should modify to
!! to set the surface wind stresses and fluxes of buoyancy or
!! temperature and fresh water. They are called when the run-time
!! parameters WIND_CONFIG or BUOY_CONFIG are set to "USER". The
!! standard version has simple examples, along with run-time error
!! messages that will cause the model to abort if this code has no
!! been modified. This code is intended for use with relatively
!! simple specifications of the forcing. For more complicated forms,
!! it is probably a good idea to read the forcing from input files
!! using "file" for WIND_CONFIG and BUOY_CONFIG.
!!
!! USER_wind_forcing() should set the surface wind stresses (taux and
!! tauy) perhaps along with the surface friction velocity (ustar).
!!
!! USER_buoyancy() forcing is used to set the surface buoyancy
!! forcing, which may include a number of fresh water flux fields
!! (evap, lprec, fprec, lrunoff, frunoff, and
!! vprec) and the surface heat fluxes (sw, lw, latent and sens)
!! if temperature and salinity are state variables, or it may simply
!! be the buoyancy flux if it is not. This routine also has coded a
!! restoring to surface values of temperature and salinity.

end module user_surface_forcing
8 changes: 5 additions & 3 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
!> This module contains the main regridding routines.
!!
!! Regridding comprises two steps:
!! (1) Interpolation and creation of a new grid based on target interface
!! densities (or any other criterion).
!! (2) Remapping of quantities between old grid and new grid.
!! 1. Interpolation and creation of a new grid based on target interface
!! densities (or any other criterion).
!! 2. Remapping of quantities between old grid and new grid.
!!
!! Original module written by Laurent White, 2008.06.09
module MOM_ALE

Expand Down
143 changes: 65 additions & 78 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
@@ -1,79 +1,8 @@
!> Baropotric solver
module MOM_barotropic

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

!********+*********+*********+*********+*********+*********+*********+**
!* *
!* By Robert Hallberg, April 1994 - January 2007 *
!* *
!* This program contains the subroutines that time steps the *
!* linearized barotropic equations. btstep is used to actually *
!* time step the barotropic equations, and contains most of the *
!* substance of this module. *
!* *
!* btstep uses a forwards-backwards based scheme to time step *
!* the barotropic equations, returning the layers' accelerations due *
!* to the barotropic changes in the ocean state, the final free *
!* surface height (or column mass), and the volume (or mass) fluxes *
!* summed through the layers and averaged over the baroclinic time *
!* step. As input, btstep takes the initial 3-D velocities, the *
!* inital free surface height, the 3-D accelerations of the layers, *
!* and the external forcing. Everything in btstep is cast in terms *
!* of anomalies, so if everything is in balance, there is explicitly *
!* no acceleration due to btstep. *
!* *
!* The spatial discretization of the continuity equation is second *
!* order accurate. A flux conservative form is used to guarantee *
!* global conservation of volume. The spatial discretization of the *
!* momentum equation is second order accurate. The Coriolis force *
!* is written in a form which does not contribute to the energy *
!* tendency and which conserves linearized potential vorticity, f/D. *
!* These terms are exactly removed from the baroclinic momentum *
!* equations, so the linearization of vorticity advection will not *
!* degrade the overall solution. *
!* *
!* btcalc calculates the fractional thickness of each layer at the *
!* velocity points, for later use in calculating the barotropic *
!* velocities and the averaged accelerations. Harmonic mean *
!* thicknesses (i.e. 2*h_L*h_R/(h_L + h_R)) are used to avoid overly *
!* strong weighting of overly thin layers. This may later be relaxed *
!* to use thicknesses determined from the continuity equations. *
!* *
!* bt_mass_source determines the real mass sources for the *
!* barotropic solver, along with the corrective pseudo-fluxes that *
!* keep the barotropic and baroclinic estimates of the free surface *
!* height close to each other. Given the layer thicknesses and the *
!* free surface height that correspond to each other, it calculates *
!* a corrective mass source that is added to the barotropic continuity*
!* equation, and optionally adjusts a slowly varying correction rate. *
!* Newer algorithmic changes have deemphasized the need for this, but *
!* it is still here to add net water sources to the barotropic solver.*
!* *
!* barotropic_init allocates and initializes any barotropic arrays *
!* that have not been read from a restart file, reads parameters from *
!* the inputfile, and sets up diagnostic fields. *
!* *
!* barotropic_end deallocates anything allocated in barotropic_init *
!* or register_barotropic_restarts. *
!* *
!* register_barotropic_restarts is used to indicate any fields that *
!* are private to the barotropic solver that need to be included in *
!* the restart files, and to ensure that they are read. *
!* *
!* A small fragment of the grid is shown below: *
!* *
!* j+1 x ^ x ^ x At x: q, CoriolisBu *
!* j+1 > o > o > At ^: v_in, vbt, accel_layer_v, vbtav *
!* j x ^ x ^ x At >: u_in, ubt, accel_layer_u, ubtav, amer *
!* j > o > o > At o: eta, h, bathyT, pbce *
!* j-1 x ^ x ^ x *
!* i-1 i i+1 *
!* i i+1 *
!* *
!* The boundaries always run through q grid points (x). *
!* *
!********+*********+*********+*********+*********+*********+*********+**

use MOM_debugging, only : hchksum, uvchksum
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, query_averaging_enabled, register_diag_field
Expand Down Expand Up @@ -172,10 +101,10 @@ module MOM_barotropic
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_) :: lin_drag_u
!< A spatially varying linear drag coefficient acting on the zonal barotropic flow, in H s-1.
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_) :: uhbt_IC
!< The barotropic solver's estimate of the zonal transport as the initial condition for
!< The barotropic solvers estimate of the zonal transport as the initial condition for
!! the next call to btstep, in H m2 s-1.
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_) :: ubt_IC
!< The barotropic solver's estimate of the zonal velocity that will be the initial
!< The barotropic solvers estimate of the zonal velocity that will be the initial
!! condition for the next call to btstep, in m s-1.
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEM_) :: ubtav
!< The barotropic zonal velocity averaged over the baroclinic time step, m s-1.
Expand All @@ -184,10 +113,10 @@ module MOM_barotropic
real ALLOCABLE_, dimension(NIMEM_,NJMEMB_PTR_) :: lin_drag_v
!< A spatially varying linear drag coefficient acting on the zonal barotropic flow, in H s-1.
real ALLOCABLE_, dimension(NIMEM_,NJMEMB_PTR_) :: vhbt_IC
!< The barotropic solver's estimate of the zonal transport as the initial condition for
!< The barotropic solvers estimate of the zonal transport as the initial condition for
!! the next call to btstep, in H m2 s-1.
real ALLOCABLE_, dimension(NIMEM_,NJMEMB_PTR_) :: vbt_IC
!< The barotropic solver's estimate of the zonal velocity that will be the initial
!< The barotropic solvers estimate of the zonal velocity that will be the initial
!! condition for the next call to btstep, in m s-1.
real ALLOCABLE_, dimension(NIMEM_,NJMEMB_PTR_) :: vbtav
!< The barotropic meridional velocity averaged over the baroclinic time step, m s-1.
Expand Down Expand Up @@ -219,7 +148,7 @@ module MOM_barotropic
real, dimension(:,:,:), pointer :: frhatu1 => NULL() !< Predictor step values of frhatu stored for diagnostics.
real, dimension(:,:,:), pointer :: frhatv1 => NULL() !< Predictor step values of frhatv stored for diagnostics.

type(BT_OBC_type) :: BT_OBC !< A structure with all of this module's fields
type(BT_OBC_type) :: BT_OBC !< A structure with all of this modules fields
!! for applying open boundary conditions.

real :: Rho0 !< The density used in the Boussinesq
Expand Down Expand Up @@ -328,7 +257,7 @@ module MOM_barotropic
logical :: use_old_coriolis_bracket_bug !< If True, use an order of operations
!! that is not bitwise rotationally symmetric in the
!! meridional Coriolis term of the barotropic solver.
type(time_type), pointer :: Time => NULL() !< A pointer to the ocean model's clock.
type(time_type), pointer :: Time => NULL() !< A pointer to the ocean models clock.
type(diag_ctrl), pointer :: diag => NULL() !< A structure that is used to regulate
!! the timing of diagnostic output.
type(MOM_domain_type), pointer :: BT_Domain => NULL()
Expand Down Expand Up @@ -4506,4 +4435,62 @@ subroutine register_barotropic_restarts(HI, GV, param_file, CS, restart_CS)

end subroutine register_barotropic_restarts

!> \namespace mom_barotropic
!!
!! By Robert Hallberg, April 1994 - January 2007
!!
!! This program contains the subroutines that time steps the
!! linearized barotropic equations. btstep is used to actually
!! time step the barotropic equations, and contains most of the
!! substance of this module.
!!
!! btstep uses a forwards-backwards based scheme to time step
!! the barotropic equations, returning the layers' accelerations due
!! to the barotropic changes in the ocean state, the final free
!! surface height (or column mass), and the volume (or mass) fluxes
!! summed through the layers and averaged over the baroclinic time
!! step. As input, btstep takes the initial 3-D velocities, the
!! inital free surface height, the 3-D accelerations of the layers,
!! and the external forcing. Everything in btstep is cast in terms
!! of anomalies, so if everything is in balance, there is explicitly
!! no acceleration due to btstep.
!!
!! The spatial discretization of the continuity equation is second
!! order accurate. A flux conservative form is used to guarantee
!! global conservation of volume. The spatial discretization of the
!! momentum equation is second order accurate. The Coriolis force
!! is written in a form which does not contribute to the energy
!! tendency and which conserves linearized potential vorticity, f/D.
!! These terms are exactly removed from the baroclinic momentum
!! equations, so the linearization of vorticity advection will not
!! degrade the overall solution.
!!
!! btcalc calculates the fractional thickness of each layer at the
!! velocity points, for later use in calculating the barotropic
!! velocities and the averaged accelerations. Harmonic mean
!! thicknesses (i.e. 2*h_L*h_R/(h_L + h_R)) are used to avoid overly
!! strong weighting of overly thin layers. This may later be relaxed
!! to use thicknesses determined from the continuity equations.
!!
!! bt_mass_source determines the real mass sources for the
!! barotropic solver, along with the corrective pseudo-fluxes that
!! keep the barotropic and baroclinic estimates of the free surface
!! height close to each other. Given the layer thicknesses and the
!! free surface height that correspond to each other, it calculates
!! a corrective mass source that is added to the barotropic continuity*
!! equation, and optionally adjusts a slowly varying correction rate.
!! Newer algorithmic changes have deemphasized the need for this, but
!! it is still here to add net water sources to the barotropic solver.*
!!
!! barotropic_init allocates and initializes any barotropic arrays
!! that have not been read from a restart file, reads parameters from
!! the inputfile, and sets up diagnostic fields.
!!
!! barotropic_end deallocates anything allocated in barotropic_init
!! or register_barotropic_restarts.
!!
!! register_barotropic_restarts is used to indicate any fields that
!! are private to the barotropic solver that need to be included in
!! the restart files, and to ensure that they are read.

end module MOM_barotropic
9 changes: 5 additions & 4 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ module MOM_forcing_type
public set_derived_forcing_fields, copy_back_forcing_fields, set_net_mass_forcing

!> Structure that contains pointers to the boundary forcing used to drive the
!! liquid ocean simulated by MOM. Data in this type is allocated in the module
!! MOM_surface_forcing.F90, of which there are three: solo, coupled, and
!! ice-shelf. Alternatively, they are allocated in MESO_surface_forcing.F90,
!! which is a special case of solo_driver/MOM_surface_forcing.F90.
!! liquid ocean simulated by MOM.
!!
!! Data in this type is allocated in the module MOM_surface_forcing.F90, of which there
!! are three: solo, coupled, and ice-shelf. Alternatively, they are allocated in
!! MESO_surface_forcing.F90, which is a special case of solo_driver/MOM_surface_forcing.F90.
type, public :: forcing

! Pointers in this module should be initialized to NULL.
Expand Down
Loading

0 comments on commit 922be4f

Please sign in to comment.