Commits

Tom Roche committed fac25b1

updated README to new-style after testing from uber_driver pulling from repository

Comments (0)

Files changed (1)

-Uses [NCL][NCL @ wikipedia] and [R][R @ wikipedia] code to
+Uses [bash][bash @ wikipedia] to drive [NCL][NCL @ wikipedia] and [R][R @ wikipedia] code to
 
 1. 2D-regrid [CLM-CN][] data (in [netCDF][] format) from global/unprojected to a projected subdomain ([AQMEII-NA][]).
-2. "reunits" the data from CLM-CN's `mgN/m^2` to `moles/sec/gridcell` (what CMAQ wants).
-3. "retemporalize" from monthly timestep to hourly
-4. check that mass is (more or less) conserved in all of the above
+1. "reunit" the data from CLM-CN's `mgN/m^2` to `moles/sec/gridcell` (what CMAQ wants).
+1. "retemporalize" from monthly timestep to hourly, creating CMAQ-style emissions files (e.g., [this][emis_mole_N2O_200801_12US1_cmaq_cb05_soa_2008ab_08c.ncf.gz], when `gunzip`ed) containing hourly emissions usable for any day in the month labeled (e.g., `200801` in the link).
+1. check that mass is (more or less) conserved in all of the above
 
-creating CMAQ-style emissions files (e.g., [this][emis_mole_N2O_200801_12US1_cmaq_cb05_soa_2008ab_08c.ncf.gz], when `gunzip`ed) containing hourly emissions usable for any day in the month labeled (e.g., `200801` in the link). Currently does not provide a clean or general-purpose (much less packaged) solution! but merely shows how to do these tasks using NCL (tested with version=6.1.2) and R (tested with version=2.15.2) and R packages including
+Currently does not provide a clean or general-purpose (much less packaged) solution! This project merely shows how to perform these tasks using
 
-* [ncdf4][]
-* [raster][]
-* [rasterVis][]
+* bash (tested with version=3.2.25)
+* NCL (tested with version=6.1.2)
+* R (tested with version=3.0.0) and packages including
+    * [ncdf4][]
+    * [fields][]
+    * [raster][]
 
-[R @ wikipedia]: http://en.wikipedia.org/wiki/R_%28programming_language%29
+[bash @ wikipedia]: http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29
 [NCL @ wikipedia]: http://en.wikipedia.org/wiki/NCAR_Command_Language
+[R @ wikipedia]: http://en.wikipedia.org/wiki/R_%28programming_language%29
 [netCDF]: http://en.wikipedia.org/wiki/NetCDF#Format_description
 [CLM-CN]: https://github.com/TomRoche/cornbeltN2O/wiki/Simulation-of-N2O-Production-and-Transport-in-the-US-Cornbelt-Compared-to-Tower-Measurements#wiki-CLM-CN-N2O
 [AQMEII-NA]: https://github.com/TomRoche/cornbeltN2O/wiki/AQMEII-North-American-domain
 [raster]: http://cran.r-project.org/web/packages/raster/
 [rasterVis]: http://cran.r-project.org/web/packages/rasterVis/
 
-The simplest way to run this code is to download and run [uber_driver.sh][], which automates the following steps. (Be sure to edit it, as discussed in the file, to match your local conditions and intentions!) Alternatively, one may manually
+To run this code,
 
 1. `git clone` this repo.
 1. `cd` to its working directory (where you cloned it to).
-1. Open the [driver (bash) script][regrid_reunit_retemporalize.sh] in an editor! You will probably need to edit it to make it work on your platform. Notably you will probably want to point it to your R executable and PDF viewer.
+1. If you're not working on one of the systems configured in [bash utilities][bash_utilities.sh]:
+    1. Download [bash_utilities.sh] to the working directory, and open it in an editor. You will need to edit the functions `setup_paths` and `setup_apps` to make it work on your host: notably you will want to point the code to your PDF viewer and NCL and R executables.
+    1. You may also want to open the [driver (bash) script][CLMCN_driver.sh] in an editor and take a look. It should run Out Of The Box, but you might need to tweak something there. In the worst case, you could hardcode your paths and apps in the driver.
+    1. Once you've got it working, you may want to fork it. If so, you can automate running your changes with [uber_driver.sh][] (changing that as needed, too).
 1. Run the driver:
-    `$ ./regrid_reunit_retemporalize.sh`
-1. This will download input, then run
+    `$ ./CLMCN_driver.sh`
+    This will download input, then run
     * an [R script][regrid_global_to_AQMEII.r] to display the input netCDF data, regrid it, and plot the output. The driver should display [an input PDF][global plots] and [an output PDF][AQMEII plots] if properly configured.
-    * an [NCL script][retemp_monthly_to_hourly.ncl] to [convert regridded concentrations][CLM-CN input processing @ project wiki] to units appropriate for [CMAQ][CMAQ @ CMAS].
+    * an [NCL script][retemp_reunit.ncl] to [convert regridded concentrations][CLM-CN input processing @ project wiki] to units appropriate for [CMAQ][CMAQ @ CMAS].
     * an [NCL script][check_conservation.ncl] to check conservation of mass from input to output. Given that the output domain (AQMEII-NA) is significantly smaller than the input domain (global), it merely reports the fraction of mass (as mgN) in output vs input, and compares that to an estimation of the land area of the output domain relative to the input domain. Current output is
 
                 Is N2O conserved from input to output? units=mgN
                        11   4.72e+14          0   1.65e+13          0   3.49e-02
                        12   4.49e+14          0   1.19e+13          0   2.66e-02
 
+[bash_utilities.sh]: https://bitbucket.org/tlroche/geia_regrid/raw/eef59bc6849c2c022415fe9a879310f482c9d8f4/bash_utilities.sh
+[CLMCN_driver.sh]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/40f7a47b93e2790e4dbb7e64f2374f2746f7a0e9/CLMCN_driver.sh?at=master
 [uber_driver.sh]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/d3e6e9567bd985a2dc0b31acdbd9d1bb8ae45b54/uber_driver.sh?at=master
 [regrid_reunit_retemporalize.sh]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/859674cf525419df313056758cc019f2c0087be3/regrid_reunit_retemporalize.sh?at=master
 [regrid_global_to_AQMEII.r]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/29b5c47d54df595c3d93c4f3d679e398e01c775b/regrid_global_to_AQMEII.r?at=master
-[retemp_monthly_to_hourly.ncl]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/a1ee1120db222421a8eb6f78fa1d79ad604d12cc/retemp_monthly_to_hourly.ncl?at=master
+[retemp_reunit.ncl]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/40f7a47b93e2790e4dbb7e64f2374f2746f7a0e9/retemp_reunit.ncl?at=master
 [check_conservation.ncl]: https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/src/828a83545a6c47aeeee674d57813c30f2662f060/check_conservation.ncl?at=master
 [CLM-CN input processing @ project wiki]: https://github.com/TomRoche/cornbeltN2O/wiki/Simulation-of-N2O-Production-and-Transport-in-the-US-Cornbelt-Compared-to-Tower-Measurements#wiki-input-processing-CLM-CNv3.5
 [CMAQ @ CMAS]: http://www.cmaq-model.org/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.