Commits

Tom Roche  committed 0c9ab73

use just one template file, for both R::raster extents and IOAPI-writing

For simplicity (and because I never automated creation of latter) à la GEIA use only
* my AQMEII_ag_soil output (and delete references to .../*EXTENTS_INPUT*) for both tasks
* use only strings=TEMPLATE_IOAPI* and delete references to strings=TEMPLATE_INPUT*

Tested on terrae/EMVL from CLMCN_driver ('env GIT_SSL_NO_VERIFY=true ./CLMCN_driver.sh'), will repeat with uber_driver.sh::repo soonest

TODO:
* move all these TODOs to https://bitbucket.org/tlroche/clm_cn_global_to_aqmeii-na/issues
* port *_driver improvements to
** other *_driver: EDGAR_driver, GFED_driver
** other uber_driver: AQMEII::uber_driver, GFED::uber_driver
* 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.*(...)
* 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)

  • Participants
  • Parent commits 42d3e56

Comments (0)

Files changed (1)

File CLMCN_driver.sh

 export CLM_CN_RAW_Y_COORDVAR_NAME='lat'
 export CLM_CN_RAW_TIME_COORDVAR_NAME='time'
 
-### Template for `raster` regridding.
-
-# The template input is a copy of some meteorological data with 52 "real" datavars.
-# That data is in the IOAPI format, which here is basically a wrapper around netCDF.
-# (IOAPI can be used with other data, and similar wrappers exist for other models.)
-# I removed all but one of the datavars (with NCO 'ncks'). TODO: script that!
-TEMPLATE_INPUT_GZ_URI='https://bitbucket.org/tlroche/geia_regrid/downloads/emis_mole_all_20080101_12US1_cmaq_cb05_soa_2008ab_08c.EXTENTS_INPUT.nc.gz'
-TEMPLATE_INPUT_GZ_FN="$(basename ${TEMPLATE_INPUT_GZ_URI})"
-TEMPLATE_INPUT_GZ_FP="${WORK_DIR}/${TEMPLATE_INPUT_GZ_FN}"
-TEMPLATE_INPUT_ROOT="${TEMPLATE_INPUT_GZ_FN%.*}" # everything left of the LAST dot
-TEMPLATE_INPUT_FN="${TEMPLATE_INPUT_ROOT}"
-export TEMPLATE_INPUT_FP="${WORK_DIR}/${TEMPLATE_INPUT_FN}"
-# export TEMPLATE_INPUT_BAND='1' # `ncks` makes dim=TSTEP first
-export TEMPLATE_DATAVAR_NAME='emi_n2o'
-
 ### Template for both `raster` extents and IOAPI-writing
 
 # This file should have all required IOAPI metadata (including the "fake datavar"=TFLAG) for a single datavar=N2O.
 function setup_resources {
   for CMD in \
     'get_raw_input' \
-    'get_template_input' \
     'get_template_IOAPI' \
     'get_regrid' \
     'get_MSFs' \
   fi
 } # end function get_raw_input
 
-### get the "template" file, used for extent-setting and emissions-file creation
-function get_template_input {
-  if [[ -z "${TEMPLATE_INPUT_FP}" ]] ; then
-    echo -e "${THIS_FN}: ERROR: TEMPLATE_INPUT_FP not defined"
-    exit 30
-  fi
-  if [[ ! -r "${TEMPLATE_INPUT_FP}" ]] ; then
-    if [[ ! -r "${TEMPLATE_INPUT_GZ_FP}" ]] ; then
-      for CMD in \
-        "${WGET_TO_FILE} ${TEMPLATE_INPUT_GZ_FP} ${TEMPLATE_INPUT_GZ_URI}" \
-      ; do
-        echo -e "$ ${CMD}"
-        eval "${CMD}"
-      done
-    fi
-    if [[ -r "${TEMPLATE_INPUT_GZ_FP}" ]] ; then
-      for CMD in \
-        "gunzip ${TEMPLATE_INPUT_GZ_FP}" \
-      ; do
-        echo -e "$ ${CMD}"
-        eval "${CMD}"
-      done
-    fi
-  fi
-  if [[ ! -r "${TEMPLATE_INPUT_FP}" ]] ; then
-    echo -e "${THIS_FN}: ERROR: cannot read TEMPLATE_INPUT_FP=='${TEMPLATE_INPUT_FP}'"
-    exit 31
-  fi
-} # end function get_template_input
-
-### get the "template" file used for IOAPI-writing
+### get the "template" file used for regridding and IOAPI-writing
 function get_template_IOAPI {
   if [[ -z "${TEMPLATE_IOAPI_FP}" ]] ; then
     echo -e "${THIS_FN}::${FUNCNAME[0]}: ERROR: TEMPLATE_IOAPI_FP not defined"