Commits

Tom Roche committed ca9a329

fixed emissions-location problem, updated README

After the previous commit I ran uber_driver from repo, during which time I
updated the README and looked at the plots, and during that I noticed that
the offshore emissions were in fact EPIC emissions mirrored.
So the problem ("fixed" in the previous code) was not that the entire field was mirrored, only that
EDGAR was mirrored relative to EPIC. (TODO: figure out why: row-dimension order?)
Fixed _that_, and now plots and VERDI are clean, and EPIC hotspots are also combined hotspots.

Tested on terrae/EMVL from both AQMEII_driver.sh and uber_driver.sh::file (latter in fresh terminal)

TODO:
* handle {name, path to} VERDI in regrid_utils/bash_utilities.sh
* move R functions from {combine_EDGAR_and_EPIC_emissions.r, compute_EPIC_emissions.r} to regrid_utils/R_utilities.r
* generate plot of EPIC-EDGAR (i.e., show where EDGAR < EPIC, EDGAR > EPIC)
*** add to README, wiki: links to overviews of BELD, EPIC
*** add to wiki: Simulation-of-N2O-Production-and-Transport-in-the-US-Cornbelt-Compared-to-Tower-Measurements#wiki-input-processing-EPIC-0509 (I have input processing instructions for other EIs, but not EPIC)
* add more stats to README, esp comparing before EPIC overlay to after
* move explicit constants BELD_CSV_to_RDS.r -> AQMEII_driver.sh
* AQMEII_driver.sh still has much uncalled cruft from ancestors=EDGAR_driver.sh, GFED_driver.sh
* regrid_utils: make commandline netCDF.stats.to.stdout.r take files beginning with numerals, e.g.
- $ Rscript ./netCDF.stats.to.stdout.r netcdf.fp=5yravg_20111219_pure_emis.nc data.var.name=N2O # fails
+ $ Rscript ./netCDF.stats.to.stdout.r netcdf.fp=yravg_20111219_pure_emis.nc data.var.name=N2O # works
* port AQMEII_driver failfast to
** other *_driver: CLMCN_driver, EDGAR_driver, GEIA_driver, GFED_driver
** other uber_driver: GFED::uber_driver
* create common project for regrid_resources à la regrid_utils, so I don't hafta hunt down which resource is in which project
* (this project only) use the EPIC input as template, rather than the TEMPLATE_INPUT_FP I shlep to all the projects.
* all regrids: how to nudge off/onshore as required? e.g., soil or burning emissions should never be offshore, marine emissions should never be onshore.
* all regrid maps: add Caribbean islands (esp Bahamas! for offshore burning), Canadian provinces, Mexican states
* complain to ncl-talk about NCL "unsupported extensions," e.g., .ncf and <null/> (e.g., MCIP output)
* determine why '<-' assignment is occasionally required in calls to visualize.*(...)
* document platform versions (e.g., linux, NCL, R)
* test on
** tlrPanP5 (which now has R package=ncdf4, but readAsciiTable of input .txt's is very slow compared to terrae)
** HPCC (once problem with ncdf4 on amad1 is debugged: in process with JOB and KMF)

Comments (0)

Files changed (2)

         1. `(ROW, COL)` is the AQMEII-NA grid
         1. `value(TSTEP, LAY, ROW, COL)` is EPIC's estimate of the total emission of N2O (in `mol/s`) from soils planted in all crops modeled by EPIC in that gridcell over that timestep.
     1. [Visualize the EPIC emissions][visualization of AQMEII-NA EPIC].
-1. *(mostly complete)* Combine EDGAR and EPIC emissions over AQMEII-NA.
+1. *(completed)* Combine EDGAR and EPIC emissions over AQMEII-NA.
     1. *(algorithm may change)* For each gridcell in AQMEII-NA: if the EPIC emissions exceed the EDGAR emissions, use the EPIC value.
     1. [Visualize the combined AQMEII-NA emissions][visualization of AQMEII-NA EDGAR+EPIC emissions].
 1. *(in process)* Create [CMAQ][CMAQ @ CMAS]-style emissions files (e.g., [this][hourly emissions for 1 Jan 2008], when `gunzip`ed) containing emissions for every hour in 2008 (the model year).

combine_EDGAR_and_EPIC_emissions.r

 for (i.tstep in 1:output.both.dim.tsteps.n) {
   for (i.lay in 1:output.both.dim.layers.n) {
     input.epic.grid <- input.epic.dv.arr[,,i.lay,i.tstep]
-    output.grid <- input.edgar.arr
+#    output.grid <- input.edgar.arr
+    ##### TODO: why do I need to reverse EDGAR rows horizontally? #####
+    # Yet if I do not mirror EDGAR around center horizontally, I get ghosting of Mexico in Canada
+    # so for now: reverse EDGAR rows horizontally (by reversing (only) the row indices)
+    output.grid <- input.edgar.arr[,input.edgar.dim.y.n:1]
+
     # we want to copy if either of
     # * is.na(EDGAR) & !is.na(EPIC)
     # * !is.na(EDGAR) & !is.na(EPIC) & (EPIC > EDGAR)
 #   end debugging-----------------------------------------------------
 
 ### go with type4 for now:
-
 output.both.dv.arr <- output.both.dv.arr.type4
-##### TODO: determine why: data is mirrored about horizontal axis! #####
-# so for now: reverse the rows horizontally
-output.both.dv.arr <-   # reverse (only) the row indices
-  output.both.dv.arr.type4[,output.both.dim.y.n:1,,]
 
 # ----------------------------------------------------------------------
 # copy/mod IOAPI/fake datavar=TFLAG