mom-ocean / MOM6

Modular Ocean Model
Other
182 stars 224 forks source link

Sponge setup not working #1218

Closed hmkhatri closed 3 years ago

hmkhatri commented 3 years ago

I am trying to set up an idealized channel configuration with a sponge in a fixed latitudinal band near the northern boundary. I am using SPONGE_CONFIG = "file" and supplying tracer profiles and idamp values from input files. MOM6 reads the data fine but the sponge does not seem to work at all. Temperature and salinity profiles drift from the specified tracer profiles in the sponge region (see picture below). I have even tried with a damping time scale of 1 day in a 10 deg wide sponge but the solution does not change.

Also, checked that MOM6 correctly sets a nonzero damping rate in the sponge region. Here is the related entry from MOM_parameter_doc.all !Total sponge columns at h points = 15680 ! The total number of columns where sponges are applied at h points.

Any idea how to resolve this issue?

sponge

gustavo-marques commented 3 years ago

@hmkhatri, I believe @sdbachman is successfully using SPONGE_CONFIG = "file". Are your runs on Gaea? If so, please send me the path via Slack and I will compare it against what we have.

MJHarrison-GFDL commented 3 years ago

@hmkhatri . Please paste your MOM_parameter.short file. The sponge code has not been well tested and there are a myriad of parameter choices. I fixed a bug in #1210 but it depends on your settings.

gustavo-marques commented 3 years ago

@hmkhatri, I could not find anything wrong with your parameter choices. I noticed you are restoring T and S to the initial state, using a previously generated MOM_IC file. In this file, you only have data for Time = 0. Perhaps you need to add a second-time entry (e.g., Time = 3650) and repeat the T and S fields. Something like this:

