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:
objectMutable state for the translated GOTM observations module.
- Parameters:
initial_salinity_type (int)
sprof_input (ProfileInput)
initial_temperature_type (int)
tprof_input (ProfileInput)
o2_prof_input (ProfileInput)
dsdx_input (ProfileInput)
dsdy_input (ProfileInput)
dtdx_input (ProfileInput)
dtdy_input (ProfileInput)
idpdx (ndarray | None)
idpdy (ndarray | None)
uprof_input (ProfileInput)
vprof_input (ProfileInput)
epsprof_input (ProfileInput)
SRelaxTau (ndarray | None)
TRelaxTau (ndarray | 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)
s_1 (float)
z_s2 (float)
s_2 (float)
s_obs_NN (float)
SRelaxTauM (float)
SRelaxTauS (float)
SRelaxTauB (float)
SRelaxSurf (float)
SRelaxBott (float)
z_t1 (float)
t_1 (float)
z_t2 (float)
t_2 (float)
t_obs_NN (float)
TRelaxTauM (float)
TRelaxTauS (float)
TRelaxTauB (float)
TRelaxSurf (float)
TRelaxBott (float)
ext_press_mode (int)
PeriodM (float)
AmpMu (float)
AmpMv (float)
PhaseMu (float)
PhaseMv (float)
PeriodS (float)
AmpSu (float)
AmpSv (float)
PhaseSu (float)
PhaseSv (float)
int_press_type (int)
s_adv (bool)
t_adv (bool)
plume_type (int)
plume_slope_x (float)
plume_slope_y (float)
extinct_method (int)
w_adv_discr (int)
period_1 (float)
amp_1 (float)
phase_1 (float)
period_2 (float)
amp_2 (float)
phase_2 (float)
Hs_input (ScalarInput)
Tz_input (ScalarInput)
phiw_input (ScalarInput)
vel_relax_tau (float)
vel_relax_ramp (float)
b_obs_surf (float)
b_obs_NN (float)
b_obs_sbf (float)
-
sprof_input:
ProfileInput¶
-
tprof_input:
ProfileInput¶
-
o2_prof_input:
ProfileInput¶
-
dsdx_input:
ProfileInput¶
-
dsdy_input:
ProfileInput¶
-
dtdx_input:
ProfileInput¶
-
dtdy_input:
ProfileInput¶
-
uprof_input:
ProfileInput¶
-
vprof_input:
ProfileInput¶
-
epsprof_input:
ProfileInput¶
-
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¶
-
Hs_input:
ScalarInput¶
-
Tz_input:
ScalarInput¶
-
phiw_input:
ScalarInput¶
- pygotm.observations.observations.clean_observations(state)[source]¶
Release observation work arrays.
- Return type:
- 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.
- pygotm.observations.observations.init_observations(state, settings=None)[source]¶
Initialise observation/input descriptors from GOTM settings.
- Return type:
- Parameters:
state (ObservationsState)
settings (GotmSettings | Mapping[str, object] | None)
- 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:
- Parameters:
state (ObservationsState)
depth (float)
nlev (int)
z (ndarray)
zi (ndarray)
h (ndarray)
gravity (float)
density_state (DensityState)
Analytical two-layer vertical profile — translation of analytical_profile.F90.
Creates a piecewise-linear vertical profile prof with:
value
v1in a surface layer from the surface down to depthz1;value
v2in a bottom layer from depthz2to the sea floor;values linearly interpolated between
v1andv2in the intermediate layer fromz1toz2.
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.
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.
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.