API

WW3Base

class pyww3.ww3.WW3Base[source]

Define the base class WW3(). Everything else enhirits from this class.

run(mpi=False, nproc=2)[source]

Run a program using mpi or not.

to_file()[source]

Write namelist text to file ww3_?.nml.

update_text(block: str, action: str = 'add', index: int = - 1)[source]

Update namelist block in the text with an action.

WW3Bounc

WW3Grid

class pyww3.grid.WW3GRid(runpath: str, grid_name: str, grid_nml: str, grid_type: str, grid_coord: str, grid_clos: str, output: str = 'ww3_grid.nml', spectrum_xfr: int = 1.1, spectrum_freq1: int = 0.04118, spectrum_nk: int = 32, spectrum_nth: int = 24, spectrum_thoff: int = 0, run_fldry: bool = False, run_flcx: bool = True, run_flcy: bool = True, run_flcth: bool = True, run_flck: bool = True, run_flsou: bool = True, timesteps_dtmax: float = 480.0, timesteps_dtxy: float = 160.0, timesteps_dtkth: float = 240.0, timesteps_dtmin: float = 10.0, grid_zlim: float = 0.0, grid_dmin: float = 0.0, rect_nx: int = 0, rect_ny: int = 0, rect_sx: float = 0.0, rect_sy: float = 0.0, rect_sf: float = 1.0, rect_x0: float = 0.0, rect_y0: float = 0.0, rect_sf0: float = 1.0, curv_nx: int = 0, curv_ny: int = 0, curv_xcoord_sf: float = 1.0, curv_xcoord_off: float = 0.0, curv_xcoord_filename: str = '', curv_xcoord_idf: int = 21, curv_xcoord_idla: int = 1, curv_xcoord_idfm: int = 1, curv_xcoord_format: str = '(....)', curv_ycoord_sf: float = 1.0, curv_ycoord_off: float = 0.0, curv_ycoord_filename: str = '', curv_ycoord_idf: int = 22, curv_ycoord_idla: int = 1, curv_ycoord_idfm: int = 1, curv_ycoord_format: str = '(....)', unst_sf: float = 1.0, unst_filename: str = '', unst_idla: int = 20, unst_idfm: int = 1, unst_format: int = '(20f10.2)', unst_ugobcfile: str = '', depth_sf: float = 1.0, depth_filename: str = '', depth_idf: int = 50, depth_dla: int = 1, depth_dfm: int = 1, depth_format: str = '(....)', mask_filename: str = '', mask_idf: int = 60, mask_idla: int = 1, mask_idfm: int = 1, mask_format: str = '(....)', obst_sf: float = 1.0, obst_filename: str = '', obst_idf: int = 70, obst_idla: int = 1, obst_idfm: int = 1, obst_format: str = '(....)', slope_sf: float = 1.0, slope_filename: str = '', slope_idf: int = 80, slope_idla: int = 1, slope_idfm: int = 1, slope_format: str = '(....)', sed_sf: float = 1.0, sed_filename: str = '', sed_idfm: int = 1, sed_idla: int = 1, sed_format: str = '(....)')[source]

This class abstracts the program ww3_grid. It is an extension of the class pyww3.ww3.WW3Base().

populate_namelist()[source]

Create the namelist text using NOAA’s latest template.

WW3Ounf

class pyww3.ounp.WW3Ounp(runpath: str, mod_def: str, output: str = 'ww3_ounp.nml', ww3_pnt: str = 'out_pnt.ww3', point_timestart: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), point_timestride: int = 0, point_timecount: int = 1000000000, point_timesplit: int = 6, point_list: str = 'all', point_samefile: bool = True, point_buffer: int = 150, point_type: int = 1, file_prefix: str = 'ww3.', file_netcdf: int = 4, spectra_output: int = 3, spectra_scale_fac: int = 1, spectra_output_fac: int = 0, param_output: int = 4, source_output: int = 4, source_scale_fac: int = 0, source_output_fac: int = 0, source_table_fac: int = 0, source_spectrum: bool = True, source_input: bool = True, source_interactions: bool = True, source_dissipation: bool = True, source_bottom: bool = True, source_ice: bool = True, source_total: bool = True)[source]

This class abstracts the program ww3_ounf. It is an extension of the class pyww3.ww3.WW3Base().

populate_namelist()[source]

Create the namelist text using NOAA’s latest template.

WW3Ounp

