MOM6
|
Diapycnal mixing and advection in isopycnal mode.
By Robert Hallberg, September 1997 - July 2000
This file contains the subroutines that implement diapycnal mixing and advection in isopycnal layers. The main subroutine, calculate_entrainment, returns the entrainment by each layer across the interfaces above and below it. These are calculated subject to the constraints that no layers can be driven to neg- ative thickness and that the each layer maintains its target density, using the scheme described in Hallberg (MWR 2000). There may or may not be a bulk mixed layer above the isopycnal layers. The solution is iterated until the change in the entrainment between successive iterations is less than some small tolerance.
The dual-stream entrainment scheme of MacDougall and Dewar (JPO 1997) is used for combined diapycnal advection and diffusion, modified as described in Hallberg (MWR 2000) to be solved implicitly in time. Any profile of diffusivities may be used. Diapycnal advection is fundamentally the residual of diapycnal diffusion, so the fully implicit upwind differencing scheme that is used is entirely appropriate. The downward buoyancy flux in each layer is determined from an implicit calculation based on the previously calculated flux of the layer above and an estim- ated flux in the layer below. This flux is subject to the foll- owing conditions: (1) the flux in the top and bottom layers are set by the boundary conditions, and (2) no layer may be driven below an Angstrom thickness. If there is a bulk mixed layer, the mixed and buffer layers are treated as Eulerian layers, whose thicknesses only change due to entrainment by the interior layers.
Data Types | |
type | entrain_diffusive_cs |
The control structure holding parametes for the MOM_entrain_diffusive module. More... | |
Functions/Subroutines | |
subroutine, public | entrainment_diffusive (h, tv, fluxes, dt, G, GV, US, CS, ea, eb, kb_out, Kd_Lay, Kd_int) |
This subroutine calculates ea and eb, the rates at which a layer entrains from the layers above and below. The entrainment rates are proportional to the buoyancy flux in a layer and inversely proportional to the density differences between layers. The scheme that is used here is described in detail in Hallberg, Mon. Wea. Rev. 2000. More... | |
subroutine | f_to_ent (F, h, kb, kmb, j, G, GV, CS, dsp1_ds, eakb, Ent_bl, ea, eb, do_i_in) |
This subroutine calculates the actual entrainments (ea and eb) and the amount of surface forcing that is applied to each layer if there is no bulk mixed layer. More... | |
subroutine | set_ent_bl (h, dtKd_int, tv, kb, kmb, do_i, G, GV, US, CS, j, Ent_bl, Sref, h_bl) |
This subroutine sets the average entrainment across each of the interfaces between buffer layers within a timestep. It also causes thin and relatively light interior layers to be entrained by the deepest buffer layer. Also find the initial coordinate potential densities (Sref) of each layer. More... | |
subroutine | determine_dskb (h_bl, Sref, Ent_bl, E_kb, is, ie, kmb, G, GV, limit, dSkb, ddSkb_dE, dSlay, ddSlay_dE, dS_anom_lim, do_i_in) |
This subroutine determines the reference density difference between the bottommost buffer layer and the first interior after the mixing between mixed and buffer layers and mixing with the layer below. Within the mixed and buffer layers, entrainment from the layer above is increased when it is necessary to keep the layers from developing a negative thickness; otherwise it equals Ent_bl. At each interface, the upward and downward fluxes average out to Ent_bl, unless entrainment by the layer below is larger than twice Ent_bl. The density difference across the first interior layer may also be returned. It could also be limited to avoid negative values or values that greatly exceed the density differences across an interface. Additionally, the partial derivatives of dSkb and dSlay with E_kb could also be returned. More... | |
subroutine | f_kb_to_ea_kb (h_bl, Sref, Ent_bl, I_dSkbp1, F_kb, kmb, i, G, GV, CS, ea_kb, tol_in) |
Given an entrainment from below for layer kb, determine a consistent entrainment from above, such that dSkb * ea_kb = dSkbp1 * F_kb. The input value of ea_kb is both the maximum value that can be obtained and the first guess of the iterations. Ideally ea_kb should be an under-estimate. More... | |
subroutine | determine_ea_kb (h_bl, dtKd_kb, Sref, I_dSkbp1, Ent_bl, ea_kbp1, min_eakb, max_eakb, kmb, is, ie, do_i, G, GV, CS, Ent, error, err_min_eakb0, err_max_eakb0, F_kb, dFdfm_kb) |
This subroutine determines the entrainment from above by the top interior layer (labeled kb elsewhere) given an entrainment by the layer below it, constrained to be within the provided bounds. More... | |
subroutine | find_maxf_kb (h_bl, Sref, Ent_bl, I_dSkbp1, min_ent_in, max_ent_in, kmb, is, ie, G, GV, CS, maxF, ent_maxF, do_i_in, F_lim_maxent, F_thresh) |
Maximize F = ent*ds_kb*I_dSkbp1 in the range min_ent < ent < max_ent. More... | |
subroutine, public | entrain_diffusive_init (Time, G, GV, US, param_file, diag, CS) |
This subroutine initializes the parameters and memory associated with the entrain_diffusive module. More... | |
subroutine, public | entrain_diffusive_end (CS) |
This subroutine cleans up and deallocates any memory associated with the entrain_diffusive module. More... | |
|
private |
This subroutine determines the reference density difference between the bottommost buffer layer and the first interior after the mixing between mixed and buffer layers and mixing with the layer below. Within the mixed and buffer layers, entrainment from the layer above is increased when it is necessary to keep the layers from developing a negative thickness; otherwise it equals Ent_bl. At each interface, the upward and downward fluxes average out to Ent_bl, unless entrainment by the layer below is larger than twice Ent_bl. The density difference across the first interior layer may also be returned. It could also be limited to avoid negative values or values that greatly exceed the density differences across an interface. Additionally, the partial derivatives of dSkb and dSlay with E_kb could also be returned.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | h_bl | Layer thickness [H ~> m or kg m-2] |
[in] | sref | Reference potential density [R ~> kg m-3] |
[in] | ent_bl | The average entrainment upward and downward across each interface around the buffer layers [H ~> m or kg m-2]. |
[in] | e_kb | The entrainment by the top interior layer [H ~> m or kg m-2]. |
[in] | is | The start of the i-index range to work on. |
[in] | ie | The end of the i-index range to work on. |
[in] | kmb | The number of mixed and buffer layers. |
[in] | limit | If true, limit dSkb and dSlay to avoid negative values. |
[in,out] | dskb | The limited potential density difference across the interface between the bottommost buffer layer and the topmost interior layer. [R ~> kg m-3] dSkb > 0. |
[in,out] | ddskb_de | The partial derivative of dSkb with E [R H-1 ~> kg m-4 or m-1]. |
[in,out] | dslay | The limited potential density difference across the topmost interior layer. 0 < dSkb [R ~> kg m-3] |
[in,out] | ddslay_de | The partial derivative of dSlay with E [R H-1 ~> kg m-4 or m-1]. |
[in,out] | ds_anom_lim | A limiting value to use for the density anomalies below the buffer layer [R ~> kg m-3]. |
[in] | do_i_in | If present, determines which columns are worked on. |
Definition at line 1204 of file MOM_entrain_diffusive.F90.
References mom_error_handler::mom_error().
Referenced by determine_ea_kb(), entrainment_diffusive(), f_kb_to_ea_kb(), and find_maxf_kb().
|
private |
This subroutine determines the entrainment from above by the top interior layer (labeled kb elsewhere) given an entrainment by the layer below it, constrained to be within the provided bounds.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | h_bl | Layer thickness, with the top interior layer at k-index kmb+1 [H ~> m or kg m-2]. |
[in] | sref | The coordinate reference potential density, with the value of the topmost interior layer at layer kmb+1 [R ~> kg m-3]. |
[in] | ent_bl | The average entrainment upward and downward across each interface around the buffer layers [H ~> m or kg m-2]. |
[in] | i_dskbp1 | The inverse of the difference in reference potential density across the base of the uppermost interior layer [R-1 ~> m3 kg-1]. |
[in] | dtkd_kb | The diapycnal diffusivity in the top interior layer times the time step [H2 ~> m2 or kg2 m-4]. |
[in] | ea_kbp1 | The entrainment from above by layer kb+1 [H ~> m or kg m-2]. |
[in] | min_eakb | The minimum permissible rate of entrainment [H ~> m or kg m-2]. |
[in] | max_eakb | The maximum permissible rate of entrainment [H ~> m or kg m-2]. |
[in] | kmb | The number of mixed and buffer layers. |
[in] | is | The start of the i-index range to work on. |
[in] | ie | The end of the i-index range to work on. |
[in] | do_i | A logical variable indicating which i-points to work on. |
cs | This module's control structure. | |
[in,out] | ent | The entrainment rate of the uppermost interior layer [H ~> m or kg m-2]. The input value is the first guess. |
[out] | error | The error (locally defined in this routine) associated with the returned solution. |
[in] | err_min_eakb0 | The errors (locally defined) associated with min_eakb when ea_kbp1 = 0, returned from a previous call to this fn. |
[in] | err_max_eakb0 | The errors (locally defined) associated with min_eakb when ea_kbp1 = 0, returned from a previous call to this fn. |
[out] | f_kb | The entrainment from below by the uppermost interior layer corresponding to the returned value of Ent [H ~> m or kg m-2]. |
[out] | dfdfm_kb | The partial derivative of F_kb with ea_kbp1 [nondim]. |
Definition at line 1577 of file MOM_entrain_diffusive.F90.
References determine_dskb(), and mom_error_handler::mom_error().
Referenced by entrainment_diffusive().
subroutine, public mom_entrain_diffusive::entrain_diffusive_end | ( | type(entrain_diffusive_cs), pointer | CS | ) |
This subroutine cleans up and deallocates any memory associated with the entrain_diffusive module.
cs | A pointer to the control structure for this module that will be deallocated. |
Definition at line 2152 of file MOM_entrain_diffusive.F90.
Referenced by mom_diabatic_driver::diabatic_driver_end().
subroutine, public mom_entrain_diffusive::entrain_diffusive_init | ( | type(time_type), intent(in) | Time, |
type(ocean_grid_type), intent(in) | G, | ||
type(verticalgrid_type), intent(in) | GV, | ||
type(unit_scale_type), intent(in) | US, | ||
type(param_file_type), intent(in) | param_file, | ||
type(diag_ctrl), intent(inout), target | diag, | ||
type(entrain_diffusive_cs), pointer | CS | ||
) |
This subroutine initializes the parameters and memory associated with the entrain_diffusive module.
[in] | time | The current model time. |
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | us | A dimensional unit scaling type |
[in] | param_file | A structure to parse for run-time parameters. |
[in,out] | diag | A structure that is used to regulate diagnostic output. |
cs | A pointer that is set to point to the control structure. |
Definition at line 2084 of file MOM_entrain_diffusive.F90.
References mom_error_handler::mom_error().
subroutine, public mom_entrain_diffusive::entrainment_diffusive | ( | real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in) | h, |
type(thermo_var_ptrs), intent(in) | tv, | ||
type(forcing), intent(in) | fluxes, | ||
real, intent(in) | dt, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(verticalgrid_type), intent(in) | GV, | ||
type(unit_scale_type), intent(in) | US, | ||
type(entrain_diffusive_cs), pointer | CS, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(out) | ea, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(out) | eb, | ||
integer, dimension( g %isd: g %ied, g %jsd: g %jed), intent(inout), optional | kb_out, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in), optional | Kd_Lay, | ||
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke+1), intent(in), optional | Kd_int | ||
) |
This subroutine calculates ea and eb, the rates at which a layer entrains from the layers above and below. The entrainment rates are proportional to the buoyancy flux in a layer and inversely proportional to the density differences between layers. The scheme that is used here is described in detail in Hallberg, Mon. Wea. Rev. 2000.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | us | A dimensional unit scaling type |
[in] | h | Layer thicknesses [H ~> m or kg m-2]. |
[in] | tv | A structure containing pointers to any available thermodynamic fields. Absent fields have NULL ptrs. |
[in] | fluxes | A structure of surface fluxes that may be used. |
[in] | dt | The time increment [T ~> s]. |
cs | The control structure returned by a previous call to entrain_diffusive_init. | |
[out] | ea | The amount of fluid entrained from the layer |
[out] | eb | The amount of fluid entrained from the layer |
[in,out] | kb_out | The index of the lightest layer denser than |
[in] | kd_lay | The diapycnal diffusivity of layers |
[in] | kd_int | The diapycnal diffusivity of interfaces |
Definition at line 54 of file MOM_entrain_diffusive.F90.
References determine_dskb(), determine_ea_kb(), f_kb_to_ea_kb(), f_to_ent(), find_maxf_kb(), mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), and set_ent_bl().
|
private |
Given an entrainment from below for layer kb, determine a consistent entrainment from above, such that dSkb * ea_kb = dSkbp1 * F_kb. The input value of ea_kb is both the maximum value that can be obtained and the first guess of the iterations. Ideally ea_kb should be an under-estimate.
[in] | g | The ocean's grid structure |
[in] | gv | The ocean's vertical grid structure |
[in] | h_bl | Layer thickness, with the top interior |
[in] | sref | The coordinate reference potential density, |
[in] | ent_bl | The average entrainment upward and downward |
[in] | i_dskbp1 | The inverse of the difference in reference potential density across the base of the uppermost interior layer [R-1 ~> m3 kg-1]. |
[in] | f_kb | The entrainment from below by the uppermost interior layer [H ~> m or kg m-2] |
[in] | kmb | The number of mixed and buffer layers. |
[in] | i | The i-index to work on |
cs | This module's control structure. | |
[in,out] | ea_kb | The entrainment from above by the layer below the buffer layer (i.e. layer kb) [H ~> m or kg m-2]. |
[in] | tol_in | A tolerance for the iterative determination of the entrainment [H ~> m or kg m-2]. |
Definition at line 1444 of file MOM_entrain_diffusive.F90.
References determine_dskb(), and find_maxf_kb().
Referenced by entrainment_diffusive().
|
private |
This subroutine calculates the actual entrainments (ea and eb) and the amount of surface forcing that is applied to each layer if there is no bulk mixed layer.
[in] | g | The ocean's grid structure |
[in] | gv | The ocean's vertical grid structure |
[in] | f | The density flux through a layer within a time step divided by the density difference across the interface below the layer [H ~> m or kg m-2]. |
[in] | h | Layer thicknesses [H ~> m or kg m-2] |
[in] | kb | The index of the lightest layer denser than the deepest buffer layer. |
[in] | kmb | The number of mixed and buffer layers. |
[in] | j | The meridional index upon which to work. |
[in] | cs | This module's control structure. |
[in] | dsp1_ds | The ratio of coordinate variable differences across the interfaces below a layer over the difference across the interface above the layer. |
[in] | eakb | The entrainment from above by the layer below the buffer layer [H ~> m or kg m-2]. |
[in] | ent_bl | The average entrainment upward and downward across each interface around the buffer layers [H ~> m or kg m-2]. |
[in,out] | ea | The amount of fluid entrained from the layer |
[in,out] | eb | The amount of fluid entrained from the layer |
[in] | do_i_in | Indicates which i-points to work on. |
Definition at line 899 of file MOM_entrain_diffusive.F90.
Referenced by entrainment_diffusive().
|
private |
Maximize F = ent*ds_kb*I_dSkbp1 in the range min_ent < ent < max_ent.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | h_bl | Layer thickness [H ~> m or kg m-2] |
[in] | sref | Reference potential density [R ~> kg m-3]. |
[in] | ent_bl | The average entrainment upward and |
[in] | i_dskbp1 | The inverse of the difference in reference potential density across the base of the uppermost interior layer [R-1 ~> m3 kg-1]. |
[in] | min_ent_in | The minimum value of ent to search, [H ~> m or kg m-2]. |
[in] | max_ent_in | The maximum value of ent to search, [H ~> m or kg m-2]. |
[in] | kmb | The number of mixed and buffer layers. |
[in] | is | The start of the i-index range to work on. |
[in] | ie | The end of the i-index range to work on. |
cs | This module's control structure. | |
[out] | maxf | The maximum value of F = ent*ds_kb*I_dSkbp1 found in the range min_ent < ent < max_ent [H ~> m or kg m-2]. |
[out] | ent_maxf | The value of ent at that maximum [H ~> m or kg m-2]. |
[in] | do_i_in | A logical array indicating which columns |
[out] | f_lim_maxent | If present, do not apply the limit in |
[in] | f_thresh | If F_thresh is present, return the first |
Definition at line 1789 of file MOM_entrain_diffusive.F90.
References determine_dskb().
Referenced by entrainment_diffusive(), and f_kb_to_ea_kb().
|
private |
This subroutine sets the average entrainment across each of the interfaces between buffer layers within a timestep. It also causes thin and relatively light interior layers to be entrained by the deepest buffer layer. Also find the initial coordinate potential densities (Sref) of each layer.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | h | Layer thicknesses [H ~> m or kg m-2] |
[in] | dtkd_int | The diapycnal diffusivity across |
[in] | tv | A structure containing pointers to any available thermodynamic fields. Absent fields have NULL ptrs. |
[in,out] | kb | The index of the lightest layer denser than the buffer layer or 1 if there is no buffer layer. |
[in] | kmb | The number of mixed and buffer layers. |
[in] | do_i | A logical variable indicating which i-points to work on. |
[in] | us | A dimensional unit scaling type |
cs | This module's control structure. | |
[in] | j | The meridional index upon which to work. |
[out] | ent_bl | The average entrainment upward and |
[out] | sref | The coordinate potential density minus 1000 for each layer [R ~> kg m-3]. |
[out] | h_bl | The thickness of each layer [H ~> m or kg m-2]. |
Definition at line 1029 of file MOM_entrain_diffusive.F90.
Referenced by entrainment_diffusive().