Skip to content

Commit

Permalink
Adding mesh_mask_edges file for AA in nemo_curvilinear
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvansebille committed Aug 27, 2024
1 parent 4505636 commit f557e3c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/examples/example_nemo_curvilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ def run_nemo_curvilinear(mode, outfile, advtype="RK4"):
fieldset = parcels.FieldSet.from_nemo(
filenames, variables, dimensions, chunksize=chunksize
)
if advtype == "AA":
mesh_mask = f"{data_folder}/mesh_mask_edges.nc"
fieldset.add_field(
parcels.Field.from_netcdf(
mesh_mask, "e2u", dimensions, interp_method="nearest"
)
)
fieldset.add_field(
parcels.Field.from_netcdf(
mesh_mask, "e1v", dimensions, interp_method="nearest"
)
)
fieldset.add_field(
parcels.Field.from_netcdf(
mesh_mask, "e1t", dimensions, interp_method="nearest"
)
)
fieldset.add_field(
parcels.Field.from_netcdf(
mesh_mask, "e2t", dimensions, interp_method="nearest"
)
)
fieldset.add_field(
parcels.Field(
"e3t", np.array(1), lon=0, lat=0, depth=0, interp_method="nearest"
)
)

assert fieldset.U.chunksize == chunksize

# Now run particles as normal
Expand Down
1 change: 1 addition & 0 deletions parcels/tools/exampledata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"U_purely_zonal-ORCA025_grid_U.nc4",
"V_purely_zonal-ORCA025_grid_V.nc4",
"mesh_mask.nc4",
"mesh_mask_edges.nc",
],
"NemoNorthSeaORCA025-N006_data": [
"ORCA025-N06_20000104d05U.nc",
Expand Down

0 comments on commit f557e3c

Please sign in to comment.