<commit_before>#ifndef CEM_GLOBALS_INCLUDED
#define CEM_GLOBALS_INCLUDED

#if defined(__cplusplus)
extern "C" {
#endif

#include "consts.h"

	float						CellDepth[Xmax][2*Ymax]; /* Depth array */
	double CliffHeightSlow = 30;		/* Cliff height above sea level for slow weathering rock PWL */
	double CliffHeightFast = 0;			/* Cliff height above sea level for fast weathering rock PWL */

	/* Overall Shoreface Configuration Arrays - Data file information */
	char   AllBeach[Xmax][2*Ymax];			/* Flag indicating of cell is entirely beach */
	char   AllRock[Xmax][2*Ymax];			/* Flag indicating if cell is entirely rock LMV */
	double PercentFullSand[Xmax][2*Ymax];	/* Fractional amount of cell full of sediment LMV */
	double PercentFullRock[Xmax][2*Ymax];	/* Fractional amount of a cell full of rock LMV */
	char   TypeOfRock[Xmax][2*Ymax];		/* Array to control weathering rates of rock along the beach LMV */
	int    Age[Xmax][2*Ymax];				/* Age since cell was deposited */
	double Topography[Xmax][2*Ymax];		/* Holds cliff heights -- will change through time, eventually...*/	
	
	int 	SinkY[] = {158, 361, 158, 361, 158, 361};		/* a sink is a cell that is routinely emptied (if it is on the beach) */
	int 	SinkX[] = {190, 190, 189, 189, 191, 191};
	
	FILE	*SaveSandFile;
	FILE    *WaveFileOutput;
	FILE    *InitMetaFile;
	FILE	*ReadSandFile;
	FILE	*ReadWaveFile;
	FILE    *ReadRealWaveFile;
	FILE    *ReadControlFile;
	
	
	/* Computational Arrays (determined for each time step)  -- will eventually be in a structure for BMI */
	
	int	    X[MaxBeachLength];		/* X Position of ith beach element */
	int	    Y[MaxBeachLength];		/* Y Position of ith beach element */
	int 	XBehind[MaxBeachLength];	/* Cell that is "behind" X[i] LMV */
	int	    YBehind[MaxBeachLength];	/* Cell that is "behind" Y[i] LMV */
	int	    XRock[MaxBeachLength];		/* X Position of ith rock element LMV */
	int	    YRock[MaxBeachLength];		/* Y Position of ith rock element LMV */
	int 	XRockBehind[MaxBeachLength];	/* Cell that is "behind" XRock[i] LMV */
	int 	YRockBehind[MaxBeachLength];	/* Cell that is "behind" YRock[i] LMV */
	char	InShadow[MaxBeachLength];	/* Is ith beach element in shadow? */
	float	ShorelineAngle[MaxBeachLength];	/* Angle between cell and right (z+1) neighbor	*/
	float   SurroundingAngle[MaxBeachLength];   	/* Angle between left and right neighbors */
	char	UpWind[MaxBeachLength];		/* Upwind or downwind condition used to calculate sediment transport */
	float	VolumeIn[MaxBeachLength];	/* Sediment volume into ith beach element*/
	float 	VolumeOut[MaxBeachLength];	/* Sediment volume out of ith beach element */
	float 	VolumeAcrossBorder[MaxBeachLength];	/* Sediment volume across border of ith beach element in m^3/day LMV*/
	/* amount sediment needed, not necessarily amount a cell gets */
	float	ActualVolumeAcross[MaxBeachLength];	/* Sediment volume that actually gets passed across border LMV */
	/* amount sed is limited by volumes across border upstream and downstream */
	char	DirectionAcrossBorder[MaxBeachLength];	/* Flag to indicate if transport across border is L or R LMV*/
	char	FlowThroughCell[MaxBeachLength];	/* Is flow through ith cell Left, Right, Convergent, or Divergent LMV*/
	float	DistanceToBeach[MaxBeachLength]; 	/* Distance in meters from rock to beach LMV*/
	float	MinDistToBeach[MaxBeachLength];	/* From a rock cell j, min distance (in meters) to closest beach LMV*/
	int     ClosestBeach[MaxBeachLength];	/* i position of closest rock to beach LMV */
	float	AmountWeathered[MaxBeachLength];	/* Amount of rock weathered from rock cell j LMV */
	
	/* Miscellaneous Global Variables -- also will be included in the BMI structure */
	
	int	    NextX;			/* Global variables used to iterate FindNextCell in global array - */
	int	    NextY;			/*	would've used pointer but wouldn't work	*/
	int 	BehindX;
	int	    BehindY;
	int 	BehindRockX;
	int	    BehindRockY;
	int 	NextRockX;		/* Global variables used to iterate FindNextRockCell in global array LMV*/
	int	    NextRockY;
	int 	TotalBeachCells;	/* Number of cells describing beach at particular iteration */
	int	    TotalRockCells; 	/* Number of cells describing rock at an iteration LMV */
	int 	ShadowXMax; 		/* used to determine maximum extent of beach cells */
	float 	WaveAngle;		/* wave angle for current time step */
	int	    FindStart;		/* Used to tell FindBeach at what Y value to start looking */
	int 	FindRockStart;		/* Used to tell FindRock at what Y value to start looking LMV */
	char	FellOffArray;		/* Flag used to determine if accidentally went off array */
	char    FellOffRockArray;	/* Flag used to determine if accidentally went off rock array LMV */
	float   MassInitial;		/* For conservation of mass calcs */
	float	MassCurrent;		/* " */
	int	    device;<commit_msg>Added some arrays/variables/matrices necessary for SWAN coupling<commit_after>#ifndef CEM_GLOBALS_INCLUDED
#define CEM_GLOBALS_INCLUDED

#if defined(__cplusplus)
extern "C" {
#endif

#include "consts.h"

	float						CellDepth[Xmax][2*Ymax]; /* Depth array */
	double CliffHeightSlow = 30;		/* Cliff height above sea level for slow weathering rock PWL */
	double CliffHeightFast = 0;			/* Cliff height above sea level for fast weathering rock PWL */

	/* Overall Shoreface Configuration Arrays - Data file information */
	char   AllBeach[Xmax][2*Ymax];			/* Flag indicating of cell is entirely beach */
	char   AllRock[Xmax][2*Ymax];			/* Flag indicating if cell is entirely rock LMV */
	double PercentFullSand[Xmax][2*Ymax];	/* Fractional amount of cell full of sediment LMV */
	double PercentFullRock[Xmax][2*Ymax];	/* Fractional amount of a cell full of rock LMV */
	char   TypeOfRock[Xmax][2*Ymax];		/* Array to control weathering rates of rock along the beach LMV */
	int    Age[Xmax][2*Ymax];				/* Age since cell was deposited */
	double Topography[Xmax][2*Ymax];		/* Holds cliff heights -- will change through time, eventually...*/	
	
	int 	SinkY[] = {158, 361, 158, 361, 158, 361};		/* a sink is a cell that is routinely emptied (if it is on the beach) */
	int 	SinkX[] = {190, 190, 189, 189, 191, 191};
	
	FILE	*SaveSandFile;
	FILE    *WaveFileOutput;
	FILE    *InitMetaFile;
	FILE	*ReadSandFile;
	FILE	*ReadWaveFile;
	FILE    *ReadRealWaveFile;
	FILE    *ReadControlFile;
	
	
	/* Computational Arrays (determined for each time step)  -- will eventually be in a structure for BMI */
	
	int	    X[MaxBeachLength];		/* X Position of ith beach element */
	int	    Y[MaxBeachLength];		/* Y Position of ith beach element */
	int 	XBehind[MaxBeachLength];	/* Cell that is "behind" X[i] LMV */
	int	    YBehind[MaxBeachLength];	/* Cell that is "behind" Y[i] LMV */
	int	    XRock[MaxBeachLength];		/* X Position of ith rock element LMV */
	int	    YRock[MaxBeachLength];		/* Y Position of ith rock element LMV */
	int 	XRockBehind[MaxBeachLength];	/* Cell that is "behind" XRock[i] LMV */
	int 	YRockBehind[MaxBeachLength];	/* Cell that is "behind" YRock[i] LMV */
	char	InShadow[MaxBeachLength];	/* Is ith beach element in shadow? */
	float	ShorelineAngle[MaxBeachLength];	/* Angle between cell and right (z+1) neighbor	*/
	float   SurroundingAngle[MaxBeachLength];   	/* Angle between left and right neighbors */
	char	UpWind[MaxBeachLength];		/* Upwind or downwind condition used to calculate sediment transport */
	float	VolumeIn[MaxBeachLength];	/* Sediment volume into ith beach element*/
	float 	VolumeOut[MaxBeachLength];	/* Sediment volume out of ith beach element */
	float 	VolumeAcrossBorder[MaxBeachLength];	/* Sediment volume across border of ith beach element in m^3/day LMV*/
	/* amount sediment needed, not necessarily amount a cell gets */
	float	ActualVolumeAcross[MaxBeachLength];	/* Sediment volume that actually gets passed across border LMV */
	/* amount sed is limited by volumes across border upstream and downstream */
	char	DirectionAcrossBorder[MaxBeachLength];	/* Flag to indicate if transport across border is L or R LMV*/
	char	FlowThroughCell[MaxBeachLength];	/* Is flow through ith cell Left, Right, Convergent, or Divergent LMV*/
	float	DistanceToBeach[MaxBeachLength]; 	/* Distance in meters from rock to beach LMV*/
	float	MinDistToBeach[MaxBeachLength];	/* From a rock cell j, min distance (in meters) to closest beach LMV*/
	int     ClosestBeach[MaxBeachLength];	/* i position of closest rock to beach LMV */
	float	AmountWeathered[MaxBeachLength];	/* Amount of rock weathered from rock cell j LMV */
	
	/* SWAN */
	if (SWANflag == 'y') 
	{
	float BreakDepth;				/* Breaking wave depth found from SWAN run */
	/* Special SWAN matrices. */
	float ShelfDepth[Xmax][2*Ymax];	/* SWAN bathymetry. */
	float Hsig[Xmax][2*Ymax];		/* SWAN wave heights. */
	float Dir[Xmax][2*Ymax];		/* SWAN wave angles. */
	float EvaluateAngle;			/* Temporary angle holder for the ConvertAngle function */
	/* for temporary debugging only, 5-5-14 */
	/* UPDATE 11/20/14 -- now using these for upwind scheme fixing, so keep 'em around (probably should rename...) */
	float Qsdebug[MaxBeachLength];		
	float Hsigdebug[MaxBeachLength];    
	float Dirdebug[MaxBeachLength];
	float Hddebug[MaxBeachLength];
	float xdebug[MaxBeachLength];
	float ydebug[MaxBeachLength];
	}
	
	
	/* Miscellaneous Global Variables -- also will be included in the BMI structure */
	
	int	    NextX;			/* Global variables used to iterate FindNextCell in global array - */
	int	    NextY;			/*	would've used pointer but wouldn't work	*/
	int 	BehindX;
	int	    BehindY;
	int 	BehindRockX;
	int	    BehindRockY;
	int 	NextRockX;		/* Global variables used to iterate FindNextRockCell in global array LMV*/
	int	    NextRockY;
	int 	TotalBeachCells;	/* Number of cells describing beach at particular iteration */
	int	    TotalRockCells; 	/* Number of cells describing rock at an iteration LMV */
	int 	ShadowXMax; 		/* used to determine maximum extent of beach cells */
	float 	WaveAngle;		/* wave angle for current time step */
	int	    FindStart;		/* Used to tell FindBeach at what Y value to start looking */
	int 	FindRockStart;		/* Used to tell FindRock at what Y value to start looking LMV */
	char	FellOffArray;		/* Flag used to determine if accidentally went off array */
	char    FellOffRockArray;	/* Flag used to determine if accidentally went off rock array LMV */
	float   MassInitial;		/* For conservation of mass calcs */
	float	MassCurrent;		/* " */
	int	    device;
{'fraction_non_alphanumeric': 0.09517361446948448, 'fraction_numerical': 0.010736047973691846, 'mean_word_length': 3.721461187214612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6378363', 'n_tokens_mistral': 3593, 'n_tokens_neox': 3282, 'n_words': 1211}