Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • foresee/4C
  • gutsch/4C
2 results
Show changes
Showing
with 4842 additions and 0 deletions
/*****************************************************************************\
* *
* prsht.h - - Interface for the Windows Property Sheet Pages *
* *
* Version 1.0 *
* *
* Copyright 1991-1998, Microsoft Corp. All rights reserved. *
* *
\*****************************************************************************/
#ifndef _PRSHT_H_
#define _PRSHT_H_
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#else
#if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
#error _WIN32_IE setting conflicts with _WIN32_WINNT setting
#endif
#endif
//
// Define API decoration for direct importing of DLL references.
//
#ifndef WINCOMMCTRLAPI
#if !defined(_COMCTL32_) && defined(_WIN32)
#define WINCOMMCTRLAPI DECLSPEC_IMPORT
#else
#define WINCOMMCTRLAPI
#endif
#endif // WINCOMMCTRLAPI
#ifndef CCSIZEOF_STRUCT
#define CCSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
#endif
//
// For compilers that don't support nameless unions
//
#ifndef DUMMYUNIONNAME
#ifdef NONAMELESSUNION
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME2 u2
#define DUMMYUNIONNAME3 u3
#define DUMMYUNIONNAME4 u4
#define DUMMYUNIONNAME5 u5
#else
#define DUMMYUNIONNAME
#define DUMMYUNIONNAME2
#define DUMMYUNIONNAME3
#define DUMMYUNIONNAME4
#define DUMMYUNIONNAME5
#endif
#endif // DUMMYUNIONNAME
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SNDMSG
#ifdef __cplusplus
#ifndef _MAC
#define SNDMSG ::SendMessage
#else
#define SNDMSG ::AfxSendMessage
#endif
#else
#ifndef _MAC
#define SNDMSG SendMessage
#else
#define SNDMSG AfxSendMessage
#endif
#endif
#endif // ifndef SNDMSG
#define MAXPROPPAGES 100
struct _PSP;
typedef struct _PSP FAR* HPROPSHEETPAGE;
#ifndef MIDL_PASS
struct _PROPSHEETPAGEA;
struct _PROPSHEETPAGEW;
#endif
typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKA)(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEA FAR *ppsp);
typedef UINT (CALLBACK FAR * LPFNPSPCALLBACKW)(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEW FAR *ppsp);
#ifdef UNICODE
#define LPFNPSPCALLBACK LPFNPSPCALLBACKW
#else
#define LPFNPSPCALLBACK LPFNPSPCALLBACKA
#endif
#define PSP_DEFAULT 0x00000000
#define PSP_DLGINDIRECT 0x00000001
#define PSP_USEHICON 0x00000002
#define PSP_USEICONID 0x00000004
#define PSP_USETITLE 0x00000008
#define PSP_RTLREADING 0x00000010
#define PSP_HASHELP 0x00000020
#define PSP_USEREFPARENT 0x00000040
#define PSP_USECALLBACK 0x00000080
#define PSP_PREMATURE 0x00000400
#if (_WIN32_IE >= 0x0400)
//----- New flags for wizard97 --------------
#define PSP_HIDEHEADER 0x00000800
#define PSP_USEHEADERTITLE 0x00001000
#define PSP_USEHEADERSUBTITLE 0x00002000
//-------------------------------------------
#endif
#define PSPCB_RELEASE 1
#define PSPCB_CREATE 2
#define PROPSHEETPAGEA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pcRefParent)
#define PROPSHEETPAGEW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pcRefParent)
typedef struct _PROPSHEETPAGEA {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
LPCSTR pszTemplate;
#ifdef _WIN32
LPCDLGTEMPLATE pResource;
#else
const VOID FAR *pResource;
#endif
} DUMMYUNIONNAME;
union {
HICON hIcon;
LPCSTR pszIcon;
} DUMMYUNIONNAME2;
LPCSTR pszTitle;
DLGPROC pfnDlgProc;
LPARAM lParam;
LPFNPSPCALLBACKA pfnCallback;
UINT FAR * pcRefParent;
#if (_WIN32_IE >= 0x0400)
LPCSTR pszHeaderTitle; // this is displayed in the header
LPCSTR pszHeaderSubTitle; //
#endif
} PROPSHEETPAGEA, FAR *LPPROPSHEETPAGEA;
typedef const PROPSHEETPAGEA FAR *LPCPROPSHEETPAGEA;
typedef struct _PROPSHEETPAGEW {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
LPCWSTR pszTemplate;
#ifdef _WIN32
LPCDLGTEMPLATE pResource;
#else
const VOID FAR *pResource;
#endif
}DUMMYUNIONNAME;
union {
HICON hIcon;
LPCWSTR pszIcon;
}DUMMYUNIONNAME2;
LPCWSTR pszTitle;
DLGPROC pfnDlgProc;
LPARAM lParam;
LPFNPSPCALLBACKW pfnCallback;
UINT FAR * pcRefParent;
#if (_WIN32_IE >= 0x0400)
LPCWSTR pszHeaderTitle; // this is displayed in the header
LPCWSTR pszHeaderSubTitle; ///
#endif
} PROPSHEETPAGEW, FAR *LPPROPSHEETPAGEW;
typedef const PROPSHEETPAGEW FAR *LPCPROPSHEETPAGEW;
#ifdef UNICODE
#define PROPSHEETPAGE PROPSHEETPAGEW
#define LPPROPSHEETPAGE LPPROPSHEETPAGEW
#define LPCPROPSHEETPAGE LPCPROPSHEETPAGEW
#define PROPSHEETPAGE_V1_SIZE PROPSHEETPAGEW_V1_SIZE
#else
#define PROPSHEETPAGE PROPSHEETPAGEA
#define LPPROPSHEETPAGE LPPROPSHEETPAGEA
#define LPCPROPSHEETPAGE LPCPROPSHEETPAGEA
#define PROPSHEETPAGE_V1_SIZE PROPSHEETPAGEA_V1_SIZE
#endif
#define PSH_DEFAULT 0x00000000
#define PSH_PROPTITLE 0x00000001
#define PSH_USEHICON 0x00000002
#define PSH_USEICONID 0x00000004
#define PSH_PROPSHEETPAGE 0x00000008
#define PSH_WIZARDHASFINISH 0x00000010
#define PSH_WIZARD 0x00000020
#define PSH_USEPSTARTPAGE 0x00000040
#define PSH_NOAPPLYNOW 0x00000080
#define PSH_USECALLBACK 0x00000100
#define PSH_HASHELP 0x00000200
#define PSH_MODELESS 0x00000400
#define PSH_RTLREADING 0x00000800
#define PSH_WIZARDCONTEXTHELP 0x00001000
#if (_WIN32_IE >= 0x0400)
//----- New flags for wizard97 -----------
#define PSH_WIZARD97 0x00002000
// 0x00004000 was not used by any previous release
#define PSH_WATERMARK 0x00008000
#define PSH_USEHBMWATERMARK 0x00010000 // user pass in a hbmWatermark instead of pszbmWatermark
#define PSH_USEHPLWATERMARK 0x00020000 //
#define PSH_STRETCHWATERMARK 0x00040000 // stretchwatermark also applies for the header
#define PSH_HEADER 0x00080000
#define PSH_USEHBMHEADER 0x00100000
#define PSH_USEPAGELANG 0x00200000 // use frame dialog template matched to page
//----------------------------------------
#endif
typedef int (CALLBACK *PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM);
#define PROPSHEETHEADERA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERA, pfnCallback)
#define PROPSHEETHEADERW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERW, pfnCallback)
typedef struct _PROPSHEETHEADERA {
DWORD dwSize;
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
HICON hIcon;
LPCSTR pszIcon;
}DUMMYUNIONNAME;
LPCSTR pszCaption;
UINT nPages;
union {
UINT nStartPage;
LPCSTR pStartPage;
}DUMMYUNIONNAME2;
union {
LPCPROPSHEETPAGEA ppsp;
HPROPSHEETPAGE FAR *phpage;
}DUMMYUNIONNAME3;
PFNPROPSHEETCALLBACK pfnCallback;
#if (_WIN32_IE >= 0x0400)
union {
HBITMAP hbmWatermark;
LPCSTR pszbmWatermark;
} DUMMYUNIONNAME4;
HPALETTE hplWatermark;
union {
HBITMAP hbmHeader; // Header bitmap shares the palette with watermark
LPCSTR pszbmHeader;
} DUMMYUNIONNAME5;
#endif
} PROPSHEETHEADERA, FAR *LPPROPSHEETHEADERA;
typedef const PROPSHEETHEADERA FAR *LPCPROPSHEETHEADERA;
typedef struct _PROPSHEETHEADERW {
DWORD dwSize;
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
HICON hIcon;
LPCWSTR pszIcon;
}DUMMYUNIONNAME;
LPCWSTR pszCaption;
UINT nPages;
union {
UINT nStartPage;
LPCWSTR pStartPage;
}DUMMYUNIONNAME2;
union {
LPCPROPSHEETPAGEW ppsp;
HPROPSHEETPAGE FAR *phpage;
}DUMMYUNIONNAME3;
PFNPROPSHEETCALLBACK pfnCallback;
#if (_WIN32_IE >= 0x0400)
union {
HBITMAP hbmWatermark;
LPCWSTR pszbmWatermark;
} DUMMYUNIONNAME4;
HPALETTE hplWatermark;
union {
HBITMAP hbmHeader;
LPCWSTR pszbmHeader;
} DUMMYUNIONNAME5;
#endif
} PROPSHEETHEADERW, FAR *LPPROPSHEETHEADERW;
typedef const PROPSHEETHEADERW FAR *LPCPROPSHEETHEADERW;
#ifdef UNICODE
#define PROPSHEETHEADER PROPSHEETHEADERW
#define LPPROPSHEETHEADER LPPROPSHEETHEADERW
#define LPCPROPSHEETHEADER LPCPROPSHEETHEADERW
#define PROPSHEETHEADER_V1_SIZE PROPSHEETHEADERW_V1_SIZE
#else
#define PROPSHEETHEADER PROPSHEETHEADERA
#define LPPROPSHEETHEADER LPPROPSHEETHEADERA
#define LPCPROPSHEETHEADER LPCPROPSHEETHEADERA
#define PROPSHEETHEADER_V1_SIZE PROPSHEETHEADERA_V1_SIZE
#endif
#define PSCB_INITIALIZED 1
#define PSCB_PRECREATE 2
WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
WINCOMMCTRLAPI HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
WINCOMMCTRLAPI BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE);
WINCOMMCTRLAPI int WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
WINCOMMCTRLAPI int WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
#ifdef UNICODE
#define CreatePropertySheetPage CreatePropertySheetPageW
#define PropertySheet PropertySheetW
#else
#define CreatePropertySheetPage CreatePropertySheetPageA
#define PropertySheet PropertySheetA
#endif
typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
typedef struct _PSHNOTIFY
{
NMHDR hdr;
LPARAM lParam;
} PSHNOTIFY, FAR *LPPSHNOTIFY;
#define PSN_FIRST (0U-200U)
#define PSN_LAST (0U-299U)
#define PSN_SETACTIVE (PSN_FIRST-0)
#define PSN_KILLACTIVE (PSN_FIRST-1)
// #define PSN_VALIDATE (PSN_FIRST-1)
#define PSN_APPLY (PSN_FIRST-2)
#define PSN_RESET (PSN_FIRST-3)
// #define PSN_CANCEL (PSN_FIRST-3)
#define PSN_HELP (PSN_FIRST-5)
#define PSN_WIZBACK (PSN_FIRST-6)
#define PSN_WIZNEXT (PSN_FIRST-7)
#define PSN_WIZFINISH (PSN_FIRST-8)
#define PSN_QUERYCANCEL (PSN_FIRST-9)
#if (_WIN32_IE >= 0x0400)
#define PSN_GETOBJECT (PSN_FIRST-10)
#endif // 0x0400
#define PSNRET_NOERROR 0
#define PSNRET_INVALID 1
#define PSNRET_INVALID_NOCHANGEPAGE 2
#define PSM_SETCURSEL (WM_USER + 101)
#define PropSheet_SetCurSel(hDlg, hpage, index) \
SNDMSG(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
#define PSM_REMOVEPAGE (WM_USER + 102)
#define PropSheet_RemovePage(hDlg, index, hpage) \
SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
#define PSM_ADDPAGE (WM_USER + 103)
#define PropSheet_AddPage(hDlg, hpage) \
SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
#define PSM_CHANGED (WM_USER + 104)
#define PropSheet_Changed(hDlg, hwnd) \
SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
#define PSM_RESTARTWINDOWS (WM_USER + 105)
#define PropSheet_RestartWindows(hDlg) \
SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
#define PSM_REBOOTSYSTEM (WM_USER + 106)
#define PropSheet_RebootSystem(hDlg) \
SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
#define PSM_CANCELTOCLOSE (WM_USER + 107)
#define PropSheet_CancelToClose(hDlg) \
PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
#define PSM_QUERYSIBLINGS (WM_USER + 108)
#define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
#define PSM_UNCHANGED (WM_USER + 109)
#define PropSheet_UnChanged(hDlg, hwnd) \
SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
#define PSM_APPLY (WM_USER + 110)
#define PropSheet_Apply(hDlg) \
SNDMSG(hDlg, PSM_APPLY, 0, 0L)
#define PSM_SETTITLEA (WM_USER + 111)
#define PSM_SETTITLEW (WM_USER + 120)
#ifdef UNICODE
#define PSM_SETTITLE PSM_SETTITLEW
#else
#define PSM_SETTITLE PSM_SETTITLEA
#endif
#define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
#define PSM_SETWIZBUTTONS (WM_USER + 112)
#define PropSheet_SetWizButtons(hDlg, dwFlags) \
PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
#define PSWIZB_BACK 0x00000001
#define PSWIZB_NEXT 0x00000002
#define PSWIZB_FINISH 0x00000004
#define PSWIZB_DISABLEDFINISH 0x00000008
#define PSM_PRESSBUTTON (WM_USER + 113)
#define PropSheet_PressButton(hDlg, iButton) \
PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
#define PSBTN_BACK 0
#define PSBTN_NEXT 1
#define PSBTN_FINISH 2
#define PSBTN_OK 3
#define PSBTN_APPLYNOW 4
#define PSBTN_CANCEL 5
#define PSBTN_HELP 6
#define PSBTN_MAX 6
#define PSM_SETCURSELID (WM_USER + 114)
#define PropSheet_SetCurSelByID(hDlg, id) \
SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
#define PSM_SETFINISHTEXTA (WM_USER + 115)
#define PSM_SETFINISHTEXTW (WM_USER + 121)
#ifdef UNICODE
#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTW
#else
#define PSM_SETFINISHTEXT PSM_SETFINISHTEXTA
#endif
#define PropSheet_SetFinishText(hDlg, lpszText) \
SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
#define PSM_GETTABCONTROL (WM_USER + 116)
#define PropSheet_GetTabControl(hDlg) \
(HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
#define PSM_ISDIALOGMESSAGE (WM_USER + 117)
#define PropSheet_IsDialogMessage(hDlg, pMsg) \
(BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
#define PSM_GETCURRENTPAGEHWND (WM_USER + 118)
#define PropSheet_GetCurrentPageHwnd(hDlg) \
(HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
#define ID_PSRESTARTWINDOWS 0x2
#define ID_PSREBOOTSYSTEM (ID_PSRESTARTWINDOWS | 0x1)
#define WIZ_CXDLG 276
#define WIZ_CYDLG 140
#define WIZ_CXBMP 80
#define WIZ_BODYX 92
#define WIZ_BODYCX 184
#define PROP_SM_CXDLG 212
#define PROP_SM_CYDLG 188
#define PROP_MED_CXDLG 227
#define PROP_MED_CYDLG 215
#define PROP_LG_CXDLG 252
#define PROP_LG_CYDLG 218
#ifdef __cplusplus
}
#endif
#endif // _PRSHT_H_
/*++
Copyright 1995 - 1998 Microsoft Corporation
Module Name:
pshpack1.h
Abstract:
This file turns 1 byte packing of structures on. (That is, it disables
automatic alignment of structure fields.) An include file is needed
because various compilers do this in different ways. For Microsoft
compatible compilers, this files uses the push option to the pack pragma
so that the poppack.h include file can restore the previous packing
reliably.
The file poppack.h is the complement to this file.
--*/
#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(1)
#else
#pragma pack(1)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
/*++
Copyright 1995 - 1998 Microsoft Corporation
Module Name:
pshpack4.h
Abstract:
This file turns 4 byte packing of structures on. (That is, it disables
automatic alignment of structure fields.) An include file is needed
because various compilers do this in different ways. For Microsoft
compatible compilers, this files uses the push option to the pack pragma
so that the poppack.h include file can restore the previous packing
reliably.
The file poppack.h is the complement to this file.
--*/
#if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
#if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED)
#pragma warning(disable:4103)
#if !(defined( MIDL_PASS )) || defined( __midl )
#pragma pack(push)
#endif
#pragma pack(4)
#else
#pragma pack(4)
#endif
#endif // ! (defined(lint) || defined(_lint) || defined(RC_INVOKED))
/*
* RICHEDIT.H
*
* Purpose:
* RICHEDIT v2.0 public definitions. Note that there is additional
* functionality available for v2.0 that is not in the original
* Windows 95 release.
*
* Copyright (c) 1985-1996, Microsoft Corporation
*/
#ifndef _RICHEDIT_
#define _RICHEDIT_
#ifdef _WIN32
#include <pshpack4.h>
#elif !defined(RC_INVOKED)
#pragma pack(4)
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* To mimic older RichEdit behavior, simply set _RICHEDIT_VER to the appropriate value */
/* Version 1.0 0x0100 */
/* Version 2.0 0x0200 */
#ifndef _RICHEDIT_VER
#define _RICHEDIT_VER 0x0210
#endif
/*
* To make some structures which can be passed between 16 and 32 bit windows
* almost compatible, padding is introduced to the 16 bit versions of the
* structure.
*/
#ifdef _WIN32
# define _WPAD /##/
#else
# define _WPAD WORD
#endif
#define cchTextLimitDefault 32767
/* Richedit2.0 Window Class. */
#define RICHEDIT_CLASSA "RichEdit20A"
#define RICHEDIT_CLASS10A "RICHEDIT" // Richedit 1.0
#ifndef MACPORT
#define RICHEDIT_CLASSW L"RichEdit20W"
#else /*----------------------MACPORT */
#define RICHEDIT_CLASSW TEXT("RichEdit20W") /* MACPORT change */
#endif /* MACPORT */
#if (_RICHEDIT_VER >= 0x0200 )
#ifdef UNICODE
#define RICHEDIT_CLASS RICHEDIT_CLASSW
#else
#define RICHEDIT_CLASS RICHEDIT_CLASSA
#endif /* UNICODE */
#else
#define RICHEDIT_CLASS RICHEDIT_CLASS10A
#endif /* _RICHEDIT_VER >= 0x0200 */
/* RichEdit messages */
#ifndef WM_CONTEXTMENU
#define WM_CONTEXTMENU 0x007B
#endif
#ifndef WM_PRINTCLIENT
#define WM_PRINTCLIENT 0x0318
#endif
#ifndef EM_GETLIMITTEXT
#define EM_GETLIMITTEXT (WM_USER + 37)
#endif
#ifndef EM_POSFROMCHAR
#define EM_POSFROMCHAR (WM_USER + 38)
#define EM_CHARFROMPOS (WM_USER + 39)
#endif
#ifndef EM_SCROLLCARET
#define EM_SCROLLCARET (WM_USER + 49)
#endif
#define EM_CANPASTE (WM_USER + 50)
#define EM_DISPLAYBAND (WM_USER + 51)
#define EM_EXGETSEL (WM_USER + 52)
#define EM_EXLIMITTEXT (WM_USER + 53)
#define EM_EXLINEFROMCHAR (WM_USER + 54)
#define EM_EXSETSEL (WM_USER + 55)
#define EM_FINDTEXT (WM_USER + 56)
#define EM_FORMATRANGE (WM_USER + 57)
#define EM_GETCHARFORMAT (WM_USER + 58)
#define EM_GETEVENTMASK (WM_USER + 59)
#define EM_GETOLEINTERFACE (WM_USER + 60)
#define EM_GETPARAFORMAT (WM_USER + 61)
#define EM_GETSELTEXT (WM_USER + 62)
#define EM_HIDESELECTION (WM_USER + 63)
#define EM_PASTESPECIAL (WM_USER + 64)
#define EM_REQUESTRESIZE (WM_USER + 65)
#define EM_SELECTIONTYPE (WM_USER + 66)
#define EM_SETBKGNDCOLOR (WM_USER + 67)
#define EM_SETCHARFORMAT (WM_USER + 68)
#define EM_SETEVENTMASK (WM_USER + 69)
#define EM_SETOLECALLBACK (WM_USER + 70)
#define EM_SETPARAFORMAT (WM_USER + 71)
#define EM_SETTARGETDEVICE (WM_USER + 72)
#define EM_STREAMIN (WM_USER + 73)
#define EM_STREAMOUT (WM_USER + 74)
#define EM_GETTEXTRANGE (WM_USER + 75)
#define EM_FINDWORDBREAK (WM_USER + 76)
#define EM_SETOPTIONS (WM_USER + 77)
#define EM_GETOPTIONS (WM_USER + 78)
#define EM_FINDTEXTEX (WM_USER + 79)
#ifdef _WIN32
#define EM_GETWORDBREAKPROCEX (WM_USER + 80)
#define EM_SETWORDBREAKPROCEX (WM_USER + 81)
#endif
/* Richedit v2.0 messages */
#define EM_SETUNDOLIMIT (WM_USER + 82)
#define EM_REDO (WM_USER + 84)
#define EM_CANREDO (WM_USER + 85)
#define EM_GETUNDONAME (WM_USER + 86)
#define EM_GETREDONAME (WM_USER + 87)
#define EM_STOPGROUPTYPING (WM_USER + 88)
#define EM_SETTEXTMODE (WM_USER + 89)
#define EM_GETTEXTMODE (WM_USER + 90)
/* enum for use with EM_GET/SETTEXTMODE */
typedef enum tagTextMode
{
TM_PLAINTEXT = 1,
TM_RICHTEXT = 2, /* default behavior */
TM_SINGLELEVELUNDO = 4,
TM_MULTILEVELUNDO = 8, /* default behavior */
TM_SINGLECODEPAGE = 16,
TM_MULTICODEPAGE = 32 /* default behavior */
} TEXTMODE;
#define EM_AUTOURLDETECT (WM_USER + 91)
#define EM_GETAUTOURLDETECT (WM_USER + 92)
#define EM_SETPALETTE (WM_USER + 93)
#define EM_GETTEXTEX (WM_USER + 94)
#define EM_GETTEXTLENGTHEX (WM_USER + 95)
/* Far East specific messages */
#define EM_SETPUNCTUATION (WM_USER + 100)
#define EM_GETPUNCTUATION (WM_USER + 101)
#define EM_SETWORDWRAPMODE (WM_USER + 102)
#define EM_GETWORDWRAPMODE (WM_USER + 103)
#define EM_SETIMECOLOR (WM_USER + 104)
#define EM_GETIMECOLOR (WM_USER + 105)
#define EM_SETIMEOPTIONS (WM_USER + 106)
#define EM_GETIMEOPTIONS (WM_USER + 107)
#define EM_CONVPOSITION (WM_USER + 108)
#define EM_SETLANGOPTIONS (WM_USER + 120)
#define EM_GETLANGOPTIONS (WM_USER + 121)
#define EM_GETIMECOMPMODE (WM_USER + 122)
#define EM_FINDTEXTW (WM_USER + 123)
#define EM_FINDTEXTEXW (WM_USER + 124)
/* BiDi specific messages */
#define EM_SETBIDIOPTIONS (WM_USER + 200)
#define EM_GETBIDIOPTIONS (WM_USER + 201)
/* Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS */
#define IMF_AUTOKEYBOARD 0x0001
#define IMF_AUTOFONT 0x0002
#define IMF_IMECANCELCOMPLETE 0x0004 // high completes the comp string when aborting, low cancels.
#define IMF_IMEALWAYSSENDNOTIFY 0x0008
/* Values for EM_GETIMECOMPMODE */
#define ICM_NOTOPEN 0x0000
#define ICM_LEVEL3 0x0001
#define ICM_LEVEL2 0x0002
#define ICM_LEVEL2_5 0x0003
#define ICM_LEVEL2_SUI 0x0004
/* New notifications */
#define EN_MSGFILTER 0x0700
#define EN_REQUESTRESIZE 0x0701
#define EN_SELCHANGE 0x0702
#define EN_DROPFILES 0x0703
#define EN_PROTECTED 0x0704
#define EN_CORRECTTEXT 0x0705 /* PenWin specific */
#define EN_STOPNOUNDO 0x0706
#define EN_IMECHANGE 0x0707 /* Far East specific */
#define EN_SAVECLIPBOARD 0x0708
#define EN_OLEOPFAILED 0x0709
#define EN_OBJECTPOSITIONS 0x070a
#define EN_LINK 0x070b
#define EN_DRAGDROPDONE 0x070c
/* BiDi specific notifications */
#define EN_ALIGN_LTR 0x0710
#define EN_ALIGN_RTL 0x0711
/* Event notification masks */
#define ENM_NONE 0x00000000
#define ENM_CHANGE 0x00000001
#define ENM_UPDATE 0x00000002
#define ENM_SCROLL 0x00000004
#define ENM_KEYEVENTS 0x00010000
#define ENM_MOUSEEVENTS 0x00020000
#define ENM_REQUESTRESIZE 0x00040000
#define ENM_SELCHANGE 0x00080000
#define ENM_DROPFILES 0x00100000
#define ENM_PROTECTED 0x00200000
#define ENM_CORRECTTEXT 0x00400000 /* PenWin specific */
#define ENM_SCROLLEVENTS 0x00000008
#define ENM_DRAGDROPDONE 0x00000010
/* Far East specific notification mask */
#define ENM_IMECHANGE 0x00800000 /* unused by RE2.0 */
#define ENM_LANGCHANGE 0x01000000
#define ENM_OBJECTPOSITIONS 0x02000000
#define ENM_LINK 0x04000000
/* New edit control styles */
#define ES_SAVESEL 0x00008000
#define ES_SUNKEN 0x00004000
#define ES_DISABLENOSCROLL 0x00002000
/* same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value */
#define ES_SELECTIONBAR 0x01000000
/* same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop */
#define ES_NOOLEDRAGDROP 0x00000008
/* New edit control extended style */
#ifdef _WIN32
#define ES_EX_NOCALLOLEINIT 0x01000000
#endif
/* These flags are used in FE Windows */
#define ES_VERTICAL 0x00400000
#define ES_NOIME 0x00080000
#define ES_SELFIME 0x00040000
/* Edit control options */
#define ECO_AUTOWORDSELECTION 0x00000001
#define ECO_AUTOVSCROLL 0x00000040
#define ECO_AUTOHSCROLL 0x00000080
#define ECO_NOHIDESEL 0x00000100
#define ECO_READONLY 0x00000800
#define ECO_WANTRETURN 0x00001000
#define ECO_SAVESEL 0x00008000
#define ECO_SELECTIONBAR 0x01000000
#define ECO_VERTICAL 0x00400000 /* FE specific */
/* ECO operations */
#define ECOOP_SET 0x0001
#define ECOOP_OR 0x0002
#define ECOOP_AND 0x0003
#define ECOOP_XOR 0x0004
/* new word break function actions */
#define WB_CLASSIFY 3
#define WB_MOVEWORDLEFT 4
#define WB_MOVEWORDRIGHT 5
#define WB_LEFTBREAK 6
#define WB_RIGHTBREAK 7
/* Far East specific flags */
#define WB_MOVEWORDPREV 4
#define WB_MOVEWORDNEXT 5
#define WB_PREVBREAK 6
#define WB_NEXTBREAK 7
#define PC_FOLLOWING 1
#define PC_LEADING 2
#define PC_OVERFLOW 3
#define PC_DELIMITER 4
#define WBF_WORDWRAP 0x010
#define WBF_WORDBREAK 0x020
#define WBF_OVERFLOW 0x040
#define WBF_LEVEL1 0x080
#define WBF_LEVEL2 0x100
#define WBF_CUSTOM 0x200
/* Far East specific flags */
#define IMF_FORCENONE 0x0001
#define IMF_FORCEENABLE 0x0002
#define IMF_FORCEDISABLE 0x0004
#define IMF_CLOSESTATUSWINDOW 0x0008
#define IMF_VERTICAL 0x0020
#define IMF_FORCEACTIVE 0x0040
#define IMF_FORCEINACTIVE 0x0080
#define IMF_FORCEREMEMBER 0x0100
#define IMF_MULTIPLEEDIT 0x0400
/* Word break flags (used with WB_CLASSIFY) */
#define WBF_CLASS ((BYTE) 0x0F)
#define WBF_ISWHITE ((BYTE) 0x10)
#define WBF_BREAKLINE ((BYTE) 0x20)
#define WBF_BREAKAFTER ((BYTE) 0x40)
/* new data types */
#ifdef _WIN32
/* extended edit word break proc (character set aware) */
typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action);
#endif
/* all character format measurements are in twips */
typedef struct _charformat
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
char szFaceName[LF_FACESIZE];
_WPAD _wPad2;
} CHARFORMATA;
typedef struct _charformatw
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
WCHAR szFaceName[LF_FACESIZE];
_WPAD _wPad2;
} CHARFORMATW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define CHARFORMAT CHARFORMATW
#else
#define CHARFORMAT CHARFORMATA
#endif /* UNICODE */
#else
#define CHARFORMAT CHARFORMATA
#endif /* _RICHEDIT_VER >= 0x0200 */
/* CHARFORMAT masks */
#define CFM_BOLD 0x00000001
#define CFM_ITALIC 0x00000002
#define CFM_UNDERLINE 0x00000004
#define CFM_STRIKEOUT 0x00000008
#define CFM_PROTECTED 0x00000010
#define CFM_LINK 0x00000020 /* Exchange hyperlink extension */
#define CFM_SIZE 0x80000000
#define CFM_COLOR 0x40000000
#define CFM_FACE 0x20000000
#define CFM_OFFSET 0x10000000
#define CFM_CHARSET 0x08000000
/* CHARFORMAT effects */
#define CFE_BOLD 0x0001
#define CFE_ITALIC 0x0002
#define CFE_UNDERLINE 0x0004
#define CFE_STRIKEOUT 0x0008
#define CFE_PROTECTED 0x0010
#define CFE_LINK 0x0020
#define CFE_AUTOCOLOR 0x40000000 /* NOTE: this corresponds to */
/* CFM_COLOR, which controls it */
#define yHeightCharPtsMost 1638
/* EM_SETCHARFORMAT wParam masks */
#define SCF_SELECTION 0x0001
#define SCF_WORD 0x0002
#define SCF_DEFAULT 0x0000 // set the default charformat or paraformat
#define SCF_ALL 0x0004 // not valid with SCF_SELECTION or SCF_WORD
#define SCF_USEUIRULES 0x0008 // modifier for SCF_SELECTION; says that
// the format came from a toolbar, etc. and
// therefore UI formatting rules should be
// used instead of strictly formatting the
// selection.
typedef struct _charrange
{
LONG cpMin;
LONG cpMax;
} CHARRANGE;
typedef struct _textrange
{
CHARRANGE chrg;
LPSTR lpstrText; /* allocated by caller, zero terminated by RichEdit */
} TEXTRANGEA;
typedef struct _textrangew
{
CHARRANGE chrg;
LPWSTR lpstrText; /* allocated by caller, zero terminated by RichEdit */
} TEXTRANGEW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define TEXTRANGE TEXTRANGEW
#else
#define TEXTRANGE TEXTRANGEA
#endif /* UNICODE */
#else
#define TEXTRANGE TEXTRANGEA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
typedef struct _editstream
{
DWORD dwCookie; /* user value passed to callback as first parameter */
DWORD dwError; /* last error */
EDITSTREAMCALLBACK pfnCallback;
} EDITSTREAM;
/* stream formats */
#define SF_TEXT 0x0001
#define SF_RTF 0x0002
#define SF_RTFNOOBJS 0x0003 /* outbound only */
#define SF_TEXTIZED 0x0004 /* outbound only */
#define SF_UNICODE 0x0010 /* Unicode file of some kind */
/* Flag telling stream operations to operate on the selection only */
/* EM_STREAMIN will replace the current selection */
/* EM_STREAMOUT will stream out the current selection */
#define SFF_SELECTION 0x8000
/* Flag telling stream operations to operate on the common RTF keyword only */
/* EM_STREAMIN will accept the only common RTF keyword */
/* EM_STREAMOUT will stream out the only common RTF keyword */
#define SFF_PLAINRTF 0x4000
typedef struct _findtext
{
CHARRANGE chrg;
LPSTR lpstrText;
} FINDTEXTA;
typedef struct _findtextw
{
CHARRANGE chrg;
LPWSTR lpstrText;
} FINDTEXTW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define FINDTEXT FINDTEXTW
#else
#define FINDTEXT FINDTEXTA
#endif /* UNICODE */
#else
#define FINDTEXT FINDTEXTA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef struct _findtextexa
{
CHARRANGE chrg;
LPSTR lpstrText;
CHARRANGE chrgText;
} FINDTEXTEXA;
typedef struct _findtextexw
{
CHARRANGE chrg;
LPWSTR lpstrText;
CHARRANGE chrgText;
} FINDTEXTEXW;
#if (_RICHEDIT_VER >= 0x0200)
#ifdef UNICODE
#define FINDTEXTEX FINDTEXTEXW
#else
#define FINDTEXTEX FINDTEXTEXA
#endif /* UNICODE */
#else
#define FINDTEXTEX FINDTEXTEXA
#endif /* _RICHEDIT_VER >= 0x0200 */
typedef struct _formatrange
{
HDC hdc;
HDC hdcTarget;
RECT rc;
RECT rcPage;
CHARRANGE chrg;
} FORMATRANGE;
/* all paragraph measurements are in twips */
#define MAX_TAB_STOPS 32
#define lDefaultTab 720
typedef struct _paraformat
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
WORD wNumbering;
#if (_RICHEDIT_VER >= 0x0210)
WORD wEffects;
#else
WORD wReserved;
#endif /* _RICHEDIT_VER >= 0x0210 */
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;
WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];
} PARAFORMAT;
/* PARAFORMAT mask values */
#define PFM_STARTINDENT 0x00000001
#define PFM_RIGHTINDENT 0x00000002
#define PFM_OFFSET 0x00000004
#define PFM_ALIGNMENT 0x00000008
#define PFM_TABSTOPS 0x00000010
#define PFM_NUMBERING 0x00000020
#define PFM_OFFSETINDENT 0x80000000
/* PARAFORMAT numbering options */
#define PFN_BULLET 0x0001
/* PARAFORMAT alignment options */
#define PFA_LEFT 0x0001
#define PFA_RIGHT 0x0002
#define PFA_CENTER 0x0003
/* CHARFORMAT2 and PARAFORMAT2 structures */
#ifdef __cplusplus
struct CHARFORMAT2W : _charformatw
{
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
};
struct CHARFORMAT2A : _charformat
{
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
};
#else /* regular C-style */
typedef struct _charformat2w
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset; /* > 0 for superscript, < 0 for subscript */
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
WCHAR szFaceName[LF_FACESIZE];
_WPAD _wPad2;
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
BYTE bReserved1;
} CHARFORMAT2W;
typedef struct _charformat2a
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
DWORD dwEffects;
LONG yHeight;
LONG yOffset; /* > 0 for superscript, < 0 for subscript */
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
char szFaceName[LF_FACESIZE];
_WPAD _wPad2;
WORD wWeight; /* Font weight (LOGFONT value) */
SHORT sSpacing; /* Amount to space between letters */
COLORREF crBackColor; /* Background color */
LCID lcid; /* Locale ID */
DWORD dwReserved; /* Reserved. Must be 0 */
SHORT sStyle; /* Style handle */
WORD wKerning; /* Twip size above which to kern char pair*/
BYTE bUnderlineType; /* Underline type */
BYTE bAnimation; /* Animated text like marching ants */
BYTE bRevAuthor; /* Revision author index */
} CHARFORMAT2A;
#endif /* C++ */
#ifdef UNICODE
#define CHARFORMAT2 CHARFORMAT2W
#else
#define CHARFORMAT2 CHARFORMAT2A
#endif
#define CHARFORMATDELTA (sizeof(CHARFORMAT2) - sizeof(CHARFORMAT))
/* CHARFORMAT and PARAFORMAT "ALL" masks
CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor*/
#define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \
CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK)
#define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET)
#define PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | \
PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | \
PFM_OFFSETINDENT| PFM_DIR)
/* New masks and effects -- a parenthesized asterisk indicates that
the data is stored by RichEdit2.0, but not displayed */
#define CFM_SMALLCAPS 0x0040 /* (*) */
#define CFM_ALLCAPS 0x0080 /* (*) */
#define CFM_HIDDEN 0x0100 /* (*) */
#define CFM_OUTLINE 0x0200 /* (*) */
#define CFM_SHADOW 0x0400 /* (*) */
#define CFM_EMBOSS 0x0800 /* (*) */
#define CFM_IMPRINT 0x1000 /* (*) */
#define CFM_DISABLED 0x2000
#define CFM_REVISED 0x4000
#define CFM_BACKCOLOR 0x04000000
#define CFM_LCID 0x02000000
#define CFM_UNDERLINETYPE 0x00800000 /* (*) */
#define CFM_WEIGHT 0x00400000
#define CFM_SPACING 0x00200000 /* (*) */
#define CFM_KERNING 0x00100000 /* (*) */
#define CFM_STYLE 0x00080000 /* (*) */
#define CFM_ANIMATION 0x00040000 /* (*) */
#define CFM_REVAUTHOR 0x00008000
#define CFE_SUBSCRIPT 0x00010000 /* Superscript and subscript are */
#define CFE_SUPERSCRIPT 0x00020000 /* mutually exclusive */
#define CFM_SUBSCRIPT CFE_SUBSCRIPT | CFE_SUPERSCRIPT
#define CFM_SUPERSCRIPT CFM_SUBSCRIPT
#define CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \
| CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \
| CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \
| CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR)
#define CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \
| CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \
| CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION)
#define CFE_SMALLCAPS CFM_SMALLCAPS
#define CFE_ALLCAPS CFM_ALLCAPS
#define CFE_HIDDEN CFM_HIDDEN
#define CFE_OUTLINE CFM_OUTLINE
#define CFE_SHADOW CFM_SHADOW
#define CFE_EMBOSS CFM_EMBOSS
#define CFE_IMPRINT CFM_IMPRINT
#define CFE_DISABLED CFM_DISABLED
#define CFE_REVISED CFM_REVISED
/* NOTE: CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
CFM_BACKCOLOR, respectively, which control them */
#define CFE_AUTOBACKCOLOR CFM_BACKCOLOR
/* Underline types */
#define CFU_CF1UNDERLINE 0xFF /* map charformat's bit underline to CF2.*/
#define CFU_INVERT 0xFE /* For IME composition fake a selection.*/
#define CFU_UNDERLINEDOTTED 0x4 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINEDOUBLE 0x3 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINEWORD 0x2 /* (*) displayed as ordinary underline */
#define CFU_UNDERLINE 0x1
#define CFU_UNDERLINENONE 0
#ifdef __cplusplus
struct PARAFORMAT2 : _paraformat
{
LONG dySpaceBefore; /* Vertical spacing before para */
LONG dySpaceAfter; /* Vertical spacing after para */
LONG dyLineSpacing; /* Line spacing depending on Rule */
SHORT sStyle; /* Style handle */
BYTE bLineSpacingRule; /* Rule for line spacing (see tom.doc) */
BYTE bCRC; /* Reserved for CRC for rapid searching */
WORD wShadingWeight; /* Shading in hundredths of a per cent */
WORD wShadingStyle; /* Nibble 0: style, 1: cfpat, 2: cbpat */
WORD wNumberingStart; /* Starting value for numbering */
WORD wNumberingStyle; /* Alignment, roman/arabic, (), ), ., etc.*/
WORD wNumberingTab; /* Space bet FirstIndent and 1st-line text*/
WORD wBorderSpace; /* Space between border and text (twips)*/
WORD wBorderWidth; /* Border pen width (twips) */
WORD wBorders; /* Byte 0: bits specify which borders */
/* Nibble 2: border style, 3: color index*/
};
#else /* regular C-style */
typedef struct _paraformat2
{
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
WORD wNumbering;
#if (_RICHEDIT_VER >= 0x0210)
WORD wEffects;
#else
WORD wReserved;
#endif /* _RICHEDIT_VER >= 0x0210 */
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;
WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];
LONG dySpaceBefore; /* Vertical spacing before para */
LONG dySpaceAfter; /* Vertical spacing after para */
LONG dyLineSpacing; /* Line spacing depending on Rule */
SHORT sStyle; /* Style handle */
BYTE bLineSpacingRule; /* Rule for line spacing (see tom.doc) */
BYTE bCRC; /* Reserved for CRC for rapid searching */
WORD wShadingWeight; /* Shading in hundredths of a per cent */
WORD wShadingStyle; /* Nibble 0: style, 1: cfpat, 2: cbpat */
WORD wNumberingStart; /* Starting value for numbering */
WORD wNumberingStyle; /* Alignment, roman/arabic, (), ), ., etc.*/
WORD wNumberingTab; /* Space bet 1st indent and 1st-line text*/
WORD wBorderSpace; /* Space between border and text (twips)*/
WORD wBorderWidth; /* Border pen width (twips) */
WORD wBorders; /* Byte 0: bits specify which borders */
/* Nibble 2: border style, 3: color index*/
} PARAFORMAT2;
#endif /* C++ */
/* PARAFORMAT 2.0 masks and effects */
#define PFM_SPACEBEFORE 0x00000040
#define PFM_SPACEAFTER 0x00000080
#define PFM_LINESPACING 0x00000100
#define PFM_STYLE 0x00000400
#define PFM_BORDER 0x00000800 /* (*) */
#define PFM_SHADING 0x00001000 /* (*) */
#define PFM_NUMBERINGSTYLE 0x00002000 /* (*) */
#define PFM_NUMBERINGTAB 0x00004000 /* (*) */
#define PFM_NUMBERINGSTART 0x00008000 /* (*) */
#define PFM_DIR 0x00010000
#define PFM_RTLPARA 0x00010000 /* (Version 1.0 flag) */
#define PFM_KEEP 0x00020000 /* (*) */
#define PFM_KEEPNEXT 0x00040000 /* (*) */
#define PFM_PAGEBREAKBEFORE 0x00080000 /* (*) */
#define PFM_NOLINENUMBER 0x00100000 /* (*) */
#define PFM_NOWIDOWCONTROL 0x00200000 /* (*) */
#define PFM_DONOTHYPHEN 0x00400000 /* (*) */
#define PFM_SIDEBYSIDE 0x00800000 /* (*) */
#define PFM_TABLE 0xc0000000 /* (*) */
/* Note: PARAFORMAT has no effects */
#define PFM_EFFECTS (PFM_DIR | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \
| PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER \
| PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \
| PFM_TABLE)
#define PFM_ALL2 (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \
| PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \
| PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE)
#define PFE_RTLPARA (PFM_DIR >> 16)
#define PFE_RTLPAR (PFM_RTLPARA >> 16) /* (Version 1.0 flag) */
#define PFE_KEEP (PFM_KEEP >> 16) /* (*) */
#define PFE_KEEPNEXT (PFM_KEEPNEXT >> 16) /* (*) */
#define PFE_PAGEBREAKBEFORE (PFM_PAGEBREAKBEFORE >> 16) /* (*) */
#define PFE_NOLINENUMBER (PFM_NOLINENUMBER >> 16) /* (*) */
#define PFE_NOWIDOWCONTROL (PFM_NOWIDOWCONTROL >> 16) /* (*) */
#define PFE_DONOTHYPHEN (PFM_DONOTHYPHEN >> 16) /* (*) */
#define PFE_SIDEBYSIDE (PFM_SIDEBYSIDE >> 16) /* (*) */
#define PFE_TABLEROW 0xc000 /* These 3 options are mutually */
#define PFE_TABLECELLEND 0x8000 /* exclusive and each imply */
#define PFE_TABLECELL 0x4000 /* that para is part of a table*/
/*
* PARAFORMAT numbering options (values for wNumbering):
*
* Numbering Type Value Meaning
* tomNoNumbering 0 Turn off paragraph numbering
* tomNumberAsLCLetter 1 a, b, c, ...
* tomNumberAsUCLetter 2 A, B, C, ...
* tomNumberAsLCRoman 3 i, ii, iii, ...
* tomNumberAsUCRoman 4 I, II, III, ...
* tomNumberAsSymbols 5 default is bullet
* tomNumberAsNumber 6 0, 1, 2, ...
* tomNumberAsSequence 7 tomNumberingStart is first Unicode to use
*
* Other valid Unicode chars are Unicodes for bullets.
*/
#define PFA_JUSTIFY 4 /* New paragraph-alignment option 2.0 (*)
/* notification structures */
#ifndef WM_NOTIFY
#define WM_NOTIFY 0x004E
typedef struct _nmhdr
{
HWND hwndFrom;
_WPAD _wPad1;
UINT idFrom;
_WPAD _wPad2;
UINT code;
_WPAD _wPad3;
} NMHDR;
#endif /* !WM_NOTIFY */
typedef struct _msgfilter
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
} MSGFILTER;
typedef struct _reqresize
{
NMHDR nmhdr;
RECT rc;
} REQRESIZE;
typedef struct _selchange
{
NMHDR nmhdr;
CHARRANGE chrg;
WORD seltyp;
} SELCHANGE;
#define SEL_EMPTY 0x0000
#define SEL_TEXT 0x0001
#define SEL_OBJECT 0x0002
#define SEL_MULTICHAR 0x0004
#define SEL_MULTIOBJECT 0x0008
/* used with IRichEditOleCallback::GetContextMenu, this flag will be
passed as a "selection type". It indicates that a context menu for
a right-mouse drag drop should be generated. The IOleObject parameter
will really be the IDataObject for the drop
*/
#define GCM_RIGHTMOUSEDROP 0x8000
typedef struct _endropfiles
{
NMHDR nmhdr;
HANDLE hDrop;
LONG cp;
BOOL fProtected;
} ENDROPFILES;
typedef struct _enprotected
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
CHARRANGE chrg;
} ENPROTECTED;
typedef struct _ensaveclipboard
{
NMHDR nmhdr;
LONG cObjectCount;
LONG cch;
} ENSAVECLIPBOARD;
#ifndef MACPORT
typedef struct _enoleopfailed
{
NMHDR nmhdr;
LONG iob;
LONG lOper;
HRESULT hr;
} ENOLEOPFAILED;
#endif
#define OLEOP_DOVERB 1
typedef struct _objectpositions
{
NMHDR nmhdr;
LONG cObjectCount;
LONG *pcpPositions;
} OBJECTPOSITIONS;
typedef struct _enlink
{
NMHDR nmhdr;
UINT msg;
_WPAD _wPad1;
WPARAM wParam;
_WPAD _wPad2;
LPARAM lParam;
CHARRANGE chrg;
} ENLINK;
/* PenWin specific */
typedef struct _encorrecttext
{
NMHDR nmhdr;
CHARRANGE chrg;
WORD seltyp;
} ENCORRECTTEXT;
/* Far East specific */
typedef struct _punctuation
{
UINT iSize;
LPSTR szPunctuation;
} PUNCTUATION;
/* Far East specific */
typedef struct _compcolor
{
COLORREF crText;
COLORREF crBackground;
DWORD dwEffects;
}COMPCOLOR;
/* clipboard formats - use as parameter to RegisterClipboardFormat() */
#define CF_RTF TEXT("Rich Text Format")
#define CF_RTFNOOBJS TEXT("Rich Text Format Without Objects")
#define CF_RETEXTOBJ TEXT("RichEdit Text and Objects")
/* Paste Special */
typedef struct _repastespecial
{
DWORD dwAspect;
DWORD dwParam;
} REPASTESPECIAL;
/* UndoName info */
typedef enum _undonameid
{
UID_UNKNOWN = 0,
UID_TYPING = 1,
UID_DELETE = 2,
UID_DRAGDROP = 3,
UID_CUT = 4,
UID_PASTE = 5
} UNDONAMEID;
/* flags for the GETEXTEX data structure */
#define GT_DEFAULT 0
#define GT_USECRLF 1
/* EM_GETTEXTEX info; this struct is passed in the wparam of the message */
typedef struct _gettextex
{
DWORD cb; /* count of bytes in the string */
DWORD flags; /* flags (see the GT_XXX defines */
UINT codepage; /* code page for translation (CP_ACP for default,
1200 for Unicode */
LPCSTR lpDefaultChar; /* replacement for unmappable chars */
LPBOOL lpUsedDefChar; /* pointer to flag set when def char used */
} GETTEXTEX;
/* flags for the GETTEXTLENGTHEX data structure */
#define GTL_DEFAULT 0 /* do the default (return # of chars) */
#define GTL_USECRLF 1 /* compute answer using CRLFs for paragraphs*/
#define GTL_PRECISE 2 /* compute a precise answer */
#define GTL_CLOSE 4 /* fast computation of a "close" answer */
#define GTL_NUMCHARS 8 /* return the number of characters */
#define GTL_NUMBYTES 16 /* return the number of _bytes_ */
/* EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg */
typedef struct _gettextlengthex
{
DWORD flags; /* flags (see GTL_XXX defines) */
UINT codepage; /* code page for translation (CP_ACP for default,
1200 for Unicode */
} GETTEXTLENGTHEX;
/* BiDi specific features */
typedef struct _bidioptions
{
UINT cbSize;
_WPAD _wPad1;
WORD wMask;
WORD wEffects;
} BIDIOPTIONS;
/* BIDIOPTIONS masks */
#if (_RICHEDIT_VER == 0x0100)
#define BOM_DEFPARADIR 0x0001 /* Default paragraph direction (implies alignment) (obsolete) */
#define BOM_PLAINTEXT 0x0002 /* Use plain text layout (obsolete) */
#define BOM_NEUTRALOVERRIDE 0x0004 /* Override neutral layout (obsolete) */
#endif /* _RICHEDIT_VER == 0x0100 */
#define BOM_CONTEXTREADING 0x0008 /* Context reading order */
#define BOM_CONTEXTALIGNMENT 0x0010 /* Context alignment */
/* BIDIOPTIONS effects */
#if (_RICHEDIT_VER == 0x0100)
#define BOE_RTLDIR 0x0001 /* Default paragraph direction (implies alignment) (obsolete) */
#define BOE_PLAINTEXT 0x0002 /* Use plain text layout (obsolete) */
#define BOE_NEUTRALOVERRIDE 0x0004 /* Override neutral layout (obsolete) */
#endif /* _RICHEDIT_VER == 0x0100 */
#define BOE_CONTEXTREADING 0x0008 /* Context reading order */
#define BOE_CONTEXTALIGNMENT 0x0010 /* Context alignment */
/* Additional EM_FINDTEXT[EX] flags */
#define FR_MATCHDIAC 0x20000000
#define FR_MATCHKASHIDA 0x40000000
#define FR_MATCHALEFHAMZA 0x80000000
/* UNICODE embedding character */
#ifndef WCH_EMBEDDING
#define WCH_EMBEDDING (WCHAR)0xFFFC
#endif /* WCH_EMBEDDING */
#undef _WPAD
#ifdef _WIN32
#include <poppack.h>
#elif !defined(RC_INVOKED)
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !_RICHEDIT_ */
/*++ BUILD Version: 0001 Increment this if a change has global effects
Copyright (c) 1985-1997, Microsoft Corporation
Module Name:
windows.h
Abstract:
Master include file for Windows applications.
Modified with WC_STATIC by F. Suckow 04.08.2011
--*/
#ifndef _WINDOWS_
#define _WINDOWS_
#ifndef WINVER
#define WINVER 0x0400
#else
#if defined(_WIN32_WINNT) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400)
#error WINVER setting conflicts with _WIN32_WINNT setting
#endif
#endif
#ifndef WC_STATIC
#define WC_STATIC "Static"
#endif
#if(WINVER >= 0x0500)
#pragma message ("")
#pragma message ("NOTE: WINVER has been defined as 0x0500 or greater which enables")
#pragma message ("Windows NT 5.0 and Windows 98 features. When these headers were released,")
#pragma message ("Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.")
#pragma message ("")
#pragma message ("For this release when WINVER is defined as 0x0500 or greater, you can only")
#pragma message ("build beta or test applications. To build a retail application,")
#pragma message ("set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk")
#pragma message ("to see if retail Windows NT 5.0 or Windows 98 headers are available.")
#pragma message ("")
#pragma message ("See the SDK release notes for more information.")
#pragma message ("")
#endif
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#if defined (_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* If defined, the following flags inhibit definition
* of the indicated items.
*
* NOGDICAPMASKS - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
* NOVIRTUALKEYCODES - VK_*
* NOWINMESSAGES - WM_*, EM_*, LB_*, CB_*
* NOWINSTYLES - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
* NOSYSMETRICS - SM_*
* NOMENUS - MF_*
* NOICONS - IDI_*
* NOKEYSTATES - MK_*
* NOSYSCOMMANDS - SC_*
* NORASTEROPS - Binary and Tertiary raster ops
* NOSHOWWINDOW - SW_*
* OEMRESOURCE - OEM Resource values
* NOATOM - Atom Manager routines
* NOCLIPBOARD - Clipboard routines
* NOCOLOR - Screen colors
* NOCTLMGR - Control and Dialog routines
* NODRAWTEXT - DrawText() and DT_*
* NOGDI - All GDI defines and routines
* NOKERNEL - All KERNEL defines and routines
* NOUSER - All USER defines and routines
* NONLS - All NLS defines and routines
* NOMB - MB_* and MessageBox()
* NOMEMMGR - GMEM_*, LMEM_*, GHND, LHND, associated routines
* NOMETAFILE - typedef METAFILEPICT
* NOMINMAX - Macros min(a,b) and max(a,b)
* NOMSG - typedef MSG and associated routines
* NOOPENFILE - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
* NOSCROLL - SB_* and scrolling routines
* NOSERVICE - All Service Controller routines, SERVICE_ equates, etc.
* NOSOUND - Sound driver routines
* NOTEXTMETRIC - typedef TEXTMETRIC and associated routines
* NOWH - SetWindowsHook and WH_*
* NOWINOFFSETS - GWL_*, GCL_*, associated routines
* NOCOMM - COMM driver routines
* NOKANJI - Kanji support stuff.
* NOHELP - Help engine interface.
* NOPROFILER - Profiler interface.
* NODEFERWINDOWPOS - DeferWindowPos routines
* NOMCX - Modem Configuration Extensions
*/
#if defined(RC_INVOKED) && !defined(NOWINRES)
#include <winresrc.h>
#else
#if defined(RC_INVOKED)
/* Turn off a bunch of stuff to ensure that RC files compile OK. */
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_MIPS_) && !defined(_X86_) && defined(_M_IX86)
#define _X86_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MRX000)
#define _MIPS_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_ALPHA)
#define _ALPHA_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_PPC)
#define _PPC_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_M68K)
#define _68K_
#endif
#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MPPC)
#define _MPPC_
#endif
#ifndef _MAC
#if defined(_68K_) || defined(_MPPC_)
#define _MAC
#endif
#endif
#ifndef RC_INVOKED
#if ( _MSC_VER >= 800 )
#pragma warning(disable:4001)
#pragma warning(disable:4201)
#pragma warning(disable:4214)
#pragma warning(disable:4514)
#endif
#include <excpt.h>
#include <stdarg.h>
#endif /* RC_INVOKED */
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#ifdef _MAC
DECLARE_HANDLE(HKEY);
typedef HKEY *PHKEY;
#endif
#if !defined(_MAC) || defined(_WIN32NLS)
#include <winnls.h>
#endif
#ifndef _MAC
#include <wincon.h>
#include <winver.h>
#endif
#if !defined(_MAC) || defined(_WIN32REG)
#include <winreg.h>
#endif
#ifndef _MAC
#include <winnetwk.h>
#endif
#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#if(_WIN32_WINNT >= 0x0400)
#include <winsock2.h>
#include <mswsock.h>
#else
#include <winsock.h>
#endif /* _WIN32_WINNT >= 0x0400 */
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#endif
#ifndef NOGDI
#include <commdlg.h>
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */
#ifdef _MAC
#include <winwlm.h>
#endif
#ifdef INC_OLE2
#include <ole2.h>
#endif /* INC_OLE2 */
#ifndef _MAC
#ifndef NOSERVICE
#include <winsvc.h>
#endif
#if(WINVER >= 0x0400)
#ifndef NOMCX
#include <mcx.h>
#endif /* NOMCX */
#ifndef NOIME
#include <imm.h>
#endif
#endif /* WINVER >= 0x0400 */
#endif
#ifndef RC_INVOKED
#if ( _MSC_VER >= 800 )
#pragma warning(default:4001)
#pragma warning(default:4201)
#pragma warning(default:4214)
/* Leave 4514 disabled. It's a stupid warning anyway. */
#endif
#endif /* RC_INVOKED */
#endif /* RC_INVOKED */
#endif /* _INC_WINDOWS */
#endif /* _WINDOWS_ */
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module data_clas for forest type classification wclas *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_clas
real, allocatable, dimension(:) :: bpart
real lhpar, nhpar, alhpar, alnpar
end module data_clas
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* climate data modules *!
!* *!
!* containes: *!
!* DATA_CLIMATE *!
!* DATA_EVAPO *!
!* DATA_INTER *!
!* DATA_DEPO *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_climate
! flag defines structure of climate data file
integer :: flag_climtyp = 0
integer :: i_exit ! day number of first missing data record
integer,allocatable,save,dimension(:) :: recs,yy
integer,allocatable,save,dimension(:,:) :: dd,mm
real,allocatable,save,dimension(:,:) :: tp,hm,prc,prs,rd,wd, tx, tn,vp, sdu,bw, sde
real,allocatable,save,dimension(:) :: tpmean
real :: airtemp = -99., & ! air temperature (°C)
airtemp_1 = -99., & ! air temperature of previous day (°C)
airtemp_2 = -99., & ! air temperature of two days before (°C)
airtemp_max = -99., & ! maximum air temperature (°C)
airtemp_min = -99., & ! minimum air temperature (°C)
hum = -99., & ! humidity (%)
prec = -99., & ! precipitation (mm)
press = -99., & ! pressure (hPa)
rad = -99., & ! solar radiation(J/cm2)
rad_max = -99., & ! maximal solar radiation(J/cm2)
wind = -99., & ! wind velocity (m/s)
rnet_tot = -99., & ! total net radiation(J/cm2)
avg_incl , & ! average sun inclination [degrees]
beta , & ! average sun inclination [radians]
dlength = -99., & ! day length == Photoperiode (h)
dptemp = -99., & ! dew point temperature
co2 = -99. ! atmospheric CO2 content (mol/mol)
integer :: flag_vegper = 0 ! indicates vegetation period described by temeprature > 10°C
integer :: flag_tveg = 0
integer :: iday_vegper = 0
! cumulative and mean values per year
real :: med_air ! yearly mean air temperature
real :: med_air_ms ! average temperature May - September
real :: med_air_mj ! avarage temperature May - July
real :: sum_prec ! yearly precipitation sum
real :: sum_prec_ms ! precipitation sum May - September
real :: sum_prec_mj ! precipitation sum may - July
real :: med_air_wm ! average temperature of the warmest month
real :: med_air_cm ! average temperature of the coldest month
real :: med_rad
real :: med_rad1 ! annual mean of daily solar radiation of the first year of simulation
real :: med_wind
real :: gdday ! annual growing degree day
! values per month
real, dimension(12) :: temp_mon ! mean monthly average air temperature (°C)
real, dimension(12) :: prec_mon ! mean monthly precipitation sum (mm)
real, dimension(12) :: rad_mon ! mean monthly average of daily radiation (J/cm2)
real, dimension(12) :: hum_mon ! mean monthly average daily relative humidity (%)
real :: aet_dec ! sum of AET of last december (mm)
real :: temp_dec ! mean average air temperature of last december (°C)
real :: prec_dec ! precipitation sum of last december (mm)
real :: rad_dec ! mean average of daily radiation of last december (J/cm2)
real :: hum_dec ! mean average of daily relative humidity of last december (%)
! values per week
real, dimension(53) :: temp_week ! mean monthly average air temperature (°C)
real, dimension(53) :: prec_week ! mean monthly precipitation sum (mm)
! for calculation of long-term monthly means
real, dimension(12) :: tempmean_mo ! long-term monthly means
real, dimension(12) :: tempmean_mo_a ! annual monthly means
integer :: days_summer = -99, & ! number of summer days (Tmax > 25°C)
days_hot = -99, & ! number of hot days (Tmax > 30°C)
days_ice = -99, & ! number of ice days (Tmax < 0°C)
days_dry = -99, & ! number of days without precipitation
days_hrain = -99, & ! number of days with heavy rain (> 10mm)
days_snow = -99, & ! number of days with snow (4C simulation)
days_rain = -99, & ! number of days with rain > 0.1 mm
days_rain_mj = -99, & ! number of days with rain > 0.1 mm May - July
days_wof = -99 ! number of days without frost Tmin > 0°C
! total mean values
real :: med_air_all ! overall yearly mean air temperature
real :: sum_prec_all ! overall mean yearly precipitation sum
real :: med_rad_all ! overall mean annual radiation
real :: gdday_all ! overlall mean annual growing degree day
! monthly climate indices
real :: ind_cout_mo ! monthly index Coutange
real :: ind_wiss_mo ! monthly index v. Wissmann
real :: ind_arid_mo ! monthly Index UNEP
real :: cwb_mo ! monthly climate water balance
! annual climate indices
real :: ind_arid_an ! annual aridity index UNEP
real :: cwb_an ! annual climate water balance
real :: ind_lang_an ! annual climate index acc. Linsser/Lang
real :: ind_cout_an ! annual index Coutange
real :: ind_wiss_an ! annual index v. Wissmann
real :: ind_mart_an ! annual index Martonne
real :: ind_mart_vp ! annual index martonne vegetation period (May- Sept.)
real :: ind_emb ! annual index Emberger
real :: ind_weck ! annual index Weck
real :: ind_reich ! annual index Reichel
real :: con_gor ! annual continentality index Gorczynski
real :: con_cur ! annual continentality index Currey
real :: con_con ! annual continentality index Conrad
real :: ind_bud ! annual dryness index Budyko
real :: ind_shc ! annual index Seljaninov
real :: cwb_an_m ! mean annual climate water balance of simulation period
! mean annual climate inidces of the simulation period
real :: ind_arid_an_m ! annual aridity index UNEP
real :: ind_lang_an_m ! annual climate index acc. Linsser/Lang
real :: ind_cout_an_m ! annual index Coutange
real :: ind_wiss_an_m ! annual index v. Wissmann
real :: ind_mart_an_m ! annual index Martonne
real :: ind_mart_vp_m ! annual index martonne vegetation perio (May- Sept.)
real :: ind_emb_m ! annual index Emberger
real :: ind_weck_m ! annual index Weck
real :: ind_reich_m ! annual index Reichel
real :: con_gor_m ! annual continentality index Gorczynski
real :: con_cur_m ! annual continentality index Currey
real :: con_con_m ! annual continentality index Conrad
real :: ind_bud_m ! annual dryness index Budyko
real :: ind_shc_m ! annual index Seljaninov
! values for evaluation of npp module
real,allocatable,save,dimension(:) :: tempfield
real,allocatable,save,dimension(:) :: globfield
real,allocatable,save,dimension(:) :: dayfield
real, dimension(5) :: clim_waterb = 0. ! climatic water balance (fire_risk)
! Mauna Loa CO2 time series, annual means
REAL :: year_CO2 = 2016
REAL :: Mauna_Loa_CO2(1959:2016) ! time series of annual mean CO2 measured at Mauna Loa, Hawaii
Real :: RCP_2p6(1765:2300)
Real :: RCP_6p0(1765:2150)
DATA Mauna_Loa_CO2 /0.00031598, 0.00031691, 0.00031765, 0.00031845, 0.00031899, &
0.00031952, 0.00032003, 0.00032137, 0.00032218, 0.00032305, &
0.00032462, 0.00032568, 0.00032632, 0.00032746, 0.00032968, &
0.00033025, 0.00033115, 0.00033215, 0.0003339, 0.0003355, &
0.00033685, 0.00033869, 0.00033993, 0.00034113, 0.00034278, &
0.00034442, 0.0003459, 0.00034715, 0.00034893, 0.00035148, &
0.00035291, 0.00035419, 0.00035559, 0.00035637, 0.00035704, &
0.00035888, 0.00036088, 0.00036264, 0.00036376, 0.00036663, &
0.00036831, 0.00036948, 0.00037102, 0.0003731, 0.00037564, &
0.00037738, 0.00037975, 0.00038185, 0.00038372, 0.00038557, &
0.00038738, 0.00038985, 0.00039163, 0.00039382, 0.00039648, &
0.00039861, 0.00040083, 0.00040421/
DATA RCP_2p6/278.05,278.11,278.22,278.34,278.47,278.60,278.73,278.87,279.01,279.15,279.30,279.46,279.62,279.78,279.94,280.10,280.24,280.38,280.52,280.66,&
280.80,280.96,281.12,281.28,281.44,281.60,281.75,281.89,282.03,282.17,282.30,282.43,282.55,282.67,282.79,282.90,283.01,283.11,283.21,283.31,283.40,283.49,&
283.58,283.66,283.74,283.80,283.85,283.89,283.93,283.96,284.00,284.04,284.09,284.13,284.17,284.20,284.22,284.24,284.26,284.28,284.30,284.32,284.34,284.36,&
284.38,284.40,284.39,284.28,284.13,283.98,283.83,283.68,283.53,283.43,283.40,283.40,283.43,283.50,283.60,283.73,283.90,284.08,284.23,284.40,284.58,284.73,&
284.88,285.00,285.13,285.28,285.43,285.58,285.73,285.90,286.08,286.23,286.38,286.50,286.63,286.78,286.90,287.00,287.10,287.23,287.38,287.53,287.70,287.90,&
288.13,288.40,288.70,289.03,289.40,289.80,290.23,290.70,291.20,291.68,292.13,292.58,292.98,293.30,293.58,293.80,294.00,294.18,294.33,294.48,294.60,294.70,&
294.80,294.90,295.03,295.23,295.50,295.80,296.13,296.48,296.83,297.20,297.63,298.08,298.50,298.90,299.30,299.70,300.08,300.43,300.78,301.10,301.40,301.73,&
302.08,302.40,302.70,303.03,303.40,303.78,304.13,304.53,304.98,305.40,305.83,306.30,306.78,307.23,307.70,308.18,308.60,309.00,309.40,309.75,310.00,310.18,&
310.30,310.38,310.38,310.30,310.20,310.13,310.10,310.13,310.20,310.33,310.50,310.75,311.10,311.50,311.93,312.43,313.00,313.60,314.23,314.85,315.50,316.27,&
317.08,317.80,318.40,318.93,319.65,320.65,321.61,322.64,323.90,324.99,325.86,327.14,328.68,329.74,330.59,331.75,333.27,334.85,336.53,338.36,339.73,340.79,&
342.20,343.78,345.28,346.80,348.65,350.74,352.49,353.86,355.02,355.89,356.78,358.13,359.84,361.46,363.16,365.32,367.35,368.87,370.47,372.52,374.76,376.81,&
378.81,380.83,382.78,384.80,387.00,389.29,391.56,393.84,396.12,398.40,400.68,402.97,405.25,407.53,409.80,412.07,414.33,416.52,418.60,420.60,422.52,424.35,&
426.10,427.75,429.31,430.78,432.16,433.44,434.59,435.65,436.63,437.52,438.33,439.06,439.69,440.22,440.66,441.02,441.35,441.62,441.86,442.08,442.28,442.46,&
442.60,442.70,442.75,442.76,442.73,442.66,442.55,442.41,442.25,442.08,441.89,441.67,441.42,441.13,440.80,440.43,440.01,439.54,439.05,438.54,438.02,437.48,&
436.92,436.34,435.76,435.18,434.60,434.00,433.38,432.78,432.19,431.62,431.06,430.51,429.96,429.41,428.86,428.30,427.73,427.14,426.57,426.00,425.46,424.94,&
424.43,423.93,423.43,422.93,422.43,421.92,421.40,420.90,420.41,419.95,419.50,419.06,418.62,418.17,417.71,417.25,416.77,416.28,415.80,415.32,414.87,414.42,&
413.99,413.55,413.10,412.64,412.17,411.69,411.19,410.70,410.22,409.76,409.31,408.86,408.42,407.97,407.52,407.07,406.61,406.15,405.69,405.26,404.84,404.45,&
404.07,403.68,403.29,402.90,402.51,402.10,401.69,401.28,400.89,400.53,400.17,399.83,399.49,399.14,398.79,398.43,398.06,397.68,397.31,396.96,396.62,396.30,&
395.99,395.68,395.36,395.03,394.70,394.36,394.00,393.66,393.33,393.02,392.72,392.44,392.14,391.85,391.54,391.23,390.91,390.58,390.26,389.95,389.65,389.38,&
389.11,388.83,388.55,388.27,387.97,387.67,387.35,387.05,386.75,386.48,386.21,385.96,385.70,385.44,385.16,384.88,384.59,384.29,384.00,383.72,383.45,383.20,&
382.96,382.72,382.46,382.20,381.93,381.66,381.37,381.08,380.81,380.56,380.32,380.09,379.86,379.61,379.36,379.11,378.84,378.56,378.29,378.03,377.78,377.56, &
377.33,377.11,376.87,376.63,376.38,376.12,375.85,375.59,375.34,375.11,374.89,374.67,374.45,374.23,373.99,373.75,373.50,373.24,372.98,372.74,372.52,372.30,&
372.10,371.89,371.67,371.44,371.21,370.96,370.71,370.46,370.23,370.01,369.80,369.60,369.40,369.19,368.97,368.74,368.50,368.26,368.02,367.79,367.58,367.38,&
367.18,366.98,366.78,366.57,366.35,366.11,365.87,365.64,365.42,365.21,365.02,364.83,364.64,364.44,364.23,364.02,363.79,363.55,363.32,363.11,362.91,362.72,&
362.54,362.35,362.16,361.95,361.75,361.52,361.29,361.07,360.86,360.67/
DATA RCP_6p0/ 278.05,278.11,278.22,278.34,278.47,278.60,278.73,278.87,279.01,279.15,279.30,279.46,279.62,279.78,279.94,280.10,280.24,280.38,280.52,280.66,&
280.80,280.96,281.12,281.28,281.44,281.60,281.75,281.89,282.03,282.17,282.30,282.43,282.55,282.67,282.79,282.90,283.01,283.11,283.21,283.31,283.40,283.49,&
283.58,283.66,283.74,283.80,283.85,283.89,283.93,283.96,284.00,284.04,284.09,284.13,284.17,284.20,284.22,284.24,284.26,284.28,284.30,284.32,284.34,284.36,&
284.38,284.40,284.39,284.28,284.13,283.98,283.83,283.68,283.53,283.43,283.40,283.40,283.43,283.50,283.60,283.73,283.90,284.08,284.23,284.40,284.58,284.73,&
284.88,285.00,285.13,285.28,285.43,285.58,285.73,285.90,286.08,286.23,286.38,286.50,286.63,286.78,286.90,287.00,287.10,287.23,287.38,287.53,287.70,287.90,&
288.13,288.40,288.70,289.03,289.40,289.80,290.23,290.70,291.20,291.68,292.13,292.58,292.98,293.30,293.58,293.80,294.00,294.18,294.33,294.48,294.60,294.70,&
294.80,294.90,295.03,295.23,295.50,295.80,296.13,296.48,296.83,297.20,297.63,298.08,298.50,298.90,299.30,299.70,300.08,300.43,300.78,301.10,301.40,301.73,&
302.08,302.40,302.70,303.03,303.40,303.78,304.13,304.53,304.98,305.40,305.83,306.30,306.78,307.23,307.70,308.18,308.60,309.00,309.40,309.75,310.00,310.18,&
310.30,310.38,310.38,310.30,310.20,310.13,310.10,310.13,310.20,310.33,310.50,310.75,311.10,311.50,311.93,312.43,313.00,313.60,314.23,314.85,315.50,316.27,&
317.08,317.80,318.40,318.93,319.65,320.65,321.61,322.64,323.90,324.99,325.86,327.14,328.68,329.74,330.59,331.75,333.27,334.85,336.53,338.36,339.73,340.79,&
342.20,343.78,345.28,346.80,348.65,350.74,352.49,353.86,355.02,355.89,356.78,358.13,359.84,361.46,363.16,365.32,367.35,368.87,370.47,372.52,374.76,376.81,&
378.81,380.83,382.78,384.80,386.93,389.07,391.17,393.24,395.30,397.35,399.39,401.42,403.43,405.43,407.40,409.36,411.30,413.22,415.14,417.08,419.04,421.00,&
422.98,424.95,426.92,428.88,430.83,432.81,434.83,436.92,439.07,441.29,443.57,445.90,448.28,450.70,453.15,455.65,458.18,460.76,463.41,466.12,468.91,471.77,&
474.69,477.67,480.70,483.78,486.92,490.10,493.34,496.64,500.02,503.48,507.02,510.63,514.31,518.03,521.80,525.62,529.49,533.40,537.38,541.44,545.59,549.82,&
554.13,558.49,562.87,567.27,571.70,576.15,580.61,585.10,589.65,594.26,598.92,603.54,608.02,612.36,616.57,620.65,624.58,628.38,632.06,635.65,639.14,642.60,&
646.06,649.52,652.95,656.36,659.75,663.11,666.42,669.72,673.02,676.29,679.50,682.65,685.71,688.69,691.59,694.40,697.11,699.73,702.28,704.76,707.20,709.60,&
711.93,714.21,716.40,718.52,720.56,722.51,724.37,726.16,727.90,729.59,731.24,732.85,734.39,735.86,737.26,738.59,739.83,740.99,742.08,743.12,744.13,745.10,&
746.02,746.88,747.68,748.40,749.05,749.62,750.09,750.51,750.87,751.20,751.49,751.74,751.92,752.00 /
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^
end module data_climate
module data_evapo
! evapotranspiration data
real :: aet = 0. ! daily total actual evapotranspiration / mm
real :: aet_cum = 0. ! yearly total actual evapotranspiration / mm
real :: aet_m = 0. ! mean yearly total actual evapotranspiration / mm
real :: pet = 0. ! daily total potential evapotranspiration / mm
real :: pet_cum = 0. ! yearly total potential evapotranspiration / mm
real :: pet_m = 0. ! mean yearly total potential evapotranspiration / mm
real :: pev_s = 0. ! potential evaporation of soil / mm
real :: pev_sn = 0. ! potential evaporation of snow / mm
real :: dew_rime = 0. ! dew or rime resp. / mm
real :: dew_cum = 0. ! yearly total dew or rime resp. / mm
real :: dew_m = 0. ! mean yearly total dew or rime resp. / mm
real :: trans_dem = 0. ! potential transpiration / mm
real :: trans_tree= 0. ! actual transpiration of trees / mm
real :: trans_sveg= 0. ! actual transpiration of ground vegetation / mm
real :: tra_tr_cum= 0. ! yearly transpiration of trees / mm
real :: tra_sv_cum= 0. ! yearly transpiration of ground vegetation / mm
real :: aev_s = 0. ! actual evaporation of soil / mm
real :: aev_i = 0. ! actual evaporation of intercepted water / mm
real :: demand_mistletoe_cohort = 0. ! helping variable: transfer of mistletoe demand from evapo.f to soil.f
REAL, dimension(12) :: aet_mon ! monthly actual evapotranspiration sum / mm
REAL, dimension(53) :: aet_week ! weekly actual evapotranspiration sum / mm
REAL, dimension(12) :: pet_mon ! monthly potential evapotranspiration sum / mm
REAL, dimension(53) :: pet_week ! weekly potential evapotranspiration sum / mm
real :: Rnet_cum = 0. ! net radiation J/cm²
integer:: unit_eva
end module data_evapo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module data_inter
! interception data
real :: interc_can = 0. ! total daily canopy interception / mm
real :: int_st_can = 0. ! canopy interception storage / mm
real :: int_cum_can = 0. ! cumulative canopy interception / mm
real :: interc_m_can = 0. ! mean yearly canopy interception / mm
real :: prec_stand = 0. ! stand precipitation / mm
real :: prec_stand_red= 0. ! reduction of stand precipitation by percentage (drought experiments) / %
real :: interc_sveg = 0. ! total daily interception of ground vegetation / mm
real :: int_st_sveg = 0. ! interception storage of ground vegetation / mm
real :: int_cum_sveg = 0. ! cumulative interception of ground vegetation / mm
real :: interc_m_sveg= 0. ! mean yearly interception of ground vegetation / mm
real :: stem_flow = 0. ! stem flow / mm
logical:: lint_snow = .false. ! interception of snow = .true.
end module data_inter
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module data_depo
! deposition data
real,allocatable,save,dimension(:,:) :: NHd, NOd ! input fields / mg N/m2
real :: NH_dep = 0. ! deposition of NHx-N / g N/m2
real :: NO_dep = 0. ! deposition of NOx-N / g N/m2
real :: Ndep_cum = 0. ! yearly cumulative deposition / g N/m2
real :: Ndep_cum_all = 0. ! overall mean yearly deposition / g N/m2
end module data_depo
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* environmental variables and indices *!
!* *!
!* containes: *!
!* DATA_BIODIV *!
!* DATA_FROST *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_biodiv
! indices of fire and biodiversity
! sum of hot days (Tmax>=25°C) and precipitation sum in the potential fire period
integer :: Ndayshot
real :: Psum_FP
integer :: prec_flag1 = 0 ! flag is equal 1 if first time precipitation of 5 mm occurs after bud burst of birch
integer :: prec_flag2 = 0
real :: ntindex ! temperature index
! fire risk
integer :: fire_indw = -99 ! fire index west
integer :: fd_fire_indw(1:5) = 0 ! frequency distribution of fore index west values
integer :: fire_inde = -99 ! fire index east
integer :: fire_indi_day = 0 ! days with forest fire indicator greater then a threshold (east)
real :: fire_indi = 0.0 ! forest fire indicator (east)
real :: fire_indi_max = 0.0 ! maximum forest fire indicator (east)
real :: fire_indb = -99 ! fire index Bruschek
real :: fire_indb_m = -99 ! mean yearly fire index Bruschek of simulation period
real :: tsumrob ! temperature sum 'Robinie'
real :: day_bb_rob = 0 ! day of budburst 'Robinie'
real :: tsumbi ! temperature sum birch
real :: day_bb_bi = 0 ! day of budburst birch
integer :: day_nest = 0 ! days since the last prec. greater then 3 mm (Nesterov)
real :: p_nest = 0.0 ! ignition index of Nesterov
type fire_risk
integer :: index ! daily fire risk level
integer, dimension (5):: frequ ! frequency of of fire risk levels (5 classes) of a year
real :: mean ! mean fire risk level of a year
real :: mean_m ! mean yearly fire risk level of simulation period
end type fire_risk
type (fire_risk),dimension(3) :: fire ! 1 - fire index west
! 2 - fire index east (M68 international)
! 3 - fire index Nesterov
! upper limit of climatic water balance for fire risk class (west)
real, dimension(4,7) :: risk_class
DATA risk_class &
/ 5., -3., -9., -15., & ! march
3., -8., -16., -27., & ! april
-3., -16., -25., -35., & ! may
-12., -24., -32., -41., & ! june
-12., -24., -31., -40., & ! july
-8., -20., -28., -37., & ! august
-6., -18., -26., -35./ ! september
integer, dimension(38) :: daybb_rob
integer, dimension(38) :: daybb_bi
DATA daybb_bi/100,114,115,113,120,115,111,109,123,124,113,110,119,99,117,117,118,117,120,124,101,117,113,117,112,119,116,112, &
102,92,106,109,109,110,111,112,112,101/
DATA daybb_rob/152,165,156,151,166,148,153,153,160,163,151,161,160,163,159,161,162,158,153,163,153,153,154,159,151,152,166,154, &
147,143,168,145,135,148,151,155,155,138/
end module data_biodiv
module data_frost
integer, allocatable, save, dimension(:) :: dnlf ! number of days with late frost during vegetation period
real, allocatable, save, dimension (:) :: tminmay_ann ! minimum temperature in may
integer, allocatable, save, dimension(:) :: date_lf ! date of last frost after start of vegetation period per year
integer, allocatable, save, dimension(:) :: date_lftot ! annual date of last frost event
integer, allocatable, save, dimension(:) :: anzdlf ! number of days with frost from April until June
integer, allocatable, save, dimension(:) :: sumtlf ! sum of temperature of days with frost from April until June
integer :: dlfabs ! number of day of the last frost for the whole simulation period
real :: tminmay ! minimum temperature of may of the whole simulation period
integer, allocatable, save, dimension(:) :: dnlf_sp ! number of day with late frost during vegetation period
integer :: dlfabs_sp ! number of day of the last frost for the whole simulation period
real :: tminmay_sp ! minimum temperature of may of the whole simulation period
real :: temp_frost = 0. ! temperature threshold of frost
integer :: lfind ! last frost index
real :: mlfind ! mean lfind
integer :: maxlfind ! maximum value of 5 part inidces
integer :: lfind_sp ! last frost index birch
integer :: maxlfind_sp ! last frost index beech
real :: mlfind_sp ! mean lfind
integer :: taxnum
end module data_frost
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module *!
!* data_help *!
!* data_help_dbh *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
Module data_help
integer :: hnspec=0 ! species number
real :: mschelp ! weight of seed class
real ::heihelp ! height of plant class
REAL :: x_sap,x_hrt,x_fol,x_frt,x_Ahb !inital values for cohorts
integer :: fail
end module data_help
module data_help_dbh
! for function in calc_dbh
real :: fAhb = 0., & ! cross sectional area heartwood at tree base
fB = 0., & ! bole height,
fH = 0., & ! heartwood
fHt = 0., & ! total tree height
fsprhos
end module data_help_dbh
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* module data_init *!
!* declaration of variables for additional information *!
!* used during initialisation *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
MODULE data_init
IMPLICIT NONE
INTEGER :: spec_nrDSW(120) ! species ordinal number in DSW according to BRA
INTEGER :: spec_nrBAY(120) ! species ordinal number in Bavaria
INTEGER :: spec_4C(120) ! species code number of 4C assigned to DSW species
CHARACTER (3) :: spec_code(120) ! specifies three letter code in DSW according to BRA
CHARACTER (50) :: GER_name(120) ! german name
CHARACTER (50) :: LAT_name(120) ! scientific, latin name
CHARACTER (50) :: ENG_name(120) ! english name
INTEGER :: spnum_for_DSW(800) ! species ordinal number (1..120) for DSW in element of vector
! which corresponds to species number according to BRA
! variables for treatment of DSW initialisation data
TYPE group_vec
INTEGER :: locid ! ID for stand
INTEGER :: taxid ! 4C species number
INTEGER :: BRAid ! DSW species code
INTEGER :: alter
INTEGER :: baumzahl
INTEGER :: schicht ! 10 = upper storey trees/Oberstand, 20 = retention trees/berhlter, 40 = understorey 50 = selction/plenter forest/ plenterartig
REAL :: dm
REAL :: mhoe
REAL :: gf
REAL :: patchsize
REAL :: standsize
REAL :: volume
END TYPE group_vec
TYPE(group_vec), DIMENSION(:), ALLOCATABLE :: ngroups
! variables for plenterwald initialisation
INTEGER, DIMENSION(4) :: low_age, high_age
! Parameter for volume functions provided by Eberswalde
REAL, DIMENSION (10,3) :: parEBW
! Parameter Pine (Kiefer) EBERSWALDE
DATA parEBW(10,1:3)/-9.780614,1.96047,0.89443/
! Parameter Ponderosa pine taken equal to Pine (Kiefer) EBERSWALDE
DATA parEBW(10,1:3)/-9.780614,1.96047,0.89443/
! Parameter for volume function adapted from SILVA
REAL, dimension (11,9) :: par_S
! Paramter Fichte/spruce SILVA
DATA par_S(2,1:9)/-3.59624,1.80213,-0.288243, 1.06247, -0.128993, 0.0353434, 0.142264, -0.058259, 0.00459854/
! Parameter Buche/beech SILVA
DATA par_S(1,1:9)/-2.7284,0.837563,-0.105843,1.62283,-0.214812,0.0289272,-0.0879719,0.0325667,-0.00446295/
! Parameter Eiche/oak SILVA
DATA par_S(4,1:9)/-3.06118,1.45506,-0.19992,1.93898,-0.689727,0.112653,-0.165102,0.120127,-0.0202543/
! Parameter Kiefer/ pine SILVA
DATA par_S(3,1:9)/-5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! Parameter Birke/birch SILVA = Weichlaub
DATA par_S(5,1:9)/-5.98031,2.65905,-0.3374,3.78395,-1.47318,0.188661,-0.540955,0.296957,-0.0385165/
! Parameter Pinus contorta (von Kiefer)
DATA par_S(6,1:9)/ -5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! Parameter Pinus ponderosa (von Kiefer)
DATA par_S(7,1:9)/ -5.80915,3.387,-0.494392,3.67116,-1.83211,0.273999,-0.459282,0.29989,-0.0444931/
! parameter Populus tremula
DATA par_S(8,1:9)/ -5.98031,2.65905,-0.3374,3.78395,-1.47318,0.188661,-0.54095500,0.296957,-0.03851650/
! parameter Robinie( black locust)
DATA par_S(11,1:9)/-2.7284,0.837563,-0.105843,1.62283,-0.214812,0.0289272,-0.0879719,0.0325667,-0.00446295/
END ! module data_init
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module management SR *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_manag
real :: basarea_tot ! total basal area
real :: tardiam_dstem=15. ! diameter target for dead stems to C_opm_stems
integer :: thin_type ! type of management scenario
integer :: thin_nr ! Number of thinnings (years with management actions)
integer :: act_thin_year ! year field index of thinning
integer :: target_type ! type of thinning in case of target thinning
integer,allocatable,save,dimension(:) :: thin_year ! Field of management years
integer,allocatable,save,dimension(:) :: thin_age ! stand age of target thinning
integer,allocatable,save,dimension(:) :: thin_tree ! number of remaining stems after thinning
integer,allocatable,save,dimension(:) :: thin_spec ! species number for thinning (target)
integer,allocatable,save,dimension(:) :: thin_tysp ! type of thinning (for target thinning)
real, allocatable,save,dimension(:) :: target_mass ! target value of stem mass
integer,allocatable,save,dimension(:) :: thinyear ! year of last thinning
integer, allocatable, save, dimension(:) :: thin_stor ! information of storey which hase to manage
real,allocatable,save,dimension(:) :: np_mod ! multiplier for 'Nutzungsprozent'
integer :: thin_dead = 0 ! 0 dead stembiomass is accumulated in litter pools
! 1 dead stem biomass is removed as harvested
integer :: domspec ! dominant species of initialised stnad for management
integer :: domspec_reg ! dominant species of regenerated/planted stand after clear cut/shelterwood
real :: stump_sum= 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! thinning types
! 1 - Niederdurchforstung (mäßig) low thinning ( moderate)
! 2 - Niederdurchforstung (stark) low thinning (heavy)
! 3 - Hochdurchforstung crown thinning
! 4 - Auslesedurchforstung selective thinning
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
real :: ho1=0. ! dominant height first thinning
real :: ho2=0. ! dominant height second thinning
real :: ho3=0. ! dominant height third thinning
real :: ho4=0. ! dominant height fourth thinning
integer :: thr1=0 ! thinning regime for ho2
integer :: thr2=0 ! thinning regime for ho3
integer :: thr3=0 ! thinning regime for ho4
integer :: thr4=0 ! thinning regime for ho>ho4
integer :: thr5=0 ! 'Rückegassen'
real :: thr6=0. ! if thr5=1 this flag control time of realization =ho1,ho2,ho3 or ho4
integer :: thr7=0 ! management regime for rotation year
integer :: mgreg=0 ! regeneration, natural/artificial
integer :: thin_ob ! control of optimal basal area thinning, =1 yes, =0 no
real :: optb= 1. ! optimal 'Bestockungsgrad'
integer :: thinonce =0 ! special case of managemnet for only one single management activity; default=0
integer, allocatable,save,dimension(:) :: thin_flag1 ! aux. varaibles for adaptive management
integer, allocatable,save,dimension(:) :: thin_flag2
integer, allocatable,save,dimension(:) :: thin_flag3
integer, allocatable,save,dimension(:) :: thin_flag4
real, allocatable, save, dimension(:) :: zbnr ! number of 'Zielbäume'/target trees
real, allocatable, save, dimension(:) :: tend ! percentage of young tree tending/'tending of plantations'
integer, allocatable,save,dimension(:) :: rot ! rotation
integer, allocatable, save, dimension(:) :: regage ! age of natural/planted regeneration
integer :: flag_direct=0 !
integer :: thinstep=0 ! number of years between thinning if ho>ho4
integer :: flag_brush=1 ! defaul, if 1 then all harvested stems remain in the litter and are not removed from the stand
integer :: cutyear =0 ! year of cutting
real :: direcfel=0. ! percentage display of 'Rückegassen' creation 'directional felling'
real :: limit=0. ! limit für hight query (+- range)
integer :: shelteryear=0 ! year of last shelterwood mang.
integer :: stand_age =0 ! age of stand
integer :: flag_manreal=0 ! management no/yes
integer :: flag_shelter = 0! shelterwood management started
integer :: flag_sh_first=0 ! aux variable for the case age(1) > regage and age(1)> rotage-20
integer :: flag_plant_shw = 0 ! flag for planting in specieal case trhat initial age is > rot-20
character(30) :: maninf ! description of measure
integer :: meas ! flag of measure
! parameter for thinning depending on age ang stand density : percent of using
real, dimension(20,20) :: usp
! multi-species management
integer,allocatable,save,dimension(:) :: specnr, age_spec,anz_tree_spec
! Austrian management
integer,dimension(10) :: num_rel_cl ! number of relative diameter classes
integer :: num_man ! total numbe rof management treatments
integer, allocatable, save, dimension(:) :: yman ! years of management for each species
integer, allocatable, save, dimension(:) :: dbh_clm ! number of relative dbh class wihich is used for thinning
integer, allocatable, save, dimension(:) :: spec_man ! number of species for treatment
real, allocatable, save, dimension(:) :: rem_clm ! removal of biomass
integer, allocatable, save, dimension(:) :: act ! activity flag
real, allocatable,save, dimension(:) :: rel_part ! mixture flag for planting
! disturbance management
integer, allocatable, save, dimension(:) :: dis_id ! number of standid with disturbance
integer :: dis_row_nr ! the total number of disturbance events (line number of disturbance section)
integer, dimension(1:6,1:2) :: dis_control ! array which is used to control the dirsturbance simulation (dim1=disturbance type(D,X,P,R,S), dim2=zeile man-file)
character(1), allocatable, save, dimension(:) :: dis_type ! disturbance type D - defoliator, X - xylem clogger, P - phloem feeder
! R - root pathogen or feeder, S - stem rot
integer, allocatable, save, dimension(:) :: fortype ! forest type 1 managed forest, 2 - naturla forest
integer, allocatable, save, dimension(:) :: dis_year ! date of disturbance
integer, allocatable, save, dimension(:) :: dis_spec ! disturbed tree species
integer, allocatable, save, dimension(:) :: dis_start ! start of disturbance within year
real, allocatable, save, dimension(:) :: dis_rel ! relative value of disturbed area
real, allocatable,save, dimension(:) :: sum_dis ! accumulated value of disturbed area (relative), for each standid
real, allocatable, save, dimension(:) :: dis_year_id ! year of last disturbance for each standid
integer ::dis_number
integer :: count_dis_real =0 ! counter for realised disturbances
! aspen managment
integer :: nsprout = 3 ! number of sprouts per tree
integer :: flag_sprout = 0 ! 0 - sprouting 1-if sprouts exist
! liocourt management
real :: dbh_max ! maximum diameter
real :: lic_a ! parameter a of licourt function
real :: lic_b ! parameter b of licourt function
real :: thin_proc ! volume removal percent
integer :: spec_lic ! species number für li management
integer :: thin_int ! thinning interval
integer, dimension(22,11) :: ntree_lic ! filed for calculation of licourt function for species i and diamter class j
end module data_manag
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for statistics with observed and simulated values *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_mess
character(150):: dirmess = 'mess/' ! directory of files with measurements
integer:: anz_mesf = 1 ! amount of measurement files
character(150),allocatable,dimension(:) :: mesfile ! name of files with measurements
logical:: flag_mess ! TRUE: measurements within the simulation period / FALSE: no measurements
integer:: unit_cons ! console unit
integer:: unit_stat ! output unit for statistical analysis
integer:: unit_mess = -99 ! unit of file with measurements
integer:: unit_mout = -99 ! output unit of file with measurements and residuals
integer unitday, unitsum, unitlit, unittemp, unitwater, unitsoil, unitsoilini, unitcbal, &
unitveg, unitveg_pi, unitveg_sp, unitveg_bi
integer,allocatable,save,dimension(:) :: unit_mon ! array of output unit numbers for monthly values
integer,allocatable,save,dimension(:) :: unit_mon_stat ! array of output unit numbers for statistics of monthly values
integer imkind, & ! amount of read maesurement value typs
tkind, & ! chronological resolution of measurement values( 1 - Tage
! 2 - Jahre)
imess, & ! amount of read measuerment values
anz_val, & ! amount of filled in measurement values
imk_nme, & ! amount of measurment numbers for mean value calculation NME
imk_nmae, & ! amount of measure numbers for mean value calculation NMAE
imk_nrmse, & ! amount of measure numbers for mean value calculation NRMSE
imk_rsq ! amount of measure numbers for mean value calculations RSQ
real,allocatable,dimension(:,:):: mess1, mess2, sim1, help2
integer,allocatable,dimension(:,:):: mtz ! arry for dates of measurements: day of the year, year
integer,allocatable,dimension(:,:):: help1, stz
integer,allocatable,dimension(:):: app
real:: &
nme_av, & ! Average normalised mean error
nmae_av, & ! Average normalised mean absolut error
nrmse_av, & ! Average normalised root mean square error
pme_av, & ! Average mean precental error
prmse_av, & ! Average mean squared percental error
tic_av, & ! Average Theil's inequality coefficient
meff_av, & ! Average modell efficiency
rsq_av ! Average coefficient of determination
type res_struct
character(15) :: mkind ! measurement value type
integer :: imes ! amount of measurement value
integer :: tkind ! chronological resolution of measurement values
integer,pointer,dimension(:):: day, year
real,pointer,dimension(:) :: resid
real,pointer,dimension(:) :: sim
real,pointer,dimension(:) :: mess
end type res_struct
type (res_struct),allocatable,dimension(:),target :: val
integer:: ikind = 50 ! amount of allowed measurement value types
integer:: fkind = 0 ! amount of not defined measurement value types
character(10), dimension(50):: sim_kind
integer, dimension(80):: mpos1, mpos2 ! position of measurement value in input file
integer, dimension(80):: spos1, spos2 ! position of variables in simulations output
integer, dimension(80):: opos1, opos2 ! position of variables in simulation output file
end module data_mess
!**************************************************************
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for various output files (Header ,...) *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_out
! definition of output form each output type (kind_name) with 4 DATA statements
! character strings with more than 1 row must be separated only by &
! Attention! Blanks are normally significant, but problematic:
! at the beginning of the row only one blank is significant
!
! Recipe for new output files:
! add 1 to the dimension field "(type (out_struct),dimension(x+1),target :: out??)"
! a n d to the number of files "out??_n"+1
! add the specifier of output file to DATA kind_name
! add the comments on first and second line to the respective DATA statements
! add the column header to DATA header (pay attention to the above remarks regarding blanks!)
! add the write statements to the case construct with the kind_name (in output.f)
! depending on the output structure special open statements might have to be added
! in OLD_OUT in output.f
! data structure of skalar and field output
type out_struct
character (10) :: kind_name ! specifies the kind and the name of the output file
integer :: unit_nr ! output unit, set in output.f
integer :: out_flag ! output flag
character (200) :: f_line ! first comment line
character (500) :: s_line ! second comment line
character (900) :: header ! header of output columns
end type out_struct
! daily output of scalars and fields
type (out_struct),dimension(24),target :: outd ! daily output files
integer :: outd_n = 24 ! number of all declared daily output files
DATA outd%kind_name /'Cday','Chumd','Copmd','Copmfractd','Cbcd', 'day', 'day_short','NH4','NH4c','NO3','NO3c','Nhumd','Nopmd', &
'NOPMfract', 'Nuptd', 'Nmind', 'perc', 'specd', 'temp', 'wat_potent', 'wat_res', 'water', 'watvol', 'wupt'/
DATA outd%f_line /'# Daily C balance', & ! Cday
'# C content of humus (hum) per layer', & ! Chumd
'# C content of organic primary matter (OPM) per layer', & ! Copmd
'# C content of organic primary matter (OPM) fractions', & ! Copmfractd
'# C content of biochar per layer', & ! Cbcd
'# Daily output', & ! day
'# Short daily output', & ! day_short
'# NH4 content per layer', & ! NH4
'# NH4 concentration per layer', & ! NH4c
'# NO3 content per layer', & ! NO3
'# NO3 concentration per layer', & ! NO3c
'# N content of humus (hum) per layer', & ! Nhumd
'# N content of organic primary matter (OPM) per layer', & ! Nopmd
'# N content of organic primary matter (OPM) fractions', & ! NOPMfract
'# Daily nitrogen uptake by roots per layer Nupt', & ! Nuptd
'# Daily nitrogen mineralisation per layer Nmin', & ! Nmind
'# Daily percolation of water per layer perc', & ! perc
'# Daily species variables svar', & ! specd
'# Daily soil temperature per layer temps', & ! temp
'# Daily soil water potential per layer wat_potential',& ! wat_potent
'# Daily water uptake resistance per layer wat_res', & ! wat_res
'# Daily soil water content per layer wats', & ! water
'# Daily soil water content per layer watvol', & ! watvol
'# Daily water uptake by roots per layer wupt_r'/ ! wupt
DATA outd%s_line / &
'# gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2&
& gC/m2 gC/m2 gC/m2 %' , & ! Cday
'# gC_m2', & ! Chumd
'# gC_m2', & ! Copmd
'# gC/m2',& ! Copmfractd
'# gC_m2', & ! Cbcd
'# Grad C J/cm2 mm mm mm mm mm mm mm mm&
& mol/m2 gC/m2 gN/m2 gN/m2 gN/m2 gN/m2 mgN/m2 &
& mm mm C&
J/cm2 J/cm2', & ! day
'# - mm', & ! day_short
'# gN/m2', & ! NH4
'# mgN/l', & ! NH4c
'# gN/m2', & ! NO3
'# mgN/l', & ! NO3c
'# gN/m2', & ! Nhumd
'# gN/m2', & ! Nopmd
'# gN/m2 |------------- Fagus sylvatica ----------------|--------------- Picea abies -----------------|&
&------------ Pinus sylvestris ----------------|--------------- Quercus robur ----------------|&
&------------- Betula pendula -----------------|-------------- Pinus contorta ---------------|&
&------------- Pinus ponderosa -----------------|-------------- Populus tremula ---------------|&
&------------- Bodenvegetation ----------------|', & ! NOPMfract
'# gN/m2', & ! Nuptd
'# gN/m2', & ! Nmind
'# mm/day', & ! perc
'# ', & ! specd
'# C', & ! temp
'# hPa', & ! wat_potent
'# ', & ! wat_res
'# mm', & ! water
'# vol%', & ! watvol
'# mm/day'/ ! wupt
DATA outd%header / &
'# Day Year gross_Phot gross_Ass net_Ass pot_NPP NPP NPP_day GPP_day NEE &
& TER_day autresp Resp_aut Resp_het Resp_fol FaPar',& ! Cday
'# Day Year Chum_1 Chum_2 Chum_3 Chum_4 Chum_5 Chum_6 ....',& ! Chumd
'# Day Year Copm_1 Copm_2 Copm_3 Copm_4 Copm_5 Copm_6 ....',& ! Copmd
'# Day Year species C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm species C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm &
& ....',& ! Copmfractd
'# Day Year Cbc_1 Cbc_2 Cbc_3 Cbc_4 Cbc_5 Cbc_6 ....',& ! Cbcd
'# Day Year Temp Rad Prec Intercep Snow PET AET Transdem Transtree Transsveg&
& GP_can Resp_het Nleach_d Nupt_d Nmin_d_c N_antot N_Depo Cover&
& LAI s_Light toFPARcan fire_indi fire_e fire_w fire_n snowday drIndd&
& buckroot buck100 cl_WatBal dewp.temp dew/rime Rnet_tot Rad_max',& ! day
'# Date fire_e cl_WatBal',& ! day_short
'# Day Year NH4_1 NH4_2 NH4_3 NH4_4 NH4_5 NH4_6 ....',& ! NH4
'# Day Year NH4_1 NH4_2 NH4_3 NH4_4 NH4_5 NH4_6 ....',& ! NH4c
'# Day Year NO3_1 NO3_2 NO3_3 NO3_4 NO3_5 NO3_6 ....',& ! NO3
'# Day Year NO3_1 NO3_2 NO3_3 NO3_4 NO3_5 NO3_6 ....',& ! NO3c
'# Day Year Nhum_1 Nhum_2 Nhum_3 Nhum_4 Nhum_5 Nhum_6 ....',& ! Nhumd
'# Day Year Nopm_1 Nopm_2 Nopm_3 Nopm_4 Nopm_5 Nopm_6 ....',& ! Nopmd
'# Day Year N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm ',& ! NOPMfract
'# Day Year Nupt_1 Nupt_2 Nupt_3 Nupt_4 Nupt_5 Nupt_6 ....',& ! Nuptd
'# Day Year Nmin_1 Nmin_2 Nmin_3 Nmin_4 Nmin_5 Nmin_6 ....',& ! Nmind
'# Day Year Percol_1 Percol_2 Percol_3 Percol_4 Percol_5 Percol_6 ....',& ! perc
'# Day Year species_name number Ndem Nupt Ndemp Nuptp RedN ',& ! specd
'# Day Year Temp_surf Temps_1 Temps_2 Temps_3 Temps_4 Temps_5 Temps_6 ....',& ! temp
'# Day Year Pot_1 Pot_2 Pot_3 Pot_4 Pot_5 Pot_6 ....',& ! wat_potent
'# Day Year Wat_res_1 Wat_res_2 Wat_res_3 Wat_res_4 Wat_res_5 Wat_res_6 ....',& ! wat_res
'# Day Year Wats_1 Wats_2 Wats_3 Wats_4 Wats_5 Wats_6 ....',& ! water
'# Day Year Wats_1 Wats_2 Wats_3 Wats_4 Wats_5 Wats_6 ....',& ! watvol
'# Day Year Wupt_r_1 Wupt_r_2 Wupt_r_3 Wupt_r_4 Wupt_r_5 Wupt_r_6 ....'/ ! wupt
! ----------------------------------------------------- !
! yearly output of scalars and fields
type (out_struct),dimension(58),target :: outy ! yearly output files
integer :: outy_n = 58 ! number of all declared yearly output files
DATA outy%kind_name /'AET_mon','c_bal','Cbc','Chum','Copm','Copmfract','classd','classage','classmvol','classd_h','classdm', 'classdm_h',&
'classh', 'classt', 'clim', 'clim_temp', 'clim_prec', 'clim_rad', 'clim_hum', &
'fcap_av','fcapv_av', 'fr_loss','GPP_mon', 'humusv', 'indi', &
'litter','Nbc','Nhum','Nopm','NEE_mon','NPP_mon','manrec', 'mansort', 'redis', 'root', 'sdrought',&
'soil', 'spec', 'standsort','TER_mon','veg', 'veg_in', 'veg_out', &
'veg_be','veg_bi','veg_pi', 'veg_pc', 'veg_pp', 'veg_pt', &
'veg_oa','veg_sp','veg_ph', 'veg_dg', 'veg_rb', 'veg_egl', 'veg_egr','veg_sveg','veg_mist'/
DATA outy%f_line /'# Monthly sum of actual evapotranspiration (AET)', & ! AET_mon
'# Yearly C-Balance, C-stocks and -fluxes; C_sumvsab is part of C_biomass', & ! c_bal
'# C content of biochar (C_bc) per layer', & ! Cbc
'# C content of humus (hum) per layer', & ! Chum
'# C content of organic primary matter (OPM) per layer', & ! Copm
'# C content of organic primary matter (OPM) fractions', & ! Copmfract
'#', & ! classd
'#', & ! classage
'#', & ! classmvol
'#', & ! classd_h
'#', & ! classdm
'#', & ! classdm_h
'#', & ! classh
'#', & ! classt
'# Climate data', & ! clim
'# Air temperature: monthly climate data', & ! clim_temp
'# Precipitation: monthly climate data', & ! clim_prec
'# Radiation: monthly climate data', & ! clim_rad
'# Relative humidity: monthly climate data', & ! clim_hum
'# Available field capacity per layer', & ! fcap_av
'# Available field capacity per layer', & ! fcapv_av
'# Percentage fine root C-loss per soil layer', & ! fr_loss
'# Monthly GPP of all cohorts and species', & ! GPP_mon
'# Content of humus per layer', & ! humusv
'# Indices of fire and biodiversity', & ! indi
'# Yearly litter fractions', & ! litter
'# N content of biochar (N_bc) per layer', & ! Nbc
'# N content of humus (hum) per layer', & ! Nhum
'# N content of organic primary matter (OPM) per layer', & ! Nopm
'# Monthly NEE of all cohorts and species', & ! NEE_mon
'# Monthly NPP of all cohorts and species', & ! NPP_mon
'# Management record', & ! manrec
'# Management sortiment',& ! mansort
'# Redistribution of root C (redis)', & ! redis
'# Root distribution (root_fr)', & ! root
'# Data from soil model', & ! sdrought
'# Data from soil model', & ! soil
'# Species number and name', & ! spec
'# sortiment of whole stand (without harvested trees)',& ! standsort
'# Monthly TER of all cohorts and species', & ! TER_mon
'# Values for the whole stand (per ha); see files veg_in, veg_out in addition', & ! veg
'# New trees (by planting or regeneration), values for the whole stand (per ha)', & ! veg_in
'# Removed trees (by mortality or management) with number of cohorts from which trees are removed (per ha)', & ! veg_out
'# Values for the whole stand (per ha) for beech', & ! veg_be
'# Values for the whole stand (per ha) for birch', & ! veg_bi
'# Values for the whole stand (per ha) for pinus sylvestris', & ! veg_pi
'# Values for the whole stand (per ha) for pinus contorta', & ! veg_pc
'# Values for the whole stand (per ha) for pinus ponderosa', & ! veg_pp
'# Values for the whole stand (per ha) for populus tremula', & ! veg_pt
'# Values for the whole stand (per ha) for oak', & ! veg_oa
'# Values for the whole stand (per ha) for spruce', & ! veg_sp
'# Values for the whole stand (per ha) for pinus halepensis', & ! veg_ph
'# Values for the whole stand (per ha) for douglas fir', & ! veg_dg
'# Values for the whole stand (per ha) for black locust', & ! veg_rb
'# Values for the whole stand (per ha) for E.globulus', & ! veg_egl
'# Values for the whole stand (per ha) for E.grandis', & ! veg_egr
'# Values for the whole stand (per ha) for ground vegetation', & ! veg_sveg
'# Values for the whole stand (per ha) for mistletoe (Visc. a.)'/! veg_mist
DATA outy%s_line / &
'# mm', & ! AET_mon
'# kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha&
& kg/ha kg/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha&
& mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2&
& mol/m2 mol/m2 mol/m2 kg/ha', & ! c_bal
'# gC/m2', & ! Cbc
'# gC/m2', & ! Chum
'# gC/m2', & ! Copm
'# gC/m2', & ! Copmfract
'# diam_class: Number of trees (per ha) in diameter classes, step 5 cm', & ! classd
'# diam_class: Mean age of trees (per ha) in diamter classes, step 5 cm', & ! classage
'# diam_class: Mean volume (m/ha) of harvested trees in diamter classes, step 5 cm', & ! classmvol
'# diam_class: Mean height of trees in diameter classes, step 5 cm', & ! classd_h
'# diam_class: Number of harvested trees (per ha) in diameter classes, step 5 cm', & ! classdm
'# diam_class: Mean height of trees in diameter classes, step 5 cm', & ! classdm_h
'# height_class: Number of trees in height classes, bis 1,5,6,7,...,50,55,>55m', & ! classh
'# diam_class: Number of dead trees (per ha) in diameter classes, step 5 cm', & ! classt
'# C mm J/cm2 m/s ppm C', & ! clim
'# C ... ', & ! clim_temp
'# mm ... ', & ! clim_prec
'# J/cm2 ... ', & ! clim_rad
'# % ... ', & ! clim_hum
'# mm', & ! fcap_av
'# %', & ! fcapv_av
'# yearly mean fine root C-loss', & ! fr_loss
'# gC/m2', & ! GPP_mon
'# %', & ! humusv
'# fire index |------------ fire index west ------------|&
&|----------------------- fire index east -----------------------|&
&|------- fire index Nesterov -------|', & ! indi
'# |-------------------------------- Dry mass kg DW/ha_yr ---------------------------------|&
& |----------------- Carbon content kg C/ha_yr -------------------|&
& |----------------- Nitrogen content kg N/ha_yr -----------------|', & ! litter
!& % % % % ', & ! litter
'# gN/m2', & ! Nbc
'# gN/m2', & ! Nhum
'# gN/m2', & ! Nopm
'# gC/m2', & ! NEE_mon
'# gC/m2', & ! NPP_mon
' ', & ! manrec
' cm cm cm cm cm m/ha kg C/ha ', & ! mansort
'# relative share of redistributed C per layer (whole stand) ', & ! redis
'# relative share of root mass per layer (whole stand) ', & ! root
'# s_drought: Number of days with water content near wilting point (drought days) per layer', & ! sdrought
'# Grad_C mm mm mm mm mm mm mm mm mm mm mol_m2 gN_m2&
& gN_m2 gC_m2 gN_m2 gN_m2 gC_m2 gN_m2 gC_m2 gN_m2 gC_m2 gC_m2 gC_m2 gC_m2 gC_m2 gC_m2&
& gN_m2 gN_m2 gN_m2 gC_m2 mm mm cm mm J/cm2 gN_m2 gC_m2 gC_m2',& ! soil
'#', & ! spec
' cm cm cm cm cm m/ha kg C/ha ', & ! standsort
'# gC/m2', & ! TER_mon
'# /ha m2_m2 kg_DW/ha kg_DW_yr/ha cm cm&
& kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 mol/m2 mol/m2 mol/m2 cm cm m m/ha m/ha', & ! veg
2*'# /ha m2_m2 kg_DW/ha cm cm&
& kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 mol/m2 mol/m2 mol/m2', & ! veg_in, veg_out
15*'# /ha m2_m2 kg_DW/ha kg_DW_yr/ha cm &
&cm kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 gN/m2 - - cm cm m m/ha m/ha mm'/ ! veg_be, bi, pi, oa, sp, sveg
DATA outy%header / &
'# Year AET_1 AET_2 AET_3 AET_4 AET_5 AET_6 AET_7 AET_8 AET_9 AET_10&
& AET_11 AET_12 AET_Quar1 AET_Quar2 AET_Quar3 AET_Quar4 AET_DJF AET_MAM AET_JJA AET_SON', & ! AET_mon
'# Year GPP NPP NEP Aut_Resp Het_Resp Tot_Resp C_dead_st C_sumvsab C_biomass&
& C_tot_ES C_soil C_tot_1 C_hum_1 C_tot_40 C_hum_40 C_tot_80 C_hum_80 C_tot_100 C_hum_100&
& GPP NPP NEP Aut_Resp Het_Resp Tot_Resp C_dead_st&
& C_sumvsab C_biomass C_tot_ES C_soil gppsum', & ! c_bal
'# Year Cbc_1 Cbc_2 Cbc_3 Cbc_4 Cbc_5 Cbc_6 ....',& ! Cbc
'# Year Chum_1 Chum_2 Chum_3 Chum_4 Chum_5 Chum_6 ....',& ! Chum
'# Year Copm_1 Copm_2 Copm_3 Copm_4 Copm_5 Copm_6 ....',& ! Copm
'# Year species C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm species C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm &
& ....',& ! Copmfract
'# Year', & ! classd
'# Year', & ! classage
'# Year', & ! classmvol
'# Year', & ! classd_h
'# Year', & ! classdm
'# Year', & ! classdm_h
'# Year', & ! classh
'# Year', & ! classt
'# Year Temp Prec Radiation Wind CO2 GDD summerdays hotdays icedays &
& drydays hraindays snowdays Ind_arid CWB Ind_Lang Ind_Cout Ind_Wissm Ind_Mart Ind_Mart_VP &
&Ind_Emb Ind_Weck Ind_Reich Ind_Gor I_Currey I_Conrad NTIndex Ind_Budyko F_day F_day_sp l_frost l_frosttot anzfd sumtfd iday_vp Ind_SHC', & ! clim
'# Year Temp_1 Temp_2 Temp_3 Temp_4 Temp_5 Temp_6 Temp_7 Temp_8 Temp_9 Temp_10&
& Temp_11 Temp_12 T_Quart1 T_Quart2 T_Quart3 T_Quart4 T_DJF T_MAM T_JJA T_SON', & ! clim_temp
'# Year Prec_1 Prec_2 Prec_3 Prec_4 Prec_5 Prec_6 Prec_7 Prec_8 Prec_9 Prec_10&
& Prec_11 Prec_12 P_Quart1 P_Quart2 P_Quart3 P_Quart4 P_DJF P_MAM P_JJA P_SON', & ! clim_prec
'# Year Rad_1 Rad_2 Rad_3 Rad_4 Rad_5 Rad_6 Rad_7 Rad_8 Rad_9 Rad_10&
& Rad_11 Rad_12 R_Quart1 R_Quart2 R_Quart3 R_Quart4 R_DJF R_MAM R_JJA R_SON', & ! clim_rad
'# Year Hum_1 Hum_2 Hum_3 Hum_4 Hum_5 Hum_6 Hum_7 Hum_8 Hum_9 Hum_10&
& Hum_11 Hum_12 H_Quart1 H_Quart2 H_Quart3 H_Quart4 H_DJF H_MAM H_JJA H_SON', & ! clim_hum
'# Year fcap_av_1 fcap_av_2 fcap_av_3 fcap_av_4 fcap_av_5 fcap_av_6 ....',& ! fcap_av
'# Year fcapvav_1 fcapvav_2 fcapvav_3 fcapvav_4 fcapvav_5 fcapvav_6 ....',& ! fcapv_av
'# Year lay_1 lay_2 lay_3 lay_4 lay_5 lay_6 ....',& ! fr_loss
'# Year GPP_1 GPP_2 GPP_3 GPP_4 GPP_5 GPP_6 GPP_7 GPP_8 GPP_9 GPP_10&
& GPP_11 GPP_12 GPP_Quar1 GPP_Quar2 GPP_Quar3 GPP_Quar4 GPP_DJF GPP_MAM GPP_JJA GPP_SON', & ! GPP_mon
'# Year humus_1 humus_2 humus_3 humus_4 humus_5 humus_6 ....',& ! humusv
'# Bruschek Mean class1 class2 class3 class4 class5&
& Mean class1 class2 class3 class4 class5 Ind_max Ind_day Mean class1 class2 class3 class4', & ! indi
'# Year fol_litter fol_lit_tr frt_litter frt_lit_tr crt_litter tb_litter stem_litter tot_litter&
& fol_litter frt_litter crt_litter tb_litter stem_litter tot_litter&
& fol_litter frt_litter crt_litter tb_litter stem_litter tot_litter', & ! litter
!'# Year fol_litter frt_litter crt_litter tb_litter stem_litter fol_litter frt_litter&
!& crt_litter tb_litter stem_litter', & ! litter
'# Year Nbc_1 Nbc_2 Nbc_3 Nbc_4 Nbc_5 Nbc_6 ....',& ! Nbc
'# Year Nhum_1 Nhum_2 Nhum_3 Nhum_4 Nhum_5 Nhum_6 ....',& ! Nhum
'# Year Nopm_1 Nopm_2 Nopm_3 Nopm_4 Nopm_5 Nopm_6 ....',& ! Nopm
'# Year NEE_1 NEE_2 NEE_3 NEE_4 NEE_5 NEE_6 NEE_7 NEE_8 NEE_9 NEE_10&
& NEE_11 NEE_12 NEE_Quar1 NEE_Quar2 NEE_Quar3 NEE_Quar4 NEE_DJF NEE_MAM NEE_JJA NEE_SON', & ! NEE_mon
'# Year NPP_1 NPP_2 NPP_3 NPP_4 NPP_5 NPP_6 NPP_7 NPP_8 NPP_9 NPP_10&
& NPP_11 NPP_12 NPP_Quar1 NPP_Quar2 NPP_Quar3 NPP_Quar4 NPP_DJF NPP_MAM NPP_JJA NPP_SON', & ! NPP_mon
'# Year management measure ', & ! manrec
'# year count spec type len diam diam wob top_d t_d wob Volume DW number type', & ! mansort
'# Year lay_1 lay_2 lay_3 lay_4 lay_5 lay_6 ....',& ! redis
'# Year root_1 root_2 root_3 root_4 root_5 root_6 ....',& ! root
'# Year layer1 layer2 layer3 layer4 ........', & ! sdrought
'# Year Temp Prec Interc Percol Wupt Wuptroot Transtree Transsveg Wuptsoil AET Wats_tot&
& GP_can N_min N_tot C_tot N_antot N_humtot C_humtot N_hum(1) C_hum(1) N_litter&
& C_litter C_opm_fol C_opm_frt C_opm_crt C_opm_tbc C_opm_stm Nupt Nleach N_depo Soil_Resp&
& PET interc_sv thick1 dew/rime Rnet_tot N_bc_tot C_bc_tot C_bc_app', & ! soil
'# Year', & ! spec
' year count spec type len diam diam wob top_d t_d wob Volume DW number ', & ! standsort
'# Year TER_1 TER_2 TER_3 TER_4 TER_5 TER_6 TER_7 TER_8 TER_9 TER_10&
& TER_11 TER_12 TER_Quar1 TER_Quar2 TER_Quar3 TER_Quar4 TER_DJF TER_MAM TER_JJA TER_SON', & ! TER_mon
'# Year num_Spec Coh Tree LAI Biomass NPPsum Meddiam&
& Domhei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem gp_can_mean gp_can_min gp_can_max mean_diam mean_height basal_area dead_stems_m3 stem_inc_m3', & ! veg
2* '# Year num_Spec Coh Tree LAI Biomass Meddiam&
& mean_hei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem gp_can_mean gp_can_min gp_can_max', & ! veg_in, veg_out
15*'# Year Spec_id Coh Tree LAI Biomass NPPsum Meddiam&
& Domhei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem Nupt Red_N daybb endbb mean_diam mean_height basal_area dead_stems_m3 stem_inc_m3 YRW'/ ! veg_be, bi, pi, oa, sp,lp, sveg, mist
! ----------------------------------------------------- !
! daily output of cohorts
type (out_struct),dimension(23),target :: outcd
integer :: outcd_n = 23 ! number of all declared cohort output files
DATA outcd%kind_name /'ass', 'aevi', 'ddi', 'dem', 'dips', 'gp', 'gsdps', 'intcap', 'interc', &
'Ndemc_d', 'Nuptc_d', 'N_fol', 'N_pool', 'RedNc', 'resp', 'respaut', &
'respbr', 'respfol', 'resphet', 'respsap', 'respfrt', 'sup', 'totfpar'/
DATA outcd%s_line /23*'# Cohort output'/ ! ass, ddi, dem, gp, gsdps, res,
! resbr, ressap, resfrt, sup
DATA outcd%f_line / &
'# Optimum gross assimilation rate (kg DW/d) assi', & ! ass
'# Daily evaporation of intercepted water (mm/day) aev_i', & ! aevi
'# Daily drought index drindd', & ! ddi
'# Demand for soil water of the cohort (mm/day) demand', & ! dem
'# Drought index for Photosyntheses calculation (cum) drindps', & ! dips
'# Unstressed stomatal conductance (mol/m2*d) gp', & ! gp
'# Number of growing season days per time step of photosynthesis ndaysps', & ! gsdps
'# Interception capacity (mm) sum of intcap(layer)', & ! intcap
'# Interception storage (mm) interc_st', & ! interc
'# Daily N demand per tree (g)', & ! Ndemc_d
'# Daily N uptake per tree (g)', & ! Nuptc_d
'# Daily N content of foliage per tree (g)', & ! N_fol
'# Daily N_pool per tree (g)', & ! N_pool
'# Daily photosynthesis nitrogen reduction factor [-]', & ! RedNc
'# Leaf respiration rate (g C/d) resp', & ! resp
'# Daily autotrophic respiration rate (g C/d) respaut', & ! respaut
'# Daily respiration rate of branches (g C/d) respbr', & ! respbr
'# Daily respiration rate of leaves (g C/d) respfol', & ! respfol
'# Daily heterotrophic respiration rate (g C/d) resphet', & ! resphet
'# Daily respiration rate of sapwood (g C/d) respsap', & ! respsap
'# Daily respiration rate of frt (g C/d) respfrt', & ! respfrt
'# Supply of soil water to roots of the cohort (mm/day) supply', & ! sup
'# Total fraction of PAR absorbed per m patch area (-) totFPAR'/ ! totfpar
DATA outcd%header / &
23*'# Day Year Coh1 Coh2 Coh3 Coh4 ...'/ ! ass, ddi, dem, gp, gsdps, res,
! resbr, ressap, resfrt, sup
! ----------------------------------------------------- !
! yearly output of cohorts
type (out_struct),dimension(58),target :: outcy
integer :: outcy_n = 58 ! number of all declared cohort output files
DATA outcy%kind_name /'age', 'ahb', 'ahbasrel', 'ahc', 'ahcasrel', 'asapw', 'atr', 'bioi', 'botlayer','cpa', 'crt', 'daybb', 'dcrb', 'diac', 'diam', &
'dtr', 'dwd','fol', 'foli', 'frt', 'frti', 'frtrel', 'frtrelc', 'geff', 'gfol', 'gfrt', 'grossass', 'gsap', &
'gsd', 'hbo', 'hea', 'hei', 'hrt', 'leaf', 'maintres', 'nas', 'npp', 'rdpt', 'rld', 'sap', &
'sfol', 'sfrt', 'spn', 'ssap', 'stem', 'str', 'tdb','toplayer', 'trman', 'ttb','Ndemc_c','Nuptc_c', &
'Nfol', 'Npool', 'Nstr','rooteff', 'watleft', 'yrw'/
DATA outcy%s_line /58*'# Cohort output'/ ! age, ahb, ahc, atr, asapw, bioi, botLayer, cpa, crt, daybb, dcrb, diac, diam,
! dtr, dwd, fol, foli, frt, frti, frtrel, geff, gfol, gfrt,
! grossass, gsap, gsd, hbo, hea, hrt, hei,
! leaf, maintres, nas, npp, rdpt, rld, sap, sfol, sfrt, spn,
! ssap, stem, str, tdb, topLayer, trman,ttb, Ndemc,Nuptc, rooteff,watleft
DATA outcy%f_line / &
'# Tree age (year)', & ! age
'# Cross sectional area of heartwood at stem base [cm**2] x_Ahb', & ! ahb
'# Relation of heartwood to sapwood at stem base', & ! ahbasrel
'# Cross sectional area of heartwood at crown base [cm**2] Ahc', & ! ahc
'# Relation of heartwood to sapwood at crown base', & ! ahcasrel
'# Cross sectional area of sapwood in bole space [cm**2] Asapw', & ! asapw
'# Number of alive trees per cohort', & ! atr
'# Net biomass increment (kg DM/year)', & ! bioi
'# Number of bottom layer of crown [-]', & ! botLayer
'# Cohort crown projection area (m2)', & ! cpa
'# coarse root biomass (kg DM/tree)', & ! crt
'# Day of leaf bud burst', & ! daybb
'# Diameter of stem at crown base (cm)',& ! dcrb
'# Drought index for allocation calculation (cum)', & ! diac
'# Diameter at breast height (cm)', & ! diam
'# Number of dead trees per cohort', & ! dtr
'# Stem biomass of dead trees per cohort', & ! dwd
'# Foliage biomass (kg DM/tree)', & ! fol
'# Foliage increment (kg DM/year/tree)', & ! foli
'# Fine root biomass (kg DM/tree)', & ! frt
'# Net fine root increment (kg DM/year/tree)', & ! frti
'# Relative fine root fraction of tree per soil layer (root profile)', & ! frtrel
'# Relative fine root fraction of cohort of total layer fine root mass per soil layer', & ! frtrel
'# Growth efficiency kg/m2', & ! geff
'# Gross growth rate foliage (kg DM/year/tree)', & ! gfol
'# Gross growth rate fine root (kg DM/year/tree)', & ! gfrt
'# Gross assimilation rate (kg DM/year/tree)', & ! grossass
'# Gross growth rate sapwood (kg DM/year/tree)', & ! gsap
'# Number of growing season days per year ndaysgr',& ! gsd
'# Bole height (cm)', & ! hbo
'# Number of years without stress', & ! hea
'# Total tree height (cm)', & ! hei
'# Heartwood biomass (kg DM/tree)', & ! hrt
'# Leaf area per tree (m2)', & ! leaf
'# Maintenance respiration (kg DM/year/tree)', & ! maintres
'# Net foliage assimilation rate (kg DM/year/tree)', & ! nas
'# NPP (kg DM/year/tree)', & ! npp
'# Rooting depth calculated with TRAP model[cm]', & ! rdpt
'# estimated root length density [cm]', & ! rld
'# Sapwood biomass (kg DM)', & ! sap
'# Senescence rate foliage (kg DM/year/tree)', & ! sfol
'# Senescence rate fine roots (kg DM/year/tree)', & ! sfrt
'# Species number of the cohort', & ! spn
'# Senescence rate sapwood (kg DM/year/tree)', & ! ssap
'# Stemwood biomass increment (kg DM/year/tree)', & ! stem
'# Number of stress years', & ! str
'# Total cohort dead biomass (kg DM/year/cohort)', & ! tdb
'# Number of top layer of crown [-]', & ! topLayer
'# Number of trees harvested by managment', & ! trman
'# Total tree biomass (kg DM/tree)', & ! ttb
'# N demand per tree and year (g)', & ! Ndemc_c
'# N uptake per tree and year (g)', & ! Nuptc_c
'# N content of foliage per tree and year (g)', & ! Nfol
'# N pool per tree and year (g)', & ! Npool
'# Ratio of N uptake to demand per tree and year', & ! Nstr
'# Root uptake efficiency factor', & ! rooteff
'# Water left in next layer', & ! watleft
'# Year ring width [mm]' / ! yrw
DATA outcy%header / &
58*'# Year Coh1 Coh2 Coh3 Coh4 ...'/ !age, ahb, ahc, atr, bioi, cpa, crt, daybb, dcrb, diac, diam,
! dtr, dwd, fol, foli, frt, frti, frtrel, geff, gfol, gfrt,
! gsap, gsd, hbo, hea, hrt, hei,
! leaf, maintres, nas, npp, rdpt, rld, sap, sfol, sfrt, spn,
! stem, str, tdb,trman, ttb, Ndemc,Nuptc, rooteff,watleft, yrw
! output at simulation end
type (out_struct),dimension(6),target :: oute
integer :: oute_n = 6 ! number of all declared end output files
DATA oute%kind_name /'sea', 'sea_ms', 'sea_npv', 'sea_st','wpm', 'wpm_inter'/
DATA oute%f_line / &
'# SEA: Costs and assets of standing stock, harvested timber, silvicultural costs, fix costs, and subsidies in euro/ha', &
'# SEA: Timber grading for harvested wood, m3/ha', &
'# SEA: liquidation value, npv, npv+ in euro/ha', &
'# SEA: Timber grading for standing stock, m3/ha', &
'# Wood product model output', &
'# Wood product model intermediate steps'/ !
DATA oute%s_line / &
'# shotcuts: sum: summe, st: standing stock, ms: harvested wood, fc: fix costs, sv: silvicultural costs, co: costs, as: assets, sub: subsidies, sp: spruce, be: beech, pi: pine, oa: oak, bi: birch, ' , &
'# Timber grades 1-7: 1-fue, 2-in, 3-LAS1a, 4-LAS1b, 5-LAS2a, 6-LAS2b, 7-LAS3a, 8-L2b, 9-L3a, 10-L3b ' , &
'# a: without discounting, b-d: interest rate (see "sea_prices.wpm" file) ' , &
'# Timber grades 1-7: 1-fue, 2-in, 3-LAS1a, 4-LAS1b, 5-LAS2a, 6-LAS2b, 7-LAS3a, 8-L2b, 9-L3a, 10-L3b ' , &
'# Carbon in different products, kg C/ha ' , &
'# Carbon in different products, kg C/ha tg: timber grades, il: industrial lines, pl: product lines'/
DATA oute%header / &
'# Year sum_all sum_st sum_ms sum_sv sum_fc sum_sub be_st_co sp_st_co pi_st_co oa_st_co bi_st_co |be_st_as sp_st_as pi_st_as oa_st_as bi_st_as |be_ms_co sp_ms_co pi_ms_co oa_ms_co bi_ms_co |be_ms_as sp_ms_as pi_ms_as oa_ms_as bi_ms_as fix_costs sub_har sub_sv_co sub_fix ', &! sea
'# Year be_tg1 be_tg2 be_tg5 be_tg6 be_tg7 be_tg8 be_tg9 be_tg10 &
&sp_tg1 sp_tg2 sp_tg4 sp_tg5 sp_tg6 sp_tg7 sp_tg8 sp_tg9 sp_tg10 &
&pi_tg1 pi_tg2 pi_tg3 pi_tg4 pi_tg5 pi_tg6 pi_tg7 pi_tg8 pi_tg9 pi_tg10 &
&oa_tg1 oa_tg2 oa_tg5 oa_tg6 oa_tg7 oa_tg8 oa_tg9 oa_tg10 &
&bi_tg1 bi_tg2 bi_tg5 bi_tg6 bi_tg7 bi_tg8 bi_tg9 bi_tg10', &! sea_ms
'# Year LVa LVb LVc LVd NPVa NPVb NPVc NPVd NPV+a NPV+b NPV+c NPV+d ', &! sea_npv
'# Year be_tg1 be_tg2 be_tg5 be_tg6 be_tg7 be_tg8 be_tg9 be_tg10 &
&sp_tg1 sp_tg2 sp_tg4 sp_tg5 sp_tg6 sp_tg7 sp_tg8 sp_tg9 sp_tg10 &
&pi_tg1 pi_tg2 pi_tg3 pi_tg4 pi_tg5 pi_tg6 pi_tg7 pi_tg8 pi_tg9 pi_tg10 &
&oa_tg1 oa_tg2 oa_tg5 oa_tg6 oa_tg7 oa_tg8 oa_tg9 oa_tg10 &
&bi_tg1 bi_tg2 bi_tg5 bi_tg6 bi_tg7 bi_tg8 bi_tg9 bi_tg10', &! sea_st
'# Year sum_input u1 u2 u3 u4 u5 u6 u7 sum_u1-7 burn&
& landfill atmo atmo_cum emission sub_energ sub_mat sub_sum', & ! wpm
'# Year tg1 tg2 tg3 tg4 tg5 tg6 il1 il2 il3 il4 il5 il6 il7 pl1 pl2 pl3 pl4 pl5 pl6 pl7 u1 u2 u3 u4 u5 u6 u7 '/ ! wpm_inter
! special output forms
INTEGER :: out_flag_light ! output flag light-file
INTEGER :: unit_err ! unit for error log file
INTEGER :: unit_trace ! unit for trace log file
INTEGER :: unit_sum ! unit for summation output (fluxes) file
INTEGER :: unit_comp1, unit_comp2 ! ncompressed output
INTEGER :: unit_light, unit_wat
INTEGER :: unit_ctr, unit_prod, unit_allo, unit_soil
INTEGER :: unit_soicnd, unit_soicna, unit_soicnr
! store output variables of veg-file
type out_veg
integer,dimension(3):: help_veg1
real,dimension(11):: help_veg2
real help_veg3
real :: help_veg4
real :: help_veg5
real :: help_veg6
end type out_veg
type (out_veg),allocatable,dimension(:),target :: sout
type (out_veg) :: vout
type out_C
real, dimension(366):: NEE ! net ecosystem exchange
real, dimension(366):: Resp_aut ! autotrophic respiration
end type out_C
type (out_C) :: Cout
character(100) :: mess_info = '# ' ! output of measurements: information line
end module data_out
!**************************************************************
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for various output files (Header ,...) *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_out
! definition of output form each output type (kind_name) with 4 DATA statements
! character strings with more than 1 row must be separated only by &
! Attention! Blanks are normally significant, but problematic:
! at the beginning of the row only one blank is significant
!
! Recipe for new output files:
! add 1 to the dimension field "(type (out_struct),dimension(x+1),target :: out??)"
! a n d to the number of files "out??_n"+1
! add the specifier of output file to DATA kind_name
! add the comments on first and second line to the respective DATA statements
! add the column header to DATA header (pay attention to the above remarks regarding blanks!)
! add the write statements to the case construct with the kind_name (in output.f)
! depending on the output structure special open statements might have to be added
! in OLD_OUT in output.f
! data structure of skalar and field output
type out_struct
character (10) :: kind_name ! specifies the kind and the name of the output file
integer :: unit_nr ! output unit, set in output.f
integer :: out_flag ! output flag
character (200) :: f_line ! first comment line
character (500) :: s_line ! second comment line
character (900) :: header ! header of output columns
end type out_struct
! daily output of scalars and fields
type (out_struct),dimension(24),target :: outd ! daily output files
integer :: outd_n = 24 ! number of all declared daily output files
DATA outd%kind_name /'Cday','Chumd','Copmd','COPMfract','Cbcd', 'day', 'day_short','NH4','NH4c','NO3','NO3c','Nhumd','Nopmd', &
'NOPMfract', 'Nuptd', 'Nmind', 'perc', 'specd', 'temp', 'wat_potent', 'wat_res', 'water', 'watvol', 'wupt'/
DATA outd%f_line /'# Daily C balance', & ! Cday
'# C content of humus (hum) per layer', & ! Chumd
'# C content of organic primary matter (OPM) per layer', & ! Copmd
'# C content of organic primary matter (OPM) fractions', & ! COPMfract
'# C content of biochar per layer', & ! Cbcd
'# Daily output', & ! day
'# Short daily output', & ! day_short
'# NH4 content per layer', & ! NH4
'# NH4 concentration per layer', & ! NH4c
'# NO3 content per layer', & ! NO3
'# NO3 concentration per layer', & ! NO3c
'# N content of humus (hum) per layer', & ! Nhumd
'# N content of organic primary matter (OPM) per layer', & ! Nopmd
'# N content of organic primary matter (OPM) fractions', & ! NOPMfract
'# Daily nitrogen uptake by roots per layer Nupt', & ! Nuptd
'# Daily nitrogen mineralisation per layer Nmin', & ! Nmind
'# Daily percolation of water per layer perc', & ! perc
'# Daily species variables svar', & ! specd
'# Daily soil temperature per layer temps', & ! temp
'# Daily soil water potential per layer wat_potential',& ! wat_potent
'# Daily water uptake resistance per layer wat_res', & ! wat_res
'# Daily soil water content per layer wats', & ! water
'# Daily soil water content per layer watvol', & ! watvol
'# Daily water uptake by roots per layer wupt_r'/ ! wupt
DATA outd%s_line / &
'# gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2 gC/m2&
& gC/m2 gC/m2 gC/m2 %' , & ! Cday
'# gC_m2', & ! Chumd
'# gC_m2', & ! Copmd
'# gC/m2 |------------- Fagus sylvatica ----------------|--------------- Picea abies -----------------|&
&------------ Pinus sylvestris ----------------|--------------- Quercus robur ----------------|&
&------------- Betula pendula -----------------|-------------- Pinus contorta ---------------|&
&------------- Bodenvegetation ----------------|', & ! COPMfract
'# gC_m2', & ! Cbcd
'# Grad C J/cm2 mm mm mm mm mm mm mm mm&
& mol/m2 gC/m2 gN/m2 gN/m2 gN/m2 gN/m2 mgN/m2 &
& mm mm C&
J/cm2 J/cm2', & ! day
'# - mm', & ! day_short
'# gN/m2', & ! NH4
'# mgN/l', & ! NH4c
'# gN/m2', & ! NO3
'# mgN/l', & ! NO3c
'# gN/m2', & ! Nhumd
'# gN/m2', & ! Nopmd
'# gN/m2 |------------- Fagus sylvatica ----------------|--------------- Picea abies -----------------|&
&------------ Pinus sylvestris ----------------|--------------- Quercus robur ----------------|&
&------------- Betula pendula -----------------|-------------- Pinus contorta ---------------|&
&------------- Pinus ponderosa -----------------|-------------- Populus tremula ---------------|&
&------------- Bodenvegetation ----------------|', & ! NOPMfract
'# gN/m2', & ! Nuptd
'# gN/m2', & ! Nmind
'# mm/day', & ! perc
'# ', & ! specd
'# C', & ! temp
'# hPa', & ! wat_potent
'# ', & ! wat_res
'# mm', & ! water
'# vol%', & ! watvol
'# mm/day'/ ! wupt
DATA outd%header / &
'# Day Year gross_Phot gross_Ass net_Ass pot_NPP NPP NPP_day GPP_day NEE &
& TER_day autresp Resp_aut Resp_het Resp_fol FaPar',& ! Cday
'# Day Year Chum_1 Chum_2 Chum_3 Chum_4 Chum_5 Chum_6 ....',& ! Chumd
'# Day Year Copm_1 Copm_2 Copm_3 Copm_4 Copm_5 Copm_6 ....',& ! Copmd
'# Day Year C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm &
& C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm &
& C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm &
& C_opm_fol C_opm_tb C_opm_frt C_opm_crt C_opm_stm ',& ! COPMfract
'# Day Year Cbc_1 Cbc_2 Cbc_3 Cbc_4 Cbc_5 Cbc_6 ....',& ! Cbcd
'# Day Year Temp Rad Prec Intercep Snow PET AET Transdem Transtree Transsveg&
& GP_can Resp_het Nleach_d Nupt_d Nmin_d_c N_antot N_Depo Cover&
& LAI s_Light toFPARcan fire_indi fire_e fire_w fire_n snowday drIndd&
& buckroot buck100 cl_WatBal dewp.temp dew/rime Rnet_tot Rad_max',& ! day
'# Date fire_e cl_WatBal',& ! day_short
'# Day Year NH4_1 NH4_2 NH4_3 NH4_4 NH4_5 NH4_6 ....',& ! NH4
'# Day Year NH4_1 NH4_2 NH4_3 NH4_4 NH4_5 NH4_6 ....',& ! NH4c
'# Day Year NO3_1 NO3_2 NO3_3 NO3_4 NO3_5 NO3_6 ....',& ! NO3
'# Day Year NO3_1 NO3_2 NO3_3 NO3_4 NO3_5 NO3_6 ....',& ! NO3c
'# Day Year Nhum_1 Nhum_2 Nhum_3 Nhum_4 Nhum_5 Nhum_6 ....',& ! Nhumd
'# Day Year Nopm_1 Nopm_2 Nopm_3 Nopm_4 Nopm_5 Nopm_6 ....',& ! Nopmd
'# Day Year N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm &
& N_opm_fol N_opm_tb N_opm_frt N_opm_crt N_opm_stm ',& ! NOPMfract
'# Day Year Nupt_1 Nupt_2 Nupt_3 Nupt_4 Nupt_5 Nupt_6 ....',& ! Nuptd
'# Day Year Nmin_1 Nmin_2 Nmin_3 Nmin_4 Nmin_5 Nmin_6 ....',& ! Nmind
'# Day Year Percol_1 Percol_2 Percol_3 Percol_4 Percol_5 Percol_6 ....',& ! perc
'# Day Year species_name number Ndem Nupt Ndemp Nuptp RedN ',& ! specd
'# Day Year Temp_surf Temps_1 Temps_2 Temps_3 Temps_4 Temps_5 Temps_6 ....',& ! temp
'# Day Year Pot_1 Pot_2 Pot_3 Pot_4 Pot_5 Pot_6 ....',& ! wat_potent
'# Day Year Wat_res_1 Wat_res_2 Wat_res_3 Wat_res_4 Wat_res_5 Wat_res_6 ....',& ! wat_res
'# Day Year Wats_1 Wats_2 Wats_3 Wats_4 Wats_5 Wats_6 ....',& ! water
'# Day Year Wats_1 Wats_2 Wats_3 Wats_4 Wats_5 Wats_6 ....',& ! watvol
'# Day Year Wupt_r_1 Wupt_r_2 Wupt_r_3 Wupt_r_4 Wupt_r_5 Wupt_r_6 ....'/ ! wupt
! ----------------------------------------------------- !
! yearly output of scalars and fields
type (out_struct),dimension(57),target :: outy ! yearly output files
integer :: outy_n = 57 ! number of all declared yearly output files
DATA outy%kind_name /'AET_mon','c_bal','Cbc','Chum','Copm','classd','classage','classmvol','classd_h','classdm', 'classdm_h',&
'classh', 'classt', 'clim', 'clim_temp', 'clim_prec', 'clim_rad', 'clim_hum', &
'fcap_av','fcapv_av', 'fr_loss','GPP_mon', 'humusv', 'indi', &
'litter','Nbc','Nhum','Nopm','NEE_mon','NPP_mon','manrec', 'mansort', 'redis', 'root', 'sdrought',&
'soil', 'spec', 'standsort','TER_mon','veg', 'veg_in', 'veg_out', &
'veg_be','veg_bi','veg_pi', 'veg_pc', 'veg_pp', 'veg_pt', &
'veg_oa','veg_sp','veg_ph', 'veg_dg', 'veg_rb', 'veg_egl', 'veg_egr','veg_sveg','veg_mist'/
DATA outy%f_line /'# Monthly sum of actual evapotranspiration (AET)', & ! AET_mon
'# Yearly C-Balance, C-stocks and -fluxes; C_sumvsab is part of C_biomass', & ! c_bal
'# C content of biochar (C_bc) per layer', & ! Cbc
'# C content of humus (hum) per layer', & ! Chum
'# C content of organic primary matter (OPM) per layer', & ! Copm
'#', & ! classd
'#', & ! classage
'#', & ! classmvol
'#', & ! classd_h
'#', & ! classdm
'#', & ! classdm_h
'#', & ! classh
'#', & ! classt
'# Climate data', & ! clim
'# Air temperature: monthly climate data', & ! clim_temp
'# Precipitation: monthly climate data', & ! clim_prec
'# Radiation: monthly climate data', & ! clim_rad
'# Relative humidity: monthly climate data', & ! clim_hum
'# Available field capacity per layer', & ! fcap_av
'# Available field capacity per layer', & ! fcapv_av
'# Percentage fine root C-loss per soil layer', & ! fr_loss
'# Monthly GPP of all cohorts and species', & ! GPP_mon
'# Content of humus per layer', & ! humusv
'# Indices of fire and biodiversity', & ! indi
'# Yearly litter fractions', & ! litter
'# N content of biochar (N_bc) per layer', & ! Nbc
'# N content of humus (hum) per layer', & ! Nhum
'# N content of organic primary matter (OPM) per layer', & ! Nopm
'# Monthly NEE of all cohorts and species', & ! NEE_mon
'# Monthly NPP of all cohorts and species', & ! NPP_mon
'# Management record', & ! manrec
'# Management sortiment',& ! mansort
'# Redistribution of root C (redis)', & ! redis
'# Root distribution (root_fr)', & ! root
'# Data from soil model', & ! sdrought
'# Data from soil model', & ! soil
'# Species number and name', & ! spec
'# sortiment of whole stand (without harvested trees)',& ! standsort
'# Monthly TER of all cohorts and species', & ! TER_mon
'# Values for the whole stand (per ha); see files veg_in, veg_out in addition', & ! veg
'# New trees (by planting or regeneration), values for the whole stand (per ha)', & ! veg_in
'# Removed trees (by mortality or management) with number of cohorts from which trees are removed (per ha)', & ! veg_out
'# Values for the whole stand (per ha) for beech', & ! veg_be
'# Values for the whole stand (per ha) for birch', & ! veg_bi
'# Values for the whole stand (per ha) for pinus sylvestris', & ! veg_pi
'# Values for the whole stand (per ha) for pinus contorta', & ! veg_pc
'# Values for the whole stand (per ha) for pinus ponderosa', & ! veg_pp
'# Values for the whole stand (per ha) for populus tremula', & ! veg_pt
'# Values for the whole stand (per ha) for oak', & ! veg_oa
'# Values for the whole stand (per ha) for spruce', & ! veg_sp
'# Values for the whole stand (per ha) for pinus halepensis', & ! veg_ph
'# Values for the whole stand (per ha) for douglas fir', & ! veg_dg
'# Values for the whole stand (per ha) for black locust', & ! veg_rb
'# Values for the whole stand (per ha) for E.globulus', & ! veg_egl
'# Values for the whole stand (per ha) for E.grandis', & ! veg_egr
'# Values for the whole stand (per ha) for ground vegetation', & ! veg_sveg
'# Values for the whole stand (per ha) for mistletoe (Visc. a.)'/! veg_mist
DATA outy%s_line / &
'# mm', & ! AET_mon
'# kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha kg/ha&
& kg/ha kg/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha t/ha&
& mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2 mol/m2&
& mol/m2 mol/m2 mol/m2 kg/ha', & ! c_bal
'# gC/m2', & ! Cbc
'# gC/m2', & ! Chum
'# gC/m2', & ! Copm
'# diam_class: Number of trees (per ha) in diameter classes, step 5 cm', & ! classd
'# diam_class: Mean age of trees (per ha) in diamter classes, step 5 cm', & ! classage
'# diam_class: Mean volume (m/ha) of harvested trees in diamter classes, step 5 cm', & ! classmvol
'# diam_class: Mean height of trees in diameter classes, step 5 cm', & ! classd_h
'# diam_class: Number of harvested trees (per ha) in diameter classes, step 5 cm', & ! classdm
'# diam_class: Mean height of trees in diameter classes, step 5 cm', & ! classdm_h
'# height_class: Number of trees in height classes, bis 1,5,6,7,...,50,55,>55m', & ! classh
'# diam_class: Number of dead trees (per ha) in diameter classes, step 5 cm', & ! classt
'# C mm J/cm2 m/s ppm C', & ! clim
'# C ... ', & ! clim_temp
'# mm ... ', & ! clim_prec
'# J/cm2 ... ', & ! clim_rad
'# % ... ', & ! clim_hum
'# mm', & ! fcap_av
'# %', & ! fcapv_av
'# yearly mean fine root C-loss', & ! fr_loss
'# gC/m2', & ! GPP_mon
'# %', & ! humusv
'# fire index |------------ fire index west ------------|&
&|----------------------- fire index east -----------------------|&
&|------- fire index Nesterov -------|', & ! indi
'# |-------------------------------- Dry mass kg DW/ha_yr ---------------------------------|&
& |----------------- Carbon content kg C/ha_yr -------------------|&
& |----------------- Nitrogen content kg N/ha_yr -----------------|', & ! litter
!& % % % % ', & ! litter
'# gN/m2', & ! Nbc
'# gN/m2', & ! Nhum
'# gN/m2', & ! Nopm
'# gC/m2', & ! NEE_mon
'# gC/m2', & ! NPP_mon
' ', & ! manrec
' cm cm cm cm cm m/ha kg C/ha ', & ! mansort
'# relative share of redistributed C per layer (whole stand) ', & ! redis
'# relative share of root mass per layer (whole stand) ', & ! root
'# s_drought: Number of days with water content near wilting point (drought days) per layer', & ! sdrought
'# Grad_C mm mm mm mm mm mm mm mm mm mm mol_m2 gN_m2&
& gN_m2 gC_m2 gN_m2 gN_m2 gC_m2 gN_m2 gC_m2 gN_m2 gC_m2 gC_m2 gC_m2 gC_m2 gC_m2 gC_m2&
& gN_m2 gN_m2 gN_m2 gC_m2 mm mm cm mm J/cm2 gN_m2 gC_m2 gC_m2',& ! soil
'#', & ! spec
' cm cm cm cm cm m/ha kg C/ha ', & ! standsort
'# gC/m2', & ! TER_mon
'# /ha m2_m2 kg_DW/ha kg_DW_yr/ha cm cm&
& kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 mol/m2 mol/m2 mol/m2 cm cm m m/ha m/ha', & ! veg
2*'# /ha m2_m2 kg_DW/ha cm cm&
& kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 mol/m2 mol/m2 mol/m2', & ! veg_in, veg_out
15*'# /ha m2_m2 kg_DW/ha kg_DW_yr/ha cm &
&cm kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha kg_DW/ha m3/ha kg_DW/ha kg_DW/ha m2_m2&
& gN/m2 gN/m2 - - cm cm m m/ha m/ha mm'/ ! veg_be, bi, pi, oa, sp, sveg
DATA outy%header / &
'# Year AET_1 AET_2 AET_3 AET_4 AET_5 AET_6 AET_7 AET_8 AET_9 AET_10&
& AET_11 AET_12 AET_Quar1 AET_Quar2 AET_Quar3 AET_Quar4 AET_DJF AET_MAM AET_JJA AET_SON', & ! AET_mon
'# Year GPP NPP NEP Aut_Resp Het_Resp Tot_Resp C_dead_st C_sumvsab C_biomass&
& C_tot_ES C_soil C_tot_1 C_hum_1 C_tot_40 C_hum_40 C_tot_80 C_hum_80 C_tot_100 C_hum_100&
& GPP NPP NEP Aut_Resp Het_Resp Tot_Resp C_dead_st&
& C_sumvsab C_biomass C_tot_ES C_soil gppsum', & ! c_bal
'# Year Cbc_1 Cbc_2 Cbc_3 Cbc_4 Cbc_5 Cbc_6 ....',& ! Cbc
'# Year Chum_1 Chum_2 Chum_3 Chum_4 Chum_5 Chum_6 ....',& ! Chum
'# Year Copm_1 Copm_2 Copm_3 Copm_4 Copm_5 Copm_6 ....',& ! Copm
'# Year', & ! classd
'# Year', & ! classage
'# Year', & ! classmvol
'# Year', & ! classd_h
'# Year', & ! classdm
'# Year', & ! classdm_h
'# Year', & ! classh
'# Year', & ! classt
'# Year Temp Prec Radiation Wind CO2 GDD summerdays hotdays icedays &
& drydays hraindays snowdays Ind_arid CWB Ind_Lang Ind_Cout Ind_Wissm Ind_Mart Ind_Mart_VP &
&Ind_Emb Ind_Weck Ind_Reich Ind_Gor I_Currey I_Conrad NTIndex Ind_Budyko F_day F_day_sp l_frost l_frosttot anzfd sumtfd iday_vp Ind_SHC', & ! clim
'# Year Temp_1 Temp_2 Temp_3 Temp_4 Temp_5 Temp_6 Temp_7 Temp_8 Temp_9 Temp_10&
& Temp_11 Temp_12 T_Quart1 T_Quart2 T_Quart3 T_Quart4 T_DJF T_MAM T_JJA T_SON', & ! clim_temp
'# Year Prec_1 Prec_2 Prec_3 Prec_4 Prec_5 Prec_6 Prec_7 Prec_8 Prec_9 Prec_10&
& Prec_11 Prec_12 P_Quart1 P_Quart2 P_Quart3 P_Quart4 P_DJF P_MAM P_JJA P_SON', & ! clim_prec
'# Year Rad_1 Rad_2 Rad_3 Rad_4 Rad_5 Rad_6 Rad_7 Rad_8 Rad_9 Rad_10&
& Rad_11 Rad_12 R_Quart1 R_Quart2 R_Quart3 R_Quart4 R_DJF R_MAM R_JJA R_SON', & ! clim_rad
'# Year Hum_1 Hum_2 Hum_3 Hum_4 Hum_5 Hum_6 Hum_7 Hum_8 Hum_9 Hum_10&
& Hum_11 Hum_12 H_Quart1 H_Quart2 H_Quart3 H_Quart4 H_DJF H_MAM H_JJA H_SON', & ! clim_hum
'# Year fcap_av_1 fcap_av_2 fcap_av_3 fcap_av_4 fcap_av_5 fcap_av_6 ....',& ! fcap_av
'# Year fcapvav_1 fcapvav_2 fcapvav_3 fcapvav_4 fcapvav_5 fcapvav_6 ....',& ! fcapv_av
'# Year lay_1 lay_2 lay_3 lay_4 lay_5 lay_6 ....',& ! fr_loss
'# Year GPP_1 GPP_2 GPP_3 GPP_4 GPP_5 GPP_6 GPP_7 GPP_8 GPP_9 GPP_10&
& GPP_11 GPP_12 GPP_Quar1 GPP_Quar2 GPP_Quar3 GPP_Quar4 GPP_DJF GPP_MAM GPP_JJA GPP_SON', & ! GPP_mon
'# Year humus_1 humus_2 humus_3 humus_4 humus_5 humus_6 ....',& ! humusv
'# Bruschek Mean class1 class2 class3 class4 class5&
& Mean class1 class2 class3 class4 class5 Ind_max Ind_day Mean class1 class2 class3 class4', & ! indi
'# Year fol_litter fol_lit_tr frt_litter frt_lit_tr crt_litter tb_litter stem_litter tot_litter&
& fol_litter frt_litter crt_litter tb_litter stem_litter tot_litter&
& fol_litter frt_litter crt_litter tb_litter stem_litter tot_litter', & ! litter
!'# Year fol_litter frt_litter crt_litter tb_litter stem_litter fol_litter frt_litter&
!& crt_litter tb_litter stem_litter', & ! litter
'# Year Nbc_1 Nbc_2 Nbc_3 Nbc_4 Nbc_5 Nbc_6 ....',& ! Nbc
'# Year Nhum_1 Nhum_2 Nhum_3 Nhum_4 Nhum_5 Nhum_6 ....',& ! Nhum
'# Year Nopm_1 Nopm_2 Nopm_3 Nopm_4 Nopm_5 Nopm_6 ....',& ! Nopm
'# Year NEE_1 NEE_2 NEE_3 NEE_4 NEE_5 NEE_6 NEE_7 NEE_8 NEE_9 NEE_10&
& NEE_11 NEE_12 NEE_Quar1 NEE_Quar2 NEE_Quar3 NEE_Quar4 NEE_DJF NEE_MAM NEE_JJA NEE_SON', & ! NEE_mon
'# Year NPP_1 NPP_2 NPP_3 NPP_4 NPP_5 NPP_6 NPP_7 NPP_8 NPP_9 NPP_10&
& NPP_11 NPP_12 NPP_Quar1 NPP_Quar2 NPP_Quar3 NPP_Quar4 NPP_DJF NPP_MAM NPP_JJA NPP_SON', & ! NPP_mon
'# Year management measure ', & ! manrec
'# year count spec type len diam diam wob top_d t_d wob Volume DW number type', & ! mansort
'# Year lay_1 lay_2 lay_3 lay_4 lay_5 lay_6 ....',& ! redis
'# Year root_1 root_2 root_3 root_4 root_5 root_6 ....',& ! root
'# Year layer1 layer2 layer3 layer4 ........', & ! sdrought
'# Year Temp Prec Interc Percol Wupt Wuptroot Transtree Transsveg Wuptsoil AET Wats_tot&
& GP_can N_min N_tot C_tot N_antot N_humtot C_humtot N_hum(1) C_hum(1) N_litter&
& C_litter C_opm_fol C_opm_frt C_opm_crt C_opm_tbc C_opm_stm Nupt Nleach N_depo Soil_Resp&
& PET interc_sv thick1 dew/rime Rnet_tot N_bc_tot C_bc_tot C_bc_app', & ! soil
'# Year', & ! spec
' year count spec type len diam diam wob top_d t_d wob Volume DW number ', & ! standsort
'# Year TER_1 TER_2 TER_3 TER_4 TER_5 TER_6 TER_7 TER_8 TER_9 TER_10&
& TER_11 TER_12 TER_Quar1 TER_Quar2 TER_Quar3 TER_Quar4 TER_DJF TER_MAM TER_JJA TER_SON', & ! TER_mon
'# Year num_Spec Coh Tree LAI Biomass NPPsum Meddiam&
& Domhei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem gp_can_mean gp_can_min gp_can_max mean_diam mean_height basal_area dead_stems_m3 stem_inc_m3', & ! veg
2* '# Year num_Spec Coh Tree LAI Biomass Meddiam&
& mean_hei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem gp_can_mean gp_can_min gp_can_max', & ! veg_in, veg_out
15*'# Year Spec_id Coh Tree LAI Biomass NPPsum Meddiam&
& Domhei Fol_Bio Sap_Bio Frt_Bio Hrt_Bio Stem_inc Stemvol rem_stems&
& dead_stems cover drIndAl Ndem Nupt Red_N daybb endbb mean_diam mean_height basal_area dead_stems_m3 stem_inc_m3 YRW'/ ! veg_be, bi, pi, oa, sp,lp, sveg, mist
! ----------------------------------------------------- !
! daily output of cohorts
type (out_struct),dimension(23),target :: outcd
integer :: outcd_n = 23 ! number of all declared cohort output files
DATA outcd%kind_name /'ass', 'aevi', 'ddi', 'dem', 'dips', 'gp', 'gsdps', 'intcap', 'interc', &
'Ndemc_d', 'Nuptc_d', 'N_fol', 'N_pool', 'RedNc', 'resp', 'respaut', &
'respbr', 'respfol', 'resphet', 'respsap', 'respfrt', 'sup', 'totfpar'/
DATA outcd%s_line /23*'# Cohort output'/ ! ass, ddi, dem, gp, gsdps, res,
! resbr, ressap, resfrt, sup
DATA outcd%f_line / &
'# Optimum gross assimilation rate (kg DW/d) assi', & ! ass
'# Daily evaporation of intercepted water (mm/day) aev_i', & ! aevi
'# Daily drought index drindd', & ! ddi
'# Demand for soil water of the cohort (mm/day) demand', & ! dem
'# Drought index for Photosyntheses calculation (cum) drindps', & ! dips
'# Unstressed stomatal conductance (mol/m2*d) gp', & ! gp
'# Number of growing season days per time step of photosynthesis ndaysps', & ! gsdps
'# Interception capacity (mm) sum of intcap(layer)', & ! intcap
'# Interception storage (mm) interc_st', & ! interc
'# Daily N demand per tree (g)', & ! Ndemc_d
'# Daily N uptake per tree (g)', & ! Nuptc_d
'# Daily N content of foliage per tree (g)', & ! N_fol
'# Daily N_pool per tree (g)', & ! N_pool
'# Daily photosynthesis nitrogen reduction factor [-]', & ! RedNc
'# Leaf respiration rate (g C/d) resp', & ! resp
'# Daily autotrophic respiration rate (g C/d) respaut', & ! respaut
'# Daily respiration rate of branches (g C/d) respbr', & ! respbr
'# Daily respiration rate of leaves (g C/d) respfol', & ! respfol
'# Daily heterotrophic respiration rate (g C/d) resphet', & ! resphet
'# Daily respiration rate of sapwood (g C/d) respsap', & ! respsap
'# Daily respiration rate of frt (g C/d) respfrt', & ! respfrt
'# Supply of soil water to roots of the cohort (mm/day) supply', & ! sup
'# Total fraction of PAR absorbed per m patch area (-) totFPAR'/ ! totfpar
DATA outcd%header / &
23*'# Day Year Coh1 Coh2 Coh3 Coh4 ...'/ ! ass, ddi, dem, gp, gsdps, res,
! resbr, ressap, resfrt, sup
! ----------------------------------------------------- !
! yearly output of cohorts
type (out_struct),dimension(58),target :: outcy
integer :: outcy_n = 58 ! number of all declared cohort output files
DATA outcy%kind_name /'age', 'ahb', 'ahbasrel', 'ahc', 'ahcasrel', 'asapw', 'atr', 'bioi', 'botlayer','cpa', 'crt', 'daybb', 'dcrb', 'diac', 'diam', &
'dtr', 'dwd','fol', 'foli', 'frt', 'frti', 'frtrel', 'frtrelc', 'geff', 'gfol', 'gfrt', 'grossass', 'gsap', &
'gsd', 'hbo', 'hea', 'hei', 'hrt', 'leaf', 'maintres', 'nas', 'npp', 'rdpt', 'rld', 'sap', &
'sfol', 'sfrt', 'spn', 'ssap', 'stem', 'str', 'tdb','toplayer', 'trman', 'ttb','Ndemc_c','Nuptc_c', &
'Nfol', 'Npool', 'Nstr','rooteff', 'watleft', 'yrw'/
DATA outcy%s_line /58*'# Cohort output'/ ! age, ahb, ahc, atr, asapw, bioi, botLayer, cpa, crt, daybb, dcrb, diac, diam,
! dtr, dwd, fol, foli, frt, frti, frtrel, geff, gfol, gfrt,
! grossass, gsap, gsd, hbo, hea, hrt, hei,
! leaf, maintres, nas, npp, rdpt, rld, sap, sfol, sfrt, spn,
! ssap, stem, str, tdb, topLayer, trman,ttb, Ndemc,Nuptc, rooteff,watleft
DATA outcy%f_line / &
'# Tree age (year)', & ! age
'# Cross sectional area of heartwood at stem base [cm**2] x_Ahb', & ! ahb
'# Relation of heartwood to sapwood at stem base', & ! ahbasrel
'# Cross sectional area of heartwood at crown base [cm**2] Ahc', & ! ahc
'# Relation of heartwood to sapwood at crown base', & ! ahcasrel
'# Cross sectional area of sapwood in bole space [cm**2] Asapw', & ! asapw
'# Number of alive trees per cohort', & ! atr
'# Net biomass increment (kg DM/year)', & ! bioi
'# Number of bottom layer of crown [-]', & ! botLayer
'# Cohort crown projection area (m2)', & ! cpa
'# coarse root biomass (kg DM/tree)', & ! crt
'# Day of leaf bud burst', & ! daybb
'# Diameter of stem at crown base (cm)',& ! dcrb
'# Drought index for allocation calculation (cum)', & ! diac
'# Diameter at breast height (cm)', & ! diam
'# Number of dead trees per cohort', & ! dtr
'# Stem biomass of dead trees per cohort', & ! dwd
'# Foliage biomass (kg DM/tree)', & ! fol
'# Foliage increment (kg DM/year/tree)', & ! foli
'# Fine root biomass (kg DM/tree)', & ! frt
'# Net fine root increment (kg DM/year/tree)', & ! frti
'# Relative fine root fraction of tree per soil layer (root profile)', & ! frtrel
'# Relative fine root fraction of cohort of total layer fine root mass per soil layer', & ! frtrel
'# Growth efficiency kg/m2', & ! geff
'# Gross growth rate foliage (kg DM/year/tree)', & ! gfol
'# Gross growth rate fine root (kg DM/year/tree)', & ! gfrt
'# Gross assimilation rate (kg DM/year/tree)', & ! grossass
'# Gross growth rate sapwood (kg DM/year/tree)', & ! gsap
'# Number of growing season days per year ndaysgr',& ! gsd
'# Bole height (cm)', & ! hbo
'# Number of years without stress', & ! hea
'# Total tree height (cm)', & ! hei
'# Heartwood biomass (kg DM/tree)', & ! hrt
'# Leaf area per tree (m2)', & ! leaf
'# Maintenance respiration (kg DM/year/tree)', & ! maintres
'# Net foliage assimilation rate (kg DM/year/tree)', & ! nas
'# NPP (kg DM/year/tree)', & ! npp
'# Rooting depth calculated with TRAP model[cm]', & ! rdpt
'# estimated root length density [cm]', & ! rld
'# Sapwood biomass (kg DM)', & ! sap
'# Senescence rate foliage (kg DM/year/tree)', & ! sfol
'# Senescence rate fine roots (kg DM/year/tree)', & ! sfrt
'# Species number of the cohort', & ! spn
'# Senescence rate sapwood (kg DM/year/tree)', & ! ssap
'# Stemwood biomass increment (kg DM/year/tree)', & ! stem
'# Number of stress years', & ! str
'# Total cohort dead biomass (kg DM/year/cohort)', & ! tdb
'# Number of top layer of crown [-]', & ! topLayer
'# Number of trees harvested by managment', & ! trman
'# Total tree biomass (kg DM/tree)', & ! ttb
'# N demand per tree and year (g)', & ! Ndemc_c
'# N uptake per tree and year (g)', & ! Nuptc_c
'# N content of foliage per tree and year (g)', & ! Nfol
'# N pool per tree and year (g)', & ! Npool
'# Ratio of N uptake to demand per tree and year', & ! Nstr
'# Root uptake efficiency factor', & ! rooteff
'# Water left in next layer', & ! watleft
'# Year ring width [mm]' / ! yrw
DATA outcy%header / &
58*'# Year Coh1 Coh2 Coh3 Coh4 ...'/ !age, ahb, ahc, atr, bioi, cpa, crt, daybb, dcrb, diac, diam,
! dtr, dwd, fol, foli, frt, frti, frtrel, geff, gfol, gfrt,
! gsap, gsd, hbo, hea, hrt, hei,
! leaf, maintres, nas, npp, rdpt, rld, sap, sfol, sfrt, spn,
! stem, str, tdb,trman, ttb, Ndemc,Nuptc, rooteff,watleft, yrw
! output at simulation end
type (out_struct),dimension(6),target :: oute
integer :: oute_n = 6 ! number of all declared end output files
DATA oute%kind_name /'sea', 'sea_ms', 'sea_npv', 'sea_st','wpm', 'wpm_inter'/
DATA oute%f_line / &
'# SEA: Costs and assets of standing stock, harvested timber, silvicultural costs, fix costs, and subsidies in euro/ha', &
'# SEA: Timber grading for harvested wood, m3/ha', &
'# SEA: liquidation value, npv, npv+ in euro/ha', &
'# SEA: Timber grading for standing stock, m3/ha', &
'# Wood product model output', &
'# Wood product model intermediate steps'/ !
DATA oute%s_line / &
'# shotcuts: sum: summe, st: standing stock, ms: harvested wood, fc: fix costs, sv: silvicultural costs, co: costs, as: assets, sub: subsidies, sp: spruce, be: beech, pi: pine, oa: oak, bi: birch, ' , &
'# Timber grades 1-7: 1-fue, 2-in, 3-LAS1a, 4-LAS1b, 5-LAS2a, 6-LAS2b, 7-LAS3a, 8-L2b, 9-L3a, 10-L3b ' , &
'# a: without discounting, b-d: interest rate (see "sea_prices.wpm" file) ' , &
'# Timber grades 1-7: 1-fue, 2-in, 3-LAS1a, 4-LAS1b, 5-LAS2a, 6-LAS2b, 7-LAS3a, 8-L2b, 9-L3a, 10-L3b ' , &
'# Carbon in different products, kg C/ha ' , &
'# Carbon in different products, kg C/ha tg: timber grades, il: industrial lines, pl: product lines'/
DATA oute%header / &
'# Year sum_all sum_st sum_ms sum_sv sum_fc sum_sub be_st_co sp_st_co pi_st_co oa_st_co bi_st_co |be_st_as sp_st_as pi_st_as oa_st_as bi_st_as |be_ms_co sp_ms_co pi_ms_co oa_ms_co bi_ms_co |be_ms_as sp_ms_as pi_ms_as oa_ms_as bi_ms_as fix_costs sub_har sub_sv_co sub_fix ', &! sea
'# Year be_tg1 be_tg2 be_tg5 be_tg6 be_tg7 be_tg8 be_tg9 be_tg10 &
&sp_tg1 sp_tg2 sp_tg4 sp_tg5 sp_tg6 sp_tg7 sp_tg8 sp_tg9 sp_tg10 &
&pi_tg1 pi_tg2 pi_tg3 pi_tg4 pi_tg5 pi_tg6 pi_tg7 pi_tg8 pi_tg9 pi_tg10 &
&oa_tg1 oa_tg2 oa_tg5 oa_tg6 oa_tg7 oa_tg8 oa_tg9 oa_tg10 &
&bi_tg1 bi_tg2 bi_tg5 bi_tg6 bi_tg7 bi_tg8 bi_tg9 bi_tg10', &! sea_ms
'# Year LVa LVb LVc LVd NPVa NPVb NPVc NPVd NPV+a NPV+b NPV+c NPV+d ', &! sea_npv
'# Year be_tg1 be_tg2 be_tg5 be_tg6 be_tg7 be_tg8 be_tg9 be_tg10 &
&sp_tg1 sp_tg2 sp_tg4 sp_tg5 sp_tg6 sp_tg7 sp_tg8 sp_tg9 sp_tg10 &
&pi_tg1 pi_tg2 pi_tg3 pi_tg4 pi_tg5 pi_tg6 pi_tg7 pi_tg8 pi_tg9 pi_tg10 &
&oa_tg1 oa_tg2 oa_tg5 oa_tg6 oa_tg7 oa_tg8 oa_tg9 oa_tg10 &
&bi_tg1 bi_tg2 bi_tg5 bi_tg6 bi_tg7 bi_tg8 bi_tg9 bi_tg10', &! sea_st
'# Year sum_input u1 u2 u3 u4 u5 u6 u7 sum_u1-7 burn&
& landfill atmo atmo_cum emission sub_energ sub_mat sub_sum', & ! wpm
'# Year tg1 tg2 tg3 tg4 tg5 tg6 il1 il2 il3 il4 il5 il6 il7 pl1 pl2 pl3 pl4 pl5 pl6 pl7 u1 u2 u3 u4 u5 u6 u7 '/ ! wpm_inter
! special output forms
INTEGER :: out_flag_light ! output flag light-file
INTEGER :: unit_err ! unit for error log file
INTEGER :: unit_trace ! unit for trace log file
INTEGER :: unit_sum ! unit for summation output (fluxes) file
INTEGER :: unit_comp1, unit_comp2 ! ncompressed output
INTEGER :: unit_light, unit_wat
INTEGER :: unit_ctr, unit_prod, unit_allo, unit_soil
INTEGER :: unit_soicnd, unit_soicna, unit_soicnr
! store output variables of veg-file
type out_veg
integer,dimension(3):: help_veg1
real,dimension(11):: help_veg2
real help_veg3
real :: help_veg4
real :: help_veg5
real :: help_veg6
end type out_veg
type (out_veg),allocatable,dimension(:),target :: sout
type (out_veg) :: vout
type out_C
real, dimension(366):: NEE ! net ecosystem exchange
real, dimension(366):: Resp_aut ! autotrophic respiration
end type out_C
type (out_C) :: Cout
character(100) :: mess_info = '# ' ! output of measurements: information line
end module data_out
!**************************************************************
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!*data module for a variety of parameters (non-species dependent)*!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_par
! from npp.f:
real :: pi = 3.1415926536 ! PI
real :: zero = 1.E-6 ! numerical zero
REAL :: lambda = 0.7 , & ! optimum ratio of ci to ca [-]
Cmass = 12.0 , & ! molar mass of carbon [g/mol]
gmin = 0.0 , & ! minimum conductance [mol/(m2*d)]
ps = 0.7 , & ! shape of PS response curve
pn = 0.025 , & ! slope of N function (eqn 27) at 20 �C [g(N) (mymol s-1)-1]
nc0 = 0.00715 , & ! minimum N content [g/g] (eqn 27)
qco2 = 0.08 , & ! C3 quantum efficiency (eqn 16)
qco2a = 1.0 , & ! scaling parameter (eqn A7)
o2 = 20.9 , & ! partial pressure of oxygen (kPa)
co2_st= 0.00035, & ! atmospheric CO2 content (mol/mol)
pfref = 0.2 , & ! albedo of the canopy
cpart = 0.5 , & ! part of C in biomass [-]
rmolw = 0.622 , & ! ratio of molecular weights of water and air
R_gas = 8.314 , & ! universal gas constant [J/mol/K] = [Pa/m3/K]
c_karman = 0.41 , & ! von Karman's constant [-]
c_air = 1.005 , & ! specific heat of air at const. pressure [J/g/K]
psycro =0.000662 , & ! psychrometer constant [hPa/K]
h_breast =137 , & ! breast height for inventory measurements [cm]
h_sapini = 200 , & ! height below which tree is initialised with sapling allometry
h_bo_br_diff = 50, & ! minimal difference between height of crown base and breast height
Q10_T = 2. ! used for calculation of dayfract from air temperature
DOUBLE PRECISION :: p0_co2 , & ! parameter variable for calculation of CO2 scenarios
p1_co2 , & ! parameter variable for calculation of CO2 scenarios
p2_co2 , & ! parameter variable for calculation of CO2 scenarios
p3_co2 , & ! parameter variable for calculation of CO2 scenarios
p4_co2 , & ! parameter variable for calculation of CO2 scenarios
p1_co2h , & ! parameter variable for calculation of historical CO2 scenarios
p2_co2h , & ! parameter variable for calculation of historical CO2 scenarios
p3_co2h , & ! parameter variable for calculation of historical CO2 scenarios
p4_co2h , & ! parameter variable for calculation of historical CO2 scenarios
p5_co2 ! parameter variable for calculation of CO2 scenarios
! Transformation coefficients
REAL :: gm2_in_kgha = 10. ! transf. coeff. from g/m2 in kg/ha
REAL :: kgha_in_gm2 = 0.1 ! transf. coeff. from kg/ha in g/m2
REAL :: gm2_in_tha = 0.01 ! transf. coeff. from g/m2 in t/ha
REAL :: tha_in_gm2 = 100. ! transf. coeff. from t/ha in g/m2
REAL :: kg_in_g = 1000. ! transf. coeff. from kg in g
REAL :: GR_in_PAR = 0.5*4.6/100. ! from global rad. in J/cm2 to PAR in mol/m2
! explanation of conversion factor:
! 0.5: PAR is 50% of incident radiation
! 4.6: 1 J = 4.6e-6 mol (Larcher 1995);
! 100: conversion J/cm2 -> MJ/m2
! soil parameter
real :: dens_om = 1.4 ! specific density of organic matter g/cm3
! parameter for snow
real :: temp_snow = 0.2 ! threshold of air temperature for snow accumulation
! parameter for calculation of potential evapotranspiration rate
real :: alpha_PT = 1.26 ! Priestley-Taylor coefficient
! parameter for calculation of transpiration demand
real :: alfm = 1.4
real :: gpmax = 14000. ! mol/(m2*d)
! parameter for growing degree day calculation
real :: thr_gdd = 5.
! van Genuchten parameter for flag_wred=9
real :: l_gnu = 0.5
! fol biomass per mistletoe [kg DW/tree], 1 Viscum (10years) see Pfiz 2010
real :: mistletoe_x_fol = 0.0158
! parameter for allocation to NSC-Pool
real :: decid_sap_allo = 0.042 !fraction of sapwood DW allocated to NSC-Pool for decidous tree species
real :: decid_tb_allo = 0.125 !fraction of twigs and branch DW allocated to NSC-Pool for decidous tree species
real :: decid_crt_allo = 0.125 !fraction of coarse root DW allocated to NSC-Pool for decidous tree species
real :: conif_sap_allo = 0.018 !fraction of sapwood allocated to NSC-Pool for coniferous tree species
real :: conif_tb_allo = 0.065 !fraction of twigs and branch allocated to NSC-Pool for coniferous tree species
real :: conif_crt_allo = 0.065 !fraction of coarse root DW allocated to NSC-Pool for coniferous tree species
! set of characters
character(len=*), parameter :: charset = &
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_"
! test
real, allocatable, dimension(:,:) ::lambda_ts
end module data_par
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for planting of seedlings/saplings *!
!* ! arrays have to be adapted to the species number ! *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_plant
integer :: quspec= 2 ! number of planted species
integer, dimension(13) :: infspec=(/1,0,1,0,0,0,0,0,0,0,0,0,0/) ! sign of planted species = 0/1
integer, dimension(13) :: npl_mix =(/3000,0,6000,4500,0,0,0,0,0,0, 0, 0, 0/) ! number of plants in mixed stands
integer, dimension(13) :: numplant=(/178,6000,8000,9000,10000,0,8000,1666, 1140, 2000, 5000, 0, 0/) ! number of plants per ha
integer, dimension(13) :: specpl=(/1,2,3,4,5,6,7,8, 9, 10, 11, 12, 13/) ! number of species
real, dimension(13) :: plant_height=(/130.,37.5,17.5,40.,8.7,0.,17.5,40.,17.5, 30.0, 30.0, 0., 0./) ! mean height of plants
real, dimension(13) :: plant_hmin=(/70.,25.,10.,30.,3.,0.,10.,30., 10., 20., 10., 0.,0./) ! minimum height of plants
real, dimension(13) :: hsdev=(/3.33,4.1,7.5,3.33,5.9,0.0,7.5,3.33, 7.5,4.1, 7.5, 0.,0. /) ! standard deviation od height
real, dimension(13) :: pl_age=(/10.,4.,2.,2.,1.,0.,2.,1.,2.,2., 2., 0.,0./) ! age of plants
real :: kappa = 1.2 !1.2
real :: ksi = 2.99 !1.5
integer, dimension(11,10) :: m_numplant
integer, dimension(11,10) :: m_specpl
real, dimension(11,10) :: m_plant_height
real, dimension(11,10) :: m_plant_hmin
real, dimension(11,10) :: m_pl_age
real, dimension(11,10) :: m_hsdev
integer :: m_numclass
end module data_plant
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* module data_simul *!
!* *!
!* contains follow global subroutines: *!
!* GETUNIT() function for unit number handling *!
!* TESTFILE(infile,ex) subroutine for testing, if a file exists *!
!* ERRORFILE(infile,ios,unitnum) subroutine for messages *!
!* during file reading *!
!* *!
!* FUNCTION GETUNIT *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_simul
integer :: anz_sim = 0 ! actual number of simulations
character(4) :: anh ! output file extension
integer :: time_b = 1951 ! start simulation year
integer :: time_cur ! current simulation year
integer :: clim_dt = 1 ! kind of climate resolution (daily/monthly) for weathergen.
integer :: repeat_number = 1 ! max. number of repeats
integer :: site_nr = 1 ! number of sites
integer :: year = 40 ! number of simulation years
integer :: ns_pro = 7 ! time step (days) for production module
integer :: ns_day ! loop variable for time step
integer :: ns ! loop variable for species
integer :: iday =1 ! actual day of simulation
integer :: ip ! loop variable for site_nr
integer :: time ! yearly loop variable in simulation_4c(from 1 to year)
integer :: monat
integer :: woche
integer :: flag_adapm = 0 ! flag for adaptive managemen:0/1(carried out last time step)
integer :: flag_bc = 0 ! flag for application of biochar (0 - no application)
integer :: flag_bc_add = 0 ! flag for output to file ...soil.ini for changes of soil parameters
! after addition of biochar (0 - no output)
integer :: flag_clim = 0 ! climate data for each site?(yes/no)
integer :: flag_climnam= 0 ! kind of generation of climate scenario names (flag_multi=8)
integer :: flag_co2 = 0 ! choice of amospheric CO2 scenario
integer :: flag_cohout = 1 ! flag for cohort output
integer :: flag_cohoutd= 1 ! flag for cohort output daily
integer :: flag_cohouty= 1 ! flag for cohort output yearly
integer :: flag_cond = 0 ! choice of heat conductance function
integer :: flag_cum = 0 ! internal flag of cumulativ calculations for output
integer :: flag_dayout = 0 ! flag of daily output
integer :: flag_decomp = 0 ! decomposition model
integer :: flag_depo = 0 ! deposition (set after reading file) 1 - mg/m2, 2 - mg/l
integer :: flag_dis = 0 ! choice of disturbance modus (1=on)
integer :: flag_hum = 0 ! internal flag for recalculation of field capcity etc. depending on humus
integer :: flag_end = 0 ! stop in partitio
integer :: flag_eva = 0 ! choice of evapotranspiration function
integer :: flag_folhei = 1 ! choice of foliage-height relationship
integer :: flag_lambda = 0 ! variable lambda time series/ FORSKA environmental factors and regeneration on/off(0)
integer :: flag_int = 0 ! choice of interception function
integer :: flag_inth = 0 ! internal flag for choice of interception function
integer :: flag_light = 3 ! flag for light absorption algorithm
integer :: flag_limi = 3 ! choice of limitations taken into account
integer :: flag_lit = 0 ! input of litter initialisation (internal control) (0 - no)
integer :: flag_mg = 0 ! choice of management (yes/no)
integer :: flag_mistle = 0 ! internal flag (1 = disturbance by mistletoe)
integer :: flag_mort = 1 ! mortality on/off
integer :: flag_multi = 0 ! Multiple run choice
integer :: flag_reg = 0 ! regeneration on/off
integer :: flag_resp = 0 ! choice of respiration modelling
integer :: flag_seedgr = 0 ! flag for weekly seedling growth
integer :: flag_sign = 0 ! choice of mode of calculation for sigman
integer :: flag_sens = 0 ! flag for sensitivity analysis (no input, derived from flag_multi)
integer :: flag_soilin = 0 ! internal flag for soil input version
integer :: flag_stand = 1 ! choice of initialization
integer :: flag_standup= 0 ! stand structure changed (1 - removal of trees, 2 - neww trees)
integer :: flag_stat = 0 ! flag for comparison with measurements
integer :: flag_sum = 0 ! flag for summation output
integer :: flag_sveg = 0 ! flag for soilvegetation (0 = no, 1 = intialis.)
integer :: flag_volfunc= 1 ! choice of volume function for trunc
integer :: flag_wred = 1 ! choice of soil water uptake function
integer :: flag_wurz = 0 ! choice of root distribution function
integer :: flag_wpm = 0 ! wpm flag
integer :: time_out = 1 ! time step of yearly output; compressed output if < 0
integer :: flag_cumNPP = 0 ! time step of summation of yearly NPP for mean yearly NPP in compressed output
logical :: flag_tree = .TRUE. ! internal flag : .TRUE. - all cohorts are trees
logical :: flag_redn =.FALSE. ! internal flag : .TRUE. - Redn<0 for at least one species
logical :: flag_mult9 = .TRUE. ! internal flag : .TRUE. - first run with flag_multi=9
logical :: flag_mult910 = .TRUE. ! internal flag : .TRUE. - runs with flag_multi=9 or flag_multi=10
logical :: flag_mult8910 = .TRUE. ! internal flag : .TRUE. - runs with flag_multi=8 or flag_multi=9 or flag_multi=10
logical :: flag_trace = .TRUE. ! internal flag : .TRUE. - output of trace.log
logical :: lmulti = .FALSE. ! stand initialisation file with several stands
logical :: lcomp1 = .TRUE. ! compressed output with start values
logical :: leaves_on = .false. ! detection of periods with lai > 0
integer :: all_leaves_on = 0 ! detection of periods with maximal lai
real :: thr_height = 50. ! threshold of height for ingrowth
integer :: n_T_downsteps = 0 ! number of steps to decrease temperature in multi-run 2
integer :: n_T_upsteps = 0 ! number of steps to increase temperature in multi-run 2
integer :: n_P_downsteps = 0 ! number of steps to decrease precipitation in multi-run 2
integer :: n_P_upsteps = 0 ! number of steps to increase precipitation in multi-run 2
real :: step_sum_T = 0. ! additive step for temperature change in multi-run 2
real :: step_fac_P = 0. ! factorial step for precipitation change in multi-run 2
real :: deltaT = 0. ! additive change of temperature
real :: deltaPrec = 1. ! factorial change of precipitation
integer :: jpar ! number (array size) of changed parameter (multi run)
real, dimension(200) :: vpar = -99.0 ! store of parameter changes (multi run)
character(30), dimension(50) :: outy_file ! name of yearly output files
integer :: nyvar ! number of yearly output files
character(30), dimension(50) :: outd_file ! name of daily output files
integer :: ndvar ! number of daily output files
character(30), dimension(50) :: outc_file ! name of cohort output files
integer :: ncvar ! number of cohort output files
integer :: ncdvar ! number of daily cohort output files
character(100), dimension(200) :: simpar ! name of changed parameter (multi run)
character(30), dimension(50) :: outvar ! name of output variables (multi run 4, 8, 9, 10)
integer :: nvar ! number of output variables (multi run 4, 8, 9, 10)
integer :: output_unit_all ! output unit number of all selected yearly variables (multi run 9, 10)
integer :: output_unit_all_m ! output unit number of all selected monthly variables (multi run 9, 10)
integer :: output_unit_all_w ! output unit number of all selected weekly variables (multi run 9, 10)
real,allocatable,save,dimension(:,:,:) :: output_var ! value array of output variables (multi run 4, 8, 9, 10)
! (number of output variable, site ip, year)
real,allocatable,save,dimension(:,:,:,:):: output_varm ! value array of monthly output variables (multi run 4, 8, 9, 10)
! (number of output variable, site ip, year, month)
real,allocatable,save,dimension(:,:,:,:):: output_varw ! value array of weekly output variables (multi run 4, 8, 9, 10)
! (number of output variable, site ip, year, week)
integer,allocatable,save,dimension(:) :: output_unit ! array of output unit numbers (multi run 9, 10)
integer,allocatable,save,dimension(:) :: output_unit_mon ! array of output unit numbers for monthly values
character(10), dimension(10) :: typeclim ! array of type of climate scenarios (multi run 9)
real,allocatable,save,dimension(:,:,:,:) :: climszenres ! data file with results from climate scenarios (flag_multi=9, 10)
! (number of output variable, site ip, climate scenario type, realization)
real,allocatable,save,dimension(:,:,:,:,:):: climszenyear ! data file with yearly results from climate scenarios (flag_multi=9, 10)
! (number of output variable, site ip, climate scenario type, realization, year)
real,allocatable,save,dimension(:,:,:,:,:):: climszenmon ! data file with monthly results from climate scenarios (flag_multi=9, 10)
! (number of output variable, site ip, climate scenario type, realization, month)
real,allocatable,save,dimension(:,:,:,:,:):: climszenweek ! data file with weekly results from climate scenarios (flag_multi=9, 10)
! (number of output variable, site ip, climate scenario type, realization, week)
character(150),allocatable,save,dimension(:) :: site_name ! names of simulation sites
character(150) :: site_name1 ! name of first simulation site (multi run 9)
integer :: allunit = 10 ! variable for function getunit
character(150):: actdir ! actual directory
character(150):: dirout = 'output/' ! directory of output files
character(150):: dirin = 'input/' ! directory of input files
character(150) :: simfile = 'test0.sim' ! default simulation parameter file
character(300),allocatable,save,dimension(:) :: climfile ! climate data file
character(300),allocatable,save,dimension(:,:,:) :: climszenfile ! data file from climate scenarios (flag_multi=9)
character(150),allocatable,save,dimension(:) :: sitefile ! site specific parameter file
character(150),allocatable,save,dimension(:) :: valfile ! soil start value file
character(150),allocatable,save,dimension(:) :: treefile ! tree initialization file
character(150),allocatable,save,dimension(:) :: manfile ! management file
character(150),allocatable,save,dimension(:) :: wpmfile ! wpm spinup file
character(150),allocatable,save,dimension(:) :: specfile ! species parameter file
character(150),allocatable,save,dimension(:) :: depofile ! deposition file
character(150),allocatable,save,dimension(:) :: redfile ! file of redN for each species
character(150),allocatable,save,dimension(:) :: litfile ! file of litter initialisation for each fraction and species
integer,allocatable,save,dimension(:) :: fl_co2 ! flag_co2 for flag_multi = 7
character(50),allocatable,save,dimension(:) :: standid ! stand identifier
character(50), allocatable, dimension(:) :: standid_list ! List of stand identifier in input file
real, allocatable, dimension(:,:) :: redN_list ! List of of RedN per species in con-file with flag_multi=8,9
integer :: anz_standid
logical :: lstandid
integer :: nrreal ! number of realizations of climate scenarios (flag_multi=9)
integer :: nrclim ! number of types of climate scenarios (flag_multi=9)
integer :: iclim ! actual number of climate scenario type (flag_multi=9)
integer :: site_anz ! number of all simulation runs for flag_multi=9
integer,dimension(12) :: monrec ! Anzahl Tage im Monat
integer :: dclass_w = 5 ! class width for diameter classification
!----------------------------------------------------------------------
contains
integer function getunit()
logical logo
inquire(allunit, opened=logo)
if(logo) allunit = allunit+1
if(allunit==5.or.allunit==6) allunit=7
getunit = allunit
end function getunit
!----------------------------------------------------------------------
subroutine testfile (infile,ex)
! test whether the file exists
character a
character(len=*),intent(inout) ::infile
logical, intent(out):: ex
ex = .false.
do
inquire (File = infile, exist = ex)
if (ex .eqv. .false.) then
print *, ' >>>foresee message: File ',trim(infile),' not exists !'
write (*,'(A)') ' (0)STOP program'
write(*,'(A)') ' (1) Repeat filename input (def)'
write(*,'(A)',advance='no') ' (2) Return to input choice: '
read (*,'(A)') a
select case(a)
case('0')
stop
case(' ','1')
write(*,'(A)',ADVANCE='NO') ' New filename: ';read (*,'(A75)')infile
case('2')
ex = .false.; exit
end select
else
if (flag_multi .ne. 9) print *, ' >>>foresee message: Filetest - file ',trim(infile),' exists! '
exit
end if
end do
end subroutine testfile
!----------------------------------------------------------------------
subroutine errorfile (infile, ios, unitnum)
! error message during file reading
integer ios, unitnum
logical ex
character(150) infile
character a
if (ios .ne. 0) then
print *,' >>>foresee message: error during file ',trim(infile),' reading!'
ex = .false.
write(*,'(A)',advance='no')' STOP program (y/n)? '
read *, a
if (a .eq. 'y' .or. a .eq. 'Y') then
print *,' Program will stop!'
stop
end if
else
if (flag_multi .ne. 9) print *,' >>>foresee message: reading file ',trim(infile),' completed'
endif
close (unitnum)
if (flag_multi .ne. 9) print *,' '
end subroutine errorfile
end module data_simul
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data module for site data *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************! *!
MODULE data_site
INTEGER :: patch_id ! Patch identifier
character(50) :: stand_id ! Stand identifier
REAL :: xlat ! latitude in radians
REAL :: lat = 52.24 ! Default Potsdam coordinates
REAL :: long = 13.04
REAL, DIMENSION(:), ALLOCATABLE :: latitude ! array of latitudes for multi run 8
REAL, ALLOCATABLE, DIMENSION(:) :: NHdep ! yearly deposition
REAL, ALLOCATABLE, DIMENSION(:) :: NOdep ! yearly deposition
INTEGER, ALLOCATABLE, DIMENSION(:) :: gwtable ! groundwater level class
! 1: 0 - 0.5 m
! 2: 0.5 - 1.0 m
! 3: 1.0 - 1.5 m
! 4: 1.5 - 2.0 m
! 5: > 2.0 m
character(50),ALLOCATABLE, DIMENSION(:) :: sitenum
! KLara
character(50),ALLOCATABLE, DIMENSION(:) :: clim_id
! WK
CHARACTER(13),ALLOCATABLE, DIMENSION(:) :: soilid
END module data_site
!*****************************************************************!
!* *!
!* 4C (FORESEE) Simulation Model *!
!* *!
!* *!
!* data modules of soil submodels *!
!* *!
!* containes: *!
!* DATA_SOIL *!
!* DATA_SOIL_CN *!
!* HELP_SOIL_CN *!
!* DATA_SOIL_T *!
!* DATA_SOIL_PARAM *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
module data_soil
! Variables and parameters of soil model
integer :: soil_id = -1 ! soil type identification
integer :: nlay = -1 ! number of soil layers
integer :: nroot_max = 1 ! number of rooting layers
integer :: s_typen = -1 ! soil type number: 1 - sand, 2 - loam,
! 3 - silt, 4 - clay
integer :: nlgrw ! number of layer with ground water
real :: grwlev ! groundwater level
real :: rmass1 ! rest of dry mass , 1. layer
! arrays with dimension nlay
real, allocatable, save, dimension(:) :: &
! Description of soil layers
thick, & ! thickness of the layer cm
mid, & ! middle of the layer cm
depth, & ! depth of the layer cm
! soil parameter
pv, & ! pore volume mm
pv_v, & ! pore volume vol%
dens, & ! soil density g/cm3
field_cap ,& ! field capacity mm
wilt_p ,& ! wilting point mm
f_cap_v ,& ! field capacity vol-%
wilt_p_v ,& ! wilting point vol%
spheat, & ! specific heat capacity J/(g K)
phv, & ! pH-value
quarzv, & ! content of quarz (Vol%)
sandv, & ! content of sand (Vol%, input: Mass%)
clayv, & ! content of clay (Vol%, input: Mass%)
siltv, & ! content of silt (Vol%, input: Mass%)
humusv, & ! content of humus (Vol%, input: Mass%)
skelv, & ! content of skeleton Vol%
skelfact, & ! skeleton factor for water calculation
vol, & ! volume of layer (cm3)
dmass, & ! dry mass of layer (g/m2)
! model parameter
wlam, & ! Lambda parameter for percolation
! soil state variables
wats, & ! water content mm
wats_1, & ! water content of previous day mm
watvol, & ! water content in vol%
wat_res, & ! water uptake resistance
perc, & ! percolation water mm
wupt_r, & ! water uptake by roots mm
wupt_ev, & ! water taking by evaporation mm
temps, & ! soil temperature ¡C
! soil help variables
fcaph, & ! field capacity without humus vol%
wiltph, & ! wilting point without humus vol%
pvh, & ! pore volume without humus vol%
! soil stress variables
BDopt, & ! optimum bulk density for root growth
fr_loss, & ! yearly fine root loss [%]
redis ! yearly part of redistribution [%]
integer, allocatable, save, dimension(:) :: &
s_drought ! number of drought days per layer
! other scalar state variables and parameter
integer :: snow_day = 0 ! days with continious snow cover day
real :: snow = 0. ! water equivalent of snow mm
real :: snow_m = 0. ! water from melting of snow mm
real :: cover = -99. ! percent of covering
real :: grwsup ! groundwater supply per day
real :: bucks_root ! bucket size (mm) of rooting zone
real :: bucks_100 ! bucket size (mm) of 1 m depth
real :: thick_1 ! thickness of first layer (old value)
! disturbance variable if xylem disturbance influence water uptake
real :: xylem_dis ! percentage of root water uptake reduction by xylem disturbance (flag_dis=1)
! yearly cumulative quantities
real :: perc_cum = 0. ! cumulative percolation water from last layer
real :: perc_sum = 0. ! sum of percolation water from last layer for weeks or months
real :: wupt_r_c = 0. ! cumulative water uptake by roots
real :: wupt_e_c = 0. ! cumulative soil evaporation
real :: wupt_cum = 0. ! cumulative whole water uptake
real :: wat_tot = 0. ! total water content of the soil profile
real :: grwsup_cum=0. ! groundwater supply per year
real, dimension(12) :: perc_mon ! monthly percolation water from last layer
real, dimension(53) :: perc_week ! wekkly percolation water from last layer
! mean quantities (per year)
real :: perc_m = 0. ! mean yearly percolation water from last layer
real :: wupt_r_m = 0. ! mean yearly water uptake by roots
! parameter
real :: fakt = 0.4 ! percolation factor
real :: w_ev_d = 7. ! depth of water taking out by evaporation (cm)
integer :: n_ev_d = 1 ! corresponding number of layer for w_ev_d
real, allocatable, save, dimension(:,:) :: xwatupt ! temp. aux. field of water uptake per cohort and layer
! arrays of given root distribution (defined input)
real, allocatable, save, dimension(:) :: root_fr ! root fraction per soil layer
! yearly fine root loss after Rasse et al. 2001
integer :: rdepth_kind ! kind of calculation of root depth
real, allocatable, dimension(:) :: wat_left ! auxiliary variable for coh%watleft to determin annual sum of available water in soil layer boardering on root zone
real, allocatable, dimension(:) :: wat_root ! auxiliary variable for coh%watleft to determin annual sum of availabel water in soil layer boardering on root zone
integer, allocatable, dimension(:) :: root_lay ! auxiliary variable for coh%nroot to determin root zone layer
real, allocatable, dimension(:) :: gr_depth ! auxiliary variable for coh%x_rdpt to determin annual sum of root growth
end module data_soil
!------------------------------------------------------------------------
module data_soil_cn
! Variables and parameters of soil_cn-model
integer :: nspeclit = 5 ! number of species-litter for decomposition and min.
integer :: kmint = 1 ! kind of reduction function of min. for temp.
integer :: knitt = 1 ! kind of reduction function of nit. for temp.
integer :: kminw = 1 ! kind of reduction function of min. for water
integer :: knitw = 1 ! kind of reduction function of nit. for water
! arrays with dimension nlay
real, allocatable, save, dimension(:) :: &
! C and N pools per layer
C_opm, & ! whole C-content of dead biomass per layer without stems / g/m2
C_hum, & ! C-content of humus per layer / g/m2
N_opm, & ! whole N-content of dead biomass per layer without stems / g/m2
N_hum, & ! N-content of humus per layer / g/m2
C_opmfrt, & ! C-content of dead fine roots per layer / g/m2
N_opmfrt, & ! N-content of dead fine roots per layer / g/m2
C_opmcrt, & ! C-content of dead coarse roots per layer / g/m2
N_opmcrt, & ! N-content of dead coarse roots per layer / g/m2
C_bc, & ! C-content of biochar per layer / g/m2
N_bc, & ! N-content of biochar per layer / g/m2
NH4, & ! NH4-content of the soil layer / g/m2
NO3, & ! NO3-content of the soil layer / g/m2
Nupt, & ! N uptake from the soil layer / g/m2
Nmin, & ! N mineralisation per day and soil layer / g/m2
! model parameter
rmin_phv, & ! reduction of mineralization depending on pH-value
rnit_phv, & ! reduction of nitrification depending on pH-value
cnv_opm, & ! C/N-ratio of dead biomass
cnv_hum, & ! C/N-ratio of humus
cnv_bc, & ! C/N-ratio of biochar
cpart_bc, & ! part of C in biochar
dens_bc ! density of biochar
real, allocatable, save, dimension(:) :: &
C_bc_appl,& ! C-content of biochar application per layer / g/m2
N_bc_appl ! C/N-ratio of biochar application per layer / g/m2
integer, allocatable, save, dimension(:) :: &
y_bc, & ! year of application of biochar
bc_appl_lay ! layer of biochar application
real :: Nleach ! N leaching from last layer per day / g/m2
real :: Nupt_d ! total daily N uptake / g/m2
real :: NH4_in, NO3_in ! input of NH4 and NO3 into the actual layer as
! deposition or transport / g/m2
real :: respsoil ! daily heterotrophic respiration / gC/m2
! Model parameter
real :: k_nit =0.0025 ! nitrification constant / per day
real :: pNH4f =0.1 ! part of free available NH4-N
real :: pNO3f =1.0 ! part of free available NO3-N
real :: k_hum_r=0.0003 ! mineralization constant of humus in mineral soil / per day
real :: k_hum =0.0002 ! mineralization constant of humus in humus layer / per day
real :: k_bc =0.00001 ! mineralization constant of biochar / per day
real :: k_syn_bc =0.003 ! synthesis coefficient of biochar / per day
integer :: y_bc_n ! actual array number of list of biochar application
integer :: n_appl_bc ! number of biochar applications
type species_litter
character (len=20) :: species_name
! soil C- and N-pools of primary organic matter per species and fraction
real :: C_opm_fol ! C-content of foliage litter pool / g/m2
real :: N_opm_fol ! N-content of foliage litter pool / g/m2
real :: C_opm_tb ! C-content of twigs and branches litter pool / g/m2
real :: N_opm_tb ! N-content of twigs and branches litter pool / g/m2
real :: C_opm_stem ! C-content of stemwood litter pool / g/m2
real :: N_opm_stem ! N-content of stemwood litter pool / g/m2
real,dimension(50):: C_opm_frt ! C-content of fine root litter pool / g/m2
real,dimension(50):: N_opm_frt ! N-content of fine root litter pool / g/m2
real,dimension(50):: C_opm_crt ! C-content of coarse root litter pool / g/m2
real,dimension(50):: N_opm_crt ! N-content of coarse root litter pool / g/m2
! C/N-ratios of organic primary matter fractions
real :: cnv_opm_fol ! C/N-ratio of foliage litter pool
real :: cnv_opm_tb ! C/N-ratio of twigs, branches litter pool
real :: cnv_opm_stem ! C/N-ratio of stemwood litter pool
real :: cnv_opm_frt ! C/N-ratio of fine root litter pool
real :: cnv_opm_crt ! C/N-ratio of coarse root litter pool
end type species_litter
type (species_litter),allocatable,dimension(:),target :: slit, slit_1
! yearly and cumulative quantities
real :: N_min = 0. ! cumulative netto mineralisation per year
real :: N_min_m = 0. ! mean cumulative netto mineralisation of all years
real :: N_tot = 0. ! total N content of the soil profil at the end of the year
real :: C_tot = 0. ! total C content of the soil profil at the end of the year
real :: N_lit = 0. ! N content of total litter per year
real :: C_lit = 0. ! C content of total litter per year
real :: N_lit_m = 0. ! mean cumulative N content of total litter of all years
real :: C_lit_m = 0. ! mean cumulative C content of total litter of all years
real :: N_lit_fol = 0. ! N content of foliage litter per year
real :: C_lit_fol = 0. ! C content of foliage litter per year
real :: N_lit_frt = 0. ! N content of fine root litter per year
real :: C_lit_frt = 0. ! C content of fine root litter per year
real :: N_lit_crt = 0. ! N content of coarse root litter per year
real :: C_lit_crt = 0. ! C content of coarse root litter per year
real :: N_lit_tb = 0. ! N content of litter from twigs and branches per year
real :: C_lit_tb = 0. ! C content of litter from twigs and branches per year
real :: N_lit_stem = 0. ! N content of new dead stems per year
real :: C_lit_stem = 0. ! C content of new dead stems per year
real :: N_hum_tot = 0. ! N content of total humus
real :: C_hum_tot = 0. ! C content of total humus
real :: N_an_tot = 0. ! total anorganic N
real :: Nupt_c = 0. ! total N uptake per year / g N/m2
real :: Nupt_m = 0. ! mean total N uptake per year
real :: Nleach_c = 0. ! cumul. N leaching from last layer per year
real :: Nleach_m = 0. ! mean cumulative N leaching from last layer of all years
real :: resps_c = 0. ! yearly soil respiration / gC/m2
real :: resps_c_m = 0. ! mean yearly soil respiration / gC/m2
real :: C_opm_fol ! C-content of total foliage litter pool / g/m2
real :: N_opm_fol ! N-content of total foliage litter pool / g/m2
real :: C_opm_stem ! C-content of total stemwood litter pool / g/m2
real :: N_opm_stem ! N-content of total stemwood litter pool / g/m2
real :: C_opm_tb ! C-content of total twigs, branches root litter pool / g/m2
real :: N_opm_tb ! N-content ofv twigs, branches litter pool / g/m2
real :: C_opm_frt ! C-content of total fine root litter pool / g/m2
real :: N_opm_frt ! N-content of total fine root litter pool / g/m2
real :: C_opm_crt ! C-content of total coarse root litter pool / g/m2
real :: N_opm_crt ! N-content of total coarse root litter pool / g/m2
real :: C_accu = 0. ! C accumulation (new C_tot - old C_tot) / t C/ha
! (mean of all years at the end of simulation)
real :: C_hum_1 ! C content in humus of the litter layer / t C/ha
real :: C_tot_1 ! total C content of the litter layer / t C/ha
real :: C_hum_40 ! C content in humus of the soil profil up to 40cm depth / t C/ha
real :: C_tot_40 ! total C content of the soil profil up to 40cm depth / t C/ha
real :: C_hum_80 ! C content in humus of the soil profil up to 80cm depth / t C/ha
real :: C_tot_80 ! total C content of the soil profil up to 80cm depth / t C/ha
real :: C_hum_100 ! C content in humus of the soil profil up to 100cm depth / t C/ha
real :: C_tot_100 ! total C content of the soil profil up to 100cm depth / t C/ha
real :: C_bc_tot ! total C content of biochar / g C/m2
real :: N_bc_tot ! total N content of biochar / g N/m2
real, dimension(12) :: resps_mon ! mean monthly soil respiration / gC/m2
real, dimension(53) :: resps_week ! mean weekly soil respiration / gC/m2
real, allocatable, save, dimension(:,:) :: xNupt ! temp. aux. field of N uptake per cohort and layer
integer unit_litter
end module data_soil_cn
!------------------------------------------------------------------------
module help_soil_cn
! internal variables for decomposition calculation
real khr, knr, ks, kbc ! reduced humif., nitr. and syth. coeff.
real remin ! reduction function of mineralisation
real reptermc, reptermn ! reprod. terms of C-/ N-pools
real term1, term2, term3, term4 ! parts of equ. III
real hexph, hexpn ! exponential parts
real cnvh ! reciprocal C/N-ratio of humus
end module help_soil_cn
!------------------------------------------------------------------------
module data_soil_t
! Variables and parameters for soil temperature calculation
integer :: flag_surf = 0 ! calculation of soil surface temperature
! 0 - surface temperature equals temperature of first layer
! 1 - with explicit surface temperature
real temps_surf ! soil surface temperature
real hflux_surf ! soil heat flux at soil surface
! model parameters
real :: C0 = 0.76, & ! coefficients for calculation of surface temperature
C1 = 0.05, &
C2 = 0.3
! arrays with dimension nlay2
real, allocatable, save, dimension(:) :: &
t_cond, & ! thermal conductivity J/(cm s K)
t_cb , & ! weighted mean of thermal conductivity (term of values b)
h_cap, & ! heat capacity J/(cm3 K)
t_diff ! thermal diffusivity cm2/s
! internal variables for calculation of thermal conductivity
type therm_par ! parameter of soil fractions (particles)
real:: vf ! volume fraction
real:: hc ! heat capacity J/(cm3 K)
real:: tc ! thermal conductivity J/(cm s K)
real:: kwa ! weighting factor k for continous medium air
real:: kww ! weighting factor k for continous medium water
real:: ga ! shape factor of particles
end type therm_par
type (therm_par):: water
type (therm_par):: quarz
type (therm_par):: clay
type (therm_par):: silt
type (therm_par):: humus
type (therm_par):: air
type (therm_par):: ice
type (therm_par):: stone
! internal variables for the numerical solution
integer :: nlay1, nlay2 ! number of 2 additional layers
! diagonals of the matrix
! arrays with dimension nlay2
real, allocatable, save, dimension(:) :: &
sb, & ! term of values b (reciprocal mean of thickness)
sv, & ! thickness times time step
sh, & ! thickness
sbt, & ! aux. array of soil temperature
sxx, & ! right side and result (soil temperature)
svv, & ! thickness times heat capacity
svva,& ! svv from previous time step
soh ! Hauptdiagonale
! array with dimension nlay2+1
real, allocatable, save, dimension(:) :: son ! Nebendiagonale
integer mfirst ! first elemet number of matrix
logical lfirst ! .true for the first time
! variables for Fourier analysis
integer :: NK ! Anzahl der Fourier-Koeffizienten
real, dimension(200) :: FTA, FTO ! Fourier-Koeffizienten
real, dimension(366) :: Four_sp ! Stuetzstellen
real :: TQ ! mittlere Temp.
integer :: it = 1 ! Starttag fuer Temp.-Profil
end module data_soil_t
!------------------------------------------------------------------------
module data_soil_param
! soil type parameters
real, dimension(13):: grwdist ! distance groundwater level to root depth
type soiltype
character(10) :: stype ! soil type
real :: lambda ! percolation coefficient lambda
real, dimension(13):: rate ! supply of groundwater to root
end type soiltype
type(soiltype), dimension(40):: soil ! parameter setting in subroutine soil_ini_param
DATA grwdist / 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140, 170, 200/
DATA soil%stype / 'Ss','gS','mS','fS','Su2','St2','Sl2','Su3','St3','Sl3','Su4','Slu','Sl4','Ls2', &
'Ls4','Lt2','Ts3','Ts4','Lts','Lt3','Tu3','Tu4','Tt','Tu2','Ts2','Tl','Lu', &
'Ut4','Us','Uls','Ut2','Ul2','Ut3','Ul3','Uu','Hum','Hh','Hu','Hn','' /
DATA soil%lambda / 1.50, 1.50, 1.50, 1.15, 0.90, 0.67, 0.60, 0.50, 0.30, 0.38, 0.37, 0.27, 0.30, &
0.30, 0.24, 0.23, 0.23, 0.22, 0.22, 0.22, 0.24, 0.26, 0.30, 0.15, 0.15, 0.15, &
0.15, 0.27, 0.25, 0.29, 0.29, 0.27, 0.27, 0.25, 0.25, 0.27, -99., -99., -99., -99. /
DATA soil(1)%rate / 5.2, 5.0, 1.5, 0.5, 0.2, 0.1, 0, 0, 0, 0, 0, 0, 0.0 /
DATA soil(2)%rate / 5.2, 5.0, 1.5, 0.5, 0.2, 0.1, 0, 0, 0, 0, 0, 0, 0.0 /
DATA soil(3)%rate / 5.8, 5.5, 5.3, 3, 1.2, 0.5, 0.2, 0.1, 0, 0, 0, 0, 0 /
DATA soil(4)%rate / 5.8, 5.5, 5.3, 5.1, 3, 1.5, 0.7, 0.3, 0.15, 0.1, 0, 0, 0 /
DATA soil(5)%rate / 5.8, 5.5, 5.3, 5.1, 4.5, 2.5, 1.5, 0.7, 0.4, 0.1, 0.08, 0, 0 /
DATA soil(6)%rate / 5.8, 5.5, 5.3, 5.1, 4.5, 2.5, 1.5, 0.7, 0.4, 0.1, 0.08, 0, 0 /
DATA soil(7)%rate / 5.8, 5.5, 5.3, 5.1, 4.5, 2.5, 1.5, 0.7, 0.4, 0.1, 0.08, 0, 0 /
! 6 > 5.0;> 5.0;> 5.0;> 5.0;4.5;2.5;1.5;0.7;0.4;0.1;< 0.1;0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! 7 > 5.0;> 5.0;> 5.0;> 5.0;4.5;2.5;1.5;0.7;0.4;0.1;< 0.1;0;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! 8 > 5.0;> 5.0;> 5.0;> 5.0;5;3.5;2;1.5;0.8;0.3;0.1;< 0.1;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! 9 > 5.0;> 5.0;> 5.0;> 5.0;3;2;1;0.7;0.4;0.15;< 0.1;0;0
! 10 > 5.0;> 5.0;> 5.0;> 5.0;5;3.5;2;1.5;0.8;0.3;0.1;< 0.1;0
! 11 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;5;3;2;1;0.5;0.15;0
! 12 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;5;3;2;1;0.5;0.15;0
! 13 > 5.0;> 5.0;> 5.0;> 5.0;3;2;1;0.7;0.4;0.15;< 0.1;0;0
! 14
! 15 > 5.0;> 5.0;> 5.0;3.5;2;1.3;0.8;0.5;0.3;0.15;< 0.1;0;0
! 16 > 5.0;> 5.0;> 5.0;3.5;2;1.3;0.8;0.5;0.3;0.15;< 0.1;0;0
! 17 > 5.0;> 5.0;> 5.0;3.5;2;1.3;0.8;0.5;0.3;0.15;< 0.1;0;0
! 18 > 5.0;> 5.0;4;2;1;0.7;0.5;0.3;0.2;0.1;< 0.1;0;0
! 19
! 20
! 21 > 5.0;> 5.0;2.5;1.2;0.7;0.5;0.3;0.2;0.15;< 0.1;0;0;0
! 22 > 5.0;> 5.0;2.5;1.2;0.7;0.5;0.3;0.2;0.15;< 0.1;0;0;0
! 23 > 5.0;> 5.0;4;2;1;0.7;0.5;0.3;0.2;0.1;< 0.1;0;0
! 24 > 5.0;> 5.0;> 5.0;> 5.0;4.5;3.5;2.5;2;1.5;0.8;0.4;0.2;< 0.1
! 25 4;2;1.1;0.7;0.5;0.4;0.35;0.3;0.22;0.17;0.14;0.1;< 0.1
! 26 4;2;1.1;0.7;0.5;0.4;0.35;0.3;0.22;0.17;0.14;0.1;< 0.1
! 27
! 28 4;2;1.1;0.7;0.5;0.4;0.35;0.3;0.22;0.17;0.14;0.1;< 0.1
! 29 > 5.0;> 5.0;> 5.0;> 5.0;4.5;3.5;2.5;2;1.5;0.8;0.4;0.2;< 0.1
! 30 > 5.0;> 5.0;> 5.0;> 5.0;4.5;3.5;2.5;2;1.5;0.8;0.4;0.2;< 0.1
! 31 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;5;3.5;2;1;0.5;0.15
! 32 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;4.5;3;2.5;1.5;0.7;0.3;0.1
! 33 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;4.5;3;2.5;1.5;0.7;0.3;0.1
! 34
! 35 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;4.5;3;2.5;1.5;0.7;0.3;0.1
! 36
! 37 > 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;> 5.0;5;3.5;2;1;0.5;0.15
end module data_soil_param
!*****************************************************************!
!* *!
!* 4C Simulation Model: Module data_species *!
!* *!
!* *!
!* module for species parameters *!
!* *!
!* Copyright (C) 1996-2018 *!
!* Potsdam Institute for Climate Impact Reserach (PIK) *!
!* Authors and contributors see AUTHOR file *!
!* This file is part of 4C and is licensed under BSD-2-Clause *!
!* See LICENSE file or under: *!
!* http://www.https://opensource.org/licenses/BSD-2-Clause *!
!* Contact: *!
!* https://gitlab.pik-potsdam.de/foresee/4C *!
!* *!
!*****************************************************************!
MODULE data_species
! general parameters
INTEGER :: nspecies ! number of all species (incl. ground vegetation)
INTEGER :: nspec_tree ! number of tree species
INTEGER :: spec_help = 1 ! aux var for species number
REAL :: weibal = 1.5 ! mortality parameter (NOT species-specific)
REAL :: weibal_int = 0.1 ! mortality parameter of intrinsic mortality
REAL :: NPP_demand_mistletoe !helping var. to substract demand of mistletoe from pine cohort
! species-specific parameters
TYPE species_par
CHARACTER (len=30) :: species_name
CHARACTER (len=15) :: species_short_name
! mortality parameters
INTEGER :: max_age ! maximum tree age [yr]
INTEGER :: yrec ! stress recovery time [yr]
INTEGER :: stol ! shade tolerance class [1=intol, 5=tol]
REAL :: intr ! intrinsic mortality rate [?]
REAL :: weibla ! lambda parameter of Weibull distribution [?]
! photosynthesis parameters
REAL :: psla_min ! minimum specific one-sided leaf area [m2/kg DW]
REAL :: psla_a ! light dep. specific one-sided leaf area [m2/kg DW]
REAL :: phic ! efficiency parameter, different for everg/decid [-]
REAL :: pnc ! leaf N content [mg/g]
REAL :: kco2_25 ! Michaelis constant for CO2 (base 25 °C) [Pa]
REAL :: ko2_25 ! inhibition constant of O2 (base 25 °C) [kPa]
REAL :: pc_25 ! CO2/O2 specificity ratio (base 25 °C) [-]
REAL :: q10_kco2 ! Q10 coefficients (acclimated to 25 °C) [-]
REAL :: q10_ko2 ! [-]
REAL :: q10_pc ! [-]
REAL :: pb ! Rd to Vm ratio [-]
REAL :: Nresp ! slope of photosynthesis response to Nitrogen [yr/kg/ha]
! NPP parameters
REAL :: respcoeff ! respiration coefficient
REAL :: prg ! growth respiration [/day]
REAL :: prms ! maintenance resp. (base 15 °C): sapwood, [/day]
REAL :: prmr ! fine roots [/day]
REAL :: q10_prms ! Q10 coefficients (acclimated to 15 °C) [-]
REAL :: q10_prmr ! [-]
! allocation parameters
REAL :: pfext ! extinction coefficient
REAL :: sigman ! root activity rate (N uptake) [/yr]
REAL :: psf ! senescence rates: foliage, [/yr]
REAL :: pss ! sapwood, [/yr]
REAL :: psr ! fine roots [/yr]
REAL :: pcnr ! N/C ratio of biomass [kg N/kg C]
REAL :: cnr_fol ! C/N ratio of foliage [kg C/kg N]
REAL :: cnr_frt ! C/N ratio of fine roots [kg C/kg N]
REAL :: cnr_crt ! C/N ratio of coarse roots [kg C/kg N]
REAL :: cnr_tbc ! C/N ratio of twigs and branches [kg C/kg N]
REAL :: cnr_stem ! C/N ratio of stemwood [kg C/kg N]
REAL :: ncon_fol ! N concentration of foliage [mg/g]
REAL :: ncon_frt ! N concentration of fine roots [mg/g]
REAL :: ncon_crt ! N concentration of coarse roots [mg/g]
REAL :: ncon_tbc ! N concentration of twigs and branches [mg/g]
REAL :: ncon_stem ! N concentration of stemwood [mg/g]
REAL :: reallo_fol ! reallocation parameter of foliage
REAL :: reallo_frt ! reallocation parameter of fine root
REAL :: prhos ! sapwood density [kg/cm3]
REAL :: pnus ! foliage to sapwood area relationship [kg/cm2]
REAL :: alphac ! (twigs, branches & coarse roots) to sapwood ratio [-]
REAL :: cr_frac ! fraction of tbc (twigs, branches, roots) that is coarse roots [-]
REAL :: pha ! height growth rate [cm/kg]
REAL :: pha_coeff1 ! " coefficient 1
REAL :: pha_coeff2 ! " coefficient 2
REAL :: pha_v1 ! parameter for non-linear height-foliage relationship
REAL :: pha_v2 ! "
REAL :: pha_v3 ! "
REAL :: crown_a ! parameter to calculate crown radius from DHB [m/cm]
REAL :: crown_b ! parameter to calculate crown radius from DHB [m]
REAL :: crown_c ! parameter to calculate crown radius from DHB [m]
! decomposition parameters per fraction
REAL :: k_opm_fol ! mineralization constant of foliage litter / per day
REAL :: k_syn_fol ! synthesis coefficient of foliage litter / fraction
REAL :: k_opm_tb ! mineralization constant of twigs and branches litter / per day
REAL :: k_syn_tb ! synthesis coefficient of twigs and branches litter / fraction
REAL :: k_opm_stem ! mineralization constant of stemwood / per day
REAL :: k_syn_stem ! synthesis coefficient of stemwood / fraction
REAL :: k_opm_frt ! mineralization constant of fine root / per day
REAL :: k_syn_frt ! synthesis coefficient of fine root / fraction
REAL :: k_opm_crt ! mineralization constant of coarse root / per day
REAL :: k_syn_crt ! synthesis coefficient of coarse root / fraction
! phenology parameters
! PIM: Promotor-Inhibitor model
! CSM: Cannel and Smoth model
! TSM: linear temperature sum model
REAL :: PItmin ! PIM: Inhibitor min temp. [°C]
REAL :: PItopt ! PIM: Inhibitor opt temp. [°C]
REAL :: PItmax ! PIM: Inhibitor max temp. [°C]
REAL :: PIa ! PIM: Inhibitor scaling factor [-]
REAL :: PPtmin ! PIM: Promotor min temp. [°C]
REAL :: PPtopt ! PIM: Promotor opt temp. [°C]
REAL :: PPtmax ! PIM: Promotor max temp. [°C]
REAL :: PPa ! PIM: Promotor scaling factor [-]
REAL :: PPb ! PIM: Promotor scaling factor [-]
REAL :: CSTbC ! CSM: chilling base temp. [°C]
REAL :: CSTbT ! CSM: base temp. [°C]
REAL :: CSa ! CSM: scaling factor [-]
REAL :: CSb ! CSM: scaling factor [-]
REAL :: LTbT ! TSM: base temp. [°C]
REAL :: LTcrit ! TSM: critical temperature sum [°C]
integer :: Lstart ! TSM: start day after 1.11.
integer :: Phmodel ! used pheno model 0: no model, 1: PIM, 2: CSM, 3: TSM
REAL :: end_bb ! last day for vegetation period
integer :: flag_endbb = 0
! Canopy parameters
REAL :: ceppot_spec ! species parameter for pot. intercept. [mm/m2 leaf area]
REAL :: fpar_mod ! Parameter in canopy_geom (Petra) temp?
! regeneration parameter
REAL :: regflag ! flag for regenration control
REAL :: seedrate ! maximum seed rate per m2
REAL :: seedmass ! mass of single seed [g DW], mean value
REAL :: seedsd ! standard deviation of seed mass
REAL :: seeda ! parameter of shoot biomass - foliage mass emp. relation
REAL :: seedb ! ------------"-------------
REAL :: pheight1 ! parameter of shoot biomass - height emp. relation
REAL :: pheight2 ! ---------"--------------
REAL :: pheight3 ! ---------"--------------
REAL :: pdiam1 ! parameter of shoot biomass -diameter emp. relation
REAL :: pdiam2 ! -------------"-----------
REAL :: pdiam3 ! -------------"-----------
! parameter for root growth model
REAL :: spec_rl ! specific root length [m/g DW]
REAL :: tbase ! minimum temperature for root growth [°C]
REAL :: topt ! optimum temperature for root growth [°C]
REAL :: bdmax_coef ! for equation of maximum bulk density for root growth []
REAL :: porcrit_coef ! for equation critical pore space for aeration []
REAL :: ph_opt_max ! maximum pH-value for optimal root growth
REAL :: ph_opt_min ! minimum pH-value for optimal root growth
REAL :: ph_max ! maximum pH-value for root growth
REAL :: ph_min ! minimum pH-value for root growth
REAL :: v_growth ! maximum velocity of coarse root growth [cm/day]
END type species_par
TYPE (species_par),allocatable,save,dimension(:),target :: spar
END MODULE data_species