How to use the tonic.models.vic.grid_params.Units function in tonic

To help you get started, we’ve selected a few tonic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github UW-Hydro / tonic / tonic / models / vic / grid_params.py View on Github external
f = Dataset(myfile, 'w', format='NETCDF4')

    # write attributes for netcdf
    f.description = 'VIC parameter file'
    f.history = 'Created: {0}\n'.format(tm.ctime(tm.time()))
    f.history += ' '.join(sys.argv) + '\n'
    f.source = sys.argv[0]  # prints the name of script used
    f.username = getuser()
    f.host = socket.gethostname()

    if lake_grid:
        lakes = True
    else:
        lakes = False

    unit = Units(organic_fract=organic_fract, spatial_frost=spatial_frost,
                 spatial_snow=spatial_snow,
                 july_tavg_supplied=july_tavg_supplied,
                 veglib_fcan=veglib_fcan, veglib_photo=veglib_photo,
                 blowing_snow=blowing_snow,
                 vegparam_lai=vegparam_lai, vegparam_fcan=vegparam_fcan,
                 vegparam_albedo=vegparam_albedo, lakes=lakes)
    desc = Desc(organic_fract=organic_fract, spatial_frost=spatial_frost,
                spatial_snow=spatial_snow,
                july_tavg_supplied=july_tavg_supplied,
                veglib_fcan=veglib_fcan, veglib_photo=veglib_photo,
                blowing_snow=blowing_snow,
                vegparam_lai=vegparam_lai, vegparam_fcan=vegparam_fcan,
                vegparam_albedo=vegparam_albedo, lakes=lakes)

    # target grid
    # coordinates