(part of the AQMEII-NA_N2O family of projects)
table of contents
- convert GEIA geospatial data from its quirky native format to netCDF.
- 2D-regrid netCDF data from global/unprojected to a projected subdomain (AQMEII-NA).
- "reunit" the data from GEIA's
moles/s(what CMAQ wants).
- "retemporalize" from yearly (single) timestep to CMAQ-style emissions files (e.g., this, when
gunziped) containing hourly emissions usable for any day in the model year=2008.
- check that mass is (more or less) conserved in all of the above
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
To run this code,
git clonethis repo. (See commandlines on the project homepage, where you probably are now.)
cdto its working directory (where you cloned it to).
- Setup your applications and paths.
- Download a copy of these bash utilities to the working directory.
- Open the file in in an editor! You will probably need to edit its functions
setup_appsto make it work on your platform. Notably you will want to point it to your PDF viewer and NCL and R executables.
- You may also want to open the driver (bash) script 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.
- 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).
- Run the driver:
$ ./GEIA_driver.shThis will download input (and possibly
regrid_utils), then run
- an R script to convert the input to a netCDF file, and plot it. The driver should display a PDF if properly configured.
- another R script to regrid the netCDF, and plot the output. The driver should display a PDF if properly configured. This PDF currently has 2 pages (p1 using
raster::plotand p2 using
- an NCL script to convert regridded concentrations to units appropriate for CMAQ (and with IOAPI metadata) and display the output using VERDI.
an NCL script 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 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=ton-N (TODO: compare global ocean area to AQMEII-NA ocean area) input input output output global NAs AQMEII-NA NAs out/in 3.60e+06 28657 1.06e+06 90768 2.96e-01
- Retest with newest
repo_diff.shshows the following local
- Move all these TODOs to issue tracker.
- Create common project for
regrid_resourcesà la regrid_utils, so I don't hafta hunt down which resource is in which project.
*.sh: use bash booleans à la
- (this project only?) Use the EPIC input as template.
- 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.,
<null/>(e.g., MCIP output).
- Determine why
<-assignment is occasionally required in calls to
- Fully document platform versions (e.g., linux, compilers, bash, 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)