-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from abigailsnyder/acs-fldgen-subsetting-outpu…
…t-fcn acs-intermediate fix to saved fldgen memory bloat
- Loading branch information
Showing
10 changed files
with
269 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
library('fldgen') | ||
|
||
train_models <- function(models, tasvar='tasAdjust', prvar='prAdjust', | ||
datadir='./training-data') { | ||
|
||
## The following would give you the complete set of models: | ||
## models <- c('GFDL-ESM2M', 'HadGEM2-ES', 'IPSL-CM5A-LR', 'MIROC5') | ||
|
||
for (model in models) { | ||
datafiles <- list.files(path=datadir, pattern=model, full.names=TRUE) | ||
cat('Processing model ', model, ' datafiles:\n', paste(datafiles, collapse='\n'),'\n') | ||
emu <- trainTP(datafiles, tvarname=tasvar, pvarname=prvar) | ||
emu$griddataP$vardata_raw <- NULL | ||
outfilename <- paste0('fldgen-',model, '.rds') | ||
coord <- emu$griddataT$coord | ||
coord[67382, ] <- c(-49.75, 178.75) | ||
emu$griddataT$coord <- coord | ||
emu$griddataP$coord <- coord | ||
|
||
saveRDS(emu, outfilename) | ||
|
||
|
||
emulator <- emulator_reducer(emu) | ||
outfilename <- paste0('fldgen-',model, '_reducedEmulator.rds') | ||
saveRDS(reducedEmulator, outfilename) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/zsh | ||
|
||
#SBATCH -p short | ||
#SBATCH -t 180 | ||
#SBATCH -A IHESD | ||
|
||
|
||
module purge | ||
module load gcc/8.1.0 | ||
module load netcdf | ||
module load R/3.4.3 | ||
|
||
## | ||
echo Rscript -e \"source('train-emulators.R'); train_models('$1')\" | ||
|
||
Rscript -e "source('train-emulators.R'); train_models('$1')" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.