optim_ctm_pars: Optimize cell thermal mass correction parameters (R workflow)

View source: R/ctm_functions.R

optim_ctm_parsR Documentation

Optimize cell thermal mass correction parameters (R workflow)

Description

Estimate optimal cell thermal mass correction parameters by minimizing the area between downcast and upcast temperature-salinity curves. Or, if only upcast or downcast is provided, optimization based on minimizing the gradient of the salinity profile

Usage

optim_ctm_pars(
  dc = NULL,
  uc = NULL,
  optim_method = "L-BFGS-B",
  start_alpha_C = c(0.001, 0.01, 0.02, 0.04, 0.08, 0.12),
  start_beta_C = c(1, 1/2, 1/4, 1/8, 1/12, 1/24),
  default_parameters = c(alpha_C = 0.04, beta_C = 0.125),
  area_method = "ts"
)

Arguments

dc

downcast oce object

uc

upcast oce object

optim_method

Optimization method for optim(). Default is the Broyden-Fletcher-Goldfarb-Shanno with constraints algorithm ("L-BFGS-B")

start_alpha_C

Starting value for alpha in cell thermal mass optimization (default = 0.04, typical value for SBE19plus).

start_beta_C

Starting value for beta in cell thermal mass optimization (default = 1/8, typical value for SBE19plus).

default_parameters

Named numeric vector of default parameters. Defaults is c(alpha_C = 0.04, beta_C = 0.125).

area_method

Area between temperature-salinity ("ts") curves, depth-salinity curves ("zs"), or pressure-salinity curves ("ps")

Value

A named numerical vector of the optimal alpha_C or beta_C. The input values are returned if the optimization does not converge.

Author(s)

Sean Rohan


afsc-gap-products/gapctd documentation built on March 5, 2025, 3:42 a.m.