From f69cbf7a95b7edfe4d13cf126b52a3f45f807130 Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Thu, 12 Jul 2018 11:47:14 -0400 Subject: [PATCH 1/3] Doxygen config: only process ocean_model_MOM.F90 from coupled_driver - The duplicate files in solo_driver and coupled_driver cause conflicts when running doxygen. This configuration change avoids the duplicate files in coupled_driver. --- docs/Doxyfile_nortd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Doxyfile_nortd b/docs/Doxyfile_nortd index 7e1fcc39cf..e07ce4f0b6 100644 --- a/docs/Doxyfile_nortd +++ b/docs/Doxyfile_nortd @@ -793,8 +793,7 @@ WARN_LOGFILE = doxygen.log INPUT = ../src \ front_page.md \ ../config_src/solo_driver \ - ../config_src/dynamic_symmetric \ - ../config_src/coupled_driver/coupler_util.F90 \ + ../config_src/dynamic_symmetric ../config_src/coupled_driver/ocean_model_MOM.F90 # This tag can be used to specify the character encoding of the source files From 6478c0131629fc5771d9bd582cd8c2619d19e40a Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Thu, 12 Jul 2018 11:49:01 -0400 Subject: [PATCH 2/3] Fixes for doxumentation using doxygen 1.8.4 - Using the older version of doxygen revealed numerous modules without either the header summary line or any doxumentation at all. The newer versions are deliberately silent on these omissions. --- config_src/coupled_driver/coupler_util.F90 | 61 +++++----- config_src/coupled_driver/ocean_model_MOM.F90 | 104 +++--------------- .../solo_driver/MESO_surface_forcing.F90 | 68 +++++------- config_src/solo_driver/coupler_types.F90 | 11 +- config_src/solo_driver/coupler_util.F90 | 59 +++++----- src/diagnostics/MOM_PointAccel.F90 | 45 ++------ src/diagnostics/MOM_debugging.F90 | 76 +++++-------- src/diagnostics/MOM_diag_to_Z.F90 | 51 ++------- src/diagnostics/MOM_diagnostics.F90 | 25 +---- src/diagnostics/MOM_sum_output.F90 | 67 ++++------- src/diagnostics/MOM_wave_structure.F90 | 89 ++++++--------- src/ice_shelf/MOM_ice_shelf_initialize.F90 | 16 ++- .../lateral/MOM_tidal_forcing.F90 | 74 ++++++------- 13 files changed, 237 insertions(+), 509 deletions(-) diff --git a/config_src/coupled_driver/coupler_util.F90 b/config_src/coupled_driver/coupler_util.F90 index dde67c2976..2c72c56cce 100644 --- a/config_src/coupled_driver/coupler_util.F90 +++ b/config_src/coupled_driver/coupler_util.F90 @@ -1,9 +1,9 @@ +!> Provides a couple of interfaces to allow more transparent and +!! robust extraction of the various fields in the coupler types. module coupler_util ! This file is part of MOM6. See LICENSE.md for the license. -! This code provides a couple of interfaces to allow more transparent and -! robust extraction of the various fields in the coupler types. use MOM_error_handler, only : MOM_error, FATAL, WARNING use coupler_types_mod, only : coupler_2d_bc_type, ind_flux, ind_alpha use coupler_types_mod, only : ind_csurf @@ -15,24 +15,20 @@ module coupler_util contains +!> Extract an array of values in a coupler bc type subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, & is, ie, js, je, conversion) - type(coupler_2d_bc_type), intent(in) :: BC_struc - integer, intent(in) :: BC_index, BC_element - real, dimension(:,:), intent(out) :: array_out - integer, optional, intent(in) :: is, ie, js, je - real, optional, intent(in) :: conversion -! Arguments: BC_struc - The type from which the data is being extracted. -! (in) BC_index - The boundary condition number being extracted. -! (in) BC_element - The element of the boundary condition being extracted. -! This could be ind_csurf, ind_alpha, ind_flux or ind_deposition. -! (out) array_out - The array being filled with the input values. -! (in, opt) is, ie, js, je - The i- and j- limits of array_out to be filled. -! These must match the size of the corresponding value array or an -! error message is issued. -! (in, opt) conversion - A number that every element is multiplied by, to -! permit sign convention or unit conversion. - + type(coupler_2d_bc_type), intent(in) :: BC_struc !< The type from which the data is being extracted. + integer, intent(in) :: BC_index !< The boundary condition number being extracted. + integer, intent(in) :: BC_element !< The element of the boundary condition being extracted. + real, dimension(:,:), intent(out) :: array_out !< The array being filled with the input values. + integer, optional, intent(in) :: is !< Start i-index + integer, optional, intent(in) :: ie !< End i-index + integer, optional, intent(in) :: js !< Start j-index + integer, optional, intent(in) :: je !< End j-index + real, optional, intent(in) :: conversion !< A number that every element is multiplied by, to + !! permit sign convention or unit conversion. + ! Local variables real, pointer, dimension(:,:) :: Array_in real :: conv integer :: i, j, is0, ie0, js0, je0, i_offset, j_offset @@ -78,24 +74,21 @@ subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, & end subroutine extract_coupler_values +!> Set an array of values in a coupler bc type subroutine set_coupler_values(array_in, BC_struc, BC_index, BC_element, & is, ie, js, je, conversion) - real, dimension(:,:), intent(in) :: array_in - type(coupler_2d_bc_type), intent(inout) :: BC_struc - integer, intent(in) :: BC_index, BC_element - integer, optional, intent(in) :: is, ie, js, je - real, optional, intent(in) :: conversion -! Arguments: array_in - The array containing the values to load into the BC. -! (out) BC_struc - The type into which the data is being loaded. -! (in) BC_index - The boundary condition number being extracted. -! (in) BC_element - The element of the boundary condition being extracted. -! This could be ind_csurf, ind_alpha, ind_flux or ind_deposition. -! (in, opt) is, ie, js, je - The i- and j- limits of array_out to be filled. -! These must match the size of the corresponding value array or an -! error message is issued. -! (in, opt) conversion - A number that every element is multiplied by, to -! permit sign convention or unit conversion. - + real, dimension(:,:), intent(in) :: array_in !< The array containing the values to load into the BC. + type(coupler_2d_bc_type), intent(inout) :: BC_struc !< The type from which the data is being extracted. + integer, intent(in) :: BC_index !< The boundary condition number being extracted. + integer, intent(in) :: BC_element !< The element of the boundary condition being extracted. + !! This could be ind_csurf, ind_alpha, ind_flux or ind_deposition. + integer, optional, intent(in) :: is !< Start i-index + integer, optional, intent(in) :: ie !< End i-index + integer, optional, intent(in) :: js !< Start j-index + integer, optional, intent(in) :: je !< End j-index + real, optional, intent(in) :: conversion !< A number that every element is multiplied by, to + !! permit sign convention or unit conversion. + ! Local variables real, pointer, dimension(:,:) :: Array_out real :: conv integer :: i, j, is0, ie0, js0, je0, i_offset, j_offset diff --git a/config_src/coupled_driver/ocean_model_MOM.F90 b/config_src/coupled_driver/ocean_model_MOM.F90 index 3b17b54b26..a09a5bfe29 100644 --- a/config_src/coupled_driver/ocean_model_MOM.F90 +++ b/config_src/coupled_driver/ocean_model_MOM.F90 @@ -1,21 +1,15 @@ +!> Top-level module for the MOM6 ocean model in coupled mode. module ocean_model_mod ! 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. ! -! Robert Hallberg -! -! -! ! 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, only : initialize_MOM, step_MOM, MOM_control_struct, MOM_end use MOM, only : extract_surface_state, allocate_surface_state, finish_MOM_initialization @@ -221,15 +215,12 @@ module ocean_model_mod contains -!======================================================================= -! -! -! -! Initialize the ocean model. -! - !> 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 initialize_ocean_type. subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn) type(ocean_public_type), target, & intent(inout) :: Ocean_sfc !< A structure containing various publicly @@ -246,11 +237,7 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn) !! in the calculation of additional gas or other !! tracer fluxes, and can be used to spawn related !! internal variables in the ice model. - -! 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 initialize_ocean_type. - + ! Local variables real :: Rho0 ! The Boussinesq ocean density, in kg m-3. real :: G_Earth ! The gravitational acceleration in m s-2. ! This include declares and sets the variable "version". @@ -408,17 +395,6 @@ subroutine ocean_model_init(Ocean_sfc, OS, Time_init, Time_in, gas_fields_ocn) call callTree_leave("ocean_model_init(") end subroutine ocean_model_init -! NAME="ocean_model_init" - - -!======================================================================= -! -! -! -! Update in time the ocean model fields. This code wraps the call to step_MOM -! with MOM4's call. -! -! !> update_ocean_model uses the forcing in Ice_ocean_boundary to advance the !! ocean model's state from the input value of Ocean_state (which must be for @@ -449,7 +425,7 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, & logical, optional, intent(in) :: Ocn_fluxes_used !< If present, this indicates whether the !! cumulative thermodynamic fluxes from the ocean, !! like frazil, have been used and should be reset. - + ! Local variables type(time_type) :: Master_time ! This allows step_MOM to temporarily change ! the time that is seen by internal modules. type(time_type) :: Time1 ! The value of the ocean model's time at the @@ -676,20 +652,6 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, & call callTree_leave("update_ocean_model()") end subroutine update_ocean_model -! NAME="update_ocean_model" - - -!======================================================================= -! -! -! -! write out restart file. -! Arguments: -! timestamp (optional, intent in) : A character string that represents the model time, -! used for writing restart. timestamp will prepend to -! the any restart file name as a prefix. -! -! !> This subroutine writes out the ocean model restart file. subroutine ocean_model_restart(OS, timestamp) @@ -728,13 +690,6 @@ subroutine ocean_model_restart(OS, timestamp) end subroutine ocean_model_restart ! NAME="ocean_model_restart" -!======================================================================= -! -! -! -! Close down the ocean model -! - !> ocean_model_end terminates the model run, saving the ocean state in a restart !! and deallocating any data associated with the ocean. subroutine ocean_model_end(Ocean_sfc, Ocean_state, Time) @@ -745,22 +700,11 @@ subroutine ocean_model_end(Ocean_sfc, Ocean_state, Time) !! upon termination. type(time_type), intent(in) :: Time !< The model time, used for writing restarts. -! This subroutine terminates the model run, saving the ocean state in a -! restart file and deallocating any data associated with the ocean. - -! Arguments: Ocean_sfc - An ocean_public_type structure that is to be -! deallocated upon termination. -! (inout) Ocean_state - A pointer to the structure containing the internal -! ocean state to be deallocated upon termination. -! (in) Time - The model time, used for writing restarts. - call ocean_model_save_restart(Ocean_state, Time) call diag_mediator_end(Time, Ocean_state%diag) call MOM_end(Ocean_state%MOM_CSp) if (Ocean_state%use_ice_shelf) call ice_shelf_end(Ocean_state%Ice_shelf_CSp) end subroutine ocean_model_end -! NAME="ocean_model_end" - !> ocean_model_save_restart causes restart files associated with the ocean to be !! written out. @@ -772,12 +716,6 @@ subroutine ocean_model_save_restart(OS, Time, directory, filename_suffix) !! write these restart files. character(len=*), optional, intent(in) :: filename_suffix !< An optional suffix (e.g., a time-stamp) !! to append to the restart file names. -! Arguments: Ocean_state - A structure containing the internal ocean state (in). -! (in) Time - The model time at this call. This is needed for mpp_write calls. -! (in, opt) directory - An optional directory into which to write these restart files. -! (in, opt) filename_suffix - An optional suffix (e.g., a time-stamp) to append -! to the restart file names. - ! Note: This is a new routine - it will need to exist for the new incremental ! checkpointing. It will also be called by ocean_model_end, giving the same ! restart behavior as now in FMS. @@ -804,8 +742,7 @@ subroutine ocean_model_save_restart(OS, Time, directory, filename_suffix) end subroutine ocean_model_save_restart -!======================================================================= - +!> Initialize the public ocean type subroutine initialize_ocean_public_type(input_domain, Ocean_sfc, diag, maskmap, & gas_fields_ocn) type(domain2D), intent(in) :: input_domain !< The ocean model domain description @@ -860,6 +797,11 @@ subroutine initialize_ocean_public_type(input_domain, Ocean_sfc, diag, maskmap, end subroutine initialize_ocean_public_type +!> This subroutine translates the coupler's ocean_data_type into MOM's +!! surface state variable. This may eventually be folded into the MOM +!! code that calculates the surface state in the first place. +!! Note the offset in the arrays because the ocean_data_type has no +!! halo points in its arrays and always uses absolute indicies. subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, patm, press_to_z) type(surface), intent(inout) :: sfc_state !< A structure containing fields that !! describe the surface state of the ocean. @@ -871,11 +813,7 @@ subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, patm, press_to_z real, optional, intent(in) :: patm(:,:) !< The pressure at the ocean surface, in Pa. real, optional, intent(in) :: press_to_z !< A conversion factor between pressure and !! ocean depth in m, usually 1/(rho_0*g), in m Pa-1. -! This subroutine translates the coupler's ocean_data_type into MOM's -! surface state variable. This may eventually be folded into the MOM -! code that calculates the surface state in the first place. -! Note the offset in the arrays because the ocean_data_type has no -! halo points in its arrays and always uses absolute indicies. + ! Local variables real :: IgR0 character(len=48) :: val_str integer :: isc_bnd, iec_bnd, jsc_bnd, jec_bnd @@ -968,15 +906,6 @@ subroutine convert_state_to_ocean_type(sfc_state, Ocean_sfc, G, patm, press_to_z end subroutine convert_state_to_ocean_type - -!======================================================================= -! -! -! -! This subroutine extracts the surface properties from the ocean's internal -! state and stores them in the ocean type returned to the calling ice model. -! - !> This subroutine extracts the surface properties from the ocean's internal !! state and stores them in the ocean type returned to the calling ice model. !! It has to be separate from the ocean_initialization call because the coupler @@ -986,7 +915,6 @@ subroutine ocean_model_init_sfc(OS, Ocean_sfc) type(ocean_public_type), intent(inout) :: Ocean_sfc !< A structure containing various publicly !! visible ocean surface properties after initialization, whose !! elements have their data set here. - integer :: is, ie, js, je is = OS%grid%isc ; ie = OS%grid%iec ; js = OS%grid%jsc ; je = OS%grid%jec @@ -998,7 +926,6 @@ subroutine ocean_model_init_sfc(OS, Ocean_sfc) call convert_state_to_ocean_type(OS%sfc_state, Ocean_sfc, OS%grid) end subroutine ocean_model_init_sfc -! !> ocean_model_flux_init is used to initialize properties of the air-sea fluxes !! as determined by various run-time parameters. It can be called from @@ -1023,9 +950,6 @@ subroutine ocean_model_flux_init(OS, verbosity) end subroutine ocean_model_flux_init -!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! -! Ocean_stock_pe - returns stocks of heat, water, etc. for conservation checks.! -!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! !> Ocean_stock_pe - returns the integrated stocks of heat, water, etc. for conservation checks. !! Because of the way FMS is coded, only the root PE has the integrated amount, !! while all other PEs get 0. diff --git a/config_src/solo_driver/MESO_surface_forcing.F90 b/config_src/solo_driver/MESO_surface_forcing.F90 index a1c20b635c..eaa11da6c1 100644 --- a/config_src/solo_driver/MESO_surface_forcing.F90 +++ b/config_src/solo_driver/MESO_surface_forcing.F90 @@ -1,48 +1,8 @@ +!> Sets forcing for the MESO configuration module MESO_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. * -!* * -!* MESO_wind_forcing should set the surface wind stresses (taux and * -!* tauy) perhaps along with the surface friction velocity (ustar). * -!* * -!* MESO_buoyancy forcing is used to set the surface buoyancy * -!* forcing, which may include a number of fresh water flux fields * -!* (evap, liq_precip, froz_precip, liq_runoff, froz_runoff, 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 @@ -408,4 +368,30 @@ subroutine MESO_surface_forcing_init(Time, G, param_file, diag, CS) end subroutine MESO_surface_forcing_init +!> \namespace meso_surface_forcing +!! +!! 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. +!! +!! MESO_wind_forcing should set the surface wind stresses (taux and +!! tauy) perhaps along with the surface friction velocity (ustar). +!! +!! MESO_buoyancy forcing is used to set the surface buoyancy +!! forcing, which may include a number of fresh water flux fields +!! (evap, liq_precip, froz_precip, liq_runoff, froz_runoff, 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 MESO_surface_forcing diff --git a/config_src/solo_driver/coupler_types.F90 b/config_src/solo_driver/coupler_types.F90 index d1264e5d6b..10d22a8eff 100644 --- a/config_src/solo_driver/coupler_types.F90 +++ b/config_src/solo_driver/coupler_types.F90 @@ -1,12 +1,13 @@ +!> This module contains the coupler-type declarations and methods for use in +!! ocean-only configurations of MOM6. +!! +!! It is intended that the version of coupler_types_mod that is avialable from +!! FMS will conform to this version with the FMS city release after warsaw. + module coupler_types_mod ! This file is part of MOM6. See LICENSE.md for the license. -! This module contains the coupler-type declarations and methods for use in -! ocean-only configurations of MOM6. It is intended that the version of -! coupler_types_mod that is avialable from FMS will conform to this version with -! the FMS city release after warsaw. - use fms_io_mod, only: restart_file_type, register_restart_field use fms_io_mod, only: query_initialized, restore_state use time_manager_mod, only: time_type diff --git a/config_src/solo_driver/coupler_util.F90 b/config_src/solo_driver/coupler_util.F90 index dde67c2976..cc63a9563d 100644 --- a/config_src/solo_driver/coupler_util.F90 +++ b/config_src/solo_driver/coupler_util.F90 @@ -1,9 +1,9 @@ +!> Provides a couple of interfaces to allow more transparent and +!! robust extraction of the various fields in the coupler types. module coupler_util ! This file is part of MOM6. See LICENSE.md for the license. -! This code provides a couple of interfaces to allow more transparent and -! robust extraction of the various fields in the coupler types. use MOM_error_handler, only : MOM_error, FATAL, WARNING use coupler_types_mod, only : coupler_2d_bc_type, ind_flux, ind_alpha use coupler_types_mod, only : ind_csurf @@ -15,24 +15,19 @@ module coupler_util contains +!> Extract an array of values in a coupler bc type subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, & is, ie, js, je, conversion) - type(coupler_2d_bc_type), intent(in) :: BC_struc - integer, intent(in) :: BC_index, BC_element - real, dimension(:,:), intent(out) :: array_out - integer, optional, intent(in) :: is, ie, js, je - real, optional, intent(in) :: conversion -! Arguments: BC_struc - The type from which the data is being extracted. -! (in) BC_index - The boundary condition number being extracted. -! (in) BC_element - The element of the boundary condition being extracted. -! This could be ind_csurf, ind_alpha, ind_flux or ind_deposition. -! (out) array_out - The array being filled with the input values. -! (in, opt) is, ie, js, je - The i- and j- limits of array_out to be filled. -! These must match the size of the corresponding value array or an -! error message is issued. -! (in, opt) conversion - A number that every element is multiplied by, to -! permit sign convention or unit conversion. - + type(coupler_2d_bc_type), intent(in) :: BC_struc !< The type from which the data is being extracted. + integer, intent(in) :: BC_index !< The boundary condition number being extracted. + integer, intent(in) :: BC_element !< The element of the boundary condition being extracted. + real, dimension(:,:), intent(out) :: array_out !< The array being filled with the input values. + integer, optional, intent(in) :: is !< Start i-index + integer, optional, intent(in) :: ie !< End i-index + integer, optional, intent(in) :: js !< Start j-index + integer, optional, intent(in) :: je !< End j-index + real, optional, intent(in) :: conversion !< A number that every element is multiplied by, to + ! Local variables real, pointer, dimension(:,:) :: Array_in real :: conv integer :: i, j, is0, ie0, js0, je0, i_offset, j_offset @@ -78,24 +73,20 @@ subroutine extract_coupler_values(BC_struc, BC_index, BC_element, array_out, & end subroutine extract_coupler_values +!> Set an array of values in a coupler bc type subroutine set_coupler_values(array_in, BC_struc, BC_index, BC_element, & is, ie, js, je, conversion) - real, dimension(:,:), intent(in) :: array_in - type(coupler_2d_bc_type), intent(inout) :: BC_struc - integer, intent(in) :: BC_index, BC_element - integer, optional, intent(in) :: is, ie, js, je - real, optional, intent(in) :: conversion -! Arguments: array_in - The array containing the values to load into the BC. -! (out) BC_struc - The type into which the data is being loaded. -! (in) BC_index - The boundary condition number being extracted. -! (in) BC_element - The element of the boundary condition being extracted. -! This could be ind_csurf, ind_alpha, ind_flux or ind_deposition. -! (in, opt) is, ie, js, je - The i- and j- limits of array_out to be filled. -! These must match the size of the corresponding value array or an -! error message is issued. -! (in, opt) conversion - A number that every element is multiplied by, to -! permit sign convention or unit conversion. - + real, dimension(:,:), intent(in) :: array_in !< The array containing the values to load into the BC. + type(coupler_2d_bc_type), intent(inout) :: BC_struc !< The type from which the data is being extracted. + integer, intent(in) :: BC_index !< The boundary condition number being extracted. + integer, intent(in) :: BC_element !< The element of the boundary condition being extracted. + integer, optional, intent(in) :: is !< Start i-index + integer, optional, intent(in) :: ie !< End i-index + integer, optional, intent(in) :: js !< Start j-index + integer, optional, intent(in) :: je !< End j-index + real, optional, intent(in) :: conversion !< A number that every element is multiplied by, to + !! permit sign convention or unit conversion. + ! Local variables real, pointer, dimension(:,:) :: Array_out real :: conv integer :: i, j, is0, ie0, js0, je0, i_offset, j_offset diff --git a/src/diagnostics/MOM_PointAccel.F90 b/src/diagnostics/MOM_PointAccel.F90 index 9e33651b86..6f93c7b0f0 100644 --- a/src/diagnostics/MOM_PointAccel.F90 +++ b/src/diagnostics/MOM_PointAccel.F90 @@ -1,31 +1,14 @@ +!> Debug accelerations at a given point +!! +!! The two subroutines in this file write out all of the terms +!! in the u- or v-momentum balance at a given point. Usually +!! these subroutines are called after the velocities exceed some +!! threshold, in order to determine which term is culpable. +!! often this is done for debugging purposes. module MOM_PointAccel ! This file is part of MOM6. See LICENSE.md for the license. -!*********************************************************************** -!* * -!* The two subroutines in this file write out all of the terms * -!* in the u- or v-momentum balance at a given point. Usually * -!* these subroutines are called after the velocities exceed some * -!* threshold, in order to determine which term is culpable. * -!* often this is done for debugging purposes. * -!* * -!* 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, CoriolisBu * -!* j+1 > o > o > At ^: v, PFv, CAv, vh, diffv, vbt, vhtr * -!* j x ^ x ^ x At >: u, PFu, CAu, uh, diffu, ubt, uhtr * -!* j > o > o > At o: h, bathyT, tr, T, S * -!* 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 : diag_ctrl use MOM_domains, only : pe_here use MOM_error_handler, only : MOM_error, NOTE @@ -106,11 +89,7 @@ subroutine write_u_accel(I, j, um, hin, ADp, CDp, dt, G, GV, CS, vel_rpt, str, a real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & optional, intent(in) :: hv !< The layer thicknesses at velocity grid points, !! from vertvisc, in m. - -! This subroutine writes to an output file all of the accelerations -! that have been applied to a column of zonal velocities over the -! previous timestep. This subroutine is called from vertvisc. - + ! Local variables real :: f_eff, CFL real :: Angstrom real :: truncvel, du @@ -438,11 +417,7 @@ subroutine write_v_accel(i, J, vm, hin, ADp, CDp, dt, G, GV, CS, vel_rpt, str, a real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & optional, intent(in) :: hv !< The layer thicknesses at velocity grid points, !! from vertvisc, in m. - -! This subroutine writes to an output file all of the accelerations -! that have been applied to a column of meridional velocities over -! the previous timestep. This subroutine is called from vertvisc. - + ! Local variables real :: f_eff, CFL real :: Angstrom real :: truncvel, dv @@ -758,7 +733,6 @@ subroutine PointAccel_init(MIS, Time, G, param_file, diag, dirs, CS) !! directory paths. type(PointAccel_CS), pointer :: CS !< A pointer that is set to point to the !! control structure for this module. - ! This include declares and sets the variable "version". #include "version_variable.h" character(len=40) :: mdl = "MOM_PointAccel" ! This module's name. @@ -801,4 +775,5 @@ subroutine PointAccel_init(MIS, Time, G, param_file, diag, dirs, CS) CS%u_file = -1 ; CS%v_file = -1 ; CS%cols_written = 0 end subroutine PointAccel_init + end module MOM_PointAccel diff --git a/src/diagnostics/MOM_debugging.F90 b/src/diagnostics/MOM_debugging.F90 index 8bc4abea31..768caf0811 100644 --- a/src/diagnostics/MOM_debugging.F90 +++ b/src/diagnostics/MOM_debugging.F90 @@ -1,14 +1,13 @@ +!> Provides checksumming functions for debugging +!! +!! This module contains subroutines that perform various error checking and +!! debugging functions for MOM6. This routine is similar to it counterpart in +!! the SIS2 code, except for the use of the ocean_grid_type and by keeping them +!! separate we retain the ability to set up MOM6 and SIS2 debugging separately. module MOM_debugging ! This file is part of MOM6. See LICENSE.md for the license. -!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! -! This module contains subroutines that perform various error checking and ! -! debugging functions for MOM6. This routine is similar to it counterpart in ! -! the SIS2 code, except for the use of the ocean_grid_type and by keeping them ! -! separate we retain the ability to set up MOM6 and SIS2 debugging separately. ! -!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! - use MOM_checksums, only : hchksum, Bchksum, qchksum, uvchksum use MOM_checksums, only : is_NaN, chksum, MOM_checksums_init use MOM_coms, only : PE_here, root_PE, num_PEs, sum_across_PEs @@ -66,16 +65,16 @@ module MOM_debugging module procedure chksum_vec_A3d, chksum_vec_A2d end interface vec_chksum_A -integer :: max_redundant_prints = 100 -integer :: redundant_prints(3) = 0 -logical :: debug = .false. -logical :: debug_chksums = .true. -logical :: debug_redundant = .true. +! Note: these parameters are module data but ONLY used when debugging and +! so can violate the thread-safe requirement of no module/global data. +integer :: max_redundant_prints = 100 !< Maximum number of times to write redundant messages +integer :: redundant_prints(3) = 0 !< Counters for controlling redundant printing +logical :: debug = .false. !< Write out verbose debugging data +logical :: debug_chksums = .true. !< Perform checksums on arrays +logical :: debug_redundant = .true. !< Check redundant contains -! ===================================================================== - !> MOM_debugging_init initializes the MOM_debugging module, and sets !! the parameterts that control which checks are active for MOM6. subroutine MOM_debugging_init(param_file) @@ -116,7 +115,7 @@ subroutine check_redundant_vC3d(mesg, u_comp, v_comp, G, is, ie, js, je, & integer, optional, intent(in) :: je !< The ending j-index to check integer, optional, intent(in) :: direction !< the direction flag to be !! passed to pass_vector - + ! Local variables character(len=24) :: mesg_k integer :: k @@ -152,9 +151,9 @@ subroutine check_redundant_vC2d(mesg, u_comp, v_comp, G, is, ie, js, je, & real :: u_resym(G%IsdB:G%IedB,G%jsd:G%jed) real :: v_resym(G%isd:G%ied,G%JsdB:G%JedB) character(len=128) :: mesg2 - integer :: i, j, is_ch, ie_ch, js_ch, je_ch integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB + Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB @@ -241,14 +240,13 @@ subroutine check_redundant_sB2d(mesg, array, G, is, ie, js, je) integer, optional, intent(in) :: ie !< The ending i-index to check integer, optional, intent(in) :: js !< The starting j-index to check integer, optional, intent(in) :: je !< The ending j-index to check - ! Local variables real :: a_nonsym(G%isd:G%ied,G%jsd:G%jed) real :: a_resym(G%IsdB:G%IedB,G%JsdB:G%JedB) character(len=128) :: mesg2 - integer :: i, j, is_ch, ie_ch, js_ch, je_ch integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB + Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB @@ -306,7 +304,6 @@ subroutine check_redundant_vB3d(mesg, u_comp, v_comp, G, is, ie, js, je, & integer, optional, intent(in) :: je !< The ending j-index to check integer, optional, intent(in) :: direction !< the direction flag to be !! passed to pass_vector - ! Local variables character(len=24) :: mesg_k integer :: k @@ -337,16 +334,15 @@ subroutine check_redundant_vB2d(mesg, u_comp, v_comp, G, is, ie, js, je, & integer, optional, intent(in) :: je !< The ending j-index to check integer, optional, intent(in) :: direction !< the direction flag to be !! passed to pass_vector - ! Local variables real :: u_nonsym(G%isd:G%ied,G%jsd:G%jed) real :: v_nonsym(G%isd:G%ied,G%jsd:G%jed) real :: u_resym(G%IsdB:G%IedB,G%JsdB:G%JedB) real :: v_resym(G%IsdB:G%IedB,G%JsdB:G%JedB) character(len=128) :: mesg2 - integer :: i, j, is_ch, ie_ch, js_ch, je_ch integer :: Isq, Ieq, Jsq, Jeq, isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB + Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB @@ -409,7 +405,6 @@ subroutine check_redundant_sT3d(mesg, array, G, is, ie, js, je) integer, optional, intent(in) :: ie !< The ending i-index to check integer, optional, intent(in) :: js !< The starting j-index to check integer, optional, intent(in) :: je !< The ending j-index to check - ! Local variables character(len=24) :: mesg_k integer :: k @@ -435,7 +430,6 @@ subroutine check_redundant_sT2d(mesg, array, G, is, ie, js, je) integer, optional, intent(in) :: ie !< The ending i-index to check integer, optional, intent(in) :: js !< The starting j-index to check integer, optional, intent(in) :: je !< The ending j-index to check - ! Local variables real :: a_nonsym(G%isd:G%ied,G%jsd:G%jed) character(len=128) :: mesg2 @@ -516,13 +510,7 @@ subroutine check_redundant_vT2d(mesg, u_comp, v_comp, G, is, ie, js, je, & integer, optional, intent(in) :: je !< The ending j-index to check integer, optional, intent(in) :: direction !< the direction flag to be !! passed to pass_vector -! Arguments: u_comp - The u-component of the vector being checked. -! (in) v_comp - The v-component of the vector being checked. -! (in) mesg - A message indicating what is being checked. -! (in) G - The ocean's grid structure. -! (in/opt) is, ie, js, je - the i- and j- range of indices to check. -! (in/opt) direction - the direction flag to be passed to pass_vector. - + ! Local variables real :: u_nonsym(G%isd:G%ied,G%jsd:G%jed) real :: v_nonsym(G%isd:G%ied,G%jsd:G%jed) character(len=128) :: mesg2 @@ -571,8 +559,6 @@ subroutine check_redundant_vT2d(mesg, u_comp, v_comp, G, is, ie, js, je, & end subroutine check_redundant_vT2d -! ===================================================================== - !> Do a checksum and redundant point check on a 3d C-grid vector. subroutine chksum_vec_C3d(mesg, u_comp, v_comp, G, halos, scalars) character(len=*), intent(in) :: mesg !< An identifying message @@ -582,7 +568,7 @@ subroutine chksum_vec_C3d(mesg, u_comp, v_comp, G, halos, scalars) integer, optional, intent(in) :: halos !< The width of halos to check (default 0) logical, optional, intent(in) :: scalars !< If true this is a pair of !! scalars that are being checked. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -608,7 +594,7 @@ subroutine chksum_vec_C2d(mesg, u_comp, v_comp, G, halos, scalars) integer, optional, intent(in) :: halos !< The width of halos to check (default 0) logical, optional, intent(in) :: scalars !< If true this is a pair of !! scalars that are being checked. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -634,7 +620,7 @@ subroutine chksum_vec_B3d(mesg, u_comp, v_comp, G, halos, scalars) integer, optional, intent(in) :: halos !< The width of halos to check (default 0) logical, optional, intent(in) :: scalars !< If true this is a pair of !! scalars that are being checked. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -663,7 +649,7 @@ subroutine chksum_vec_B2d(mesg, u_comp, v_comp, G, halos, scalars, symmetric) !! scalars that are being checked. logical, optional, intent(in) :: symmetric !< If true, do the checksums on the !! full symmetric computational domain. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -690,7 +676,7 @@ subroutine chksum_vec_A3d(mesg, u_comp, v_comp, G, halos, scalars) integer, optional, intent(in) :: halos !< The width of halos to check (default 0) logical, optional, intent(in) :: scalars !< If true this is a pair of !! scalars that are being checked. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -708,7 +694,6 @@ subroutine chksum_vec_A3d(mesg, u_comp, v_comp, G, halos, scalars) end subroutine chksum_vec_A3d - !> Do a checksum and redundant point check on a 2d C-grid vector. subroutine chksum_vec_A2d(mesg, u_comp, v_comp, G, halos, scalars) character(len=*), intent(in) :: mesg !< An identifying message @@ -718,7 +703,7 @@ subroutine chksum_vec_A2d(mesg, u_comp, v_comp, G, halos, scalars) integer, optional, intent(in) :: halos !< The width of halos to check (default 0) logical, optional, intent(in) :: scalars !< If true this is a pair of !! scalars that are being checked. - + ! Local variables logical :: are_scalars are_scalars = .false. ; if (present(scalars)) are_scalars = scalars @@ -736,9 +721,6 @@ subroutine chksum_vec_A2d(mesg, u_comp, v_comp, G, halos, scalars) end subroutine chksum_vec_A2d - -! ===================================================================== - !> This function returns the sum over computational domain of all !! processors of hThick*stuff, where stuff is a 3-d array at tracer points. function totalStuff(HI, hThick, areaT, stuff) @@ -747,7 +729,6 @@ function totalStuff(HI, hThick, areaT, stuff) real, dimension(HI%isd:,HI%jsd:), intent(in) :: areaT !< The array of cell areas in m2 real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: stuff !< The array of stuff to be summed real :: totalStuff !< the globally integrated amoutn of stuff - ! Local variables integer :: i, j, k, nz @@ -760,12 +741,8 @@ function totalStuff(HI, hThick, areaT, stuff) end function totalStuff -! ===================================================================== - !> This subroutine display the total thickness, temperature and salinity !! as well as the change since the last call. -!! NOTE: This subroutine uses "save" data which is not thread safe and is purely -!! for extreme debugging without a proper debugger. subroutine totalTandS(HI, hThick, areaT, temperature, salinity, mesg) type(hor_index_type), intent(in) :: HI !< A horizontal index type real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: hThick !< The array of thicknesses to use as weights @@ -773,11 +750,10 @@ subroutine totalTandS(HI, hThick, areaT, temperature, salinity, mesg) real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: temperature !< The temperature field to sum real, dimension(HI%isd:,HI%jsd:,:), intent(in) :: salinity !< The salinity field to sum character(len=*), intent(in) :: mesg !< An identifying message - ! NOTE: This subroutine uses "save" data which is not thread safe and is purely for ! extreme debugging without a proper debugger. real, save :: totalH = 0., totalT = 0., totalS = 0. - + ! Local variables logical, save :: firstCall = .true. real :: thisH, thisT, thisS, delH, delT, delS integer :: i, j, k, nz @@ -850,8 +826,6 @@ logical function check_column_integrals(nk_1, field_1, nk_2, field_2, missing_va real, dimension(nk_2), intent(in) :: field_2 !< Second field to be summed real, optional, intent(in) :: missing_value !< If column contains missing values, !! mask them from the sum - - ! Local variables real :: u1_sum, error1, u2_sum, error2, misval integer :: k diff --git a/src/diagnostics/MOM_diag_to_Z.F90 b/src/diagnostics/MOM_diag_to_Z.F90 index 25178d7d69..77e49442af 100644 --- a/src/diagnostics/MOM_diag_to_Z.F90 +++ b/src/diagnostics/MOM_diag_to_Z.F90 @@ -1,29 +1,11 @@ -Module MOM_diag_to_Z +!> Maps tracers and velocities into depth space for output as diagnostic quantities. +!! +!! Currently, a piecewise linear subgrid structure is used for tracers, while velocities can +!! use either piecewise constant or piecewise linear structures. +module MOM_diag_to_Z ! This file is part of MOM6. See LICENSE.md for the license. -!********+*********+*********+*********+*********+*********+*********+** -!* * -!* By Robert Hallberg, July 2006 * -!* * -!* This subroutine maps tracers and velocities into depth space * -!* for output as diagnostic quantities. Currently, a piecewise * -!* linear subgrid structure is used for tracers, while velocities can * -!* use either piecewise constant or piecewise linear structures. * -!* * -!* A small fragment of the grid is shown below: * -!* * -!* j+1 x ^ x ^ x At x: q, CoriolisBu * -!* j+1 > o > o > At ^: v * -!* j x ^ x ^ x At >: u * -!* j > o > o > At o: h, bathyT * -!* 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_domains, only : pass_var use MOM_coms, only : reproducing_sum use MOM_diag_mediator, only : post_data, post_data_1d_k, register_diag_field, safe_alloc_ptr @@ -98,7 +80,7 @@ Module MOM_diag_to_Z end type diag_to_Z_CS -integer, parameter :: NO_ZSPACE = -1 +integer, parameter :: NO_ZSPACE = -1 !< Flag to enable z-space? contains @@ -110,7 +92,7 @@ function global_z_mean(var,G,CS,tracer) real, dimension(SZI_(G), SZJ_(G), CS%nk_zspace), & intent(in) :: var !< An array with the variable to average integer, intent(in) :: tracer !< The tracer index being worked on - + ! Local variables real, dimension(SZI_(G), SZJ_(G), CS%nk_zspace) :: tmpForSumming, weight real, dimension(CS%nk_zspace) :: global_z_mean, scalarij, weightij real, dimension(CS%nk_zspace) :: global_temp_scalar, global_weight_scalar @@ -170,9 +152,6 @@ subroutine calculate_Z_diag_fields(u, v, h, ssh_in, frac_shelf_h, G, GV, CS) !! ice shelf, or unassocatiaed if there is no shelf type(diag_to_Z_CS), pointer :: CS !< Control structure returned by a previous call !! to diag_to_Z_init. - -! This subroutine maps tracers and velocities into depth space for diagnostics. - ! Local variables ! Note the deliberately reversed axes in h_f, u_f, v_f, and tr_f. real :: ssh(SZI_(G),SZJ_(G)) ! copy of ssh_in (meter or kg/m2) @@ -524,9 +503,6 @@ subroutine calculate_Z_transport(uh_int, vh_int, h, dt, G, GV, CS) type(diag_to_Z_CS), pointer :: CS !< Control structure returned by !! previous call to !! diag_to_Z_init. - -! This subroutine maps horizontal transport into depth space for diagnostic output. - ! Local variables real, dimension(SZI_(G), SZJ_(G)) :: & htot, & ! total layer thickness (meter or kg/m2) @@ -690,7 +666,6 @@ subroutine find_overlap(e, Z_top, Z_bot, k_max, k_start, k_top, k_bot, wt, z1, z real, dimension(:), intent(out) :: z2 !< Depths of the bottom limit of the part of !! a layer that contributes to a depth level, relative to the cell center and normalized !! by the cell thickness (nondim). Note that -1/2 <= z1 < z2 <= 1/2. - ! Local variables real :: Ih, e_c, tot_wt, I_totwt integer :: k @@ -737,9 +712,6 @@ subroutine find_limited_slope(val, e, slope, k) real, dimension(:), intent(in) :: e !< Column interface heights (meter or kg/m2). real, intent(out) :: slope !< Normalized slope in the intracell distribution of val. integer, intent(in) :: k !< Layer whose slope is being determined. - -! This subroutine determines a limited slope for val to be advected with -! a piecewise limited scheme. ! Local variables real :: d1, d2 @@ -770,7 +742,6 @@ subroutine calc_Zint_diags(h, in_ptrs, ids, num_diags, G, GV, CS) type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(diag_to_Z_CS), pointer :: CS !< Control structure returned by !! previous call to diag_to_Z_init. - ! Local variables real, dimension(SZI_(G),SZJ_(G),max(CS%nk_zspace+1,1),max(num_diags,1)) :: & diag_on_Z ! diagnostics interpolated to depth space @@ -929,7 +900,6 @@ subroutine register_Z_tracer_low(tr_ptr, name, long_name, units, standard_name, type(time_type), intent(in) :: Time !< Current model time. type(diag_to_Z_CS), pointer :: CS !< Control struct returned by previous call to !! diag_to_Z_init. - ! Local variables character(len=256) :: posted_standard_name integer :: isd, ied, jsd, jed, nk, m, id_test @@ -983,10 +953,8 @@ subroutine MOM_diag_to_Z_init(Time, G, GV, param_file, diag, CS) type(diag_to_Z_CS), pointer :: CS !< Pointer to point to control structure for !! this module, which is allocated and !! populated here. - ! This include declares and sets the variable "version". #include "version_variable.h" - ! Local variables character(len=40) :: mdl = "MOM_diag_to_Z" ! module name character(len=200) :: in_dir, zgrid_file ! strings for directory/file @@ -1084,7 +1052,6 @@ subroutine get_Z_depths(depth_file, int_depth_name, int_depth, cell_depth_name, integer, intent(out) :: z_axis_index !< The cell-center z-axis diagnostic index handle integer, intent(out) :: edge_index !< The interface z-axis diagnostic index handle integer, intent(out) :: nk_out !< The number of layers in the output grid - ! Local variables real, allocatable :: cell_depth(:) character (len=200) :: units, long_name @@ -1216,7 +1183,6 @@ function ocean_register_diag_with_z(tr_ptr, vardesc_tr, G, Time, CS) type(diag_to_Z_CS), pointer :: CS !< Control struct returned by a previous !! call to diag_to_Z_init. integer :: ocean_register_diag_with_z !< The retuned Z-space diagnostic ID - ! Local variables type(vardesc) :: vardesc_z character(len=64) :: var_name ! A variable's name. @@ -1273,7 +1239,6 @@ function register_Z_diag(var_desc, CS, day, missing) !! previous call to diag_to_Z_init. type(time_type), intent(in) :: day !< The current model time real, intent(in) :: missing !< The missing value for this diagnostic - ! Local variables character(len=64) :: var_name ! A variable's name. character(len=48) :: units ! A variable's units. @@ -1328,7 +1293,6 @@ function register_Zint_diag(var_desc, CS, day) type(diag_to_Z_CS), pointer :: CS !< Control structure returned by !! previous call to diag_to_Z_init. type(time_type), intent(in) :: day !< The current model time - ! Local variables character(len=64) :: var_name ! A variable's name. character(len=48) :: units ! A variable's units. @@ -1364,5 +1328,4 @@ function register_Zint_diag(var_desc, CS, day) end function register_Zint_diag - end module MOM_diag_to_Z diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90 index 46019b0c4d..f200a15bed 100644 --- a/src/diagnostics/MOM_diagnostics.F90 +++ b/src/diagnostics/MOM_diagnostics.F90 @@ -1,29 +1,10 @@ +!> Calculates any requested diagnostic quantities +!! that are not calculated in the various subroutines. +!! Diagnostic quantities are requested by allocating them memory. module MOM_diagnostics ! This file is part of MOM6. See LICENSE.md for the license. -!********+*********+*********+*********+*********+*********+*********+** -!* * -!* By Robert Hallberg, February 2001 * -!* * -!* This subroutine calculates any requested diagnostic quantities * -!* that are not calculated in the various subroutines. Diagnostic * -!* quantities are requested by allocating them memory. * -!* * -!* A small fragment of the grid is shown below: * -!* * -!* j+1 x ^ x ^ x At x: q, CoriolisBu * -!* j+1 > o > o > At ^: v * -!* j x ^ x ^ x At >: u * -!* j > o > o > At o: h, bathyT * -!* 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_coms, only : reproducing_sum use MOM_diag_mediator, only : post_data, post_data_1d_k, get_diag_time_end use MOM_diag_mediator, only : register_diag_field, register_scalar_field diff --git a/src/diagnostics/MOM_sum_output.F90 b/src/diagnostics/MOM_sum_output.F90 index 3f23687fef..3392f85437 100644 --- a/src/diagnostics/MOM_sum_output.F90 +++ b/src/diagnostics/MOM_sum_output.F90 @@ -1,42 +1,8 @@ +!> Reports integrated quantities for monitoring the model state module MOM_sum_output ! This file is part of MOM6. See LICENSE.md for the license. -!********+*********+*********+*********+*********+*********+*********+** -!* * -!* By Robert Hallberg, April 1994 - June 2002 * -!* * -!* This file contains the subroutine (write_energy) that writes * -!* horizontally integrated quantities, such as energies and layer * -!* volumes, and other summary information to an output file. Some * -!* of these quantities (APE or resting interface height) are defined * -!* relative to the global histogram of topography. The subroutine * -!* that compiles that histogram (depth_list_setup) is also included * -!* in this file. * -!* * -!* In addition, if the number of velocity truncations since the * -!* previous call to write_energy exceeds maxtrunc or the total energy * -!* exceeds a very large threshold, a fatal termination is triggered. * -!* * -!* This file also contains a few miscelaneous initialization * -!* calls to FMS-related modules. * -!* * -!* 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 * -!* j x ^ x ^ x At >: u * -!* j > o > o > At o: h, bathyT * -!* 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_coms, only : sum_across_PEs, PE_here, root_PE, num_PEs, max_across_PEs use MOM_coms, only : reproducing_sum, EFP_to_real, real_to_EFP use MOM_coms, only : EFP_type, operator(+), operator(-), assignment(=) @@ -66,9 +32,7 @@ module MOM_sum_output public write_energy, accumulate_net_input, MOM_sum_output_init -!----------------------------------------------------------------------- - -integer, parameter :: NUM_FIELDS = 17 +integer, parameter :: NUM_FIELDS = 17 !< Number of diagnostic fields !> A list of depths and corresponding globally integrated ocean area at each !! depth and the ocean volume below each depth. @@ -323,7 +287,6 @@ subroutine write_energy(u, v, h, tv, day, n, G, GV, CS, tracer_CSp, OBC, dt_forc type(ocean_OBC_type), & optional, pointer :: OBC !< Open boundaries control structure. type(time_type), optional, intent(in) :: dt_forcing !< The forcing time step - ! Local variables real :: eta(SZI_(G),SZJ_(G),SZK_(G)+1) ! The height of interfaces, in m. real :: areaTm(SZI_(G),SZJ_(G)) ! A masked version of areaT, in m2. @@ -949,7 +912,6 @@ subroutine accumulate_net_input(fluxes, sfc_state, dt, G, CS) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(Sum_output_CS), pointer :: CS !< The control structure returned by a previous call !! to MOM_sum_output_init. - ! Local variables real, dimension(SZI_(G),SZJ_(G)) :: & FW_in, & ! The net fresh water input, integrated over a timestep in kg. @@ -1068,11 +1030,7 @@ subroutine depth_list_setup(G, CS) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(Sum_output_CS), pointer :: CS !< The control structure returned by a !! previous call to MOM_sum_output_init. -! This subroutine sets up an ordered list of depths, along with the -! cross sectional areas at each depth and the volume of fluid deeper -! than each depth. This might be read from a previously created file -! or it might be created anew. (For now only new creation occurs. - + ! Local variables integer :: k if (CS%read_depth_list) then @@ -1101,7 +1059,6 @@ subroutine create_depth_list(G, CS) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(Sum_output_CS), pointer :: CS !< The control structure set up in MOM_sum_output_init, !! in which the ordered depth list is stored. - ! Local variables real, dimension(G%Domain%niglobal*G%Domain%njglobal + 1) :: & Dlist, & !< The global list of bottom depths, in m. @@ -1229,7 +1186,6 @@ subroutine write_depth_list(G, CS, filename, list_size) !! previous call to MOM_sum_output_init. character(len=*), intent(in) :: filename !< The path to the depth list file to write. integer, intent(in) :: list_size !< The size of the depth list. - ! Local variables real, allocatable :: tmp(:) integer :: ncid, dimid(1), Did, Aid, Vid, status, k @@ -1310,7 +1266,6 @@ subroutine read_depth_list(G, CS, filename) type(Sum_output_CS), pointer :: CS !< The control structure returned by a !! previous call to MOM_sum_output_init. character(len=*), intent(in) :: filename !< The path to the depth list file to read. - ! Local variables character(len=32) :: mdl character(len=240) :: var_name, var_msg @@ -1393,4 +1348,20 @@ subroutine read_depth_list(G, CS, filename) end subroutine read_depth_list +!> \namespace mom_sum_output +!! +!! By Robert Hallberg, April 1994 - June 2002 +!! +!! This file contains the subroutine (write_energy) that writes +!! horizontally integrated quantities, such as energies and layer +!! volumes, and other summary information to an output file. Some +!! of these quantities (APE or resting interface height) are defined +!! relative to the global histogram of topography. The subroutine +!! that compiles that histogram (depth_list_setup) is also included +!! in this file. +!! +!! In addition, if the number of velocity truncations since the +!! previous call to write_energy exceeds maxtrunc or the total energy +!! exceeds a very large threshold, a fatal termination is triggered. + end module MOM_sum_output diff --git a/src/diagnostics/MOM_wave_structure.F90 b/src/diagnostics/MOM_wave_structure.F90 index 6b55717daa..0890006c98 100644 --- a/src/diagnostics/MOM_wave_structure.F90 +++ b/src/diagnostics/MOM_wave_structure.F90 @@ -1,31 +1,14 @@ +!> Vertical structure functions for first baroclinic mode wave speed module MOM_wave_structure ! This file is part of MOM6. See LICENSE.md for the license. -!********+*********+*********+*********+*********+*********+*********+** -!* * -!* By Benjamin Mater & Robert Hallberg, 2015 * -!* * -!* The subroutine in this module calculates the vertical structure * -!* functions of the first baroclinic mode internal wave speed. * -!* Calculation of interface values is the same as done in * -!* MOM_wave_speed by Hallberg, 2008. * -!* * -!* 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, vh, vav * -!* j x ^ x ^ x At >: u, uh, uav * -!* j > o > o > At o: h * -!* 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). * -!* * -!********+*********+*********+*********+*********+*********+*********+** +! By Benjamin Mater & Robert Hallberg, 2015 + +! The subroutine in this module calculates the vertical structure +! functions of the first baroclinic mode internal wave speed. +! Calculation of interface values is the same as done in +! MOM_wave_speed by Hallberg, 2008. use MOM_debugging, only : isnan => is_NaN use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl @@ -74,6 +57,31 @@ module MOM_wave_structure contains !> This subroutine determines the internal wave velocity structure for any mode. +!! +!! This subroutine solves for the eigen vector [vertical structure, e(k)] associated with +!! the first baroclinic mode speed [i.e., smallest eigen value (lam = 1/c^2)] of the +!! system d2e/dz2 = -(N2/cn2)e, or (A-lam*I)e = 0, where A = -(1/N2)(d2/dz2), lam = 1/c^2, +!! and I is the identity matrix. 2nd order discretization in the vertical lets this system +!! be represented as +!! +!! -Igu(k)*e(k-1) + (Igu(k)+Igl(k)-lam)*e(k) - Igl(k)*e(k+1) = 0.0 +!! +!! with rigid lid boundary conditions e(1) = e(nz+1) = 0.0 giving +!! +!! (Igu(2)+Igl(2)-lam)*e(2) - Igl(2)*e(3) = 0.0 +!! -Igu(nz)*e(nz-1) + (Igu(nz)+Igl(nz)-lam)*e(nz) = 0.0 +!! +!! where, upon noting N2 = reduced gravity/layer thickness, we get +!! Igl(k) = 1.0/(gprime(k)*H(k)) ; Igu(k) = 1.0/(gprime(k)*H(k-1)) +!! +!! The eigen value for this system is approximated using "wave_speed." This subroutine uses +!! these eigen values (mode speeds) to estimate the corresponding eigen vectors (velocity +!! structure) using the "inverse iteration with shift" method. The algorithm is +!! +!! Pick a starting vector reasonably close to mode structure and with unit magnitude, b_guess +!! For n=1,2,3,... +!! Solve (A-lam*I)e = e_guess for e +!! Set e_guess=e/|e| and repeat, with each iteration refining the estimate of e subroutine wave_structure(h, tv, G, GV, cn, ModeNum, freq, CS, En, full_halos) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid @@ -96,34 +104,6 @@ subroutine wave_structure(h, tv, G, GV, cn, ModeNum, freq, CS, En, full_halos) logical,optional, intent(in) :: full_halos !< If true, do the calculation !! over the entire computational !! domain. - -! This subroutine determines the internal wave velocity structure for any mode. -! -! This subroutine solves for the eigen vector [vertical structure, e(k)] associated with -! the first baroclinic mode speed [i.e., smallest eigen value (lam = 1/c^2)] of the -! system d2e/dz2 = -(N2/cn2)e, or (A-lam*I)e = 0, where A = -(1/N2)(d2/dz2), lam = 1/c^2, -! and I is the identity matrix. 2nd order discretization in the vertical lets this system -! be represented as -! -! -Igu(k)*e(k-1) + (Igu(k)+Igl(k)-lam)*e(k) - Igl(k)*e(k+1) = 0.0 -! -! with rigid lid boundary conditions e(1) = e(nz+1) = 0.0 giving -! -! (Igu(2)+Igl(2)-lam)*e(2) - Igl(2)*e(3) = 0.0 -! -Igu(nz)*e(nz-1) + (Igu(nz)+Igl(nz)-lam)*e(nz) = 0.0 -! -! where, upon noting N2 = reduced gravity/layer thickness, we get -! Igl(k) = 1.0/(gprime(k)*H(k)) ; Igu(k) = 1.0/(gprime(k)*H(k-1)) -! -! The eigen value for this system is approximated using "wave_speed." This subroutine uses -! these eigen values (mode speeds) to estimate the corresponding eigen vectors (velocity -! structure) using the "inverse iteration with shift" method. The algorithm is -! -! Pick a starting vector reasonably close to mode structure and with unit magnitude, b_guess -! For n=1,2,3,... -! Solve (A-lam*I)e = e_guess for e -! Set e_guess=e/|e| and repeat, with each iteration refining the estimate of e - ! Local variables real, dimension(SZK_(G)+1) :: & dRho_dT, dRho_dS, & @@ -585,7 +565,7 @@ subroutine wave_structure(h, tv, G, GV, cn, ModeNum, freq, CS, En, full_halos) end subroutine wave_structure -!> This subroutine solves a tri-diagonal system Ax=y using either the standard +!> Solves a tri-diagonal system Ax=y using either the standard !! Thomas algorithm (TDMA_T) or its more stable variant that invokes the !! "Hallberg substitution" (TDMA_H). subroutine tridiag_solver(a, b, c, h, y, method, x) @@ -602,7 +582,6 @@ subroutine tridiag_solver(a, b, c, h, y, method, x) real, dimension(:), intent(in) :: y !< vector of known values on right hand side. character(len=*), intent(in) :: method !< A string describing the algorithm to use real, dimension(:), intent(out) :: x !< vector of unknown values to solve for. - ! Local variables integer :: nrow ! number of rows in A matrix real, allocatable, dimension(:,:) :: A_check ! for solution checking @@ -721,7 +700,6 @@ subroutine wave_structure_init(Time, G, param_file, diag, CS) !! diagnostic output. type(wave_structure_CS), pointer :: CS !< A pointer that is set to point to the !! control structure for this module. - ! This include declares and sets the variable "version". #include "version_variable.h" character(len=40) :: mdl = "MOM_wave_structure" ! This module's name. @@ -757,5 +735,4 @@ subroutine wave_structure_init(Time, G, param_file, diag, CS) end subroutine wave_structure_init - end module MOM_wave_structure diff --git a/src/ice_shelf/MOM_ice_shelf_initialize.F90 b/src/ice_shelf/MOM_ice_shelf_initialize.F90 index 8dcacb3e60..ec6ce0fffa 100644 --- a/src/ice_shelf/MOM_ice_shelf_initialize.F90 +++ b/src/ice_shelf/MOM_ice_shelf_initialize.F90 @@ -1,3 +1,4 @@ +!> Initialize ice shelf variables module MOM_ice_shelf_initialize ! This file is part of MOM6. See LICENSE.md for the license. @@ -12,14 +13,13 @@ module MOM_ice_shelf_initialize #include - !MJHpublic initialize_ice_shelf_boundary, initialize_ice_thickness public initialize_ice_thickness contains -subroutine initialize_ice_thickness (h_shelf, area_shelf_h, hmask, G, PF) - +!> Initialize ice shelf thickness +subroutine initialize_ice_thickness(h_shelf, area_shelf_h, hmask, G, PF) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZDI_(G),SZDJ_(G)), & intent(inout) :: h_shelf !< The ice shelf thickness, in m. @@ -48,9 +48,8 @@ subroutine initialize_ice_thickness (h_shelf, area_shelf_h, hmask, G, PF) end subroutine initialize_ice_thickness - -subroutine initialize_ice_thickness_from_file (h_shelf, area_shelf_h, hmask, G, PF) - +!> Initialize ice shelf thickness from file +subroutine initialize_ice_thickness_from_file(h_shelf, area_shelf_h, hmask, G, PF) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZDI_(G),SZDJ_(G)), & intent(inout) :: h_shelf !< The ice shelf thickness, in m. @@ -135,9 +134,8 @@ subroutine initialize_ice_thickness_from_file (h_shelf, area_shelf_h, hmask, G, end subroutine initialize_ice_thickness_from_file - -subroutine initialize_ice_thickness_channel (h_shelf, area_shelf_h, hmask, G, PF) - +!> Initialize ice shelf thickness for a channel configuration +subroutine initialize_ice_thickness_channel(h_shelf, area_shelf_h, hmask, G, PF) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZDI_(G),SZDJ_(G)), & intent(inout) :: h_shelf !< The ice shelf thickness, in m. diff --git a/src/parameterizations/lateral/MOM_tidal_forcing.F90 b/src/parameterizations/lateral/MOM_tidal_forcing.F90 index c4553e4c87..95c9b10047 100644 --- a/src/parameterizations/lateral/MOM_tidal_forcing.F90 +++ b/src/parameterizations/lateral/MOM_tidal_forcing.F90 @@ -1,38 +1,8 @@ +!> Tidal contributions to geopotential module MOM_tidal_forcing ! This file is part of MOM6. See LICENSE.md for the license. -!********+*********+*********+*********+*********+*********+*********+** -!* * -!* Code by Robert Hallberg, August 2005, based on C-code by Harper * -!* Simmons, February, 2003, in turn based on code by Brian Arbic. * -!* * -!* The main subroutine in this file calculates the total tidal * -!* contribution to the geopotential, including self-attraction and * -!* loading terms and the astronomical contributions. All options * -!* are selected with entries in a file that is parsed at run-time. * -!* Overall tides are enabled with a line '#define TIDES' in that file.* -!* Tidal constituents must be individually enabled with lines like * -!* '#define TIDE_M2'. This file has default values of amplitude, * -!* frequency, Love number, and phase at time 0 for the Earth's M2, * -!* S2, N2, K2, K1, O1, P1, Q1, MF, and MM tidal constituents, but * -!* the frequency, amplitude and phase ant time 0 for each constituent * -!* can be changed at run time by setting variables like TIDE_M2_FREQ, * -!* TIDE_M2_AMP and TIDE_M2_PHASE_T0 (for M2). * -!* * -!* In addition, the approach to calculating self-attraction and * -!* loading is set at run time. The default is to use the scalar * -!* approximation, with a coefficient TIDE_SAL_SCALAR_VALUE that must * -!* be set in the run-time file (for global runs, 0.094 is typical). * -!* Alternately, TIDAL_SAL_FROM_FILE can be set to read the SAL from * -!* a file containing the results of a previous simulation. To iterate * -!* the SAL to convergence, USE_PREVIOUS_TIDES may be useful (for * -!* details, see Arbic et al., 2004, DSR II). With TIDAL_SAL_FROM_FILE * -!* or USE_PREVIOUS_TIDES,a list of input files must be provided to * -!* describe each constituent's properties from a previous solution. * -!* * -!*********************************************************************** - use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, & CLOCK_MODULE use MOM_domains, only : pass_var @@ -49,8 +19,8 @@ module MOM_tidal_forcing #include -integer, parameter :: MAX_CONSTITUENTS = 10 ! The maximum number of tidal - ! constituents that could be used. +integer, parameter :: MAX_CONSTITUENTS = 10 !< The maximum number of tidal + !! constituents that could be used. !> The control structure for the MOM_tidal_forcing mldule type, public :: tidal_forcing_CS ; private @@ -84,7 +54,7 @@ module MOM_tidal_forcing amp_prev => NULL() !< The amplitude of the previous tidal solution, in m. end type tidal_forcing_CS -integer :: id_clock_tides +integer :: id_clock_tides !< CPU clock for tides contains @@ -99,7 +69,6 @@ subroutine tidal_forcing_init(Time, G, param_file, CS) type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters. type(tidal_forcing_CS), pointer :: CS !< A pointer that is set to point to the control !! structure for this module. - ! Local variables real, dimension(SZI_(G), SZJ_(G)) :: & phase, & ! The phase of some tidal constituent. @@ -379,7 +348,7 @@ subroutine find_in_files(filenames, varname, array, G) character(len=*), intent(in) :: varname !< The name of the variable to read type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure real, dimension(SZI_(G),SZJ_(G)), intent(out) :: array !< The array to fill with the data - + ! Local variables integer :: nf do nf=1,size(filenames) @@ -411,9 +380,6 @@ subroutine tidal_forcing_sensitivity(G, CS, deta_tidal_deta) type(tidal_forcing_CS), pointer :: CS !< The control structure returned by a previous call to tidal_forcing_init. real, intent(out) :: deta_tidal_deta !< The partial derivative of eta_tidal with !! the local value of eta, nondim. -! This subroutine calculates returns the partial derivative of the local -! geopotential height with the input sea surface height due to self-attraction -! and loading. if (CS%USE_SAL_SCALAR .and. CS%USE_PREV_TIDES) then deta_tidal_deta = 2.0*CS%SAL_SCALAR @@ -442,7 +408,6 @@ subroutine calc_tidal_forcing(Time, eta, eta_tidal, G, CS, deta_tidal_deta) real, optional, intent(out) :: deta_tidal_deta !< The partial derivative of !! eta_tidal with the local value of !! eta, nondim. - ! Local variables real :: eta_astro(SZI_(G),SZJ_(G)) real :: eta_SAL(SZI_(G),SZJ_(G)) @@ -534,4 +499,33 @@ subroutine tidal_forcing_end(CS) end subroutine tidal_forcing_end +!> \namespace tidal_forcing +!! +!! Code by Robert Hallberg, August 2005, based on C-code by Harper +!! Simmons, February, 2003, in turn based on code by Brian Arbic. +!! +!! The main subroutine in this file calculates the total tidal +!! contribution to the geopotential, including self-attraction and +!! loading terms and the astronomical contributions. All options +!! are selected with entries in a file that is parsed at run-time. +!! Overall tides are enabled with the run-time parameter 'TIDES=True'. +!! Tidal constituents must be individually enabled with lines like +!! 'TIDE_M2=True'. This file has default values of amplitude, +!! frequency, Love number, and phase at time 0 for the Earth's M2, +!! S2, N2, K2, K1, O1, P1, Q1, MF, and MM tidal constituents, but +!! the frequency, amplitude and phase ant time 0 for each constituent +!! can be changed at run time by setting variables like TIDE_M2_FREQ, +!! TIDE_M2_AMP and TIDE_M2_PHASE_T0 (for M2). +!! +!! In addition, the approach to calculating self-attraction and +!! loading is set at run time. The default is to use the scalar +!! approximation, with a coefficient TIDE_SAL_SCALAR_VALUE that must +!! be set in the run-time file (for global runs, 0.094 is typical). +!! Alternately, TIDAL_SAL_FROM_FILE can be set to read the SAL from +!! a file containing the results of a previous simulation. To iterate +!! the SAL to convergence, USE_PREVIOUS_TIDES may be useful (for +!! details, see Arbic et al., 2004, DSR II). With TIDAL_SAL_FROM_FILE +!! or USE_PREVIOUS_TIDES,a list of input files must be provided to +!! describe each constituent's properties from a previous solution. + end module MOM_tidal_forcing From f7be32d4f5ba702c5a9f123c95245d7e2de6bd11 Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Thu, 12 Jul 2018 12:00:35 -0400 Subject: [PATCH 3/3] Fixed documentation in MOM_debugging --- src/diagnostics/MOM_debugging.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diagnostics/MOM_debugging.F90 b/src/diagnostics/MOM_debugging.F90 index 768caf0811..92ee5898d5 100644 --- a/src/diagnostics/MOM_debugging.F90 +++ b/src/diagnostics/MOM_debugging.F90 @@ -71,7 +71,7 @@ module MOM_debugging integer :: redundant_prints(3) = 0 !< Counters for controlling redundant printing logical :: debug = .false. !< Write out verbose debugging data logical :: debug_chksums = .true. !< Perform checksums on arrays -logical :: debug_redundant = .true. !< Check redundant +logical :: debug_redundant = .true. !< Check redundant values on PE boundaries contains