class pyww3.ounf.WW3Ounf(runpath: str, mod_def: str, ww3_grd: str = 'out_grd.ww3', output: str = 'ww3_ounf.nml', field_timestart: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), field_timestride: int = 0, field_timecount: int = 1000000000, field_timesplit: int = 6, field_list: typing.List[str] = <factory>, field_samefile: bool = True, field_partition: typing.List[int] = <factory>, field_type: int = 3, file_prefix: str = 'ww3.', file_netcdf: int = 4, file_ix0: int = 1, file_ixn: int = 1000000000, file_iy0: int = 1, file_iyn: int = 1000000000, smc_type: int = 1, smc_sxo: int = 0, smc_exo: int = 0, smc_syo: int = 0, smc_eyo: int = 0, smc_celfac: int = 1, smc_noval: int = -999)[source]

This class abstracts the program ww3_ounf. It is an extension of the class pyww3.ww3.WW3Base().

populate_namelist()[source]

Create the namelist text using NOAA’s latest template.

WW3Prnc

class pyww3.prnc.WW3Prnc(runpath: str, mod_def: str, forcing_field: str, forcing_grid_latlon: bool, file_filename: str, file_longitude: str, file_latitude: str, file_var_1: str, output: str = 'ww3_prnc.nml', file_var_2: str = ' ', file_var_3: str = ' ', forcing_timestart: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), forcing_timestop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), file_timeshift: str = '00000000 000000')[source]

This class abstracts the program ww3_prnc. It is an extension of the class pyww3.ww3.WW3Base().

populate_namelist()[source]

Create the namelist text using NOAA’s latest template.

reverse_latitudes(newfilename)[source]

Reverse latitudes if requested

WW3Shel

Abstracts the ww3_shel program.

class pyww3.shel.WW3Shel(runpath: str, mod_def: str, output: str = 'ww3_shel.nml', nproc: int = 1, domain_iostyp: int = 1, domain_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), domain_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), input_forcing_water_levels: bool = False, input_forcing_currents: bool = False, input_forcing_winds: bool = False, input_forcing_ice_conc: bool = False, input_forcing_ice_param1: bool = False, input_forcing_ice_param2: bool = False, input_forcing_ice_param3: bool = False, input_forcing_ice_param4: bool = False, input_forcing_ice_param5: bool = False, input_forcing_mud_density: bool = False, input_forcing_mud_thickness: bool = False, input_forcing_mud_viscosity: bool = False, input_assim_mean: bool = False, input_assim_spec1d: bool = False, input_assim_spec2d: bool = False, type_field_list: typing.List[str] = <factory>, type_point_file: str = 'mylist', type_track_format: bool = True, type_partition_x0: int = 0, type_partition_xn: int = 0, type_partition_nx: int = 0, type_partition_y0: int = 0, type_partition_yn: int = 0, type_partition_ny: int = 0, type_coupling_sent: str = ' ', type_coupling_received: str = ' ', date_field_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_field_stride: int = 0, date_field_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_point_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_point_stride: int = 0, date_point_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_track_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_track_stride: int = 0, date_track_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_restart_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_restart_stride: int = 0, date_restart_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_boundary_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_boundary_stride: int = 0, date_boundary_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_partition_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_partition_stride: int = 0, date_partition_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_coupling_start: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), date_coupling_stride: int = 0, date_coupling_stop: datetime.datetime = datetime.datetime(2900, 12, 31, 0, 0), date_restart: str = "'19000101 000000' '0' '29001231 000000'", homog_count_n_ic1: int = 0, homog_count_n_ic2: int = 0, homog_count_n_ic3: int = 0, homog_count_n_ic4: int = 0, homog_count_n_ic5: int = 0, homog_count_n_mdn: int = 0, homog_count_n_mth: int = 0, homog_count_n_mvs: int = 0, homog_count_n_lev: int = 0, homog_count_n_cur: int = 0, homog_count_n_wnd: int = 0, homog_count_n_ice: int = 0, homog_count_n_mov: int = 0, homog_input_1_name: str = 'unset', homog_input_1_date: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), homog_input_1_value1: int = 0, homog_input_1_value2: int = 0, homog_input_1_value3: int = 0, homog_input_2_name: str = 'unset', homog_input_2_date: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), homog_input_2_value1: int = 0, homog_input_2_value2: int = 0, homog_input_2_value3: int = 0, homog_input_3_name: str = 'unset', homog_input_3_date: datetime.datetime = datetime.datetime(1900, 1, 1, 0, 0), homog_input_3_value1: int = 0, homog_input_3_value2: int = 0, homog_input_3_value3: int = 0)[source]

This class abstracts the program ww3_ounf. It is an extension of the class pyww3.ww3.WW3Base().

populate_namelist()[source]

Create the namelist text using NOAA’s latest template.