Observations

Profile and observational data handling — analytical profiles, constant profiles, and file-based initialisation of temperature and salinity.

Observation and profile modules.

Observational data access for GOTM.

Provides routines for reading and interpolating observational profiles of temperature, salinity, velocity, and related quantities onto the model grid. Used to initialise the model state and to apply nudging/relaxation towards observed values.

Key routines: init_observations, post_init_observations, get_all_obs, clean_observations.

class pygotm.observations.observations.ObservationsState(initial_salinity_type=1, sprof_input=<factory>, initial_temperature_type=1, tprof_input=<factory>, o2_prof_input=<factory>, dsdx_input=<factory>, dsdy_input=<factory>, dtdx_input=<factory>, dtdy_input=<factory>, idpdx=None, idpdy=None, uprof_input=<factory>, vprof_input=<factory>, epsprof_input=<factory>, SRelaxTau=None, TRelaxTau=None, zeta_input=<factory>, dpdx_input=<factory>, dpdy_input=<factory>, h_press_input=<factory>, w_adv_input=<factory>, w_height_input=<factory>, A_input=<factory>, g1_input=<factory>, g2_input=<factory>, z_s1=0.0, s_1=0.0, z_s2=0.0, s_2=0.0, s_obs_NN=0.0, SRelaxTauM=1000000000000000.0, SRelaxTauS=1000000000000000.0, SRelaxTauB=1000000000000000.0, SRelaxSurf=0.0, SRelaxBott=0.0, z_t1=0.0, t_1=0.0, z_t2=0.0, t_2=0.0, t_obs_NN=0.0, TRelaxTauM=1000000000000000.0, TRelaxTauS=1000000000000000.0, TRelaxTauB=1000000000000000.0, TRelaxSurf=0.0, TRelaxBott=0.0, ext_press_mode=0, PeriodM=44714.0, AmpMu=0.0, AmpMv=0.0, PhaseMu=0.0, PhaseMv=0.0, PeriodS=43200.0, AmpSu=0.0, AmpSv=0.0, PhaseSu=0.0, PhaseSv=0.0, int_press_type=0, s_adv=False, t_adv=False, plume_type=2, plume_slope_x=0.0, plume_slope_y=0.0, extinct_method=1, w_adv_discr=6, period_1=44714.0, amp_1=0.0, phase_1=0.0, period_2=43200.0, amp_2=0.0, phase_2=0.0, Hs_input=<factory>, Tz_input=<factory>, phiw_input=<factory>, vel_relax_tau=1000000000000000.0, vel_relax_ramp=1000000000000000.0, b_obs_surf=0.0, b_obs_NN=0.0, b_obs_sbf=0.0)[source]

Bases: object

Mutable state for the translated GOTM observations module.

Parameters:
initial_salinity_type: int = 1
sprof_input: ProfileInput
initial_temperature_type: int = 1
tprof_input: ProfileInput
o2_prof_input: ProfileInput
dsdx_input: ProfileInput
dsdy_input: ProfileInput
dtdx_input: ProfileInput
dtdy_input: ProfileInput
idpdx: ndarray | None = None
idpdy: ndarray | None = None
uprof_input: ProfileInput
vprof_input: ProfileInput
epsprof_input: ProfileInput
SRelaxTau: ndarray | None = None
TRelaxTau: ndarray | None = None
zeta_input: ScalarInput
dpdx_input: ScalarInput
dpdy_input: ScalarInput
h_press_input: ScalarInput
w_adv_input: ScalarInput
w_height_input: ScalarInput
A_input: ScalarInput
g1_input: ScalarInput
g2_input: ScalarInput
z_s1: float = 0.0
s_1: float = 0.0
z_s2: float = 0.0
s_2: float = 0.0
s_obs_NN: float = 0.0
SRelaxTauM: float = 1000000000000000.0
SRelaxTauS: float = 1000000000000000.0
SRelaxTauB: float = 1000000000000000.0
SRelaxSurf: float = 0.0
SRelaxBott: float = 0.0
z_t1: float = 0.0
t_1: float = 0.0
z_t2: float = 0.0
t_2: float = 0.0
t_obs_NN: float = 0.0
TRelaxTauM: float = 1000000000000000.0
TRelaxTauS: float = 1000000000000000.0
TRelaxTauB: float = 1000000000000000.0
TRelaxSurf: float = 0.0
TRelaxBott: float = 0.0
ext_press_mode: int = 0
PeriodM: float = 44714.0
AmpMu: float = 0.0
AmpMv: float = 0.0
PhaseMu: float = 0.0
PhaseMv: float = 0.0
PeriodS: float = 43200.0
AmpSu: float = 0.0
AmpSv: float = 0.0
PhaseSu: float = 0.0
PhaseSv: float = 0.0
int_press_type: int = 0
s_adv: bool = False
t_adv: bool = False
plume_type: int = 2
plume_slope_x: float = 0.0
plume_slope_y: float = 0.0
extinct_method: int = 1
w_adv_discr: int = 6
period_1: float = 44714.0
amp_1: float = 0.0
phase_1: float = 0.0
period_2: float = 43200.0
amp_2: float = 0.0
phase_2: float = 0.0
Hs_input: ScalarInput
Tz_input: ScalarInput
phiw_input: ScalarInput
vel_relax_tau: float = 1000000000000000.0
vel_relax_ramp: float = 1000000000000000.0
b_obs_surf: float = 0.0
b_obs_NN: float = 0.0
b_obs_sbf: float = 0.0
pygotm.observations.observations.clean_observations(state)[source]