netcdf sponge_TS { dimensions: lont = 320; latt = 272 ; depth = 75 ; time = UNLIMITED ; // (2 currently) variables: double lont(lont) ; double latt(latt) ; double depth(depth) ; double time(time) ; time:calendar = "noleap" ; time:units = "hours since 0001-01-01 00:00:00" ; double PTMP(time, depth, latt, lont) ; PTMP:_FillValue = -1.e+20 ; double SALT(time, depth, latt, lont) ; SALT:_FillValue = -1.e+20 ; }

Hope that fixes the problem.

hmkhatri commented 3 years ago

Thanks. @MJHarrison-GFDL Below is the output of the MOM_parameter.short file. @gustavo-marques I will try putting additional time entry in TS_sponge.nc file.

! This file was written by the model and records the non-default parameters used at run-time.

! === module MOM ===
USE_REGRIDDING = True           !   [Boolean] default = False
                                ! If True, use the ALE algorithm (regridding/remapping). If False, use the
                                ! layered isopycnal algorithm.
DT = 3600.0                     !   [s]
                                ! The (baroclinic) dynamics time step.  The time-step that is actually used will
                                ! be an integer fraction of the forcing time-step (DT_FORCING in ocean-only mode
                                ! or the coupling timestep in coupled mode.)
SAVE_INITIAL_CONDS = True       !   [Boolean] default = False
                                ! If true, write the initial conditions to a file given by IC_OUTPUT_FILE.
IC_OUTPUT_FILE = "Initial_state" ! default = "MOM_IC"
                                ! The file into which to write the initial conditions.

! === module MOM_domains ===
NIGLOBAL = 320                  !
                                ! The total number of thickness grid points in the x-direction in the physical
                                ! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time.
NJGLOBAL = 272                  !
                                ! The total number of thickness grid points in the y-direction in the physical
                                ! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time.

! === module MOM_fixed_initialization ===
INPUTDIR = "INPUT"              ! default = "."
                                ! The directory in which input files are found.

! === module MOM_grid_init ===
GRID_CONFIG = "mosaic"          !
                                ! A character string that determines the method for defining the horizontal
                                ! grid.  Current options are:
                                !     mosaic - read the grid from a mosaic (supergrid)
                                !              file set by GRID_FILE.
                                !     cartesian - use a (flat) Cartesian grid.
                                !     spherical - use a simple spherical grid.
                                !     mercator - use a Mercator spherical grid.
GRID_FILE = "hgrid.nc"          !
                                ! Name of the file from which to read horizontal grid data.
TOPO_CONFIG = "file"            !
                                ! This specifies how bathymetry is specified:
                                !     file - read bathymetric information from the file
                                !       specified by (TOPO_FILE).
                                !     flat - flat bottom set to MAXIMUM_DEPTH.
                                !     bowl - an analytically specified bowl-shaped basin
                                !       ranging between MAXIMUM_DEPTH and MINIMUM_DEPTH.
                                !     spoon - a similar shape to 'bowl', but with an vertical
                                !       wall at the southern face.
                                !     halfpipe - a zonally uniform channel with a half-sine
                                !       profile in the meridional direction.
                                !     bbuilder - build topography from list of functions.
                                !     benchmark - use the benchmark test case topography.
                                !     Neverworld - use the Neverworld test case topography.
                                !     DOME - use a slope and channel configuration for the
                                !       DOME sill-overflow test case.
                                !     ISOMIP - use a slope and channel configuration for the
                                !       ISOMIP test case.
                                !     DOME2D - use a shelf and slope configuration for the
                                !       DOME2D gravity current/overflow test case.
                                !     Kelvin - flat but with rotated land mask.
                                !     seamount - Gaussian bump for spontaneous motion test case.
                                !     dumbbell - Sloshing channel with reservoirs on both ends.
                                !     shelfwave - exponential slope for shelfwave test case.
                                !     Phillips - ACC-like idealized topography used in the Phillips config.
                                !     dense - Denmark Strait-like dense water formation and overflow.
                                !     USER - call a user modified routine.
TOPO_FILE = "topography.nc"     ! default = "topog.nc"
                                ! The file from which the bathymetry is read.
MAXIMUM_DEPTH = 4000.0          !   [m]
                                ! The maximum depth of the ocean.

! === module MOM_verticalGrid ===
! Parameters providing information about the vertical grid.
NK = 75                         !   [nondim]
                                ! The number of model layers.

! === module MOM_EOS ===

! === module MOM_tracer_flow_control ===

! === module MOM_coord_initialization ===
COORD_CONFIG = "file"           ! default = "none"
                                ! This specifies how layers are to be defined:
                                !     ALE or none - used to avoid defining layers in ALE mode
                                !     file - read coordinate information from the file
                                !       specified by (COORD_FILE).
                                !     BFB - Custom coords for buoyancy-forced basin case
                                !       based on SST_S, T_BOT and DRHO_DT.
                                !     linear - linear based on interfaces not layers
                                !     layer_ref - linear based on layer densities
                                !     ts_ref - use reference temperature and salinity
                                !     ts_range - use range of temperature and salinity
                                !       (T_REF and S_REF) to determine surface density
                                !       and GINT calculate internal densities.
                                !     gprime - use reference density (RHO_0) for surface
                                !       density and GINT calculate internal densities.
                                !     ts_profile - use temperature and salinity profiles
                                !       (read from COORD_FILE) to set layer densities.
                                !     USER - call a user modified routine.
COORD_FILE = "layer_coord.nc"   !
                                ! The file from which the coordinate densities are read.
REGRIDDING_COORDINATE_MODE = "Z*" ! default = "LAYER"
                                ! Coordinate mode for vertical regridding. Choose among the following
                                ! possibilities:  LAYER - Isopycnal or stacked shallow water layers
                                !  ZSTAR, Z* - stretched geopotential z*
                                !  SIGMA_SHELF_ZSTAR - stretched geopotential z* ignoring shelf
                                !  SIGMA - terrain following coordinates
                                !  RHO   - continuous isopycnal
                                !  HYCOM1 - HyCOM-like hybrid coordinate
                                !  SLIGHT - stretched coordinates above continuous isopycnal
                                !  ADAPTIVE - optimize for smooth neutral density surfaces
ALE_COORDINATE_CONFIG = "FILE:vgrid.nc,dz" ! default = "UNIFORM"
                                ! Determines how to specify the coordinate resolution. Valid options are:
                                !  PARAM       - use the vector-parameter ALE_RESOLUTION
                                !  UNIFORM[:N] - uniformly distributed
                                !  FILE:string - read from a file. The string specifies
                                !                the filename and variable name, separated
                                !                by a comma or space, e.g. FILE:lev.nc,dz
                                !                or FILE:lev.nc,interfaces=zw
                                !  WOA09[:N]   - the WOA09 vertical grid (approximately)
                                !  FNC1:string - FNC1:dz_min,H_total,power,precision
                                !  HYBRID:string - read from a file. The string specifies
                                !                the filename and two variable names, separated
                                !                by a comma or space, for sigma-2 and dz. e.g.
                                !                HYBRID:vgrid.nc,sigma2,dz
!ALE_RESOLUTION = 1.0, 2.7869487436612492, 4.465200168663957, 6.088831874792309, 7.675427348721486, 9.234056820196486, 10.770272432309497, 12.287821786299801, 13.789402496545307, 15.27704745875873, 16.752342319823015, 18.21655755431665, 19.6707333041918, 21.115736352232034, 22.552299790959324, 23.98105148500204, 25.402535017360975, 26.817225442770564, 28.225541360534805, 29.627854320264817, 31.024496256929353, 32.415765444507656, 33.80193131883749, 35.183238425314755, 36.5599096808437, 37.93214909236093, 39.30014404027611, 40.66406721029114, 42.02407823858243, 43.380325121462874, 44.73294543009183, 46.08206736271245, 47.42781066062287, 48.770287409183084, 50.10960274129104, 51.44585545768939, 52.779138576004016, 54.10953981843204, 55.437142046389454, 56.76202364911592, 58.08425889215482, 59.40391823074674, 60.721068592421034, 62.03577363247496, 63.34809396550099, 64.65808737569455, 65.96580900831691, 67.27131154436302, 68.57464536023735, 69.87585867400253, 71.17499767957838, 72.47210667010881, 73.76722815155608, 75.0604029474739, 76.35167029579452, 77.64106793837391, 78.9286322039593, 80.21439808516243, 81.49839930998724, 82.78066840835345, 84.06123677407913, 85.34013472267407, 86.61739154530324, 87.8930355592338, 89.167
                                ! The distribution of vertical resolution for the target
                                ! grid used for Eulerian-like coordinates. For example,
                                ! in z-coordinate mode, the parameter is a list of level
                                ! thicknesses (in m). In sigma-coordinate mode, the list
                                ! is of non-dimensional fractions of the water column.
REMAPPING_SCHEME = "PPM_H4"     ! default = "PLM"
                                ! This sets the reconstruction scheme used for vertical remapping for all
                                ! variables. It can be one of the following schemes: PCM         (1st-order
                                ! accurate)
                                ! PLM         (2nd-order accurate)
                                ! PPM_H4      (3rd-order accurate)
                                ! PPM_IH4     (3rd-order accurate)
                                ! PQM_IH4IH3  (4th-order accurate)
                                ! PQM_IH6IH5  (5th-order accurate)

! === module MOM_state_initialization ===
INIT_LAYERS_FROM_Z_FILE = True  !   [Boolean] default = False
                                ! If true, initialize the layer thicknesses, temperatures, and salinities from a
                                ! Z-space file on a latitude-longitude grid.

! === module MOM_initialize_layers_from_Z ===
TEMP_SALT_Z_INIT_FILE = "TS_init_Z.nc" ! default = "temp_salt_z.nc"
                                ! The name of the z-space input file used to initialize temperatures (T) and
                                ! salinities (S). If T and S are not in the same file, TEMP_Z_INIT_FILE and
                                ! SALT_Z_INIT_FILE must be set.
Z_INIT_FILE_PTEMP_VAR = "T"     ! default = "ptemp"
                                ! The name of the potential temperature variable in TEMP_Z_INIT_FILE.
Z_INIT_FILE_SALT_VAR = "S"      ! default = "salt"
                                ! The name of the salinity variable in SALT_Z_INIT_FILE.
Z_INIT_ALE_REMAPPING = True     !   [Boolean] default = False
                                ! If True, then remap straight to model coordinate from file.
SPONGE = True                   !   [Boolean] default = False
                                ! If true, sponges may be applied anywhere in the domain. The exact location and
                                ! properties of those sponges are specified via SPONGE_CONFIG.
SPONGE_DAMPING_FILE = "sponge.nc" !
                                ! The name of the file with the sponge damping rates.
SPONGE_STATE_FILE = "sponge_IC.nc" ! default = "sponge.nc"
                                ! The name of the file with the state to damp toward.
SPONGE_PTEMP_VAR = "Temp"       ! default = "PTEMP"
                                ! The name of the potential temperature variable in SPONGE_STATE_FILE.
SPONGE_SALT_VAR = "Salt"        ! default = "SALT"
                                ! The name of the salinity variable in SPONGE_STATE_FILE.
SPONGE_ETA_VAR = "eta"          ! default = "ETA"
                                ! The name of the interface height variable in SPONGE_STATE_FILE.
SPONGE_IDAMP_VAR = "idampone"   ! default = "IDAMP"
                                ! The name of the inverse damping rate variable in SPONGE_DAMPING_FILE.

! === module MOM_sponge ===

! === module MOM_diag_mediator ===
NUM_DIAG_COORDS = 2             ! default = 1
                                ! The number of diagnostic vertical coordinates to use. For each coordinate, an
                                ! entry in DIAG_COORDS must be provided.
DIAG_COORDS = "z Z ZSTAR", "rho2 RHO2 RHO" !
                                ! A list of string tuples associating diag_table modules to a coordinate
                                ! definition used for diagnostics. Each string is of the form
                                ! "MODULE_SUFFIX,PARAMETER_SUFFIX,COORDINATE_NAME".
DIAG_COORD_DEF_Z = "FILE:vgrid.nc,dz" ! default = "WOA09"
                                ! Determines how to specify the coordinate resolution. Valid options are:
                                !  PARAM       - use the vector-parameter DIAG_COORD_RES_Z
                                !  UNIFORM[:N] - uniformly distributed
                                !  FILE:string - read from a file. The string specifies
                                !                the filename and variable name, separated
                                !                by a comma or space, e.g. FILE:lev.nc,dz
                                !                or FILE:lev.nc,interfaces=zw
                                !  WOA09[:N]   - the WOA09 vertical grid (approximately)
                                !  FNC1:string - FNC1:dz_min,H_total,power,precision
                                !  HYBRID:string - read from a file. The string specifies
                                !                the filename and two variable names, separated
                                !                by a comma or space, for sigma-2 and dz. e.g.
                                !                HYBRID:vgrid.nc,sigma2,dz
DIAG_COORD_DEF_RHO2 = "RFNC1:35,999.5,1028,1028.5,8.,1038.,0.0078125" ! default = "WOA09"
                                ! Determines how to specify the coordinate resolution. Valid options are:
                                !  PARAM       - use the vector-parameter DIAG_COORD_RES_RHO2
                                !  UNIFORM[:N] - uniformly distributed
                                !  FILE:string - read from a file. The string specifies
                                !                the filename and variable name, separated
                                !                by a comma or space, e.g. FILE:lev.nc,dz
                                !                or FILE:lev.nc,interfaces=zw
                                !  WOA09[:N]   - the WOA09 vertical grid (approximately)
                                !  FNC1:string - FNC1:dz_min,H_total,power,precision
                                !  HYBRID:string - read from a file. The string specifies
                                !                the filename and two variable names, separated
                                !                by a comma or space, for sigma-2 and dz. e.g.
                                !                HYBRID:vgrid.nc,sigma2,dz

! === module MOM_lateral_mixing_coeffs ===

! === module MOM_set_visc ===
HBBL = 10.0                     !   [m]
                                ! The thickness of a bottom boundary layer with a viscosity of KVBBL if
                                ! BOTTOMDRAGLAW is not defined, or the thickness over which near-bottom
                                ! velocities are averaged for the drag law if BOTTOMDRAGLAW is defined but
                                ! LINEAR_DRAG is not.
DRAG_BG_VEL = 0.01              !   [m s-1] default = 0.0
                                ! DRAG_BG_VEL is either the assumed bottom velocity (with LINEAR_DRAG) or an
                                ! unresolved  velocity that is combined with the resolved velocity to estimate
                                ! the velocity magnitude.  DRAG_BG_VEL is only used when BOTTOMDRAGLAW is
                                ! defined.
BBL_THICK_MIN = 0.1             !   [m] default = 0.0
                                ! The minimum bottom boundary layer thickness that can be used with
                                ! BOTTOMDRAGLAW. This might be Kv/(cdrag*drag_bg_vel) to give Kv as the minimum
                                ! near-bottom viscosity.
KV = 1.0E-05                    !   [m2 s-1]
                                ! The background kinematic viscosity in the interior. The molecular value, ~1e-6
                                ! m2 s-1, may be used.

! === module MOM_thickness_diffuse ===

! === module MOM_dynamics_split_RK2 ===

! === module MOM_continuity ===

! === module MOM_continuity_PPM ===

! === module MOM_CoriolisAdv ===
CORIOLIS_EN_DIS = True          !   [Boolean] default = False
                                ! If true, two estimates of the thickness fluxes are used to estimate the
                                ! Coriolis term, and the one that dissipates energy relative to the other one is
                                ! used.
CORIOLIS_SCHEME = "SADOURNY75_ENSTRO" ! default = "SADOURNY75_ENERGY"
                                ! CORIOLIS_SCHEME selects the discretization for the Coriolis terms. Valid
                                ! values are:
                                !    SADOURNY75_ENERGY - Sadourny, 1975; energy cons.
                                !    ARAKAWA_HSU90     - Arakawa & Hsu, 1990
                                !    SADOURNY75_ENSTRO - Sadourny, 1975; enstrophy cons.
                                !    ARAKAWA_LAMB81    - Arakawa & Lamb, 1981; En. + Enst.
                                !    ARAKAWA_LAMB_BLEND - A blend of Arakawa & Lamb with
                                !                         Arakawa & Hsu and Sadourny energy
BOUND_CORIOLIS = True           !   [Boolean] default = False
                                ! If true, the Coriolis terms at u-points are bounded by the four estimates of
                                ! (f+rv)v from the four neighboring v-points, and similarly at v-points.  This
                                ! option would have no effect on the SADOURNY Coriolis scheme if it were
                                ! possible to use centered difference thickness fluxes.

! === module MOM_PressureForce ===

! === module MOM_PressureForce_FV ===

! === module MOM_hor_visc ===
AH_VEL_SCALE = 0.01             !   [m s-1] default = 0.0
                                ! The velocity scale which is multiplied by the cube of the grid spacing to
                                ! calculate the biharmonic viscosity. The final viscosity is the largest of this
                                ! scaled viscosity, the Smagorinsky and Leith viscosities, and AH.
SMAGORINSKY_AH = True           !   [Boolean] default = False
                                ! If true, use a biharmonic Smagorinsky nonlinear eddy viscosity.
SMAG_BI_CONST = 0.015           !   [nondim] default = 0.0
                                ! The nondimensional biharmonic Smagorinsky constant, typically 0.015 - 0.06.

! === module MOM_vert_friction ===
HMIX_FIXED = 20.0               !   [m]
                                ! The prescribed depth over which the near-surface viscosity and diffusivity are
                                ! elevated when the bulk mixed layer is not used.

! === module MOM_barotropic ===
BOUND_BT_CORRECTION = True      !   [Boolean] default = False
                                ! If true, the corrective pseudo mass-fluxes into the barotropic solver are
                                ! limited to values that require less than maxCFL_BT_cont to be accommodated.
BEBT = 0.2                      !   [nondim] default = 0.1
                                ! BEBT determines whether the barotropic time stepping uses the forward-backward
                                ! time-stepping scheme or a backward Euler scheme. BEBT is valid in the range
                                ! from 0 (for a forward-backward treatment of nonrotating gravity waves) to 1
                                ! (for a backward Euler treatment). In practice, BEBT must be greater than about
                                ! 0.05.
DTBT = 0.0                      !   [s or nondim] default = -0.98
                                ! The barotropic time step, in s. DTBT is only used with the split explicit time
                                ! stepping. To set the time step automatically based the maximum stable value
                                ! use 0, or a negative value gives the fraction of the stable value. Setting
                                ! DTBT to 0 is the same as setting it to -0.98. The value of DTBT that will
                                ! actually be used is an integer fraction of DT, rounding down.

! === module MOM_diagnostics ===

! === module MOM_diabatic_driver ===
! The following parameters are used for diabatic processes.

! === module MOM_set_diffusivity ===

! === module MOM_bkgnd_mixing ===
! Adding static vertical background mixing coefficients
KD = 1.0E-05                    !   [m2 s-1] default = 0.0
                                ! The background diapycnal diffusivity of density in the interior. Zero or the
                                ! molecular value, ~1e-7 m2 s-1, may be used.

! === module MOM_kappa_shear ===
! Parameterization of shear-driven turbulence following Jackson, Hallberg and Legg, JPO 2008
USE_JACKSON_PARAM = True        !   [Boolean] default = False
                                ! If true, use the Jackson-Hallberg-Legg (JPO 2008) shear mixing
                                ! parameterization.
VERTEX_SHEAR = True             !   [Boolean] default = False
                                ! If true, do the calculations of the shear-driven mixing at the cell vertices
                                ! (i.e., the vorticity points).

! === module MOM_diabatic_aux ===
! The following parameters are used for auxiliary diabatic processes.

! === module MOM_opacity ===

! === module MOM_tracer_advect ===

! === module MOM_tracer_hor_diff ===

! === module MOM_sum_output ===
DATE_STAMPED_STDOUT = False     !   [Boolean] default = True
                                ! If true, use dates (not times) in messages to stdout
ENERGYSAVEDAYS = 10.0           !   [days] default = 1.0
                                ! The interval in units of TIMEUNIT between saves of the energies of the run and
                                ! other globally summed diagnostics.

! === module MOM_surface_forcing ===
VARIABLE_WINDS = False          !   [Boolean] default = True
                                ! If true, the winds vary in time after the initialization.
BUOY_CONFIG = "file"            ! default = "zero"
                                ! The character string that indicates how buoyancy forcing is specified. Valid
                                ! options include (file), (zero), (linear), (USER), (BFB) and (NONE).
ARCHAIC_OMIP_FORCING_FILE = False !   [Boolean] default = True
                                ! If true, use the forcing variable decomposition from the old German OMIP
                                ! prescription that predated CORE. If false, use the variable groupings
                                ! available from MOM output diagnostics of forcing variables.
LONGWAVE_FILE = "buoyancy.nc"   !
                                ! The file with the longwave heat flux, in the variable given by
                                ! LONGWAVE_FORCING_VAR.
SHORTWAVE_FILE = "buoyancy.nc"  !
                                ! The file with the shortwave heat flux, in the variable given by
                                ! SHORTWAVE_FORCING_VAR.
EVAPORATION_FILE = "buoyancy.nc" !
                                ! The file with the evaporative moisture flux, in the variable given by
                                ! EVAP_FORCING_VAR.
LATENTHEAT_FILE = "buoyancy.nc" !
                                ! The file with the latent heat flux, in the variable given by
                                ! LATENT_FORCING_VAR.
SENSIBLEHEAT_FILE = "buoyancy.nc" !
                                ! The file with the sensible heat flux, in the variable given by
                                ! SENSIBLE_FORCING_VAR.
RAIN_FILE = "buoyancy.nc"       !
                                ! The file with the liquid precipitation flux, in the variable given by
                                ! RAIN_FORCING_VAR.
RAIN_FORCING_VAR = "liq_runoff" ! default = "liq_precip"
                                ! The variable with the liquid precipitation flux.
SNOW_FILE = "buoyancy.nc"       !
                                ! The file with the frozen precipitation flux, in the variable given by
                                ! SNOW_FORCING_VAR.
SNOW_FORCING_VAR = "liq_runoff" ! default = "froz_precip"
                                ! The variable with the frozen precipitation flux.
RUNOFF_FILE = "buoyancy.nc"     !
                                ! The file with the fresh and frozen runoff/calving fluxes, in variables given
                                ! by LIQ_RUNOFF_FORCING_VAR and FROZ_RUNOFF_FORCING_VAR.
SSTRESTORE_FILE = "TS_init_Z.nc" !
                                ! The file with the SST toward which to restore in the variable given by
                                ! SST_RESTORE_VAR.
SALINITYRESTORE_FILE = "TS_init_Z.nc" !
                                ! The file with the surface salinity toward which to restore in the variable
                                ! given by SSS_RESTORE_VAR.
WIND_CONFIG = "file"            ! default = "zero"
                                ! The character string that indicates how wind forcing is specified. Valid
                                ! options include (file), (2gyre), (1gyre), (gyres), (zero), and (USER).
WIND_FILE = "wind.nc"           !
                                ! The file in which the wind stresses are found in variables STRESS_X and
                                ! STRESS_Y.
WINDSTRESS_X_VAR = "taux"       ! default = "STRESS_X"
                                ! The name of the x-wind stress variable in WIND_FILE.
WINDSTRESS_Y_VAR = "tauy"       ! default = "STRESS_Y"
                                ! The name of the y-wind stress variable in WIND_FILE.

! === module MOM_main (MOM_driver) ===
DAYMAX = 3600.0                 !   [days]
                                ! The final time of the whole simulation, in units of TIMEUNIT seconds.  This
                                ! also sets the potential end time of the present run segment if the end time is
                                ! not set via ocean_solo_nml in input.nml.
RESTART_CONTROL = 3             ! default = 1
                                ! An integer whose bits encode which restart files are written. Add 2 (bit 1)
                                ! for a time-stamped file, and odd (bit 0) for a non-time-stamped file. A
                                ! non-time-stamped restart file is saved at the end of the run segment for any
                                ! non-negative value.
RESTINT = 1825.0                !   [days] default = 0.0
                                ! The interval between saves of the restart file in units of TIMEUNIT.  Use 0
                                ! (the default) to not save incremental restart files at all.
MJHarrison-GFDL commented 3 years ago

@hmkhatri . Try setting NEW_SPONGES = True. The default sponge configurations don't make sense in ALE mode. We don't have diagnostics for sponges at this time, but it would be lumped in with the total diabatic tendency (diabatic_diff_temp_tendency).

Also, please update your code using #1210 since it has a related bugfix.

Sorry for the confusion, we're working on code cleanup here and better documentation.

MJHarrison-GFDL commented 3 years ago

Also, you would want to apply SPONGE_DATA_ONGRID = True

hmkhatri commented 3 years ago

@MJHarrison-GFDL Thanks. I will try these options.

hmkhatri commented 3 years ago

@MJHarrison-GFDL I tried your suggestions but MOM6 started to return segmentation fault. I could not pinpoint the related issue in the code.

I then wrote a separate module for the sponge (following RGC case). The module reads idamp values and tracer profiles from nc files, so this works similar to the standard SPONGE_CONFIG = "file" method. With the new code, restoring within the sponge works fine.

Here is the relevant file SOC_initialization.F90

sponge

Hallberg-NOAA commented 3 years ago

Thank you for this update, @hmkhatri. Having a properly working version of the code turned out to be very helpful for figuring out what was going on in initialize_sponges_file().

Matt and I have looked into initialize_sponges_file() we think that we know where this issue is coming from.

MOM6 has two different modules to handle sponges - one in layer mode and the other for use in ALE mode. They use similar but distinct calls to register the damping rate and the target properties for these two modules. The problem is that in initialize_sponges_file(), some of the calls to register the target properties without using automated spatial and temporal interpolation are using the routines from the layer module when they should be using the ALE module. This is tough to detect because to save memory we are deliberately not allocating the sponge control structure in the case when there are no sponge points on a PE, and if the second call with the properties is made with an unassociated control structure, it is being interpreted as a valid call but on a PE with no sponges, so the code just returns. Also, given MOM6's flexible coordinate system, it would be perfectly conceivable to use layer-mode sponges in some parts of the domain and ALE-mode sponges in others. Combining the two modules and then overloading the corresponding calls might be one way to avoid this issue ever arising again, but it would be more work than could be done quickly.

@MJHarrison-GFDL is working on a PR to fix to the specific issues in initialize_sponges_file(), at which point we expect it to result in similar results to those you show above.

sdbachman commented 3 years ago

Just FYI, Alper and I have been working on our own improvements to the sponge code and we will be submitting a PR soon. It isn't clear to me whether Matt's improvements are separate from, complementary to, or in conflict with what we have done, although I think they are mostly complementary. We would be happy to have a discussion about what we have done to make sure everybody is on the same page.

On Wed, Oct 7, 2020 at 3:56 PM Robert Hallberg notifications@github.com wrote:

Thank you for this update, @hmkhatri https://github.com/hmkhatri. Having a properly working version of the code turned out to be very helpful for figuring out what was going on in initialize_sponges_file().

Matt and I have looked into initialize_sponges_file() we think that we know where this issue is coming from.

MOM6 has two different modules to handle sponges - one in layer mode and the other for use in ALE mode. They use similar but distinct calls to register the damping rate and the target properties for these two modules. The problem is that in initialize_sponges_file(), some of the calls to register the target properties without using automated spatial and temporal interpolation are using the routines from the layer module when they should be using the ALE module. This is tough to detect because to save memory we are deliberately not allocating the sponge control structure in the case when there are no sponge points on a PE, and if the second call with the properties is made with an unassociated control structure, it is being interpreted as a valid call but on a PE with no sponges, so the code just returns. Also, given MOM6's flexible coordinate system, it would be perfectly conceivable to use layer-mode sponges in some parts of the domain and ALE-mode sponges in others. Combining the two modules and then overloading the corresponding calls might be one way to avoid this issue ever arising again, but it would be more work than could be done quickly.

@MJHarrison-GFDL https://github.com/MJHarrison-GFDL is working on a PR to fix to the specific issues in initialize_sponges_file(), at which point we expect it to result in similar results to those you show above.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/MOM6/issues/1218#issuecomment-705214742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5PGIVWPHZPCO7VSBLPPK3SJTPXDANCNFSM4R6JXSBA .

MJHarrison-GFDL commented 3 years ago

Hi Scott and Alper. Sure, let me know what time works for you. I have a separate PR (#1210 ) to dev/gfdl which includes a sponge test (tc4) with file i/o. I can offer to add sponge_uv tests as well.

sdbachman commented 3 years ago

Matt, us NCAR folks already have a chat re: the sponge scheduled for Thursday the 15th at 3 PM EST. You are welcome to join if you would like (I'll send you the meeting info privately), or we can update you after we have everything ironed out on our end. Let me know what you would prefer.

On Fri, Oct 9, 2020 at 10:55 AM Matthew Harrison notifications@github.com wrote:

Hi Scott and Alper. Sure, let me know what time works for you. I have a separate PR (#1210 https://github.com/NOAA-GFDL/MOM6/pull/1210 ) to dev/gfdl which includes a sponge test (tc4) with file i/o. I can offer to add sponge_uv tests as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/MOM6/issues/1218#issuecomment-706292194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5PGIQFAXQNQMZ3WGVZATTSJ46A5ANCNFSM4R6JXSBA .

MJHarrison-GFDL commented 3 years ago

I'll join your meeting. That time works for me.

kshedstrom commented 3 years ago

I'd like to know more about the sponges too and I can make that meeting time. Do you have code for making the files?

Kate

On Fri, Oct 9, 2020 at 9:07 AM Matthew Harrison notifications@github.com wrote:

I'll join your meeting. That time works for me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/MOM6/issues/1218#issuecomment-706298118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADMQHR3H3DX4LNEBVCISJLSJ47N5ANCNFSM4R6JXSBA .

sdbachman commented 3 years ago

Hi Kate, we don't have code to generate the files, but maybe we can discuss whether this would be useful and how best to do that. I'm sending you an invite now.

On Fri, Oct 9, 2020 at 11:13 AM Kate Hedstrom notifications@github.com wrote:

I'd like to know more about the sponges too and I can make that meeting time. Do you have code for making the files?

Kate

On Fri, Oct 9, 2020 at 9:07 AM Matthew Harrison notifications@github.com wrote:

I'll join your meeting. That time works for me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/MOM6/issues/1218#issuecomment-706298118, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AADMQHR3H3DX4LNEBVCISJLSJ47N5ANCNFSM4R6JXSBA

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/MOM6/issues/1218#issuecomment-706300661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5PGIS7JRCIPD3ZSMVPX5TSJ5AB3ANCNFSM4R6JXSBA .

hmkhatri commented 3 years ago

@Hallberg-NOAA Glad to know that the new test module for the sponge was useful in figuring out the issue. Let me know if you need anything from my side.

MJHarrison-GFDL commented 3 years ago

@hmkhatri . Did that work for your test?

hmkhatri commented 3 years ago

@MJHarrison-GFDL I ran my test case with your "sponge file init patch" branch. MOM6 is returning the following error when I set sponge =True

FATAL from PE 104: get_cal_time: "unspecified" is not an acceptable calendar attribute. acceptable calendars are: noleap, 365_day, 365_days, 360_day, julian, no_calendar, thirty_day_months, gregorian

In input.nml file, I have set

&ocean_solo_nml
    date_init = 1,1,1,0,0,0
    calendar = 'thirty_day_months'

I have not seen this error before. I ran the test case in debug mode but could not find the reason for it.

Hallberg-NOAA commented 3 years ago

We believe that this issue has been addressed by PR#1222. @hmkhatri, please try again with the updated code on the dev/gfdl branch and let us know if this issue is still a problem.

hmkhatri commented 3 years ago

@Hallberg-NOAA @MJHarrison-GFDL Thanks for the updates. With the latest changes PR #1222, the sponge works fine (see image below).

This issue can be closed now.

image