diff --git a/src/core/MOM_checksum_packages.F90 b/src/core/MOM_checksum_packages.F90 index d01e7f9639..9c59a4768a 100644 --- a/src/core/MOM_checksum_packages.F90 +++ b/src/core/MOM_checksum_packages.F90 @@ -52,16 +52,23 @@ module MOM_checksum_packages ! ============================================================================= subroutine MOM_state_chksum_5arg(mesg, u, v, h, uh, vh, G, GV, haloshift, symmetric) - character(len=*), intent(in) :: mesg - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< The zonal velocity, in m s-1 - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< The meridional velocity, in m s-1 - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2) - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: uh - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: vh - integer, optional, intent(in) :: haloshift - logical, optional, intent(in) :: symmetric + character(len=*), & + intent(in) :: mesg !< A message that appears on the chksum lines. + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: u !< The zonal velocity, in m s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: v !< The meridional velocity, in m s-1. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2). + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: uh !< Volume flux through zonal faces = u*h*dy, m3 s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: vh !< Volume flux through meridional + !! faces = v*h*dx, in m3 s-1. + integer, optional, intent(in) :: haloshift + logical, optional, intent(in) :: symmetric ! This subroutine writes out chksums for the model's basic state variables. ! Arguments: mesg - A message that appears on the chksum lines. ! (in) u - Zonal velocity, in m s-1. @@ -89,14 +96,17 @@ end subroutine MOM_state_chksum_5arg ! ============================================================================= subroutine MOM_state_chksum_3arg(mesg, u, v, h, G, GV, haloshift, symmetric) - character(len=*), intent(in) :: mesg - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< The zonal velocity, in m s-1 - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< The meridional velocity, in m s-1 - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2) - integer, optional, intent(in) :: haloshift - logical, optional, intent(in) :: symmetric + character(len=*), intent(in) :: mesg !< A message that appears on the chksum lines. + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: u !< Zonal velocity, in m s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: v !< Meridional velocity, in m s-1. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2). + integer, optional, intent(in) :: haloshift + logical, optional, intent(in) :: symmetric ! This subroutine writes out chksums for the model's basic state variables. ! Arguments: mesg - A message that appears on the chksum lines. ! (in) u - Zonal velocity, in m s-1. @@ -122,9 +132,10 @@ end subroutine MOM_state_chksum_3arg ! ============================================================================= subroutine MOM_thermo_chksum(mesg, tv, G, haloshift) - character(len=*), intent(in) :: mesg - type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure + character(len=*), intent(in) :: mesg !< A message that appears on the chksum lines. + type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various + !! thermodynamic variables. + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. integer, optional, intent(in) :: haloshift ! This subroutine writes out chksums for the model's thermodynamic state ! variables. @@ -147,19 +158,39 @@ end subroutine MOM_thermo_chksum subroutine MOM_accel_chksum(mesg, CAu, CAv, PFu, PFv, diffu, diffv, G, GV, pbce, & u_accel_bt, v_accel_bt, symmetric) - character(len=*), intent(in) :: mesg - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: CAu - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: CAv - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: PFu - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: PFv - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: diffu - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: diffv - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), optional, intent(in) :: pbce - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), optional, intent(in) :: u_accel_bt - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), optional, intent(in) :: v_accel_bt - logical, optional, intent(in) :: symmetric + character(len=*), intent(in) :: mesg !< A message that appears on the chksum lines. + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: CAu !< Zonal acceleration due to Coriolis + !! and momentum advection terms, in m s-2. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: CAv !< Meridional acceleration due to Coriolis + !! and momentum advection terms, in m s-2. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: PFu !< Zonal acceleration due to pressure gradients + !! (equal to -dM/dx) in m s-2. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: PFv !< Meridional acceleration due to pressure gradients + !! (equal to -dM/dy) in m s-2. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: diffu !< Zonal acceleration due to convergence of the + !! along-isopycnal stress tensor, in m s-2. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: diffv !< Meridional acceleration due to convergence of + !! the along-isopycnal stress tensor, in m s-2. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + optional, intent(in) :: pbce !< The baroclinic pressure anomaly in each layer + !! due to free surface height anomalies, in + !! m s-2.pbce points to a space with nz layers + !! or NULL. !! NULL. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + optional, intent(in) :: u_accel_bt !< The zonal acceleration from terms in the + !! barotropic solver,in m s-2. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + optional, intent(in) :: v_accel_bt !< The meridional acceleration from terms in + !! the barotropic solver,in m s-2. + logical, optional, intent(in) :: symmetric ! This subroutine writes out chksums for the model's accelerations. ! Arguments: mesg - A message that appears on the chksum lines. @@ -205,13 +236,24 @@ end subroutine MOM_accel_chksum ! ============================================================================= subroutine MOM_state_stats(mesg, u, v, h, Temp, Salt, G, allowChange, permitDiminishing) - type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure - character(len=*), intent(in) :: mesg - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< The zonal velocity, in m s-1 - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< The meridional velocity, in m s-1 - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2) - real, pointer, dimension(:,:,:), intent(in) :: Temp, Salt - logical, optional, intent(in) :: allowChange, permitDiminishing + type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. + character(len=*), intent(in) :: mesg !< A message that appears on the chksum lines. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(in) :: u !< The zonal velocity, in m s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(in) :: v !< The meridional velocity, in m s-1. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + intent(in) :: h !< Layer thicknesses, in H (usually m or kg m-2). + real, pointer, dimension(:,:,:), & + intent(in) :: Temp !< Temperature in degree C. + real, pointer, dimension(:,:,:), & + intent(in) :: Salt !< Salinity, in ppt. + + logical, optional, intent(in) :: allowChange !< do not flag an error + !! if the statistics change. + logical, optional, & + intent(in) :: permitDiminishing !< do not flag error + !!if the extrema are diminishing. ! This subroutine monitors statistics for the model's state variables. ! Arguments: mesg - A message that appears on the chksum lines. ! (in) u - Zonal velocity, in m s-1. diff --git a/src/core/MOM_dynamics_legacy_split.F90 b/src/core/MOM_dynamics_legacy_split.F90 index 9332e5cc5a..b5a8409804 100644 --- a/src/core/MOM_dynamics_legacy_split.F90 +++ b/src/core/MOM_dynamics_legacy_split.F90 @@ -272,27 +272,60 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, & Time_local, dt, fluxes, p_surf_begin, p_surf_end, & dt_since_flux, dt_therm, uh, vh, uhtr, vhtr, eta_av, & G, GV, CS, calc_dtbt, VarMix, MEKE) - type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), target, intent(inout) :: u !< The zonal velocity, in m s-1 - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), target, intent(inout) :: v !< The meridional velocity, in m s-1 - real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: h !< Layer thicknesses, in H (usually m or kg m-2) - type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables - type(vertvisc_type), intent(inout) :: visc - type(time_type), intent(in) :: Time_local - real, intent(in) :: dt !< The baroclinic dynamics time step, in s - type(forcing), intent(in) :: fluxes - real, dimension(:,:), pointer :: p_surf_begin, p_surf_end - real, intent(in) :: dt_since_flux, dt_therm - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), target, intent(inout) :: uh - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), target, intent(inout) :: vh - real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: uhtr - real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: vhtr - real, dimension(SZI_(G),SZJ_(G)), intent(out) :: eta_av - type(MOM_dyn_legacy_split_CS), pointer :: CS - logical, intent(in) :: calc_dtbt - type(VarMix_CS), pointer :: VarMix - type(MEKE_type), pointer :: MEKE + type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure. + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + target, intent(inout) :: u !< The zonal velocity, in m s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + target, intent(inout) :: v !< The meridional velocity, in m s-1. + real, dimension(SZI_(G),SZJ_(G),SZK_(G)), & + intent(inout) :: h !< Layer thicknesses, in H (usually m or kg m-2). + type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various. + !! thermodynamic variables. + type(vertvisc_type), intent(inout) :: visc !< A structure containing vertical viscosities, + !! bottom drag viscosities, and related fields. + type(time_type), intent(in) :: Time_local !< The model time at the end + !! of the time step. + real, intent(in) :: dt !< The baroclinic dynamics time step, in s + type(forcing), intent(in) :: fluxes !< A structure containing pointers to any + !! possible forcing fields. Unused fields + !! have NULL ptrs. + real, dimension(:,:), pointer :: p_surf_begin !< A pointer (perhaps NULL) to the + !! surface pressure at the beginning + !! of this dynamic step, in Pa. + real, dimension(:,:), pointer :: p_surf_end !< A pointer (perhaps NULL) to the + !! surface pressure at the end of + !! this dynamic step, in Pa. + real, intent(in) :: dt_since_flux !< The elapsed time since fluxes + !! were applied, in s. + real, intent(in) :: dt_therm !< The thermodynamic time step, in s. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + target, intent(inout) :: uh !< The zonal volume or mass transport, + !! in m3 s-1 or kg s-1. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + target, intent(inout) :: vh !< The meridional volume or mass transport, + !! in m3 s-1 or kg s-1. + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), & + intent(inout) :: uhtr !< The accumulated zonal volume or mass + !! transport since the last tracer advection, + !! in m3 or kg. + real, dimension(SZI_(G),SZJB_(G),SZK_(G)), & + intent(inout) :: vhtr !< The accumulated meridional volume or mass + !! transport since the last tracer advection, + !! in m3 or kg. + real, dimension(SZI_(G),SZJ_(G)), & + intent(out) :: eta_av !< The free surface height or column mass + !! time-averaged over a time step, + !! in m or kg m-2. + type(MOM_dyn_legacy_split_CS), & + pointer :: CS !< The control structure set up by + !! initialize_dyn_legacy_split. + logical, intent(in) :: calc_dtbt !< If true, recalculate the + !! barotropic time step. + type(VarMix_CS), pointer :: VarMix ! Returns the model's tracer flux units. function get_tr_flux_units(GV, tr_units, tr_vol_conc_units, tr_mass_conc_units) - character(len=48) :: get_tr_flux_units - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure - character(len=*), optional, intent(in) :: tr_units - character(len=*), optional, intent(in) :: tr_vol_conc_units - character(len=*), optional, intent(in) :: tr_mass_conc_units + character(len=48) :: get_tr_flux_units !< The model's flux units + !! for a tracer. + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical + !! grid structure. + character(len=*), optional, intent(in) :: tr_units !< Units for a tracer, for example + !! Celsius or PSU. + character(len=*), optional, intent(in) :: tr_vol_conc_units !< The concentration units per unit + !! volume, forexample if the units are + !! umol m-3, tr_vol_conc_units would + !! be umol. + character(len=*), optional, intent(in) :: 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. + ! 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.