BU ์ธ๋ถ์ ๋๊ตฐ๊ฐ๊ฐ ์ด๊ฒ์ ์คํํ๊ณ ์ฑ๊ณต์ ์ผ๋ก ํ์ผ์ ๋ค์ด๋ก๋ํ๋์ง ์๋ ค์ค ์ ์๊ธฐ๋ฅผ ๋ฐ๋์ต๋๋ค.
PEcAn.data.atmosphere::download.CRUNCEP(
site_id = 1000005129, # This is not used inside the function. Lat/long is used
lat.in = 46.0827,
lon.in = -89.9792,
model = NULL,
scenario = NULL,
ensemble_member = NULL,
method = NULL,
overwrite = FALSE,
outfolder = '/fs/data1/pecan.data/dbfiles/CRUNCEP_site_1-5129/',
start_date = '2005-01-01',
end_date = '2010-12-31',
verbose=TRUE
)
๋ฐ๋ก ์ง๊ธ, ์ด๊ฒ์ test-pecan๊ณผ pecan2 ๋จธ์ ๋ชจ๋์์ ์ด ์ค๋ฅ๋ฅผ ๋ฐํํฉ๋๋ค.
Error in ncvar_get_inner(ncid2use, varid2use, nc$var[[li]]$missval, addOffset, :
C function R_nc4_get_vara_double returned error
๋๋ ์ด๊ฒ์ ์๋ํ๊ณ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๋ด ๊ฒฝํ์ OpenDAP๋ ๊ฝค ๊น๋ค๋ก์ธ ์ ์์ต๋๋ค. method = "ncss"
๋ฅผ ์ฌ์ฉํ๋ฉด ์ ์์ ์ผ๋ก ์๋ํ๋ ๊ฒ ๊ฐ์ผ๋ฏ๋ก ์๋ํด ๋ณด์ญ์์ค.
๋ ๊ฐ๋ ฅํ ๋ค์ด๋ก๋ ๋ฐฉ๋ฒ์ฒ๋ผ ๋ณด์ด๊ธฐ ๋๋ฌธ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ํ๋ ๊ฒ์ ๊ณ ๋ คํด ๋ณผ ๊ฐ์น๊ฐ ์์ต๋๋ค.
@ashiklom ๊ฐ์ฌํฉ๋๋ค.
ncdf4 ํจ์๋ฅผ ์ง์ ์ฌ์ฉํ์ฌ ๋์ผํ ๋์์ ํ์ธํ ์ ์์ต๋๋ค.
> nc <- ncdf4::nc_open("https://thredds.daac.ornl.gov/thredds/dodsC/ornldaac/1220/mstmip_driver_global_hd_climate_tair_2005_v1.nc4", verbose=TRUE)
> ncdf4::ncvar_get(nc, varid="tair", start=c(181, 88, 1), c(1, 1, 1460))
Error in Rsx_nc4_get_vara_double: NetCDF: Access failure
Var: tair Ndims: 3 Start: 0,87,180 Count: 1460,1,1
Error in ncvar_get_inner(ncid2use, varid2use, nc$var[[li]]$missval, addOffset, :
C function R_nc4_get_vara_double returned error
๋ด Mac์์๋ ์ฝ๊ฐ ๋ค๋ฆ ๋๋ค.
PEcAn.data.atmosphere::download.CRUNCEP(
site_id = 1000005129, # This is not used inside the function. Lat/long is used
lat.in = 46.0827,
lon.in = -89.9792,
model = NULL,
scenario = NULL,
ensemble_member = NULL,
method = "ncss",
overwrite = FALSE,
outfolder = '~/scratch',
start_date = '2005-01-01',
end_date = '2010-12-31',
verbose=TRUE
)
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/ornldaac/1220/mstmip_driver_global_hd_landwatermask_v1.nc4?var=land_water_mask&disableLLSubset=on&disableProjSubset=on&horizStride=1&accept=netcdf'
downloaded 262 KB
2019-09-19 13:34:03 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Downloading ~/scratch/CRUNCEP.2005.nc
2019-09-19 13:34:03 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Attempting to access file at:
https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_tair_2005_v1.nc4/dataset.html
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_tair_2005_v1.nc4/dataset.html?var=tair&south=46.0827&west=-89.9792&north=46.082705&east=-89.979195&time_start=2005-01-01T00:00:00Z&time_end=2005-12-31T21:00:00Z&accept=netcdf'
downloaded 18 KB
[1] "ncvar_def: entering"
[1] "ncvar_def: prec= float"
[1] "ncvar_def: making ncvar object for var air_temperature"
2019-09-19 13:34:09 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Attempting to access file at:
https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_lwdown_2005_v1.nc4/dataset.html
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_lwdown_2005_v1.nc4/dataset.html?var=lwdown&south=46.0827&west=-89.9792&north=46.082705&east=-89.979195&time_start=2005-01-01T00:00:00Z&time_end=2005-12-31T21:00:00Z&accept=netcdf'
downloaded 18 KB
[1] "ncvar_def: entering"
[1] "ncvar_def: prec= float"
[1] "ncvar_def: making ncvar object for var surface_downwelling_longwave_flux_in_air"
2019-09-19 13:34:14 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Attempting to access file at:
https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_press_2005_v1.nc4/dataset.html
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_press_2005_v1.nc4/dataset.html?var=press&south=46.0827&west=-89.9792&north=46.082705&east=-89.979195&time_start=2005-01-01T00:00:00Z&time_end=2005-12-31T21:00:00Z&accept=netcdf'
downloaded 18 KB
[1] "ncvar_def: entering"
[1] "ncvar_def: prec= float"
[1] "ncvar_def: making ncvar object for var air_pressure"
2019-09-19 13:34:19 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Attempting to access file at:
https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_swdown_2005_v1.nc4/dataset.html
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_swdown_2005_v1.nc4/dataset.html?var=swdown&south=46.0827&west=-89.9792&north=46.082705&east=-89.979195&time_start=2005-01-01T00:00:00Z&time_end=2005-12-31T21:00:00Z&accept=netcdf'
downloaded 18 KB
[1] "ncvar_def: entering"
[1] "ncvar_def: prec= float"
[1] "ncvar_def: making ncvar object for var surface_downwelling_shortwave_flux_in_air"
2019-09-19 13:34:24 INFO [PEcAn.data.atmosphere::download.CRUNCEP] :
Attempting to access file at:
https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_uwind_2005_v1.nc4/dataset.html
trying URL 'https://thredds.daac.ornl.gov/thredds/ncss/grid/ornldaac/1220/mstmip_driver_global_hd_climate_uwind_2005_v1.nc4/dataset.html?var=uwind&south=46.0827&west=-89.9792&north=46.082705&east=-89.979195&time_start=2005-01-01T00:00:00Z&time_end=2005-12-31T21:00:00Z&accept=netcdf'
downloaded 18 KB
ncss๋ก ์์ ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
#2426์ ์ํด ์์ ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ์ด๊ฒ์ ์๋ํ๊ณ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค. ๋ด ๊ฒฝํ์ OpenDAP๋ ๊ฝค ๊น๋ค๋ก์ธ ์ ์์ต๋๋ค.
method = "ncss"
๋ฅผ ์ฌ์ฉํ๋ฉด ์ ์์ ์ผ๋ก ์๋ํ๋ ๊ฒ ๊ฐ์ผ๋ฏ๋ก ์๋ํด ๋ณด์ญ์์ค.๋ ๊ฐ๋ ฅํ ๋ค์ด๋ก๋ ๋ฐฉ๋ฒ์ฒ๋ผ ๋ณด์ด๊ธฐ ๋๋ฌธ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ํ๋ ๊ฒ์ ๊ณ ๋ คํด ๋ณผ ๊ฐ์น๊ฐ ์์ต๋๋ค.