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 1129 additions and 110 deletions
File added
File deleted
File added
File added
No preview for this file type
No preview for this file type
File deleted
No preview for this file type
No preview for this file type
File added
File added
File added
File added
/*
* 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_ */
...@@ -121,7 +121,7 @@ module data_soil ...@@ -121,7 +121,7 @@ module data_soil
! arrays of given root distribution (defined input) ! arrays of given root distribution (defined input)
real, allocatable, save, dimension(:) :: root_fr ! root fraction per soil layer real, allocatable, save, dimension(:) :: root_fr ! root fraction per soil layer
! dp_rfr ! depth of root fraction / cm
! yearly fine root loss after Rasse et al. 2001 ! yearly fine root loss after Rasse et al. 2001
integer :: rdepth_kind ! kind of calculation of root depth 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_left ! auxiliary variable for coh%watleft to determin annual sum of available water in soil layer boardering on root zone
...@@ -298,15 +298,15 @@ module data_soil_t ...@@ -298,15 +298,15 @@ module data_soil_t
! Variables and parameters for soil temperature calculation ! Variables and parameters for soil temperature calculation
integer flag_surf ! calculation of soil surface temperature integer :: flag_surf = 0 ! calculation of soil surface temperature
! 0 - old version ! 0 - surface temperature equals temperature of first layer
! 1 - new ersion with explicit surface temperature ! 1 - with explicit surface temperature
real temps_surf ! soil surface temperature real temps_surf ! soil surface temperature
real hflux_surf ! soil heat flux at soil surface real hflux_surf ! soil heat flux at soil surface
! model parameters ! model parameters
real :: C0 = 0.76, & ! Faltungskoeff. real :: C0 = 0.76, & ! coefficients for calculation of surface temperature
C1 = 0.05, & C1 = 0.05, &
C2 = 0.3 C2 = 0.3
......
...@@ -50,11 +50,12 @@ if (hum .le. 0.) then ...@@ -50,11 +50,12 @@ if (hum .le. 0.) then
else if (hum .gt. 100.) then else if (hum .gt. 100.) then
hum = 100. hum = 100.
endif endif
if (press .gt. 0.) then if (prs(i,j) .gt. 0.) then
press = prs(i,j) press = prs(i,j)
else else
press = 1013. press = 1013.
endif endif
rad = rd(i,j) rad = rd(i,j)
wind = wd(i,j) wind = wd(i,j)
if (wind .lt. 0.) wind = 0.5 if (wind .lt. 0.) wind = 0.5
......
...@@ -118,7 +118,8 @@ SUBROUTINE INITIA ...@@ -118,7 +118,8 @@ SUBROUTINE INITIA
! end of declaration section ! end of declaration section
!****************************************************************************** !******************************************************************************
ncl1 = 60 !ncl1 = 60
ncl1=40
allocate (zheigh(ncl1), zbhd(ncl1), zhbc(ncl1), nz(ncl1)) allocate (zheigh(ncl1), zbhd(ncl1), zhbc(ncl1), nz(ncl1))
allocate (smaldc(ncl1), bigdc(ncl1)) allocate (smaldc(ncl1), bigdc(ncl1))
print *,' ' print *,' '
...@@ -133,7 +134,7 @@ WRITE(*,'(A)',advance='no') ' ***Make your choice: ' ...@@ -133,7 +134,7 @@ WRITE(*,'(A)',advance='no') ' ***Make your choice: '
READ *, data_flag READ *, data_flag
print *,' ' print *,' '
clwdth=2 !set diameter class-class width clwdth=15 !set diameter class-class width
corr_la=1. !standard value for leaf area correction in stands of high sum of crown projection areas corr_la=1. !standard value for leaf area correction in stands of high sum of crown projection areas
mixed_tot_ca=0. !sum of crown projection area for mixed stands mixed_tot_ca=0. !sum of crown projection area for mixed stands
pass = 1 !counter for number of passes through calculation loop for mixed stands pass = 1 !counter for number of passes through calculation loop for mixed stands
...@@ -256,7 +257,7 @@ CASE(1) ...@@ -256,7 +257,7 @@ CASE(1)
IF (datasets=='multi') THEN IF (datasets=='multi') THEN
select_lines=.false. select_lines=.false.
fl_num=0 fl_num=0
if(infile=='input/hyyti_ini_0616.txt') then
ALLOCATE(ngroups(10000)) ALLOCATE(ngroups(10000))
numstand= 0 numstand= 0
...@@ -291,7 +292,6 @@ if(infile=='input/hyyti_ini_0616.txt') then ...@@ -291,7 +292,6 @@ if(infile=='input/hyyti_ini_0616.txt') then
iF(baum(i).EQ.22) ngroups(nlines)%taxid=6 ! Larix iF(baum(i).EQ.22) ngroups(nlines)%taxid=6 ! Larix
iF(baum(i).EQ.23) ngroups(nlines)%taxid=7 ! Pinus strobus iF(baum(i).EQ.23) ngroups(nlines)%taxid=7 ! Pinus strobus
iF(baum(i).EQ.24) ngroups(nlines)%taxid=10 ! Douglasie iF(baum(i).EQ.24) ngroups(nlines)%taxid=10 ! Douglasie
IF (dm(i).eq.0) dm(i) = 0.5 IF (dm(i).eq.0) dm(i) = 0.5
IF (mhoe(i).eq.0) mhoe(i) = 1.0 IF (mhoe(i).eq.0) mhoe(i) = 1.0
IF (gf(i).eq.0) gf(i) = 0.25 IF (gf(i).eq.0) gf(i) = 0.25
...@@ -310,50 +310,6 @@ if(infile=='input/hyyti_ini_0616.txt') then ...@@ -310,50 +310,6 @@ if(infile=='input/hyyti_ini_0616.txt') then
3333 CONTINUE 3333 CONTINUE
nlines=nlines-1 nlines=nlines-1
WRITE(*,*) nlines,'sets of data', numstand, 'sets of stands' WRITE(*,*) nlines,'sets of data', numstand, 'sets of stands'
ELSE
IF(select_lines) THEN
READ(listunit,*)nlines_comp
ALLOCATE(locid_comp(nlines_comp))
DO i=1,nlines_comp ! reading list of sites to be initialised
READ(listunit,*) locid_comp(i)
ENDDO ! end reading list of sites to be initialised
ENDIF ! end of reading file with sites to be selected
IF(select_lines) CLOSE(listunit)
CALL assign_DSW
CALL init_plenter_param
READ (inunit,*)nlines
ALLOCATE(ngroups(nlines))
istart=1
READ(inunit,*) ngroups(1)%locid,ngroups(1)%schicht,ngroups(1)%BRAid,ngroups(1)%alter,ngroups(1)%patchsize,ngroups(1)%mhoe,ngroups(1)%dm,ngroups(1)%volume,ngroups(1)%gf
ngroups(1)%patchsize=ngroups(1)%patchsize*10000.
ngroups(1)%baumzahl=0
ngroups(istart)%standsize=ngroups(1)%patchsize
ngroups(1)%taxid=tax_of_BRA_id(ngroups(1)%BRAid)
DO i=2,nlines
READ(inunit,*) ngroups(i)%locid,ngroups(i)%schicht,ngroups(i)%BRAid,ngroups(i)%alter,ngroups(i)%patchsize,ngroups(i)%mhoe,ngroups(i)%dm,ngroups(i)%volume,ngroups(i)%gf
WRITE(*,*) 'set no', i, 'read'
ngroups(i)%baumzahl=0
! the following line maps BRAid 770 to 779, other 'Mehlbeeren', because two
! different numbering systems existed in Brandenburg in the course of time
IF(ngroups(i)%BRAid==770) ngroups(i)%BRAid=779
ngroups(i)%patchsize=ngroups(i)%patchsize*10000.
ngroups(i)%taxid=tax_of_BRA_id(ngroups(i)%BRAid)
IF(ngroups(i)%taxid==6) ngroups(i)%taxid=3
IF(ngroups(i)%taxid==0) THEN
ELSE
ENDIF
IF(ngroups(i)%locid==ngroups(istart)%locid) THEN
ngroups(istart)%standsize=ngroups(istart)%standsize+ngroups(i)%patchsize
ngroups(i)%standsize = ngroups(istart)%standsize
ELSE
istart=i
ngroups(istart)%standsize=ngroups(i)%patchsize
fl_num=fl_num+1
ENDIF
ENDDO ! readin loop for multi data-set
ENDIF ! block for direct DSW data or brb_inv-file structure
CLOSE(inunit) CLOSE(inunit)
! read in file headder for description, write into ini-file ! read in file headder for description, write into ini-file
cform=1;hlp_lai=0 cform=1;hlp_lai=0
...@@ -571,6 +527,7 @@ if(infile=='input/hyyti_ini_0616.txt') then ...@@ -571,6 +527,7 @@ if(infile=='input/hyyti_ini_0616.txt') then
! classification of single values in diameter cohorts ! classification of single values in diameter cohorts
clwdth=1+AINT((bhdmax-bhdmin)/ncl1) !calculation of class widths clwdth=1+AINT((bhdmax-bhdmin)/ncl1) !calculation of class widths
! write(4444,*) 'clwdth', clwdth, bhdmax, bhdmin, ncl1
DO i=1,ncl1 DO i=1,ncl1
nz(i)=0 nz(i)=0
zbhd(i)=0 zbhd(i)=0
...@@ -771,8 +728,9 @@ CASE(6) ...@@ -771,8 +728,9 @@ CASE(6)
g=ngroups(iz)%gf !basal area/ha g=ngroups(iz)%gf !basal area/ha
gpatch=g*4. !basal area/patch gpatch=g*4. !basal area/patch
bz=ngroups(iz)%baumzahl*4. !tree numbre/patch bz=ngroups(iz)%baumzahl*4. !tree numbre/patch
clwdth=dg/20. ! clwdth=dg/20.
clwdth=dg/5
! selection of uni-height curve: beech, spruce, oak calculation according to Weimann, ! selection of uni-height curve: beech, spruce, oak calculation according to Weimann,
! other species of trees after Kuleschis (vergl. Gerold 1990) ! other species of trees after Kuleschis (vergl. Gerold 1990)
IF (taxid==3.OR.taxid==5) THEN IF (taxid==3.OR.taxid==5) THEN
......
...@@ -165,6 +165,7 @@ do ...@@ -165,6 +165,7 @@ do
case (8, 9, 10) case (8, 9, 10)
call readsoil ! reading soil parameter call readsoil ! reading soil parameter
IF (flag_end .gt.0) return
call readredN ! Input redN or test resp. call readredN ! Input redN or test resp.
end select end select
endif endif
...@@ -198,7 +199,7 @@ call readlit ...@@ -198,7 +199,7 @@ call readlit
! Initialization of soil model with profile data ! Initialization of soil model with profile data
call soil_ini ! Aufruf ohne s_cn_ini call soil_ini ! Aufruf ohne s_cn_ini
! Initialization disturbances ! Initialization disturbances
IF (flag_dis .eq. 1) CALL dist_ini IF (flag_dis .eq. 1 .or. flag_dis .eq. 2) CALL dist_ini
! Initialization of stand ! Initialization of stand
call prepare_stand call prepare_stand
IF (flag_end .gt.0) return IF (flag_end .gt.0) return
...@@ -268,12 +269,13 @@ if (flag_eva .gt.10) call evapo_ini ...@@ -268,12 +269,13 @@ if (flag_eva .gt.10) call evapo_ini
subroutine readsoil ! Input of soil parameter subroutine readsoil ! Input of soil parameter
use data_par
use data_soil_t use data_soil_t
use data_site use data_site
implicit none implicit none
integer :: inunit, helpnl, helpnr integer :: inunit, helpnl, helpnr, ihelp
real helpgrw, hlong, hlat real helpgrw, hlong, hlat
character :: text character :: text
character(30) :: hor, boart, helpid character(30) :: hor, boart, helpid
...@@ -283,17 +285,15 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' readsoil' ...@@ -283,17 +285,15 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' readsoil'
! Setting of flag_surf from flag_cond ! Setting of flag_surf from flag_cond
select case (flag_cond) select case (flag_cond)
case (0,1,2,3) case (0,1,2,3)
flag_surf = 0 flag_surf = 0
case (10,11,12,13)
flag_surf = 1
case (20,21,22,23) case (10,11,12,13)
flag_surf = 2 flag_surf = 1
case (30,31,32,33) case (30,31,32,33)
flag_surf = 3 flag_surf = 3
end select end select
! Setting of flag_bc from flag_decomp ! Setting of flag_bc from flag_decomp
...@@ -479,7 +479,7 @@ IF (ex .eqv. .true.) then ...@@ -479,7 +479,7 @@ IF (ex .eqv. .true.) then
if (.not.flag_mult8910) print *,' >>>FORESEE message: soil_id ', soilid(ip), ' not found' if (.not.flag_mult8910) print *,' >>>FORESEE message: soil_id ', soilid(ip), ' not found'
if (.not.flag_mult8910) print *,' Check your input choice!!!' if (.not.flag_mult8910) print *,' Check your input choice!!!'
if (help==1) call dealloc_soil if (help==1) call dealloc_soil
CALL error_mess(time,"soil identificator not found"//adjustl(soilid(ip))//"ip No.",real(help_ip)) CALL error_mess(time,"soil identificator not found "//adjustl(soilid(ip))//"ip No.",real(help_ip))
flag_end = 5 flag_end = 5
return return
ENDIF ! ios ENDIF ! ios
...@@ -535,15 +535,11 @@ IF (ex .eqv. .true.) then ...@@ -535,15 +535,11 @@ IF (ex .eqv. .true.) then
endif endif
end do end do
IF (ios .ne.0) then IF (ios .ne.0) then
if (.not.flag_mult8910) print *,' >>>FORESEE message: Error during reading soil data!' print *,' >>>FORESEE message: Error during reading soil data!'
WRITE(*,'(A)',advance='no') ' Stop program (y/n)? ' print *, ' Program stopped!'
read *, a
IF ( a .eq. 'y' .or. a .eq. 'Y') then
print *, ' STOP program!'
stop
endif
IF (help==1) call dealloc_soil IF (help==1) call dealloc_soil
if (.not.flag_mult8910) print *,' Check your input choice!!!' flag_end = 7
return
endif ! ios endif ! ios
exit exit
endif endif
...@@ -556,7 +552,7 @@ IF (ex .eqv. .true.) then ...@@ -556,7 +552,7 @@ IF (ex .eqv. .true.) then
print *,' Check your input choice!!!' print *,' Check your input choice!!!'
endif endif
if (help==1) call dealloc_soil if (help==1) call dealloc_soil
CALL error_mess(time,"soil identificator not found"//adjustl(soilid(ip))//"ip No.",real(help_ip)) CALL error_mess(time,"soil identificator not found "//adjustl(soilid(ip))//"ip No.",real(help_ip))
flag_end = 5 flag_end = 5
return return
ENDIF ! ios ENDIF ! ios
...@@ -915,7 +911,7 @@ if (.not.flag_mult8910 .or. (flag_mult8910 .and. anh .eq. "1") .or. (flag_mult89 ...@@ -915,7 +911,7 @@ if (.not.flag_mult8910 .or. (flag_mult8910 .and. anh .eq. "1") .or. (flag_mult89
WRITE(unit_ctr,'(A66,I4)') 'Time step for photosynthesis calculations (days) - ns_pro: ',ns_pro WRITE(unit_ctr,'(A66,I4)') 'Time step for photosynthesis calculations (days) - ns_pro: ',ns_pro
WRITE(unit_ctr,'(A66,I4)') 'Mortality (0-OFF,1-ON stress, 2- ON stress+intr) - flag_mort: ',flag_mort WRITE(unit_ctr,'(A66,I4)') 'Mortality (0-OFF,1-ON stress, 2- ON stress+intr) - flag_mort: ',flag_mort
WRITE(unit_ctr,'(A66,I4)') 'Regeneration (0-OFF,1-ON, 2-weekly growth of seedl.) - flag_reg: ',flag_reg WRITE(unit_ctr,'(A66,I4)') 'Regeneration (0-OFF,1-ON, 2-weekly growth of seedl.) - flag_reg: ',flag_reg
WRITE(unit_ctr,'(A66,I4)') 'use FORSKA for regeneration (0-OFF,1-ON) - flag_forska: ',flag_forska WRITE(unit_ctr,'(A66,I4)') 'use FORSKA for regeneration (0-OFF,1-ON) - flag_forska: ',flag_lambda
WRITE(unit_ctr,'(A66,I4)') 'Stand initialization (0-no,1-from *.ini,2-generate) - flag_stand: ',flag_stand WRITE(unit_ctr,'(A66,I4)') 'Stand initialization (0-no,1-from *.ini,2-generate) - flag_stand: ',flag_stand
WRITE(unit_ctr,'(A66,I4)') 'Ground vegetation initialization (0-no,1-generate) - flag_sveg: ',flag_sveg WRITE(unit_ctr,'(A66,I4)') 'Ground vegetation initialization (0-no,1-generate) - flag_sveg: ',flag_sveg
WRITE(unit_ctr,'(A66,I4)') 'Stand management (0-no,1-yes, 2 - seed once) - flag_mg: ',flag_mg WRITE(unit_ctr,'(A66,I4)') 'Stand management (0-no,1-yes, 2 - seed once) - flag_mg: ',flag_mg
...@@ -1179,22 +1175,17 @@ real hNO, hNH ...@@ -1179,22 +1175,17 @@ real hNO, hNH
if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' readdepo' if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' readdepo'
if (.not.allocated(NOd)) allocate (NOd (1:366,1:year))
if (.not.allocated(NHd)) allocate (NHd (1:366, 1:year))
! for areal usage standard/constant deposition is set as concentration: ! for areal usage standard/constant deposition is set as concentration:
if (flag_multi .eq. 8 .or. flag_mult910) then if (flag_multi .eq. 8 .or. flag_mult910) then
flag_depo = 2 flag_depo = 2
if (.not.allocated(NOd)) then NOd = NOdep(ip) ! concentration mg/l
allocate (NOd (1:366,1:year)) NHd = NHdep(ip) ! concentration mg/l
NOd = NOdep(ip) ! concentration mg/l
endif
if (.not.allocated(NHd)) then
allocate (NHd (1:366,1:year))
NHd = NHdep(ip) ! concentration mg/l
endif
return return
endif endif
if (.not.allocated(NOd)) allocate (NOd (1:366,1:year))
if (.not.allocated(NHd)) allocate (NHd (1:366, 1:year))
NOd = 0. NOd = 0.
NHd = 0. NHd = 0.
...@@ -1427,6 +1418,7 @@ END subroutine readdepo ...@@ -1427,6 +1418,7 @@ END subroutine readdepo
SUBROUTINE readredN SUBROUTINE readredN
use data_out use data_out
use data_site
use data_species use data_species
use data_stand use data_stand
use data_simul use data_simul
......
...@@ -32,7 +32,6 @@ character a ...@@ -32,7 +32,6 @@ character a
character(8) actdate character(8) actdate
character(10) acttime, helpsim, text1, text2 character(10) acttime, helpsim, text1, text2
real time1, time2, time3 real time1, time2, time3
logical lhelp
unit_err=getunit() unit_err=getunit()
if(flag_multi.eq.5) dirout = './' if(flag_multi.eq.5) dirout = './'
...@@ -46,20 +45,6 @@ write (unit_trace, '(I4,I10,A)') iday, time_cur, ' sim_control' ...@@ -46,20 +45,6 @@ write (unit_trace, '(I4,I10,A)') iday, time_cur, ' sim_control'
! check daily output ! check daily output
if (year > 5 .and. flag_dayout .ge. 1) then if (year > 5 .and. flag_dayout .ge. 1) then
lhelp = .true.
do i = 1,outd_n
if (outd(i)%out_flag .eq. flag_dayout) then
select CASE (outd(i)%kind_name)
CASE ('day_short')
lhelp = .false.
end select
endif
enddo
if (lhelp) then
write(*,*) ' Warning: Your choice of daily output is ON with a simulation time of' write(*,*) ' Warning: Your choice of daily output is ON with a simulation time of'
write(*,'(I6,A,I8,A)') year,' years. This option will create ',365*year,' data records per file!' write(*,'(I6,A,I8,A)') year,' years. This option will create ',365*year,' data records per file!'
write(*,'(A)',advance='no') ' Do you really want do use daily output (y/n)? ' write(*,'(A)',advance='no') ' Do you really want do use daily output (y/n)? '
...@@ -67,7 +52,6 @@ if (year > 5 .and. flag_dayout .ge. 1) then ...@@ -67,7 +52,6 @@ if (year > 5 .and. flag_dayout .ge. 1) then
IF (a .eq. 'n' .or. a .eq. 'N') then IF (a .eq. 'n' .or. a .eq. 'N') then
flag_dayout = 0 flag_dayout = 0
ENDIF ENDIF
endif ! lhelp
ENDIF ENDIF
! open file ycomp (yearly compressed output (multi run)) ! open file ycomp (yearly compressed output (multi run))
...@@ -136,10 +120,14 @@ time3 = 0. ...@@ -136,10 +120,14 @@ time3 = 0.
case (5) case (5)
print*,ip, ' stop in readsoil, soil ID not found ', adjustl(soilid(ip)) print*,ip, ' stop in readsoil, soil ID not found ', adjustl(soilid(ip))
case (6) case (6)
write(*,'(A,I5)') ' >>>foresee message: stop in read_cli - no climate data for year ',time_b write(*,'(A,I5)') ' >>>foresee message: stop in read_cli, no climate data for year ',time_b
call finish_simul
stop
case (7)
print*,ip, ' stop in readsoil, error during reading soil data ', adjustl(soilid(ip))
call finish_simul call finish_simul
stop stop
case default case default
print*,ip, 'flag_end = ', flag_end print*,ip, 'flag_end = ', flag_end
end select end select
...@@ -228,7 +216,7 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C ...@@ -228,7 +216,7 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C
DO time = 1, year DO time = 1, year
iday = 1 iday = 1
! Update population variable for new year if population is changed through interventions ! Update population variable for new year if population is changed through interventions
if (flag_standup .gt. 0 .or. flag_dis==1) then if (flag_standup .gt. 0 .or. flag_dis==1 .or. flag_dis==1) then
call stand_balance call stand_balance
call standup call standup
flag_standup = 0 flag_standup = 0
...@@ -239,7 +227,10 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C ...@@ -239,7 +227,10 @@ if (flag_trace) write (unit_trace, '(I4,I10,A)') iday, time_cur, ' simulation_4C
! read or create Redn for areal application ! read or create Redn for areal application
IF (time.EQ.1 .and. flag_redn) CALL RedN_ini IF (time.EQ.1 .and. flag_redn) CALL RedN_ini
IF (flag_dis .eq. 1) CALL dis_manag
IF (flag_dis .eq. 1 .or. flag_dis .eq. 2) then
CALL dis_manag
endif
! simulation of processes with subannual resolution (fluxes and soil) ! simulation of processes with subannual resolution (fluxes and soil)
CALL stand_daily CALL stand_daily
......