Project

General

Profile

« Previous | Next » 

Revision 8009a075

Added by Adam Wilson almost 11 years ago

Updating validation to use new cloud data

View differences:

climate/procedures/ee_compile.R
36 36

  
37 37
## drop some if not complete
38 38
#df=df[df$month%in%1:9&df$year%in%c(2001:2012),]
39
rerun=T  # set to true to recalculate all dates even if file already exists
39
rerun=F  # set to true to recalculate all dates even if file already exists
40 40

  
41 41
## Loop over existing months to build composite netcdf files
42 42
foreach(date=unique(df$date)) %dopar% {
......
106 106

  
107 107
### merge all the tiles to a single global composite
108 108
#system(paste("ncdump -h ",list.files(tempdir,pattern="mod09.*.nc$",full=T)[10]))
109
system(paste("cdo -O  mergetime ",paste(list.files(tempdir,pattern="mod09.*.nc$",full=T),collapse=" ")," data/cloud_daily.nc"))
109
system(paste("cdo -O  mergetime -setctomiss,-32768 ",paste(list.files(tempdir,pattern="mod09.*.nc$",full=T),collapse=" ")," data/cloud_monthly.nc"))
110 110

  
111 111
#  Overall mean
112
system(paste("cdo -O  -chname,CF,CF_annual -timmean data/cloud_daily.nc  data/cloud_mean.nc"))
112
system(paste("cdo -O  -chname,CF,CF_annual -timmean data/cloud_monthly.nc  data/cloud_mean.nc"))
113 113

  
114 114
### generate the monthly mean and sd
115 115
#system(paste("cdo -P 10 -O merge -ymonmean data/mod09.nc -chname,CF,CF_sd -ymonstd data/mod09.nc data/mod09_clim.nc"))
116
system(paste("cdo  -O -ymonmean data/cloud_daily.nc data/cloud_ymonmean.nc"))
117
system(paste("cdo  -O -chname,CF,CF_sd -ymonstd data/cloud_daily.nc data/cloud_ymonsd.nc"))
116
system(paste("cdo  -f nc4c -O -ymonmean data/cloud_monthly.nc data/cloud_ymonmean.nc"))
117
system(paste("cdo  -f nc4c -O -chname,CF,CF_sd -ymonstd data/cloud_monthly.nc data/cloud_ymonsd.nc"))
118 118

  
119 119
#if(!file.exists("data/mod09_metrics.nc")) {
120
#    system("cdo -chname,CF,CFmin -timmin data/mod09_clim_mean.nc data/mod09_min.nc")
121
#    system("cdo -chname,CF,CFmax -timmax data/mod09_clim_mean.nc data/mod09_max.nc")
122
#    system("cdo -chname,CF,CFsd -timstd data/mod09_clim_mean.nc data/mod09_std.nc")
123
#    system("cdo -f nc2 merge data/mod09_std.nc data/mod09_min.nc data/mod09_max.nc data/mod09_metrics.nc")
124
    system("cdo merge -chname,CF,CFmin -timmin data/cloud_clim_mean.nc -chname,CF,CFmax -timmax data/cloud_clim_mean.nc  -chname,CF,CFsd -timstd data/cloud_clim_mean.nc  data/cloud_metrics.nc")
120
    system("cdo -f nc4c -chname,CF,CFmin -timmin data/cloud_ymonmean.nc data/cloud_min.nc")
121
    system("cdo -f nc4c -chname,CF,CFmax -timmax data/cloud_ymonmean.nc data/cloud_max.nc")
122
    system("cdo -f nc4c -chname,CF,CFsd -timstd data/cloud_ymonmean.nc data/cloud_std.nc")
123
#    system("cdo -f nc2 merge data/mod09_std.nc data/mod09_min.nc data/cloud_max.nc data/cloud_metrics.nc")
124
#    system("cdo merge -chname,CF,CFmin -timmin data/cloud_ymonmean.nc -chname,CF,CFmax -timmax data/cloud_ymonmean.nc  -chname,CF,CFsd -timstd data/cloud_ymonmean.nc  data/cloud_metrics.nc")
125 125
#}
126 126

  
127 127

  
......
163 163

  
164 164

  
165 165
## read in monthly dataset
166
mod09=brick("data/mod09_clim_mean.nc",varname="CF")
166
mod09=brick("data/cloud_ymonmean.nc",varname="CF")
167 167
plot(mod09[1])
168 168

  
169 169
mod09_seas=calc(mod09,seasconc,return.Pc=T,return.thetat=F,overwrite=T,filename="data/mod09_seas.nc",NAflag=255,datatype="INT1U")

Also available in: Unified diff