Commit ef49cdae authored by Franssen, Wietse's avatar Franssen, Wietse
Browse files

rev5.0 minor improvements

parent 880e1284
......@@ -31,6 +31,8 @@ if (submitscript) {
variables<-names(variableInfo)
FillValue <- 1e20
dir.create(outPath, recursive = TRUE, showWarnings = FALSE)
for (iMember in members) {
for (initYear in initYears) {
......@@ -57,13 +59,14 @@ for (iMember in members) {
NCtimeAtt<-ncatt_get( ncid_in, "time", "units" )$value
nc_close(ncid_in)
NCdata[is.na(NCdata)] <- FillValue
## CREATE NETCDF
if (firstVar == TRUE) {
dimT <- ncdim_def("time", NCtimeAtt, NCtime, unlim = FALSE)
dimY <- ncdim_def("lat", "degrees_north",round(NClat,2))
dimX <- ncdim_def("lon", "degrees_east", round(NClon,2))
FillValue <- 1e20
## SAVE AS NC-DATA
nameFileNCout <- sprintf("%s/forcing_seas15_%s_%s_E%02d_INIT%4d_%02d.nc4",
......@@ -73,7 +76,7 @@ for (iMember in members) {
iMember,
initYear,
initMonth)
data <- ncvar_def( variableName, variableInfo[[variableName]]$units, list(dimX,dimY,dimT), FillValue, prec="float")#, compression=4)
data <- ncvar_def( variableName, variableInfo[[variableName]]$units, list(dimX,dimY,dimT), FillValue, prec="float", compression=4)
print(paste0("Creating: ", nameFileNCout, " for: ", variableName))
ncid_out <- nc_create( nameFileNCout,data)
......@@ -107,9 +110,10 @@ for (iMember in members) {
ncatt_put( ncid_out, variableName, "standard_name", variableInfo[[variableName]]$standardName)
ncatt_put( ncid_out, variableName, "long_name", variableInfo[[variableName]]$longName)
ncatt_put( ncid_out, variableName, "_FillValue", FillValue)
#ncatt_put( ncid_out, variableName, "_FillValue", FillValue)
firstVar<-FALSE
rm(data, NCdata)
}
nc_close(ncid_out)
} ## end initMonth
......
#!/bin/bash
#SBATCH --account=5120867-01
#SBATCH --time=5000
#SBATCH --mem=4024
#SBATCH --mem=16024
#SBATCH --ntasks=1
#SBATCH --output=./log/log_5_doNetcdfCombine_<location>_<bcInfo>_<resolution>deg_initMonth<initMonth>_%j.txt
#SBATCH --job-name=Combine
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment