-Uses [NCL][NCL @ wikipedia] and [R][R @ wikipedia] code to
+Uses [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
+* bash (tested with version=3.2.25)
+* NCL (tested with version=6.1.2)
+* R (tested with version=3.0.0) and packages including
[R @ wikipedia]: http://en.wikipedia.org/wiki/ R_%28programming_language%29
+ @ wikipedia]: http://en.wikipedia.org/wiki/%29
[NCL @ wikipedia]: http://en.wikipedia.org/wiki/NCAR_Command_Language
+[R @ wikipedia]: http://en.wikipedia.org/wiki/R_%28programming_language%29
-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
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).
- `$ ./regrid_reunit_retemporalize.sh`
-1. This will download input, then run
+ 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
[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/