Overview

(part of the AQMEII-NA_N2O family of projects)

table of contents

summary

Suppose you have CMAQ-ready boundary (BC) and initial (IC) condition IOAPI/netCDF files containing a number of species (typically those required for air-quality (AQ) applications), but not some particular species of interest. This project takes as input

and outputs a set of well-formed CMAQ BCs or ICs (corresponding one-to-one to the input) containing all of the AQ species, plus N2O.

description

Uses bash to drive NCL code to

  1. Read appropriate N2O atmospheric concentrations, in ppmv as required by CMAQ BC and IC files. Sources may include
    • hard-coded input from an ungridded source of spatially- and temporally-coarse mean concentrations (e.g., NOAA ESRL HATS N2O concentrations)
    • (planned) spatially- and temporally-matching concentration grids (someday to derive from a 3D-regrid project)
  2. (planned) "Reverticalize" AQ-only/N2O-free CMAQ BCs and ICs, due to unexpected vertical-layer-boundary mismatch between received IC/BCs and meteorology.
  3. Read AQ-only/N2O-free CMAQ BCs and ICs.
  4. Write "well-formed" N2O-augmented files corresponding to the inputs. (Confirming well-formedness WRT IOAPI may require use of VERDI.)

operation

To run this code,

  1. git clone this repo. (See commandlines on the project homepage, where you probably are now.)
  2. cd to its working directory (where you cloned it to).
  3. Setup your applications and paths.
    1. Download a copy of these bash utilities to the working directory.
    2. Open the file in in an editor! You will probably need to edit its functions setup_paths and setup_apps to make it work on your platform. Notably you will want to point it to your PDF viewer and NCL and R executables.
    3. 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.
    4. 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).
  4. Run the driver: $ ./BC_IC_N2O_driver.sh This will download inputs, then run ...
    1. write_N2O.ncl, which will write an N2O datasource file (currently this, used for both BCs and ICs) if not available.
    2. reverticalize_ICs.ncl, which will loop over the set of paths to CMAQ IC files passed to it by the driver, changing their vertical layers to match the input meteorology
    3. reverticalize_BCs.ncl, which will perform similar functions WRT passed BC files.
    4. IC_plus_N2O.ncl, which will loop over the set of paths to CMAQ IC files passed to it by the driver,
      • (planned) verifying consistency of their vertical layers with sample meteorology
      • augmenting those files with species=N2O.
    5. BC_plus_N2O.ncl, which will perform similar functions WRT passed BC files.

TODOs

  1. Retest with newest regrid_utils! Currently, repo_diff.sh shows the following local diffs:
    • IOAPI.ncl
    • string.ncl
    • time.ncl
  2. Move all these TODOs to issue tracker.
  3. uber_driver.sh or resource_strings.sh: add provision to {copy, not create} N2O datasource file from uber_driver if desired: it's small now ...
  4. *.sh: use bash booleans à la N2O_integration_driver.sh.
  5. BC_plus_N2O.ncl, IC_plus_N2O.ncl (aka *_plus_N2O.ncl): refactor! Code is virtually the same, except
    • s/BC/IC/g (or vv)
    • BC datavars have dimensions=(TSTEP, LAY, PERIM) (and |dimensions|==3)
    • IC datavars have dimensions=(TSTEP, LAY, ROW, COL) (and |dimensions|==4)
  6. BC_IC_N2O_driver.sh: move input processing (i.e., creating metafiles with BC/IC filepaths) to functions
  7. *_plus_N2O.ncl: after processing first IC, all subsequent produce these (apparently harmless) warnings: > warning:VarVarWrite: Dimension names for dimension number (0) don't match, assigning name of rhs dimension to lhs, use "(/../)" if this change is not desired > warning:VarVarWrite: Dimension names for dimension number (1) don't match, assigning name of rhs dimension to lhs, use "(/../)" if this change is not desired > warning:VarVarWrite: Dimension names for dimension number (2) don't match, assigning name of rhs dimension to lhs, use "(/../)" if this change is not desired > warning:VarVarWrite: Dimension names for dimension number (3) don't match, assigning name of rhs dimension to lhs, use "(/../)" if this change is not desired > warning:["Execute.c":8128]:Execute: Error occurred at or near line 369 in file ./IC_plus_N2O.ncl
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.