Subversion Repositories public iLand

Rev

Rev 1217 | Rev 1220 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/********************************************************************************************
**    iLand - an individual based forest landscape and disturbance model
**    http://iland.boku.ac.at
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
**
**    This program is free software: you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation, either version 3 of the License, or
**    (at your option) any later version.
**
**    This program is distributed in the hope that it will be useful,
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**    GNU General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
********************************************************************************************/


#include "windout.h"

WindOut::WindOut()
{
    mWM = 0;
    setName("Wind disturbance module output", "wind");
    setDescription("Wind related output generated by event (typically per year). "\
                   "The outputs are created after each year (or spread event) and contain information about bark beetle generations, spread and damage for the total landscape.\n " \
                   "For spatially explicit outputs, see also the script functions for extracting gridded data.");
    columns() << OutputColumn::year()
              << OutputColumn("iterations", "Number of iterations of the storm event. Translate to duration by multiplying with 'durationPerIteration'.", OutInteger)
              << OutputColumn("windspeed_ms", "Wind speed of the event in m/s (note that windspeed varies with topography and between interations).", OutDouble)
              << OutputColumn("direction", "Main wind direction of the event in degrees (0°: north, 90°: east, 180°: south, 270°: west).", OutDouble)
              << OutputColumn("area_ha", "Total area affected (sum of area of pixels with affected trees)", OutDouble)
              << OutputColumn("killedTrees", "total number of trees that were killed in the event.", OutDouble)
              << OutputColumn("killedBasalArea", "Total Basal Area (m2) of killed during the event.", OutDouble)
              << OutputColumn("killedVolume", "Sum of tree volume (m3) killed during the event.", OutDouble);


}

WindOut::~WindOut()
{

}

void WindOut::exec()
{
    if (!mWM)
        return;

    const double area_factor = 0.01; // area in ha of one pixel
    *this << currentYear();
    *this << mWM->mCurrentIteration << mWM->mWindSpeed << GRAD(mWM->mWindDirection) << mWM->mPixelAffected*area_factor;
    *this << mWM->mTreesKilled << mWM->mTotalKilledBasalArea << mWM->mTotalKilledVolume;

    //qDebug() << "windout" << mWM->mTotalKilledBasalArea;

    writeRow();

}

void WindOut::setup()
{

}