merra_smb_mean.py

  • Reads monthly MERRA-2 datafiles to calculate multi-annual means of derived surface mass balance products

Source code

General Methods

SMBcorr.merra_smb_mean(DIRECTORY, PRODUCT, RANGE=None, VERBOSE=False, MODE=509)[source]

Reads monthly MERRA-2 datafiles to calculate multi-annual means of derived surface mass balance products

Parameters:
base_dir: str

Working data directory

PRODUCT: str

MERRA-2 product to calculate

  • SMB: Surface Mass Balance

  • ACCUM: Snowfall accumulation

  • PRECIP: Precipitation

  • RAIN: Total Rainfall

  • SUBLIM: Evaporation and Sublimation

  • REFREEZE: Melt Water Refreeze

RANGE: list, default [1961,1990]

Start and end year of mean

VERBOSE: bool, default False

Verbose output of netCDF4 variables

MODE: oct, default 0o775

Permission mode of directories and files created

SMBcorr.merra_smb_mean.read_merra_variables(merra_flux_file, merra_ice_surface_file)[source]
Read a subset of MERRA-2 variables for deriving

surface mass balance products

From tavgM_2d_int (Vertically Integrated Diagnostics) collection:

  • PRECCU: convective rain

  • PRECLS: large-scale rain

  • PRECSN: snow

  • EVAP: evaporation

From tavgM_2d_glc (Land Ice Surface Diagnostics) collection:

  • RUNOFF: runoff over glaciated land

Parameters:
merra_flux_file: str

Path to tavgM_2d_int file

merra_ice_surface_file: str

Path to tavgM_2d_glc file

Calling Sequence

usage: merra_smb_mean.py [-h] [--directory DIRECTORY] [--mean START END]
                         [--verbose] [--mode MODE]
                         {SMB,ACCUM,PRECIP,RAINFALL,SUBLIM,RUNOFF}
                         [{SMB,ACCUM,PRECIP,RAINFALL,SUBLIM,RUNOFF} ...]

Positional Arguments

product

Possible choices: SMB, ACCUM, PRECIP, RAINFALL, SUBLIM, RUNOFF

MERRA-2 derived product

Named Arguments

--directory, -D

Working data directory

--mean, -m

Start and end year range for mean

--verbose, -V

Verbose output of run

--mode, -M

Permission mode of directories and files