# firn_density_spin

Class for spinning up the model.

This file spins up to a steady-state firn column using constant temperature, accumulation rate, and surface density. This works well for long model runs with big time steps (e.g. for ice-core related questions).

To spin up using a climate with a bit of variability (like a reference climate interval) for e.g. altimetry or melt related runs, this script will essentially create an initial condition. In this case, set ‘yearSpin’ in your .json file to some small number (e.g. 1); otherwise you are wasting computing time.

class `firn_density_spin.``FirnDensitySpin`(config, climateTS=None)

  Parameters used in the model, for the initialization as well as the time evolution:

  : gridLen: size of grid used in the model run

    (unit: number of boxes, type: int)

  : dx: vector of width of each box, used for stress calculations

    (unit: m, type: array of ints)

  : dz: vector of thickness of each box

    (unit: m, type: float)

  : z: vector of edge locations of each box (value is the top of the box)

    (unit: m, type: float)

  : dt: number of seconds per time step

    (unit: seconds, type: float)

  : t: number of years per time step

    (unit: years, type: float)

  : modeltime: linearly spaced time vector from indicated start year to indicated end year

    (unit: years, type: array of floats)

  : years: total number of years in the model run

    (unit: years, type: float)

  : stp: total number of steps in the model run

    (unit: number of steps, type: int)

  : T_mean: interpolated temperature vector based on the model time and the initial user temperature data

    (unit: ???, type: array of floats)

  : Ts: interpolated temperature vector based on the model time & the initial user temperature data

    may have a seasonal signal imposed depending on number of years per time step (< 1) (unit: ???, type: array of floats)

  : bdot: bdot is meters of ice equivalent/year. multiply by 0.917 for W.E. or 917.0 for kg/year

    (unit: ???, type: )

  : bdotSec: accumulation rate vector at each time step

    (unit: ???, type: array of floats)

  : rhos0: surface accumulate rate vector

    (unit: ???, type: array of floats)

  Returns D_surf

    diffusivity tracker (unit: ???, type: array of floats)

  `time_evolve`()

    Evolve the spatial grid, time grid, accumulation rate, age, density, mass, stress, and temperature through time based on the user specified number of timesteps in the model run. Updates the firn density using a user specified