SAMSIM
Functions/Subroutines
mo_layer_dynamics Module Reference

Mo_layer_dynamics contains all subroutines for the growth and shrinking of layer thickness. More...

Functions/Subroutines

subroutine, public layer_dynamics (phi, N_active, Nlayer, N_bottom, N_middle, N_top, m, S_abs, H_abs, thick, thick_0, T_bottom, S_bu_bottom, bottom_flag, debug_flag, melt_thick_output, N_bgc, bgc_abs, bgc_bottom)
 Organizes the Semi-Adaptive grid SAMSIM uses. More...
 
subroutine, public top_melt (Nlayer, N_active, N_bottom, N_middle, N_top, thick_0, m, S_abs, H_abs, thick, N_bgc, bgc_abs)
 
subroutine, public top_grow (Nlayer, N_active, N_bottom, N_middle, N_top, thick_0, m, S_abs, H_abs, thick, N_bgc, bgc_abs)
 Top grow subroutine. More...
 

Detailed Description

Mo_layer_dynamics contains all subroutines for the growth and shrinking of layer thickness.

The middle layers have flexible thickness in contrast to the lower and upper layers which have static thickness. The details are provided in the separate subroutines.

Author
Philipp Griewank

COPYRIGHT

This file is part of SAMSIM.

SAMSIM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

SAMSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with SAMSIM. If not, see http://www.gnu.org/licenses/.

Function/Subroutine Documentation

subroutine, public mo_layer_dynamics::layer_dynamics ( real(wp), dimension(nlayer), intent(in)  phi,
integer, intent(inout)  N_active,
integer, intent(in)  Nlayer,
integer, intent(in)  N_bottom,
integer, intent(in)  N_middle,
integer, intent(in)  N_top,
real(wp), dimension(nlayer), intent(inout)  m,
real(wp), dimension(nlayer), intent(inout)  S_abs,
real(wp), dimension(nlayer), intent(inout)  H_abs,
real(wp), dimension(nlayer), intent(inout)  thick,
real(wp), intent(in)  thick_0,
real(wp), intent(in)  T_bottom,
real(wp), intent(in)  S_bu_bottom,
integer, intent(in)  bottom_flag,
integer, intent(in)  debug_flag,
real(wp), intent(inout)  melt_thick_output,
integer, intent(in)  N_bgc,
real(wp), dimension(nlayer,n_bgc), intent(inout), optional  bgc_abs,
real(wp), dimension(n_bgc), intent(in), optional  bgc_bottom 
)

Organizes the Semi-Adaptive grid SAMSIM uses.

Modifies the grid and all core variables due to growth or melt. Calls the different subroutines according to current conditions. All subroutines can be called with or without biogeochemical tracers active, which is triggered by providing bgc_abs when calling the subroutine. See Griewank PhD thesis for a full description of the grid.

Conditions under which following layer dynamics subroutines are called:

  • bottom_melt: lowest layer is ice free, second lowest layer has a solid fraction smaller than phi_s_min/2, and all Nlayer layers are active.
  • bottom_melt_simple: lowest layer is ice free, second lowest layer has a solid fraction smaller than phi_s_min/2, and not all Nlayer layers are active.
  • bottom_melt_simple: lowest layer is ice free, second lowest layer has a solid fraction smaller than phi_s_min/2, all Nlayer layers are active, and the thickness of the middle layers equals thick_0
  • bottom_growth_simple: lowest layer has a solid fraction higher than psi_s_min, and not all Nlayer layers are active
  • bottom_growth: lowest layer has a solid fraction higher than psi_s_min, and all Nlayer layers are active
  • top_grow: top layer thicker than 3/2 * thick_0
  • top_melt: top layer thinner than 1/2 * thick_0

If debug_flag is set to 2 the layer values will be written into the debug output (thermoXX.dat) before and after layer dynamics with a string to identify which subroutine was called

Revision History
created by Philipp Griewank, IMPRS (2010-07-29)
first complete and hopefully stable version by Philipp Griewank, IMPRS (2010-08-10)
Parameters
[in,out]melt_thick_outputNiels, 2017 add: melt_thick_output !OBS: only 3rd element in standard melt_thick_output vector!
[in]bgc_bottomNiels, 2017 add: subtract top growth from melt thick output
subroutine, public mo_layer_dynamics::top_grow ( integer, intent(in)  Nlayer,
integer, intent(inout)  N_active,
integer, intent(in)  N_bottom,
integer, intent(in)  N_middle,
integer, intent(in)  N_top,
real(wp), intent(in)  thick_0,
real(wp), dimension(nlayer), intent(inout)  m,
real(wp), dimension(nlayer), intent(inout)  S_abs,
real(wp), dimension(nlayer), intent(inout)  H_abs,
real(wp), dimension(nlayer), intent(inout)  thick,
integer, intent(in)  N_bgc,
real(wp), dimension(nlayer,n_bgc), intent(inout), optional  bgc_abs 
)

Top grow subroutine.

Should be called when the top layer is thicker then 1.5 *thick_0. If N_active=Nlayer middle layers are expanded by thick_0/N_middle and top layers are moved one down. IF N_active<Nlayer then N_active=N_active+1 and all layers are shifted downwards.

Revision History
Started by Philipp Griewank, IMPRS (2011-05-10>)
subroutine, public mo_layer_dynamics::top_melt ( integer, intent(in)  Nlayer,
integer, intent(inout)  N_active,
integer, intent(in)  N_bottom,
integer, intent(in)  N_middle,
integer, intent(in)  N_top,
real(wp), intent(in)  thick_0,
real(wp), dimension(nlayer), intent(inout)  m,
real(wp), dimension(nlayer), intent(inout)  S_abs,
real(wp), dimension(nlayer), intent(inout)  H_abs,
real(wp), dimension(nlayer), intent(inout)  thick,
integer, intent(in)  N_bgc,
real(wp), dimension(nlayer,n_bgc), intent(inout), optional  bgc_abs 
)