I tried to run PyGNOME with ROMS output and I had the following error I did not have before.
adding a wind mover:
Traceback (most recent call last):
File "run_pygnome_ensembles.py", line 243, in <module>
model = make_model(gridfile,datafile,start_time,duration,netcdf_file = outfile, location_file=loc_file)
File "run_pygnome_ensembles.py", line 128, in make_model
w_mover = PyWindMover(wf, default_num_method='Euler')
File "/home/dj/software/PyGnome/py_gnome/gnome/movers/py_wind_movers.py", line 98, in __init__
**kwargs)
File "/home/dj/anaconda2/envs/gnome/lib/python2.7/site-packages/gridded/variable.py", line 764, in from_netCDF
ds = dg = get_dataset(grid_file)
File "/home/dj/anaconda2/envs/gnome/lib/python2.7/site-packages/gridded/utilities.py", line 370, in get_dataset
return nc4.MFDataset(ncfile)
File "netCDF4/_netCDF4.pyx", line 6108, in netCDF4._netCDF4.MFDataset.__init__
TypeError: 'GridWind' object does not support indexing
The line of the code which caused the error is below.
NetCDF file metadata is below. I extracted surface layer using NCO to run PyGNOME. I was told PyGNOME should run without any modifications.
netcdf TXLA2.ocn.his.2016_03_12_c00_surf {
dimensions:
tracer = 2 ;
s_rho = 1 ;
s_w = 1 ;
ocean_time = UNLIMITED ; // (1344 currently)
eta_rho = 191 ;
xi_rho = 671 ;
eta_psi = 190 ;
xi_psi = 670 ;
eta_u = 191 ;
xi_u = 670 ;
eta_v = 190 ;
xi_v = 671 ;
variables:
double Akk_bak ;
Akk_bak:long_name = "background vertical mixing coefficient for turbulent energy" ;
Akk_bak:units = "meter2 second-1" ;
double Akp_bak ;
Akp_bak:long_name = "background vertical mixing coefficient for length scale" ;
Akp_bak:units = "meter2 second-1" ;
double Akt_bak(tracer) ;
Akt_bak:long_name = "background vertical mixing coefficient for tracers" ;
Akt_bak:units = "meter2 second-1" ;
double Akv_bak ;
Akv_bak:long_name = "background vertical mixing coefficient for momentum" ;
Akv_bak:units = "meter2 second-1" ;
double Charnok_alpha ;
Charnok_alpha:long_name = "Charnok factor for surface roughness" ;
double CrgBan_cw ;
CrgBan_cw:long_name = "surface flux due to Craig and Banner wave breaking" ;
double Cs_r(s_rho) ;
Cs_r:long_name = "S-coordinate stretching curves at RHO-points" ;
Cs_r:valid_min = -1. ;
Cs_r:valid_max = 0. ;
Cs_r:field = "Cs_r, scalar" ;
double Cs_w(s_w) ;
Cs_w:long_name = "S-coordinate stretching curves at W-points" ;
Cs_w:valid_min = -1. ;
Cs_w:valid_max = 0. ;
Cs_w:field = "Cs_w, scalar" ;
double Falpha ;
Falpha:long_name = "Power-law shape barotropic filter parameter" ;
double Fbeta ;
Fbeta:long_name = "Power-law shape barotropic filter parameter" ;
double Fgamma ;
Fgamma:long_name = "Power-law shape barotropic filter parameter" ;
int Lm2CLM ;
Lm2CLM:long_name = "2D momentum climatology processing switch" ;
Lm2CLM:flag_values = 0, 1 ;
Lm2CLM:flag_meanings = ".FALSE. .TRUE." ;
int Lm3CLM ;
Lm3CLM:long_name = "3D momentum climatology processing switch" ;
Lm3CLM:flag_values = 0, 1 ;
Lm3CLM:flag_meanings = ".FALSE. .TRUE." ;
int LnudgeM2CLM ;
LnudgeM2CLM:long_name = "2D momentum climatology nudging activation switch" ;
LnudgeM2CLM:flag_values = 0, 1 ;
LnudgeM2CLM:flag_meanings = ".FALSE. .TRUE." ;
int LnudgeM3CLM ;
LnudgeM3CLM:long_name = "3D momentum climatology nudging activation switch" ;
LnudgeM3CLM:flag_values = 0, 1 ;
LnudgeM3CLM:flag_meanings = ".FALSE. .TRUE." ;
int LnudgeTCLM(tracer) ;
LnudgeTCLM:long_name = "tracer climatology nudging activation switch" ;
LnudgeTCLM:flag_values = 0, 1 ;
LnudgeTCLM:flag_meanings = ".FALSE. .TRUE." ;
int LsshCLM ;
LsshCLM:long_name = "sea surface height climatology processing switch" ;
LsshCLM:flag_values = 0, 1 ;
LsshCLM:flag_meanings = ".FALSE. .TRUE." ;
int LtracerCLM(tracer) ;
LtracerCLM:long_name = "tracer climatology processing switch" ;
LtracerCLM:flag_values = 0, 1 ;
LtracerCLM:flag_meanings = ".FALSE. .TRUE." ;
int LtracerSponge(tracer) ;
LtracerSponge:long_name = "horizontal diffusivity sponge activation switch" ;
LtracerSponge:flag_values = 0, 1 ;
LtracerSponge:flag_meanings = ".FALSE. .TRUE." ;
int LtracerSrc(tracer) ;
LtracerSrc:long_name = "tracer point sources and sink activation switch" ;
LtracerSrc:flag_values = 0, 1 ;
LtracerSrc:flag_meanings = ".FALSE. .TRUE." ;
int LuvSponge ;
LuvSponge:long_name = "horizontal viscosity sponge activation switch" ;
LuvSponge:flag_values = 0, 1 ;
LuvSponge:flag_meanings = ".FALSE. .TRUE." ;
int LuvSrc ;
LuvSrc:long_name = "momentum point sources and sink activation switch" ;
LuvSrc:flag_values = 0, 1 ;
LuvSrc:flag_meanings = ".FALSE. .TRUE." ;
int LwSrc ;
LwSrc:long_name = "mass point sources and sink activation switch" ;
LwSrc:flag_values = 0, 1 ;
LwSrc:flag_meanings = ".FALSE. .TRUE." ;
double M2nudg ;
M2nudg:long_name = "2D momentum nudging/relaxation inverse time scale" ;
M2nudg:units = "day-1" ;
double M3nudg ;
M3nudg:long_name = "3D momentum nudging/relaxation inverse time scale" ;
M3nudg:units = "day-1" ;
float Pair(ocean_time, eta_rho, xi_rho) ;
Pair:long_name = "surface air pressure" ;
Pair:units = "millibar" ;
Pair:time = "ocean_time" ;
Pair:coordinates = "lon_rho lat_rho ocean_time" ;
Pair:field = "Pair, scalar, series" ;
Pair:_FillValue = 1.e+37f ;
double Tcline ;
Tcline:long_name = "S-coordinate surface/bottom layer width" ;
Tcline:units = "meter" ;
double Tnudg(tracer) ;
Tnudg:long_name = "Tracers nudging/relaxation inverse time scale" ;
Tnudg:units = "day-1" ;
float Uwind(ocean_time, eta_rho, xi_rho) ;
Uwind:long_name = "surface u-wind component" ;
Uwind:units = "meter second-1" ;
Uwind:time = "ocean_time" ;
Uwind:coordinates = "lon_rho lat_rho ocean_time" ;
Uwind:field = "u-wind, scalar, series" ;
Uwind:_FillValue = 1.e+37f ;
int Vstretching ;
Vstretching:long_name = "vertical terrain-following stretching function" ;
int Vtransform ;
Vtransform:long_name = "vertical terrain-following transformation equation" ;
float Vwind(ocean_time, eta_rho, xi_rho) ;
Vwind:long_name = "surface v-wind component" ;
Vwind:units = "meter second-1" ;
Vwind:time = "ocean_time" ;
Vwind:coordinates = "lon_rho lat_rho ocean_time" ;
Vwind:field = "v-wind, scalar, series" ;
Vwind:_FillValue = 1.e+37f ;
double Znudg ;
Znudg:long_name = "free-surface nudging/relaxation inverse time scale" ;
Znudg:units = "day-1" ;
double Zob ;
Zob:long_name = "bottom roughness" ;
Zob:units = "meter" ;
double Zos ;
Zos:long_name = "surface roughness" ;
Zos:units = "meter" ;
double Zos_hsig_alpha ;
Zos_hsig_alpha:long_name = "wave amplitude factor for surface roughness" ;
double angle(eta_rho, xi_rho) ;
angle:long_name = "angle between XI-axis and EAST" ;
angle:units = "radians" ;
angle:coordinates = "lon_rho lat_rho" ;
angle:field = "angle, scalar" ;
int deflate ;
deflate:long_name = "NetCDF-4/HDF5 file format deflate filer flag" ;
int deflate_level ;
deflate_level:long_name = "NetCDF-4/HDF5 file format deflate level parameter" ;
double dstart ;
dstart:long_name = "time stamp assigned to model initilization" ;
dstart:units = "days since 1970-01-01 00:00:00" ;
double dt ;
dt:long_name = "size of long time-steps" ;
dt:units = "second" ;
double dtfast ;
dtfast:long_name = "size of short time-steps" ;
dtfast:units = "second" ;
double el ;
el:long_name = "domain length in the ETA-direction" ;
el:units = "meter" ;
double f(eta_rho, xi_rho) ;
f:long_name = "Coriolis parameter at RHO-points" ;
f:units = "second-1" ;
f:coordinates = "lon_rho lat_rho" ;
f:field = "coriolis, scalar" ;
double gamma2 ;
gamma2:long_name = "slipperiness parameter" ;
double gls_Kmin ;
gls_Kmin:long_name = "minimum value of specific turbulent kinetic energy" ;
double gls_Pmin ;
gls_Pmin:long_name = "minimum Value of dissipation" ;
double gls_c1 ;
gls_c1:long_name = "shear production coefficient" ;
double gls_c2 ;
gls_c2:long_name = "dissipation coefficient" ;
double gls_c3m ;
gls_c3m:long_name = "buoyancy production coefficient (minus)" ;
double gls_c3p ;
gls_c3p:long_name = "buoyancy production coefficient (plus)" ;
double gls_cmu0 ;
gls_cmu0:long_name = "stability coefficient" ;
double gls_m ;
gls_m:long_name = "turbulent kinetic energy exponent" ;
double gls_n ;
gls_n:long_name = "turbulent length scale exponent" ;
double gls_p ;
gls_p:long_name = "stability exponent" ;
double gls_sigk ;
gls_sigk:long_name = "constant Schmidt number for TKE" ;
double gls_sigp ;
gls_sigp:long_name = "constant Schmidt number for PSI" ;
double h(eta_rho, xi_rho) ;
h:long_name = "bathymetry at RHO-points" ;
h:units = "meter" ;
h:coordinates = "lon_rho lat_rho" ;
h:field = "bath, scalar" ;
double hc ;
hc:long_name = "S-coordinate parameter, critical depth" ;
hc:units = "meter" ;
double lat_psi(eta_psi, xi_psi) ;
lat_psi:long_name = "latitude of PSI-points" ;
lat_psi:units = "degree_north" ;
lat_psi:standard_name = "latitude" ;
lat_psi:field = "lat_psi, scalar" ;
double lat_rho(eta_rho, xi_rho) ;
lat_rho:long_name = "latitude of RHO-points" ;
lat_rho:units = "degree_north" ;
lat_rho:standard_name = "latitude" ;
lat_rho:field = "lat_rho, scalar" ;
double lat_u(eta_u, xi_u) ;
lat_u:long_name = "latitude of U-points" ;
lat_u:units = "degree_north" ;
lat_u:standard_name = "latitude" ;
lat_u:field = "lat_u, scalar" ;
double lat_v(eta_v, xi_v) ;
lat_v:long_name = "latitude of V-points" ;
lat_v:units = "degree_north" ;
lat_v:standard_name = "latitude" ;
lat_v:field = "lat_v, scalar" ;
double lon_psi(eta_psi, xi_psi) ;
lon_psi:long_name = "longitude of PSI-points" ;
lon_psi:units = "degree_east" ;
lon_psi:standard_name = "longitude" ;
lon_psi:field = "lon_psi, scalar" ;
double lon_rho(eta_rho, xi_rho) ;
lon_rho:long_name = "longitude of RHO-points" ;
lon_rho:units = "degree_east" ;
lon_rho:standard_name = "longitude" ;
lon_rho:field = "lon_rho, scalar" ;
double lon_u(eta_u, xi_u) ;
lon_u:long_name = "longitude of U-points" ;
lon_u:units = "degree_east" ;
lon_u:standard_name = "longitude" ;
lon_u:field = "lon_u, scalar" ;
double lon_v(eta_v, xi_v) ;
lon_v:long_name = "longitude of V-points" ;
lon_v:units = "degree_east" ;
lon_v:standard_name = "longitude" ;
lon_v:field = "lon_v, scalar" ;
double mask_psi(eta_psi, xi_psi) ;
mask_psi:long_name = "mask on psi-points" ;
mask_psi:flag_values = 0., 1. ;
mask_psi:flag_meanings = "land water" ;
mask_psi:coordinates = "lon_psi lat_psi" ;
double mask_rho(eta_rho, xi_rho) ;
mask_rho:long_name = "mask on RHO-points" ;
mask_rho:flag_values = 0., 1. ;
mask_rho:flag_meanings = "land water" ;
mask_rho:coordinates = "lon_rho lat_rho" ;
double mask_u(eta_u, xi_u) ;
mask_u:long_name = "mask on U-points" ;
mask_u:flag_values = 0., 1. ;
mask_u:flag_meanings = "land water" ;
mask_u:coordinates = "lon_u lat_u" ;
double mask_v(eta_v, xi_v) ;
mask_v:long_name = "mask on V-points" ;
mask_v:flag_values = 0., 1. ;
mask_v:flag_meanings = "land water" ;
mask_v:coordinates = "lon_v lat_v" ;
int nHIS ;
nHIS:long_name = "number of time-steps between history records" ;
int nRST ;
nRST:long_name = "number of time-steps between restart records" ;
int nSTA ;
nSTA:long_name = "number of time-steps between stations records" ;
int ndefHIS ;
ndefHIS:long_name = "number of time-steps between the creation of history files" ;
int ndtfast ;
ndtfast:long_name = "number of short time-steps" ;
double nl_tnu2(tracer) ;
nl_tnu2:long_name = "nonlinear model Laplacian mixing coefficient for tracers" ;
nl_tnu2:units = "meter2 second-1" ;
double nl_visc2 ;
nl_visc2:long_name = "nonlinear model Laplacian mixing coefficient for momentum" ;
nl_visc2:units = "meter2 second-1" ;
int ntimes ;
ntimes:long_name = "number of long time-steps" ;
double ocean_time(ocean_time) ;
ocean_time:long_name = "time since initialization" ;
ocean_time:units = "seconds since 1970-01-01 00:00:00" ;
ocean_time:calendar = "gregorian" ;
ocean_time:field = "time, scalar, series" ;
double pm(eta_rho, xi_rho) ;
pm:long_name = "curvilinear coordinate metric in XI" ;
pm:units = "meter-1" ;
pm:coordinates = "lon_rho lat_rho" ;
pm:field = "pm, scalar" ;
double pn(eta_rho, xi_rho) ;
pn:long_name = "curvilinear coordinate metric in ETA" ;
pn:units = "meter-1" ;
pn:coordinates = "lon_rho lat_rho" ;
pn:field = "pn, scalar" ;
double rdrg ;
rdrg:long_name = "linear drag coefficient" ;
rdrg:units = "meter second-1" ;
double rdrg2 ;
rdrg2:long_name = "quadratic drag coefficient" ;
double rho0 ;
rho0:long_name = "mean density used in Boussinesq approximation" ;
rho0:units = "kilogram meter-3" ;
double s_rho(s_rho) ;
s_rho:long_name = "S-coordinate at RHO-points" ;
s_rho:valid_min = -1. ;
s_rho:valid_max = 0. ;
s_rho:positive = "up" ;
s_rho:standard_name = "ocean_s_coordinate_g2" ;
s_rho:formula_terms = "s: s_rho C: Cs_r eta: zeta depth: h depth_c: hc" ;
s_rho:field = "s_rho, scalar" ;
double s_w(s_w) ;
s_w:long_name = "S-coordinate at W-points" ;
s_w:valid_min = -1. ;
s_w:valid_max = 0. ;
s_w:positive = "up" ;
s_w:standard_name = "ocean_s_coordinate_g2" ;
s_w:formula_terms = "s: s_w C: Cs_w eta: zeta depth: h depth_c: hc" ;
s_w:field = "s_w, scalar" ;
float salt(ocean_time, s_rho, eta_rho, xi_rho) ;
salt:long_name = "salinity" ;
salt:time = "ocean_time" ;
salt:coordinates = "lon_rho lat_rho s_rho ocean_time" ;
salt:field = "salinity, scalar, series" ;
salt:_FillValue = 1.e+37f ;
float shflux(ocean_time, eta_rho, xi_rho) ;
shflux:long_name = "surface net heat flux" ;
shflux:units = "watt meter-2" ;
shflux:negative_value = "upward flux, cooling" ;
shflux:positive_value = "downward flux, heating" ;
shflux:time = "ocean_time" ;
shflux:coordinates = "lon_rho lat_rho ocean_time" ;
shflux:field = "surface heat flux, scalar, series" ;
shflux:_FillValue = 1.e+37f ;
int shuffle ;
shuffle:long_name = "NetCDF-4/HDF5 file format shuffle filer flag" ;
int spherical ;
spherical:long_name = "grid type logical switch" ;
spherical:flag_values = 0, 1 ;
spherical:flag_meanings = "Cartesian spherical" ;
float ssflux(ocean_time, eta_rho, xi_rho) ;
ssflux:long_name = "surface net salt flux, (E-P)*SALT" ;
ssflux:units = "meter second-1" ;
ssflux:negative_value = "upward flux, freshening (net precipitation)" ;
ssflux:positive_value = "downward flux, salting (net evaporation)" ;
ssflux:time = "ocean_time" ;
ssflux:coordinates = "lon_rho lat_rho ocean_time" ;
ssflux:field = "surface net salt flux, scalar, series" ;
ssflux:_FillValue = 1.e+37f ;
float sustr(ocean_time, eta_u, xi_u) ;
sustr:long_name = "surface u-momentum stress" ;
sustr:units = "newton meter-2" ;
sustr:time = "ocean_time" ;
sustr:coordinates = "lon_u lat_u ocean_time" ;
sustr:field = "surface u-momentum stress, scalar, series" ;
sustr:_FillValue = 1.e+37f ;
float svstr(ocean_time, eta_v, xi_v) ;
svstr:long_name = "surface v-momentum stress" ;
svstr:units = "newton meter-2" ;
svstr:time = "ocean_time" ;
svstr:coordinates = "lon_v lat_v ocean_time" ;
svstr:field = "surface v-momentum stress, scalar, series" ;
svstr:_FillValue = 1.e+37f ;
double sz_alpha ;
sz_alpha:long_name = "surface flux from wave dissipation" ;
float temp(ocean_time, s_rho, eta_rho, xi_rho) ;
temp:long_name = "potential temperature" ;
temp:units = "Celsius" ;
temp:time = "ocean_time" ;
temp:coordinates = "lon_rho lat_rho s_rho ocean_time" ;
temp:field = "temperature, scalar, series" ;
temp:_FillValue = 1.e+37f ;
double theta_b ;
theta_b:long_name = "S-coordinate bottom control parameter" ;
double theta_s ;
theta_s:long_name = "S-coordinate surface control parameter" ;
float u(ocean_time, s_rho, eta_u, xi_u) ;
u:long_name = "u-momentum component" ;
u:units = "meter second-1" ;
u:time = "ocean_time" ;
u:coordinates = "lon_u lat_u s_rho ocean_time" ;
u:field = "u-velocity, scalar, series" ;
u:_FillValue = 1.e+37f ;
float v(ocean_time, s_rho, eta_v, xi_v) ;
v:long_name = "v-momentum component" ;
v:units = "meter second-1" ;
v:time = "ocean_time" ;
v:coordinates = "lon_v lat_v s_rho ocean_time" ;
v:field = "v-velocity, scalar, series" ;
v:_FillValue = 1.e+37f ;
float w(ocean_time, s_w, eta_rho, xi_rho) ;
w:long_name = "vertical momentum component" ;
w:units = "meter second-1" ;
w:time = "ocean_time" ;
w:coordinates = "lon_rho lat_rho s_w ocean_time" ;
w:field = "w-velocity, scalar, series" ;
w:_FillValue = 1.e+37f ;
double xl ;
xl:long_name = "domain length in the XI-direction" ;
xl:units = "meter" ;
float zeta(ocean_time, eta_rho, xi_rho) ;
zeta:long_name = "free-surface" ;
zeta:units = "meter" ;
zeta:time = "ocean_time" ;
zeta:coordinates = "lon_rho lat_rho ocean_time" ;
zeta:field = "free-surface, scalar, series" ;
zeta:_FillValue = 1.e+37f ;
// global attributes:
:NLM_LBC = "\nEDGE: WEST SOUTH EAST NORTH \nzeta: Che Che Che Clo \nubar: Shc Shc Shc Clo \nvbar: Shc Shc Shc Clo \nu: Rad Rad Rad Clo \nv: Rad Rad Rad Clo \ntemp: Rad Rad Rad Clo \nsalt: Rad Rad Rad Clo \ntke: Gra Gra Gra Clo" ;
:svn_url = "https:://myroms.org/svn/src" ;
:svn_rev = "" ;
:code_dir = "/scratch/user/d.kobashi/source_code/COAWST/COAWST.r960-dev" ;
:header_dir = "/home/d.kobashi/forecasts/projects/ensemble_gefs/compile" ;
:header_file = "txla2.h" ;
:os = "Linux" ;
:cpu = "x86_64" ;
:compiler_system = "ifort" ;
:compiler_command = "/software/easybuild/software/impi/5.0.3.048-iccifort-2015.3.187-GCC-4.8.4/bin64/" ;
:compiler_flags = "-heap-arrays -fp-model fast -mt_mpi -ip -O3 -msse2 -free" ;
:tiling = "010x012" ;
:history = "Tue Aug 13 13:07:21 2019: ncks -d s_rho,29 -d s_w,30 TXLA2.ocn.his.2016_03_12_c00.nc TXLA2.ocn.his.2016_03_12_c00_surf.nc\nROMS/TOMS, Version 3.7, Wednesday - August 7, 2019 - 1:28:19 PM" ;
:ana_file = "ROMS/Functionals/ana_btflux.h, ROMS/Functionals/ana_sponge.h, ROMS/Functionals/ana_nudgcoef.h" ;
:CPP_options = "TXLA2, ANA_BSFLUX, ANA_BTFLUX, ANA_NUDGCOEF, ANA_SPONGE, ASSUMED_SHAPE, BULK_FLUXES, CURVGRID, DEFLATE, DIFF_GRID, DJ_GRADPS, DOUBLE_PRECISION, EMINUSP, GLS_MIXING, HDF5, KANTHA_CLAYSON, LONGWAVE, MASKING, MIX_GEO_TS, MIX_S_UV, MPI, NONLINEAR, NONLIN_EOS, NO_LBC_ATT, N2S2_HORAVG, POWER_LAW, PROFILE, QCORRECTION, K_GSCHEME, RADIATION_2D, !RST_SINGLE, SALINITY, SOLAR_SOURCE, SOLVE3D, SPLINES, SPHERICAL, STATIONS, TS_MPDATA, TS_DIF2, UV_ADV, UV_COR, UV_U3HADVECTION, UV_C4VADVECTION, UV_LOGDRAG, UV_VIS2, VAR_RHO_2D, VISC_GRID, WTYPE_GRID" ;
:NCO = "\"4.6.0\"" ;
}
Any suggestions would be appreciated.