From fa26fe06dcb26cb986013cfbbe7dd205e942e845 Mon Sep 17 00:00:00 2001 From: Nathanael Wong Date: Sat, 25 Nov 2023 00:01:56 -0500 Subject: [PATCH] Updating to the latest version of NCDatasets --- Project.toml | 2 +- src/analysis/hourly.jl | 80 ++++++++++++++++++++--------------------- src/analysis/monthly.jl | 76 +++++++++++++++++++-------------------- src/compile/hourly.jl | 12 +++---- src/compile/monthly.jl | 14 ++++---- src/landsea/landsea.jl | 16 ++++----- src/save/daily.jl | 12 +++---- src/save/extract.jl | 6 ++-- src/save/hourly.jl | 12 +++---- src/save/monthly.jl | 12 +++---- 10 files changed, 121 insertions(+), 121 deletions(-) diff --git a/Project.toml b/Project.toml index dcaf4f25..b3aceab6 100644 --- a/Project.toml +++ b/Project.toml @@ -21,7 +21,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" GeoRegions = "^5.1" HTTP = "0.9, 1" JSON = "0.21" -NCDatasets = "0.11, ^0.12.7" +NCDatasets = "0.13" PrettyTables = "1, 2" Reexport = "1" julia = "1" diff --git a/src/analysis/hourly.jl b/src/analysis/hourly.jl index ae1be4ff..0f055a11 100644 --- a/src/analysis/hourly.jl +++ b/src/analysis/hourly.jl @@ -214,28 +214,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_mean_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(davg,:,:,25,13),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,25,13),scale,offset) scale,offset = ncoffsetscale(view(dstd,:,:,25,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_std_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(dstd,:,:,25,13),scale,offset) + ncvar.var[:,:] = real2int16(view(dstd,:,:,25,13),scale,offset) scale,offset = ncoffsetscale(view(dmax,:,:,25,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_maximum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmax,:,:,25,13),scale,offset) + ncvar.var[:,:] = real2int16(view(dmax,:,:,25,13),scale,offset) scale,offset = ncoffsetscale(view(dmin,:,:,25,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_minimum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmin,:,:,25,13),scale,offset) + ncvar.var[:,:] = real2int16(view(dmin,:,:,25,13),scale,offset) ## DOMAIN YEARLY DIURNAL STATISTICS @@ -244,28 +244,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_mean_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,13),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(dstd,:,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_std_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dstd,:,:,1:24,13),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dstd,:,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(dmax,:,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_maximum_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmax,:,:,1:24,13),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dmax,:,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(dmin,:,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_minimum_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmin,:,:,1:24,13),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dmin,:,:,1:24,13),scale,offset) ## DOMAIN MONTHLY CLIMATOLOGY @@ -274,28 +274,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_mean_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,25,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(dstd,:,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_std_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dstd,:,:,25,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dstd,:,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(dmax,:,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_maximum_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmax,:,:,25,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dmax,:,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(dmin,:,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_minimum_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmin,:,:,25,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(dmin,:,:,25,1:12),scale,offset) ## DOMAIN MONTHLY DIURNAL STATISTICS @@ -304,28 +304,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_mean_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(davg,:,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(dstd,:,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_std_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dstd,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(dstd,:,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(dmax,:,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_maximum_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmax,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(dmax,:,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(dmin,:,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_minimum_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(dmin,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(dmin,:,:,1:24,1:12),scale,offset) ## ZONAL-MEAN YEARLY CLIMATOLOGY @@ -364,28 +364,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_mean_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(zstd,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_std_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zstd,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(zstd,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(zmax,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_maximum_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmax,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(zmax,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(zmin,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_minimum_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmin,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(zmin,:,1:24,13),scale,offset) ## ZONAL-MEAN MONTHLY CLIMATOLOGY @@ -394,28 +394,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_mean_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(zstd,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_std_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zstd,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zstd,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(zmax,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_maximum_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmax,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zmax,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(zmin,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_minimum_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmin,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zmin,:,25,1:12),scale,offset) ## ZONAL-MEAN MONTHLY DIURNAL STATISTICS @@ -424,28 +424,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_mean_hourly",Int16, ("latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(zavg,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(zstd,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_std_hourly",Int16, ("latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zstd,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(zstd,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(zmax,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_maximum_hourly",Int16, ("latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmax,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(zmax,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(zmin,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_minimum_hourly",Int16, ("latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zmin,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(zmin,:,1:24,1:12),scale,offset) ## MERIDIONAL-MEAN YEARLY CLIMATOLOGY @@ -484,28 +484,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_mean_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(mstd,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_std_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mstd,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(mstd,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(mmax,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_maximum_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmax,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(mmax,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(mmin,:,1:24,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_minimum_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmin,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(mmin,:,1:24,13),scale,offset) ## MERIDIONAL-MEAN MONTHLY CLIMATOLOGY @@ -514,28 +514,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_mean_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(mstd,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_std_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mstd,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mstd,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(mmax,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_maximum_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmax,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mmax,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(mmin,:,25,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_minimum_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmin,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mmin,:,25,1:12),scale,offset) ## MERIDIONAL-MEAN MONTHLY DIURNAL STATISTICS @@ -544,28 +544,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_mean_hourly",Int16, ("longitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(mavg,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(mstd,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_std_hourly",Int16, ("longitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mstd,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(mstd,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(mmax,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_maximum_hourly",Int16, ("longitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmax,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(mmax,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(mmin,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_minimum_hourly",Int16, ("longitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mmin,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(mmin,:,1:24,1:12),scale,offset) close(ds) diff --git a/src/analysis/monthly.jl b/src/analysis/monthly.jl index 56d6faa8..e6c8df44 100644 --- a/src/analysis/monthly.jl +++ b/src/analysis/monthly.jl @@ -204,35 +204,35 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_mean_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:12),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,13)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_mean_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(davg,:,:,13),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,13),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,14)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_std_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(davg,:,:,14),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,14),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,15)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_maximum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,15),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,15),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,16)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_minimum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,16),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,16),scale,offset) ## ZONAL-MEAN CLIMATOLOGY @@ -241,7 +241,7 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_mean_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:12),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,13)) attr_var["scale_factor"] = scale @@ -278,7 +278,7 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_mean_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:12),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,13)) attr_var["scale_factor"] = scale @@ -376,21 +376,21 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_mean_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(davg,:,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_mean_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(zavg,:,:,1:24,1:12),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,:,1:24,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_mean_hourly",Int16, ("longitude","latitude","hour","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,:,1:24,1:12),scale,offset) + ncvar.var[:,:,:,:] = real2int16(view(mavg,:,:,1:24,1:12),scale,offset) ## DOMAIN YEARLY CLIMATOLOGY @@ -399,28 +399,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_mean_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(davg,:,:,25,13),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,25,13),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,26,14)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_std_climatology",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = real2int16(view(davg,:,:,26,14),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,26,14),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,27,15)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_maximum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,27,15),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,27,15),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,28,16)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_minimum_climatology",Int16, ("longitude","latitude"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,28,16),scale,offset) + ncvar.var[:,:] = real2int16(view(davg,:,:,28,16),scale,offset) ## DOMAIN YEARLY DIURNAL STATISTICS @@ -429,28 +429,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_mean_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,13),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,1:24,14)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_std_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,14),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:24,14),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,1:24,15)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_maximum_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,15),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:24,15),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,1:24,16)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_yearly_minimum_hourly",Int16, ("longitude","latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,1:24,16),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,1:24,16),scale,offset) ## DOMAIN MONTHLY CLIMATOLOGY @@ -459,28 +459,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_mean_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,25,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,26,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_std_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,26,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,26,1:12),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,27,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_maximum_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,27,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,27,1:12),scale,offset) scale,offset = ncoffsetscale(view(davg,:,:,28,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"domain_monthly_minimum_climatology",Int16, ("longitude","latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(davg,:,:,28,1:12),scale,offset) + ncvar.var[:,:,:] = real2int16(view(davg,:,:,28,1:12),scale,offset) ## ZONAL-MEAN YEARLY CLIMATOLOGY @@ -519,28 +519,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_mean_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,1:24,14)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_std_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,14),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:24,14),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,1:24,15)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_maximum_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,15),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:24,15),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,1:24,16)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_yearly_minimum_hourly",Int16, ("latitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,1:24,16),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,1:24,16),scale,offset) ## ZONAL-MEAN MONTHLY CLIMATOLOGY @@ -549,28 +549,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_mean_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,26,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_std_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,26,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,26,1:12),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,27,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_maximum_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,27,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,27,1:12),scale,offset) scale,offset = ncoffsetscale(view(zavg,:,28,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"zonalavg_monthly_minimum_climatology",Int16, ("latitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(zavg,:,28,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(zavg,:,28,1:12),scale,offset) ## MERIDIONAL-MEAN YEARLY CLIMATOLOGY @@ -609,28 +609,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_mean_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,13),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:24,13),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,1:24,14)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_std_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,14),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:24,14),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,1:24,15)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_maximum_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,15),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:24,15),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,1:24,16)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_yearly_minimum_hourly",Int16, ("longitude","hour"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,1:24,16),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,1:24,16),scale,offset) ## MERIDIONAL-MEAN MONTHLY CLIMATOLOGY @@ -639,28 +639,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_mean_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,25,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,25,1:12),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,26,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_std_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,26,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,26,1:12),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,27,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_maximum_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,27,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,27,1:12),scale,offset) scale,offset = ncoffsetscale(view(mavg,:,28,1:12)) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"meridionalavg_monthly_minimum_climatology",Int16, ("longitude","month"),attrib=attr_var); - ncvar.var[:] = real2int16(view(mavg,:,28,1:12),scale,offset) + ncvar.var[:,:] = real2int16(view(mavg,:,28,1:12),scale,offset) close(ds) diff --git a/src/compile/hourly.jl b/src/compile/hourly.jl index 9ecb79e0..3bece2df 100644 --- a/src/compile/hourly.jl +++ b/src/compile/hourly.jl @@ -118,42 +118,42 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"average",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eavg + ncvar.var[:,:] = eavg scale,offset = ncoffsetscale(edhr) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_diurnal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = edhr + ncvar.var[:,:] = edhr scale,offset = ncoffsetscale(eitr) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_intraseasonal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eitr + ncvar.var[:,:] = eitr scale,offset = ncoffsetscale(esea) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_seasonal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = esea + ncvar.var[:,:] = esea scale,offset = ncoffsetscale(eian) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_interannual",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eian + ncvar.var[:,:] = eian scale,offset = ncoffsetscale(erng) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_noise",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = erng + ncvar.var[:,:] = erng close(ds) diff --git a/src/compile/monthly.jl b/src/compile/monthly.jl index 8f1b7811..95e25fbd 100644 --- a/src/compile/monthly.jl +++ b/src/compile/monthly.jl @@ -170,28 +170,28 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"average",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eavg + ncvar.var[:,:] = eavg scale,offset = ncoffsetscale(edhr) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_diurnal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = edhr + ncvar.var[:,:] = edhr scale,offset = ncoffsetscale(esea) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_seasonal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = esea + ncvar.var[:,:] = esea scale,offset = ncoffsetscale(eian) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_interannual",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eian + ncvar.var[:,:] = eian close(ds) @@ -252,21 +252,21 @@ function save( attr_var["add_offset"] = offset ncvar = defVar(ds,"average",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eavg + ncvar.var[:,:] = eavg scale,offset = ncoffsetscale(esea) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_seasonal",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = esea + ncvar.var[:,:] = esea scale,offset = ncoffsetscale(eian) attr_var["scale_factor"] = scale attr_var["add_offset"] = offset ncvar = defVar(ds,"variability_interannual",Int16, ("longitude","latitude"),attrib=attr_var) - ncvar.var[:] = eian + ncvar.var[:,:] = eian close(ds) diff --git a/src/landsea/landsea.jl b/src/landsea/landsea.jl index 513b2f55..3570280c 100644 --- a/src/landsea/landsea.jl +++ b/src/landsea/landsea.jl @@ -42,8 +42,8 @@ function getLandSea( gds = NCDataset(glbfnc) glon = gds["longitude"][:] glat = gds["latitude"][:] - glsm = nomissing(gds["lsm"][:],NaN) - goro = nomissing(gds["z"][:],NaN) + glsm = nomissing(gds["lsm"][:,:,1],NaN) + goro = nomissing(gds["z"][:,:,1],NaN) close(gds) if smooth @@ -79,9 +79,9 @@ function getLandSea( lds = NCDataset(lsmfnc) lon = lds["longitude"][:] lat = lds["latitude"][:] - lsm = nomissing(lds["lsm"][:], NaN) - oro = nomissing(lds["z"][:], NaN) - msk = lds["mask"][:] + lsm = nomissing(lds["lsm"][:,:], NaN) + oro = nomissing(lds["z"][:,:], NaN) + msk = lds["mask"][:,:] close(lds) @info "$(modulelog()) - Retrieving the regional ERA5 Land-Sea mask for the \"$(ereg.ID)\" ERA5Region ..." @@ -191,9 +191,9 @@ function saveLandSea( nclon[:] = lon nclat[:] = lat - nclsm[:] = lsm - ncoro[:] = oro - ncmsk[:] = mask + nclsm[:,:] = lsm + ncoro[:,:] = oro + ncmsk[:,:] = mask close(ds) diff --git a/src/save/daily.jl b/src/save/daily.jl index 6fe831a2..d80828c7 100644 --- a/src/save/daily.jl +++ b/src/save/daily.jl @@ -42,11 +42,11 @@ function save( nctime[:] = collect(1:ndy) .- 1 if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end @@ -99,11 +99,11 @@ function save( nctime[:] = collect(1:ndy) .- 1 if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end diff --git a/src/save/extract.jl b/src/save/extract.jl index 97358e13..82f7bb52 100644 --- a/src/save/extract.jl +++ b/src/save/extract.jl @@ -41,7 +41,7 @@ function save( nclon[:] = lsd.lon nclat[:] = lsd.lat nctime[:] = collect(1:nhr) .- 1 - ncvar.var[:] = data + ncvar.var[:,:,:] = data close(ds) @@ -92,7 +92,7 @@ function save( nclon[:] = lsd.lon nclat[:] = lsd.lat nctime[:] = collect(1:nhr) .- 1 - ncvar.var[:] = data + ncvar.var[:,:,:] = data close(ds) @@ -138,7 +138,7 @@ function save( nclon[:] = lsd.lon nclat[:] = lsd.lat nctime[:] = save_definetimes(e5ds,dt) - ncvar.var[:] = data + ncvar.var[:,:,:] = data close(ds) diff --git a/src/save/hourly.jl b/src/save/hourly.jl index 86196804..469438bc 100644 --- a/src/save/hourly.jl +++ b/src/save/hourly.jl @@ -42,11 +42,11 @@ function save( nctime[:] = collect(1:nhr) .- 1 if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end @@ -99,11 +99,11 @@ function save( nctime[:] = collect(1:nhr) .- 1 if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end diff --git a/src/save/monthly.jl b/src/save/monthly.jl index fe9f09c8..db416b45 100644 --- a/src/save/monthly.jl +++ b/src/save/monthly.jl @@ -40,11 +40,11 @@ function save( nctime[:] = save_definetimes(e5ds,dt) if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end @@ -96,11 +96,11 @@ function save( nctime[:] = save_definetimes(e5ds,dt) if iszero(scale) - ncvar.var[:] = 0 + ncvar.var[:,:,:] = 0 else if iszero(sum(isnan.(data))) - ncvar[:] = data - else; ncvar.var[:] = real2int16(data,scale,offset) + ncvar[:,:,:] = data + else; ncvar.var[:,:,:] = real2int16(data,scale,offset) end end