subsettools.clm

Functions to configure CLM for coupled ParFlow-CLM simulations.

Functions

config_clm(ij_bounds, start, end, dataset, write_dir)

Modify template CLM driver files for a desired subdomain and run duration.

subsettools.clm.config_clm(ij_bounds, start, end, dataset, write_dir, time_zone='UTC')[source]

Modify template CLM driver files for a desired subdomain and run duration.

This function will obtain template clm driver files (specifically vegm, vep and drv_clmin) from the existing national simulations on HydroData and modify them to reflect the desired subdomain (indicated by the ij_bounds) and run duration (indicated by the start and end dates). The modified files will be written out to a user specified directory. These files are required if you are going to run a ParFlow-CLM simulation.

Parameters:
  • ij_bounds (tuple[int]) – bounding box for subset. This should be given as i,j index values where 0,0 is the lower left hand corner of a domain. ij_bounds are given relative to whatever grid is being used for the subset.

  • start (str) – start date (inclusive), in the form ‘yyyy-mm-dd’

  • end (str) – end date (exlusive), in the form ‘yyyy-mm-dd’

  • dataset (str) – the dataset that the files should be obtained from name e.g. “conus1_baseline_mod”

  • write_dir (str) – directory where the subset files will be written

  • timezone (str) – timezone information for start and end dates. Defaults to “UTC”.

Returns:

A dictionary mapping the CLM file types (“vegp”, “vegm”, “drv_clm”) to the corresponging filepaths where the CLM files were written.

Example:

filepaths = config_clm(
    ij_bounds=(375, 239, 487, 329),
    start="2005-10-01",
    end="2006-10-01",
    dataset="conus1_baseline_mod",
    write_dir="/path/to/your/chosen/directory"
)