/////////////////////////////////////////////////////////////////////////////////////// /// \file eceinput.h /// \brief Input module copied from demoinput.h for EC-Earth data (ecev3). Paul Miller /// /// \author Joe Siltberg /// $Date: 2018-02-02 18:01:35 +0100 (ven, 02 fév 2018) $ /// /////////////////////////////////////////////////////////////////////////////////////// #ifndef LPJ_GUESS_ECEINPUT_H #define LPJ_GUESS_ECEINPUT_H #include "guess.h" #include "inputmodule.h" #include #include "gutil.h" #include "externalinput.h" /// An input module for EC-Earth /** This input module will read and provide LULCC, crop and management info for EC-Earth runs * * \see InputModule for more documentation about writing input modules. */ class EceInput : public InputModule { public: /// Constructor /** Declares the instruction file parameters used by the input module. */ EceInput(); /// Destructor, cleans up used resources ~EceInput(); /// Reads in gridlist and initialises the input module /** Gets called after the instruction file has been read */ void init(); /// See base class for documentation about this function's responsibilities bool getgridcell(Gridcell& gridcell); /// See base class for documentation about this function's responsibilities bool getclimate(Gridcell& gridcell); /// See base class for documentation about this function's responsibilities void getlandcover(Gridcell& gridcell); /// Obtains land management data for one day void getmanagement(Gridcell& gridcell) {management_input.getmanagement(gridcell, landcover_input);} private: /// Type for storing grid cell longitude, latitude and description text struct Coord { int id; float lon; float lat; // xtring descrip; }; /// Land cover input module LandcoverInput landcover_input; /// Management input module ManagementInput management_input; /// Help function to readenv, reads in 12 monthly values from a text file bool read_from_file(Coord coord, xtring fname, const char* format, double monthly[12], bool soil = false); /// Reads in environmental data for a location bool readenv(Coord coord, long& seed); /// number of simulation years to run after spinup int nyear; /// A list of Coord objects containing coordinates of the grid cells to simulate ListArray_id gridlist; /// Flag for getgridcell(). True indicates that the first gridcell has not been read yet by getgridcell() bool first_call; // Timers for keeping track of progress through the simulation Timer tprogress,tmute; static const int MUTESEC=20; // minimum number of sec to wait between progress messages /* // ecev3 - not needed // Daily temperature, precipitation and sunshine for one year double dtemp[Date::MAX_YEAR_LENGTH]; double dprec[Date::MAX_YEAR_LENGTH]; double dsun[Date::MAX_YEAR_LENGTH]; // bvoc // Daily diurnal temperature range for one year double ddtr[Date::MAX_YEAR_LENGTH]; /// atmospheric CO2 concentration (ppmv) (read from ins file) double co2; /// atmospheric nitrogen deposition (kgN/yr/ha) (read from ins file) double ndep; */ }; #endif // LPJ_GUESS_ECEINPUT_H