You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a python wrapper for WW3 using the namelists "interface" that may be of interest for the community. The code is here: https://github.com/caiostringari/pyww3 and you can install it with pip install pyww3.
I only work on this during my free time so it's definitely not complete and mostly undocumented so far.
My implementation tries to expose all options available in the namelists. For example, you can do:
frompyww3.gridimportWW3GRidW=WW3GRid(runpath="some/path/here",
grid_name="your_awesome_grid",
grid_nml="your/grid.nml",
grid_type="some_grid_type",
grid_coord="some_coord_system",
grid_clos="some_closure",
rect_nx=NX,
rect_ny=NY,
rect_sx=SX,
rect_sy=SY,
rect_sf=SF,
rect_x0=X0,
rect_y0=Y0,
rect_sf0=SF0,
grid_zlim=ZLIM,
grid_dmin=DMIN,
depth_filename="your_bathy",
depth_sf=DSF,
obst_filename="your_obst",
obst_sf=OSF,
mask_filename="your_mask")
W.to_file() # this writes ww3_grid.nml in the runpathW.run() # this runs ww3_grid in the runpath.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone,
I wrote a python wrapper for WW3 using the namelists "interface" that may be of interest for the community. The code is here: https://github.com/caiostringari/pyww3 and you can install it with
pip install pyww3
.I only work on this during my free time so it's definitely not complete and mostly undocumented so far.
My implementation tries to expose all options available in the namelists. For example, you can do:
I have a more or less complete example here: https://colab.research.google.com/drive/1Py-aMvTMxDiyjpPXBoIe5eQx8iRm47zF?usp=sharing
Please let me know if this is useful to you and/or you find any bugs.
Fell free to delete this if it is not fit for here...
Cheers,
Caio Stringari
Beta Was this translation helpful? Give feedback.
All reactions