Output¶
Output variables, locations and times.
XBeach output.
Output
pydantic-model
¶
Output(**data: Any)
Bases: XBeachBaseModel
XBeach output configuration.
XBeach supports four different types of output: 1) instantaneous spatial output 2) time-averaged spatial output 3) fixed point output or 4) run-up gauge output. In principle any variable in XBeach can be outputted as long as it is part of the spaceparams structure defined in variables.f90 in the XBeach source code.
This class simplifies output configuration by using list fields (meanvars,
globalvars, pointvars, points, rugauges) to define variables and locations.
The corresponding count keywords (nmeanvar, nglobalvar, npointvar, npoints,
nrugauge) are automatically set based on list lengths when generating params.txt.
Empty lists disable that output type.
Instantaneous spatial output¶
Instantaneous spatial output (globalvars) describes the instantaneous state of
variables across the entire model domain at various points in time.
Time-averaged spatial output¶
Time-averaged spatial output (meanvars)describes the time-averaged state of
variables across the entire model domain at various points in time. The user can
define the averaging period using the tintm field.
Fixed point output¶
Fixed point output (pointvars) allows the user to select one or more locations for
which a time series of data is stored. This output describes a time-series of one or
more variables at one point in the model domain. To make use of this option, the
user must specify the output locations using the points field describing the
location coordinates given as the x-coordinate and y-coordinate and in world
coordinates. XBeach will link the output location to the nearest computational point.
Run-up gauge output¶
Run-up gauge output describes a time-series of a number of variables at the (moving) waterline. In this case XBeach scans in an x-directional transect defined by the user for the location of the waterline. Output information is recorded for this moving point. This is particularly useful to keep track of run-up levels in cross-shore transects.
The definition of run-up gauges is similar to the definition of fixed point output.
The user needs to specify the run-up gauge locations using the rugauges field,
describing the coordinates of the initial location of the run-up gauge. XBeach will
subsequently link the initial run-up gauge location to the nearest computational
cross-shore transect rather than just the nearest computational point.
Run-up gauges share their selection of output variables with regular point output. However, in the case of run-up gauges, XBeach will automatically also include the variables xw, yw and zs to the point output variables, if these variables were not specified using the npointvar keyword in params.txt. Note that the user should refer to the pointvars.idx output file to check order of output variables for points and run-up gauges.
See https://xbeach.readthedocs.io/en/latest/xbeach_manual.html#output-selection for more information.
Fields:
-
model_type(Literal['output']) -
outputformat(Optional[Literal['fortran', 'netcdf', 'debug']]) -
outputprecision(Optional[Literal['single', 'double']]) -
ncfilename(Optional[str]) -
meanvars(list[OutputVarsEnum]) -
globalvars(list[OutputVarsEnum]) -
points(list[tuple[float, float]]) -
pointvars(list[OutputVarsEnum]) -
rugauges(list[tuple[float, float]]) -
nrugdepth(Optional[int]) -
rugdepth(Optional[float]) -
timings(Optional[bool]) -
tstart(Optional[float]) -
tintc(Optional[float]) -
tintg(Optional[float]) -
tintm(Optional[float]) -
tintp(Optional[float]) -
tinth(Optional[float]) -
writehotstart(Optional[bool]) -
tsglobal(Optional[XBeachDataBlob]) -
tsmean(Optional[XBeachDataBlob]) -
tspoints(Optional[XBeachDataBlob]) -
projection(Optional[str]) -
remdryoutput(Optional[bool]) -
rotate(Optional[bool])
Validators:
-
check_no_duplicate_variables→meanvars,globalvars,pointvars -
check_variable_limits→meanvars,globalvars,pointvars,points,rugauges -
validate_point_output_consistency -
fixed_or_file_times
outputformat
pydantic-field
¶
Output file format (XBeach default: fortran)
outputprecision
pydantic-field
¶
Netcdf output precision (XBeach default: double)
ncfilename
pydantic-field
¶
Xbeach netcdf output file name (XBeach default: xboutput.nc)
meanvars
pydantic-field
¶
meanvars: list[OutputVarsEnum] = []
Mean output variables (sets nmeanvar and variable list in params.txt)
globalvars
pydantic-field
¶
globalvars: list[OutputVarsEnum] = []
Global output variables (sets nglobalvar and variable list in params.txt)
points
pydantic-field
¶
Point locations as (x, y) coordinate pairs (sets npoints and point coordinates in params.txt)
pointvars
pydantic-field
¶
pointvars: list[OutputVarsEnum] = []
Point output variables (sets npointvar and variable list in params.txt)
rugauges
pydantic-field
¶
Runup gauge locations as (x, y) coordinate pairs (sets nrugauge and gauge coordinates in params.txt)
nrugdepth
pydantic-field
¶
Number of depths to compute runup in runup gauge
rugdepth
pydantic-field
¶
Minimum depth for determination of last wet point in runup gauge (XBeach default: 0)
timings
pydantic-field
¶
Switch enable progress output to screen (XBeach default: True)
tstart
pydantic-field
¶
Start time (s) of output, in morphological time (XBeach default: 0)
tintc
pydantic-field
¶
Interval time (s) of cross section output (XBeach default: -123)
tintg
pydantic-field
¶
Interval time (s) of global output (XBeach default: tint, 900 s), the first output is given at tstart
tintm
pydantic-field
¶
Interval time (s) of mean, var, max, min output (XBeach default: tstop - tstart), the first output is given at tstart+tintm and represents the average condition over the interval between tstart and tstart+tintm
tintp
pydantic-field
¶
Interval time (s) of point and runup gauge output (XBeach default: 1), the first output is given at tstart
tinth
pydantic-field
¶
Output interval (s) for writing hotstart files (XBeach default: 0). If not specified or 0, hotstart is written only at the end of simulation.
writehotstart
pydantic-field
¶
Write hotstart files during simulation (XBeach default: 0). Hotstart files can be used to initialize a subsequent simulation.
tsglobal
pydantic-field
¶
tsglobal: Optional[XBeachDataBlob] = None
File source containing timings of global output
tsmean
pydantic-field
¶
tsmean: Optional[XBeachDataBlob] = None
File source containing timings of mean, max, min and var output
tspoints
pydantic-field
¶
tspoints: Optional[XBeachDataBlob] = None
File source containing timings of point output
projection
pydantic-field
¶
Projection string specifying the coordinate reference system. Stored in netCDF output file as metadata. Does not influence model results.
remdryoutput
pydantic-field
¶
Switch to remove dry output points from output data of zs etc (XBeach default: 1)
rotate
pydantic-field
¶
Switch to rotate output as postprocessing with angle specified by grid alfa (XBeach default: 1)
check_no_duplicate_variables
pydantic-validator
¶
Validate that variable lists don't contain duplicates.
check_variable_limits
pydantic-validator
¶
Validate that variable lists don't exceed XBeach limits.
validate_point_output_consistency
pydantic-validator
¶
validate_point_output_consistency() -> Output
Validate consistency between pointvars and point/rugauge locations.
fixed_or_file_times
pydantic-validator
¶
fixed_or_file_times() -> Output
Validate that either fixed times or file times are specified.
check_for_typos
classmethod
¶
Suggest the closest field name for an unknown input key.
A field can be given by its name or, like in pydantic, by its alias.
get
¶
Return the params dict with file fetching for nested components.
This method handles two types of nested components: 1. Components with explicit parameter fields: Need special handling to extract the field value and merge remaining params 2. Discriminated union components: Already flattened by the serializer
The default implementation: - For components with explicit fields: includes that field in return dict - For discriminated unions or leaf components: returns standard params - For parent components: processes XBeachBaseModel children recursively
XBeachDataBlob fields are fetched into destdir and written as the file name under the field name. Override this method only for other file handling, such as fetching several files from a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
destdir
|
str | Path
|
Directory path for file operations. |
required |
Returns:
| Type | Description |
|---|---|
Flat dictionary of XBeach parameters.
|
|