miscoutput.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. ///////////////////////////////////////////////////////////////////////////////////////
  2. /// \file cropoutput.h
  3. /// \brief Output module for the land use and management information
  4. ///
  5. /// \author Joe Siltberg
  6. /// $Date: 2020-06-12 17:25:52 +0200 (ven, 12 jun 2020) $
  7. ///
  8. ///////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef LPJ_GUESS_MISC_OUTPUT_H
  10. #define LPJ_GUESS_MISC_OUTPUT_H
  11. #include "guess.h"
  12. #include "outputmodule.h"
  13. #include "outputchannel.h"
  14. #include "gutil.h"
  15. namespace GuessOutput {
  16. // Definitions for separate output files per NATURAL and FOREST stand (when
  17. // instruction file parameter printseparatestands == true, printseparatestands
  18. // is set to false in LandcoverInput::init() when input land cover
  19. // fraction data file has data for > 50 gridcells)
  20. /// Output module for the most commonly needed output files
  21. class MiscOutput : public OutputModule {
  22. public:
  23. MiscOutput();
  24. ~MiscOutput();
  25. // implemented functions inherited from OutputModule
  26. // (see documentation in OutputModule)
  27. void init();
  28. void outannual(Gridcell& gridcell);
  29. void outdaily(Gridcell& gridcell);
  30. private:
  31. /// Upper limit for files in multiple stand printout
  32. static const int MAXNUMBER_STANDS = 1000;
  33. /// Upper limit for files in multiple pft printout
  34. static const int MAXNUMBER_PFTS = 100;
  35. /// Upper limit for files in multiple soil layer printout
  36. static const int MAXNUMBER_LYRS = 20;
  37. /// Printout of first stand from first historic year
  38. static const bool PRINTFIRSTSTANDFROM1901 = true;
  39. /// Defines all output tables
  40. void openlocalfiles(Gridcell& gridcell);
  41. void define_output_tables();
  42. void define_cmip6_and_crescendo_output_tables();
  43. void closelocalfiles(Gridcell& gridcell);
  44. // Output file names ...
  45. xtring file_yield, file_yield1, file_yield2, file_sdate1, file_sdate2,
  46. file_hdate1, file_hdate2, file_lgp, file_phu, file_fphu, file_fhi,
  47. file_irrigation, file_seasonality, file_mco2, file_cflux_cropland,
  48. file_cflux_pasture, file_cflux_natural, file_cflux_forest,
  49. file_cpool_cropland, file_cpool_pasture, file_cpool_natural,
  50. file_cpool_forest, file_nflux_cropland, file_nflux_pasture,
  51. file_nflux_natural, file_nflux_forest, file_npool_cropland,
  52. file_npool_pasture, file_npool_natural, file_npool_forest,
  53. file_anpp_cropland, file_anpp_pasture, file_anpp_natural,
  54. file_anpp_forest, file_cmass_cropland, file_cmass_pasture,
  55. file_cmass_natural, file_cmass_forest, file_dens_natural,
  56. file_dens_forest;
  57. // daily
  58. xtring file_daily_lai, file_daily_npp, file_daily_nmass, file_daily_cmass,
  59. file_daily_cton, file_daily_ndemand, file_daily_cmass_leaf,
  60. file_daily_nmass_leaf, file_daily_cmass_root, file_daily_nmass_root,
  61. file_daily_cmass_stem, file_daily_nmass_stem,
  62. file_daily_cmass_storage, file_daily_nmass_storage,
  63. file_daily_n_input_soil, file_daily_avail_nmass_soil,
  64. file_daily_upper_wcont, file_daily_lower_wcont,
  65. file_daily_irrigation, file_daily_temp, file_daily_prec,
  66. file_daily_rad, file_daily_cmass_dead_leaf,
  67. file_daily_nmass_dead_leaf, file_daily_fphu, file_daily_nminleach,
  68. file_daily_norgleach, file_daily_nuptake, file_daily_ds,
  69. file_daily_stem, file_daily_leaf, file_daily_root,
  70. file_daily_storage;
  71. // CMIP6
  72. xtring file_baresoilFrac_yearly, file_residualFrac_yearly, file_cLitter_yearly, file_cLitterLut_yearly,
  73. file_cProduct_yearly, file_cProductLut_yearly, file_cropFrac_yearly,
  74. file_cSoil_yearly, file_cSoilLut_yearly, file_cVeg_yearly, file_cVegLut_yearly,
  75. file_fracInLut_yearly, file_fracLut_yearly, file_fracOutLut_yearly,
  76. file_grassFrac_yearly, file_pastureFrac_yearly, file_shrubFrac_yearly, file_treeFrac_yearly,
  77. file_vegFrac_yearly, file_burntFractionAll_yearly, file_burntFractionAll_monthly,
  78. file_cLand_monthly, file_cLand1_monthly, file_cLand_yearly, file_cFlux_yearly, file_cLitterCwd_monthly, file_cLitterSubSurf_monthly,
  79. file_cLitterSurf_monthly, file_cOther_monthly, file_cropFracC3_monthly,
  80. file_cropFracC4_monthly, file_cSoil_monthly, file_cStem_monthly,
  81. file_cTotFireLut_monthly, file_cWood_monthly, file_evspsblpot_monthly,
  82. file_fAnthDisturb_monthly, file_fBNF_monthly, file_fCLandToOcean_monthly,
  83. file_fDeforestToAtmos_monthly, file_fDeforestToProduct_monthly,
  84. file_fFireAll_monthly, file_fFireNat_monthly, file_fHarvestToAtmos_monthly,
  85. file_fLitterFire_monthly, file_fLuc_monthly,
  86. file_fLulccAtmLut_monthly, file_fLulccProductLut_monthly,
  87. file_fLulccResidueLut_monthly, file_fNAnthDisturb_monthly,
  88. file_fNdep_monthly, file_fNfert_monthly, file_fNgas_monthly,
  89. file_fNgasFire_monthly, file_fNgasNonFire_monthly, file_fNLandToOcean_monthly,
  90. file_fNleach_monthly, file_fNLitterSoil_monthly, file_fNloss_monthly,
  91. file_fNnetmin_monthly, file_fNProduct_monthly, file_fNup_monthly,
  92. file_fNVegLitter_monthly, file_fProductDecomp_monthly,
  93. file_fProductDecompLut_monthly, file_fracLut_monthly, file_fVegFire_monthly,
  94. file_gppGrass_monthly, file_gppLut_monthly, file_gppTree_monthly,
  95. file_grassFracC3_monthly, file_grassFracC4_monthly, file_irrLut_monthly,
  96. file_laiLut_monthly, file_mrroLut_monthly, file_mrsll_monthly,
  97. file_mrsol_monthly, file_mrsoLut_monthly, file_mrsosLut_monthly,
  98. file_necbLut_monthly, file_nep_monthly, file_netAtmosLandCO2Flux_monthly,
  99. file_nLand_monthly, file_nLeaf_monthly, file_nLitter_monthly,
  100. file_nLitterCwd_monthly, file_nLitterSubSurf_monthly, file_nLitterSurf_monthly,
  101. file_nMineral_monthly, file_nMineralNH4_monthly, file_nMineralNO3_monthly,
  102. file_fN2O_monthly, file_fNOx_monthly,
  103. file_nOther_monthly, file_nppGrass_monthly, file_nppLut_monthly,
  104. file_nppTree_monthly, file_nProduct_monthly, file_nRoot_monthly,
  105. file_nSoil_monthly, file_nStem_monthly, file_nwdFracLut_monthly,
  106. file_nVeg_monthly, file_pastureFracC3_monthly, file_pastureFracC4_monthly,
  107. file_prCrop_monthly, file_raGrass_monthly, file_raLeaf_monthly,
  108. file_raLut_monthly, file_raOther_monthly, file_raRoot_monthly,
  109. file_raStem_monthly, file_raTree_monthly, file_rhLitter_monthly,
  110. file_rhLut_monthly, file_rhSoil_monthly, file_treeFracBdlDcd_monthly,
  111. file_treeFracBdlEvg_monthly, file_treeFracNdlDcd_monthly,
  112. file_treeFracNdlEvg_monthly, file_vegFrac_monthly, file_vegHeightTree_monthly,
  113. file_baresoilFrac_monthly, file_cCwd_monthly, file_cLeaf_monthly,
  114. file_cLitter_monthly, file_cLitterAbove_monthly, file_cLitterBelow_monthly,
  115. file_cProduct_monthly, file_cRoot_monthly, file_cropFrac_monthly,
  116. file_cSoilFast_monthly, file_cSoilMedium_monthly, file_cSoilSlow_monthly,
  117. file_cVeg_monthly, file_fCO2antt_monthly, file_evspsblsoi_monthly,
  118. file_fCO2nat_monthly, file_evspsblveg_monthly, file_evspsbl_monthly, file_fFire_monthly,
  119. file_fGrazing_monthly, file_fHarvest_monthly, file_fLitterSoil_monthly,
  120. file_fVegLitter_monthly, file_fVegOther_monthly, file_gpp_monthly,
  121. file_grassFrac_monthly, file_lai_monthly, file_landCoverFrac_monthly,
  122. file_mrro_monthly, file_mrros_monthly, file_mrso_monthly, file_mrsos_monthly,
  123. file_nbp_monthly, file_npp_monthly, file_pastureFrac_monthly,
  124. file_prveg_monthly, file_ra_monthly, file_residualFrac_monthly,
  125. file_rGrowth_monthly, file_rh_monthly, file_rMaint_monthly,
  126. file_shrubFrac_monthly, file_tran_monthly, file_treeFrac_monthly,
  127. file_tsl_monthly, file_ec_daily, file_et_daily, file_evspsblpot_daily,
  128. file_lai_daily, file_mrsll_daily, file_mrso_daily, file_mrsol_daily,
  129. file_mrsos_daily, file_mrro_daily, file_prCrop_daily, file_tran_daily,
  130. file_tsl_daily, file_prveg_daily;
  131. // Output tables
  132. Table out_yield, out_yield1, out_yield2, out_sdate1, out_sdate2,
  133. out_hdate1, out_hdate2, out_lgp, out_phu, out_fhi, out_fphu,
  134. out_irrigation, out_seasonality, out_mco2, out_cflux_cropland,
  135. out_cflux_pasture, out_cflux_natural, out_cflux_forest,
  136. out_cpool_cropland, out_cpool_pasture, out_cpool_natural,
  137. out_cpool_forest, out_nflux_cropland, out_nflux_pasture,
  138. out_nflux_natural, out_nflux_forest, out_npool_cropland,
  139. out_npool_pasture, out_npool_natural, out_npool_forest,
  140. out_anpp_cropland, out_anpp_pasture, out_anpp_natural,
  141. out_anpp_forest, out_cmass_cropland, out_cmass_pasture,
  142. out_cmass_natural, out_cmass_forest, out_dens_natural,
  143. out_dens_forest;
  144. Table out_anpp_stand_natural[MAXNUMBER_STANDS];
  145. Table out_cmass_stand_natural[MAXNUMBER_STANDS];
  146. Table out_anpp_stand_forest[MAXNUMBER_STANDS];
  147. Table out_cmass_stand_forest[MAXNUMBER_STANDS];
  148. // IFS input
  149. Table ifs_input;
  150. // CRESCENDO tables
  151. Table cresc_tas, cresc_pr, cresc_irri, cresc_rsds, cresc_mrso, cresc_mrro,
  152. cresc_evapotrans, cresc_evspsblveg, cresc_evspsblsoi, cresc_tran, cresc_snd,
  153. cresc_cVeg, cresc_nVeg, cresc_cLitter, cresc_nLitter, cresc_cSoil, cresc_nSoil,
  154. cresc_cProduct, cresc_nProduct, cresc_gpp, cresc_npp, cresc_rh, cresc_ra,
  155. cresc_fFire, cresc_fLuc, cresc_nbp, cresc_fReprEst, cresc_fSeed, cresc_fHarv,
  156. cresc_harvcrop, cresc_harvgraz, cresc_prod, cresc_fNdep, cresc_fBNF, cresc_fNup,
  157. cresc_fNnetmin, cresc_fNleach, cresc_fCleach, cresc_fNgas, cresc_fNgasFire,
  158. cresc_fN2O, cresc_fNOx, cresc_fNloss, cresc_fVegLitter, cresc_fNVegLitter,
  159. cresc_fLitterSoil, cresc_fNLitterSoil, cresc_cLeaf, cresc_cRoot, cresc_cWood,
  160. cresc_cCwd, cresc_nLeaf, cresc_nRoot, cresc_nWood, cresc_nCwd, cresc_burntArea,
  161. cresc_dlai, cresc_tsl, cresc_msl, cresc_lai, cresc_lcf, cresc_fapar, cresc_vH, cresc_tD,
  162. cresc_cton_veg;
  163. #ifdef CRESCENDO_FACE
  164. // CRESCENDO FACE daily tables
  165. Table face_co2, face_ppt, face_ndep, face_par, face_at, face_st, face_sw, face_et, face_t,
  166. face_es, face_ec, face_ro, face_drain, face_nep, face_gpp, face_npp, face_reco, face_rauto,
  167. face_rleaf, face_rwood, face_rroot, face_rgrow, face_rhet, face_rsoil, face_rother, face_cl,
  168. face_cw, face_cfr, face_tnc, face_cflit, face_cflita, face_cflitb, face_cclitb, face_csoil,
  169. face_gl, face_gw, face_gr, face_cllfall, face_crlin, face_cwin, face_lai, face_lma, face_ncon,
  170. face_ncan, face_nwood, face_nfr, face_nstor, face_nlit, face_nrlit, face_ndw, face_nsoil,
  171. face_npoolm, face_npoolo, face_nfix, face_nlitin, face_nwlin, face_nrlin, face_nup, face_ngmin,
  172. face_nmin, face_nvol, face_nleach, face_ngl, face_ngw, face_ngr;
  173. #endif
  174. // CMIP6 tables
  175. Table cmip6_acLitter, cmip6_acProduct, cmip6_acSoil, cmip6_acVeg,
  176. cmip6_acropFrac, cmip6_apastureFrac, cmip6_agrassFrac, cmip6_ashrubFrac,
  177. cmip6_atreeFrac, cmip6_avegFrac, cmip6_abaresoilFrac, cmip6_aresidualFrac,
  178. cmip6_aburntFractionAll_yearly, cmip6_aburntFractionAll_monthly,
  179. cmip6_treeFrac, cmip6_grassFrac, cmip6_shrubFrac, cmip6_cropFrac, cmip6_pastureFrac, cmip6_vegFrac,
  180. cmip6_baresoilFrac, cmip6_residualFrac, cmip6_landCoverFrac,
  181. cmip6_cropFracC3, cmip6_cropFracC4, cmip6_grassFracC3, cmip6_grassFracC4,
  182. cmip6_pastureFracC3, cmip6_pastureFracC4, cmip6_cVeg, cmip6_cLeaf,
  183. cmip6_cRoot, cmip6_cStem, cmip6_cOther, cmip6_nVeg, cmip6_nLeaf,
  184. cmip6_nRoot, cmip6_nStem, cmip6_nOther, cmip6_cLitter, cmip6_cLitterCwd,
  185. cmip6_cLitterSurf, cmip6_cLitterSubSurf, cmip6_nLitter, cmip6_nLitterCwd,
  186. cmip6_nLitterSurf, cmip6_nLitterSubSurf, cmip6_cSoil, cmip6_nSoil,
  187. cmip6_cSoilFast, cmip6_cSoilMedium, cmip6_cSoilSlow, cmip6_cWood,
  188. cmip6_cCwd, cmip6_cLitterAbove, cmip6_cLitterBelow, cmip6_cProduct,
  189. cmip6_cLand, cmip6_cLand1, cmip6_cyLand, cmip6_cyFlux, cmip6_nProduct, cmip6_nLand, cmip6_nMinNH4, cmip6_nMinNO3,
  190. cmip6_nMineral, cmip6_fN2O, cmip6_fNOx, cmip6_nbp, cmip6_netAtmosLandCO2Flux, cmip6_nep,
  191. cmip6_gpp, cmip6_gppGrass, cmip6_gppTree, cmip6_npp, cmip6_nppGrass,
  192. cmip6_nppTree, cmip6_ra, cmip6_raLeaf, cmip6_raRoot, cmip6_raStem,
  193. cmip6_raOther, cmip6_rGrowth, cmip6_rMaint, cmip6_raGrass, cmip6_raTree,
  194. cmip6_rh, cmip6_rhSoil, cmip6_rhLitter, cmip6_fVegLitter, cmip6_fVegOther,
  195. cmip6_fNVegLitter, cmip6_fLitterSoil, cmip6_fNLitterSoil, cmip6_fFireNat,
  196. cmip6_fFire, cmip6_fVegFire, cmip6_fLitterFire, cmip6_fFireAll,
  197. cmip6_fCLandToOcean, cmip6_fNLandToOcean, cmip6_fAnthDisturb,
  198. cmip6_fNAnthDisturb, cmip6_fHarvest, cmip6_fHarvestToAtmos,
  199. cmip6_fDeforestToAtmos, cmip6_fDeforestToProduct,
  200. cmip6_fProductDecomp, cmip6_fNProduct, cmip6_fGrazing, cmip6_fco2antt,
  201. cmip6_fco2nat, cmip6_fNloss, cmip6_fBNF, cmip6_fNfert, cmip6_fNup,
  202. cmip6_fNnetmin, cmip6_fNleach, cmip6_fNgas, cmip6_fNdep, cmip6_fNgasFire,
  203. cmip6_fNgasNonFire, cmip6_dlai, cmip6_lai, cmip6_mrso, cmip6_vegHeightTree,
  204. cmip6_tsl, cmip6_dtsl, cmip6_mrsll, cmip6_dmrsll, cmip6_mrsos, cmip6_mrsol,
  205. cmip6_dmrso, cmip6_dmrsol, cmip6_dmrsos, cmip6_dmrro, cmip6_evspsblveg, cmip6_evspsbl,
  206. cmip6_prveg, cmip6_dprveg, cmip6_dec, cmip6_evspsblsoi, cmip6_evspsblpot, cmip6_devspsblpot,
  207. cmip6_tran, cmip6_dtran, cmip6_det, cmip6_mrro, cmip6_mrros, cmip6_dprCrop,
  208. cmip6_prCrop, cmip6_treeFracBdlDcd, cmip6_treeFracBdlEvg, cmip6_treeFracNdlDcd,
  209. cmip6_treeFracNdlEvg, cmip6_fluc, cmip6_cTotFireLut, cmip6_fLulccAtmLut,
  210. cmip6_fLulccProductLut, cmip6_fLulccResidueLut, cmip6_fProductDecompLut,
  211. cmip6_mfracLut, cmip6_fracLut, cmip6_fracOutLut, cmip6_fracInLut, cmip6_gppLut,
  212. cmip6_irrLut, cmip6_laiLut, cmip6_mrroLut, cmip6_mrsoLut, cmip6_mrsosLut,
  213. cmip6_necbLut, cmip6_nppLut, cmip6_nwdFracLut, cmip6_raLut, cmip6_rhLut,
  214. cmip6_cSoilLut, cmip6_cVegLut, cmip6_cLitterLut, cmip6_cProductLut;
  215. //daily
  216. Table out_daily_lai, out_daily_npp, out_daily_cton, out_daily_nmass,
  217. out_daily_cmass, out_daily_ndemand, out_daily_cmass_leaf,
  218. out_daily_nmass_leaf, out_daily_cmass_root, out_daily_nmass_root,
  219. out_daily_cmass_stem, out_daily_nmass_stem, out_daily_cmass_storage,
  220. out_daily_nmass_storage, out_daily_n_input_soil,
  221. out_daily_cmass_dead_leaf, out_daily_nmass_dead_leaf, out_daily_fphu,
  222. out_daily_avail_nmass_soil, out_daily_upper_wcont,
  223. out_daily_lower_wcont, out_daily_irrigation, out_daily_temp,
  224. out_daily_prec, out_daily_rad, out_daily_nminleach,
  225. out_daily_norgleach, out_daily_nuptake, out_daily_ds, out_daily_stem,
  226. out_daily_leaf, out_daily_root, out_daily_storage;
  227. Table out_mlambda;
  228. };
  229. }
  230. #endif // LPJ_GUESS_MISC_OUTPUT_H