From 0da8297070d758fa16098af8ff2977256d495688 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Wed, 11 Jul 2018 15:56:58 -0400 Subject: [PATCH] Module dOxyGenization for MOM_variables & vertGrid Added dOxygen comments describing the whole MOM_variables and MOM_verticalGrid modules. All answers are bitwise identical. --- src/core/MOM_variables.F90 | 61 +++++++++++++++++------------------ src/core/MOM_verticalGrid.F90 | 54 +++++++++++-------------------- 2 files changed, 49 insertions(+), 66 deletions(-) diff --git a/src/core/MOM_variables.F90 b/src/core/MOM_variables.F90 index d176b407d3..4165fb0e11 100644 --- a/src/core/MOM_variables.F90 +++ b/src/core/MOM_variables.F90 @@ -1,3 +1,4 @@ +!> Provides transparent structures with groups of MOM6 variables and supporting routines module MOM_variables ! This file is part of MOM6. See LICENSE.md for the license. @@ -116,29 +117,29 @@ module MOM_variables !! they refer to in MOM.F90. type, public :: ocean_internal_state real, pointer, dimension(:,:,:) :: & - T => NULL(), & !< Pointer to the temperature state variable - S => NULL(), & !< Pointer to the salinity state variable - u => NULL(), & !< Pointer to the zonal velocity - v => NULL(), & !< Pointer to the meridional velocity - h => NULL() !< Pointer to the layer thicknesses + T => NULL(), & !< Pointer to the temperature state variable, in deg C + S => NULL(), & !< Pointer to the salinity state variable, in PSU or g/kg + u => NULL(), & !< Pointer to the zonal velocity, in m s-1 + v => NULL(), & !< Pointer to the meridional velocity, in m s-1 + h => NULL() !< Pointer to the layer thicknesses, in H (often m or kg m-2) real, pointer, dimension(:,:,:) :: & - uh => NULL(), & !< Pointer to zonal transports - vh => NULL() !< Pointer to meridional transports + uh => NULL(), & !< Pointer to zonal transports, in H m2 s-1 + vh => NULL() !< Pointer to meridional transports, in H m2 s-1 real, pointer, dimension(:,:,:) :: & - CAu => NULL(), & !< Pointer to the zonal Coriolis and Advective acceleration - CAv => NULL(), & !< Pointer to the meridional Coriolis and Advective acceleration - PFu => NULL(), & !< Pointer to the zonal Pressure force acceleration - PFv => NULL(), & !< Pointer to the meridional Pressure force acceleration - diffu => NULL(), & !< Pointer to the zonal acceleration due to lateral viscosity - diffv => NULL(), & !< Pointer to the meridional acceleration due to lateral viscosity - pbce => NULL(), & !< Pointer to the baroclinic pressure force dependency on free surface movement - u_accel_bt => NULL(), & !< Pointer to the zonal barotropic-solver acceleration - v_accel_bt => NULL() !< Pointer to the meridional barotropic-solver acceleration + CAu => NULL(), & !< Pointer to the zonal Coriolis and Advective acceleration, in m s-2 + CAv => NULL(), & !< Pointer to the meridional Coriolis and Advective acceleration, in m s-2 + PFu => NULL(), & !< Pointer to the zonal Pressure force acceleration, in m s-2 + PFv => NULL(), & !< Pointer to the meridional Pressure force acceleration, in m s-2 + diffu => NULL(), & !< Pointer to the zonal acceleration due to lateral viscosity, in m s-2 + diffv => NULL(), & !< Pointer to the meridional acceleration due to lateral viscosity, in m s-2 + pbce => NULL(), & !< Pointer to the baroclinic pressure force dependency on free surface movement, in s-2 + u_accel_bt => NULL(), & !< Pointer to the zonal barotropic-solver acceleration, in m s-2 + v_accel_bt => NULL() !< Pointer to the meridional barotropic-solver acceleration, in m s-2 real, pointer, dimension(:,:,:) :: & - u_av => NULL(), & !< Pointer to zonal velocity averaged over the timestep - v_av => NULL(), & !< Pointer to meridional velocity averaged over the timestep - u_prev => NULL(), & !< Pointer to zonal velocity at the end of the last timestep - v_prev => NULL() !< Pointer to meridional velocity at the end of the last timestep + u_av => NULL(), & !< Pointer to zonal velocity averaged over the timestep, in m s-1 + v_av => NULL(), & !< Pointer to meridional velocity averaged over the timestep, in m s-1 + u_prev => NULL(), & !< Pointer to zonal velocity at the end of the last timestep, in m s-1 + v_prev => NULL() !< Pointer to meridional velocity at the end of the last timestep, in m s-1 end type ocean_internal_state !> Pointers to arrays with accelerations, which can later be used for derived diagnostics, like energy balances. @@ -234,8 +235,7 @@ module MOM_variables real, pointer, dimension(:,:,:) :: Kd_shear => NULL() !< The shear-driven turbulent diapycnal diffusivity at the interfaces between layers !! in tracer columns, in m2 s-1. - real, pointer, dimension(:,:,:) :: & - Kv_shear => NULL() + real, pointer, dimension(:,:,:) :: Kv_shear => NULL() !< The shear-driven turbulent vertical viscosity at the interfaces between layers !! in tracer columns, in m2 s-1. real, pointer, dimension(:,:,:) :: Kv_shear_Bu => NULL() @@ -290,13 +290,13 @@ module MOM_variables !! the ocean model. Unused fields are unallocated. subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & gas_fields_ocn) - type(ocean_grid_type), intent(in) :: G !< ocean grid structure - type(surface), intent(inout) :: sfc_state !< ocean surface state type to be allocated. - logical, optional, intent(in) :: use_temperature !< If true, allocate the space for thermodynamic variables. - logical, optional, intent(in) :: do_integrals !< If true, allocate the space for vertically - !! integrated fields. + type(ocean_grid_type), intent(in) :: G !< ocean grid structure + type(surface), intent(inout) :: sfc_state !< ocean surface state type to be allocated. + logical, optional, intent(in) :: use_temperature !< If true, allocate the space for thermodynamic variables. + logical, optional, intent(in) :: do_integrals !< If true, allocate the space for vertically + !! integrated fields. type(coupler_1d_bc_type), & - optional, intent(in) :: gas_fields_ocn !< If present, this type describes the ocean + optional, intent(in) :: gas_fields_ocn !< If present, this type describes the ocean !! ocean and surface-ice fields that will participate !! in the calculation of additional gas or other !! tracer fluxes, and can be used to spawn related @@ -327,8 +327,7 @@ subroutine allocate_surface_state(sfc_state, G, use_temperature, do_integrals, & allocate(sfc_state%v(isd:ied,JsdB:JedB)) ; sfc_state%v(:,:) = 0.0 if (alloc_integ) then - ! Allocate structures for the vertically integrated ocean_mass, ocean_heat, - ! and ocean_salt. + ! Allocate structures for the vertically integrated ocean_mass, ocean_heat, and ocean_salt. allocate(sfc_state%ocean_mass(isd:ied,jsd:jed)) ; sfc_state%ocean_mass(:,:) = 0.0 if (use_temp) then allocate(sfc_state%ocean_heat(isd:ied,jsd:jed)) ; sfc_state%ocean_heat(:,:) = 0.0 @@ -347,7 +346,7 @@ end subroutine allocate_surface_state !> Deallocates the elements of a surface state type. subroutine deallocate_surface_state(sfc_state) - type(surface), intent(inout) :: sfc_state !< ocean surface state type to be deallocated. + type(surface), intent(inout) :: sfc_state !< ocean surface state type to be deallocated here. if (.not.sfc_state%arrays_allocated) return diff --git a/src/core/MOM_verticalGrid.F90 b/src/core/MOM_verticalGrid.F90 index f1dda828e0..4eb972148b 100644 --- a/src/core/MOM_verticalGrid.F90 +++ b/src/core/MOM_verticalGrid.F90 @@ -1,3 +1,4 @@ +!> Provides a transparent vertical ocean grid type and supporting routines module MOM_verticalGrid ! This file is part of MOM6. See LICENSE.md for the license. @@ -56,14 +57,16 @@ module MOM_verticalGrid !> Allocates and initializes the ocean model vertical grid structure. subroutine verticalGridInit( param_file, GV ) -! This routine initializes the verticalGrid_type structure (GV). -! All memory is allocated but not necessarily set to meaningful values until later. type(param_file_type), intent(in) :: param_file !< Parameter file handle/type type(verticalGrid_type), pointer :: GV !< The container for vertical grid data -! This include declares and sets the variable "version". -#include "version_variable.h" + ! This routine initializes the verticalGrid_type structure (GV). + ! All memory is allocated but not necessarily set to meaningful values until later. + + ! Local variables integer :: nk, H_power real :: rescale_factor + ! This include declares and sets the variable "version". +# include "version_variable.h" character(len=16) :: mdl = 'MOM_verticalGrid' if (associated(GV)) call MOM_error(FATAL, & @@ -150,14 +153,11 @@ end subroutine verticalGridInit !> Returns the model's thickness units, usually m or kg/m^2. function get_thickness_units(GV) - character(len=48) :: get_thickness_units + character(len=48) :: get_thickness_units !< The vertical thickness units type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure -! This subroutine returns the appropriate units for thicknesses, -! depending on whether the model is Boussinesq or not and the scaling for -! the vertical thickness. - -! Arguments: G - The ocean's grid structure. -! (ret) get_thickness_units - The model's vertical thickness units. + ! This subroutine returns the appropriate units for thicknesses, + ! depending on whether the model is Boussinesq or not and the scaling for + ! the vertical thickness. if (GV%Boussinesq) then get_thickness_units = "m" @@ -168,14 +168,11 @@ end function get_thickness_units !> Returns the model's thickness flux units, usually m^3/s or kg/s. function get_flux_units(GV) - character(len=48) :: get_flux_units + character(len=48) :: get_flux_units !< The thickness flux units type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure -! This subroutine returns the appropriate units for thickness fluxes, -! depending on whether the model is Boussinesq or not and the scaling for -! the vertical thickness. - -! Arguments: G - The ocean's grid structure. -! (ret) get_flux_units - The model's thickness flux units. + ! This subroutine returns the appropriate units for thickness fluxes, + ! depending on whether the model is Boussinesq or not and the scaling for + ! the vertical thickness. if (GV%Boussinesq) then get_flux_units = "m3 s-1" @@ -201,20 +198,9 @@ function get_tr_flux_units(GV, tr_units, tr_vol_conc_units, tr_mass_conc_units) !! the units are mol kg-1, !! tr_vol_conc_units would be mol. -! This subroutine returns the appropriate units for thicknesses and fluxes, -! depending on whether the model is Boussinesq or not and the scaling for -! the vertical thickness. - -! Arguments: G - The ocean's grid structure. -! One of the following three arguments must be present. -! (in,opt) tr_units - Units for a tracer, for example Celsius or PSU. -! (in,opt) tr_vol_conc_units - The concentration units per unit volume, for -! example if the units are umol m-3, -! tr_vol_conc_units would be umol. -! (in,opt) tr_mass_conc_units - The concentration units per unit mass of sea -! water, for example if the units are mol kg-1, -! tr_vol_conc_units would be mol. -! (ret) get_tr_flux_units - The model's flux units for a tracer. + ! This subroutine returns the appropriate units for thicknesses and fluxes, + ! depending on whether the model is Boussinesq or not and the scaling for + ! the vertical thickness. integer :: cnt cnt = 0 @@ -253,7 +239,6 @@ end function get_tr_flux_units !> This sets the coordinate data for the "layer mode" of the isopycnal model. subroutine setVerticalGridAxes( Rlay, GV ) - ! Arguments type(verticalGrid_type), intent(inout) :: GV !< The container for vertical grid data real, dimension(GV%ke), intent(in) :: Rlay !< The layer target density ! Local variables @@ -276,8 +261,7 @@ end subroutine setVerticalGridAxes !> Deallocates the model's vertical grid structure. subroutine verticalGridEnd( GV ) -! Arguments: G - The ocean's grid structure. - type(verticalGrid_type), pointer :: GV !< The ocean's vertical grid structure + type(verticalGrid_type), pointer :: GV !< The ocean's vertical grid structure deallocate( GV%g_prime, GV%Rlay ) deallocate( GV%sInterface , GV%sLayer )