Meteorological Forcing Python API¶
See also
Meteorological (Storm) Forcing – overview of met forcing and the object model
Storm Specification Data – the
rundata.met_dataattribute referencenetcdf_input – gridded NetCDF met forcing
This is the Python API for building and writing GeoClaw meteorological forcing.
The object model separates the evolving feature (a Track /
StormTrack) from the forcing generated from it
(ParametricMetForcing, GriddedMetForcing). The historical
Storm class is retained as a backwards-compatible wrapper.
Readers ingest many track/data formats; writers emit only the two files
GeoClaw consumes – a parametric storm file (write_geoclaw) and a gridded
descriptor (write_data).
Storm (compatibility wrapper)¶
Track and StormTrack¶
Parametric met forcing¶
Gridded met forcing¶
Workflow tools¶
Met forcing data object¶
The surge.data file written by setrun.py is described by
SurgeData (also available under the alias
MetData); it is set in setrun.py as rundata.met_data (the former
rundata.surge_data remains an accepted alias). See Storm Specification Data for
the per-attribute reference.
- class clawpack.geoclaw.data.SurgeData¶
Bases:
ClawDataMeteorological (storm) forcing parameters written to
surge.data.Set as
rundata.surge_datain asetrun.pyand written tosurge.data, which the Fortranmet_forcing_modulereads to activate and configure wind/pressure forcing. See Storm Specification Data for the per-attribute reference.- Forcing selection:
The forcing family and subtype are the preferred, explicit way to select a model:
storm_family–"parametric"(an analytic model with a storm center/track),"gridded"(file-backed wind/pressure fields, e.g. OWI/ASCII or NetCDF), or"none"(forcing off).storm_subtype– for a parametric family, a model name such as"holland80","holland2010","cle","slosh","rankine","modified_rankine","demaria", or"willoughby"; for a gridded family,"gridded".
The legacy
storm_specification_type(a model-name string or the signed integer code, e.g."holland80"/1or"data"/-1) remains fully supported: whenstorm_family/storm_subtypeare unset it is resolved throughforcing_subtype_registry. All three map to the same forcing on thesurge.datawire.- Key attributes:
wind_forcing/pressure_forcing(bool) – enable the wind and pressure source terms.drag_law(int) – wind-drag law (0 none, 1 Garratt, 2 Powell).wind_index/pressure_index(int) – 0-basedauxcomponent indices for the forcing fields (Fortran indexing is +1).storm_time_scale(float) – multiplicative scale on the storm time axis (>1 slower, <1 faster).t_ramp_on/t_ramp_off(float) – seconds over which the forcing ramps on aftert0and off beforetfinal(0 disables).rotation_override(int/str) – override the hemisphere-based storm rotation sense.wind_refine/R_refine(list/bool) – AMR refinement thresholds on wind speed and (parametric only) distance to the storm center.storm_file(str) – path to the storm track file or gridded descriptor.
See Meteorological Forcing Python API for the Python storm/track object model and Sources for Storm Surge Data for storm data sources.
- read(path: Path = PosixPath('surge.data'), force: bool = False)¶
Read surge data file
- storm_spec_dict_mapping = {'cle': 3, 'data': -1, 'demaria': 7, 'gridded': -1, 'holland08': 8, 'holland10': 2, 'holland2008': 8, 'holland2010': 2, 'holland80': 1, 'modified-rankine': 6, 'modified_rankine': 6, 'none': 0, 'rankine': 5, 'slosh': 4, 'willoughby': 9, None: 0}¶
- storm_spec_not_implemented = {}¶
- write(out_file='surge.data', data_source='setrun.py')¶
Write out the data file to the path given