Release observation work arrays.

Return type:

None

Parameters:

state (ObservationsState)

pygotm.observations.observations.get_all_obs(state, julday, secs, nlev, z, *, fsecs=None)[source]

Update analytical observations for the current model time.

Return type:

None

Parameters:
pygotm.observations.observations.init_observations(state, settings=None)[source]

Initialise observation/input descriptors from GOTM settings.

Return type:

None

Parameters:
pygotm.observations.observations.post_init_observations(state, depth, nlev, z, zi, h, gravity, density_state)[source]

Allocate observation work arrays and prepare analytical/profile inputs.

Return type:

None

Parameters:

Analytical two-layer vertical profile — translation of analytical_profile.F90.

Creates a piecewise-linear vertical profile prof with:

  • value v1 in a surface layer from the surface down to depth z1;

  • value v2 in a bottom layer from depth z2 to the sea floor;

  • values linearly interpolated between v1 and v2 in the intermediate layer from z1 to z2.

Used to initialise temperature or salinity when the GOTM YAML method is set to two_layer.

Original FORTRAN author: Karsten Bolding.

pygotm.observations.analytical_profile.analytical_profile(nlev, z, z1, v1, z2, v2)[source]

Create the piecewise-linear two-layer profile from analytical_profile.F90.

Return type:

ndarray

Parameters:

Constant-buoyancy-frequency salinity profile — translation of const_NNS.F90.

Constructs a salinity profile such that the squared buoyancy frequency \(N^2\) equals a prescribed constant value NN [s⁻²] throughout the water column, given a uniform background temperature T_const. The haline contraction coefficient \(\beta\) is evaluated at each grid interface via get_beta(), and iterated once per level for accuracy.

Used to initialise salinity when the GOTM YAML method is set to buoyancy.

Original FORTRAN author: Lars Umlauf.

pygotm.observations.const_nns.const_NNS(density_state, nlev, z, zi, S_top, T_const, NN, gravity, S=None)[source]

Construct a salinity profile with constant buoyancy frequency.

Return type:

ndarray

Parameters:

Constant-buoyancy-frequency temperature profile — translation of const_NNT.F90.

Constructs a temperature profile such that the squared buoyancy frequency \(N^2\) equals a prescribed constant value NN [s⁻²] throughout the water column, given a uniform background salinity S_const. The thermal expansion coefficient \(\alpha\) is evaluated at each grid interface via get_alpha(), and iterated once per level for accuracy.

Used to initialise temperature when the GOTM YAML method is set to buoyancy.

Original FORTRAN author: Lars Umlauf.

pygotm.observations.const_nnt.const_NNT(density_state, nlev, z, zi, T_top, S_const, NN, gravity, T=None)[source]

Construct a temperature profile with constant buoyancy frequency.

Return type:

ndarray

Parameters: