Skip to content

Commit

Permalink
Merged with conflict fix from ICOGS3D_new
Browse files Browse the repository at this point in the history
  • Loading branch information
jreniel committed Aug 14, 2021
2 parents cdf44f1 + 87711ce commit b9c614e
Show file tree
Hide file tree
Showing 12 changed files with 2,103 additions and 1,649 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ forecast
hgrid.*
fgrid.*
vgrid.*
.idea
13 changes: 13 additions & 0 deletions examples/examples_hindcast/01_nwm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from datetime import datetime

from pyschism.mesh.hgrid import Hgrid
from pyschism.forcing.hydrology.nwmhindcast import NationalWaterModel

startdate=datetime(2018,7,3)
rnday=10

hgrid=Hgrid.open('hgrid.gr3', crs='EPSG:4326')

nwm=NationalWaterModel()
nwm.fetch_data(hgrid, startdate, rnday)
nwm.write('./', overwrite=True)
18 changes: 18 additions & 0 deletions examples/examples_hindcast/02_era5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from datetime import datetime
from time import time
import pathlib

from pyschism.forcing.atmosphere.era5 import ERA5

from pyschism.mesh.hgrid import Hgrid

startdate=datetime(2018,7,1)

t0=time()
hgrid=Hgrid.open('hgrid.gr3',crs='EPSG:4326')
bbox = hgrid.get_bbox('EPSG:4326', output_type='bbox')

er=ERA5()
outdir = pathlib.Path('./ERA5')
er.gen_sflux(startdate, rnday=10, bbox=bbox, outdir=outdir)
print(f'It took {(time()-t0)/60} minutes to generate 10 days')
15 changes: 15 additions & 0 deletions pyschism/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ class Coriolis(Enum):
CORICOEFF = 0
RLATITUDE = -1

class IofWetdryVariables(Enum):
wetdry_node = "wetdry_node"
wetdry_elem = "wetdry_elem"
wetdry_side = "wetdry_side"

@classmethod
def _missing_(cls, name):
raise ValueError(f"{name} is not a valid WETDRY output variable.")

class IofZcorVariables(Enum):
zcor = "zcor"

@classmethod
def _missing_(cls, name):
raise ValueError(f"{name} is not a valid ZCOR output variable.")

class IofHydroVariables(Enum):
elev = "elev"
Expand Down
Loading

0 comments on commit b9c614e

Please sign in to comment.