<commit_before>#include <math.h>
#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define	Subprograms
#define	Int	extern int
#define	Double	extern double
#include	"Headers.h"

 

extern double SU;

void
	Title_block(FILE*), Input_Data_block(FILE*);

/**********************************************************************/
int Read_data(void)
/**********************************************************************/
{
Readtext(Title);
iff(Title, FINISH) return(0);
Read(MaxH,lf);
fscanf(Input1,"%s", Case); Skip;
iff(Case,Wavelength)
	{
	Read(L,lf);
	Height = MaxH/L;
	}
iff(Case,Period)
	{
	Read(T,lf);
	Height = MaxH/(T*T);
	}
Read(Current_criterion,d);
Read(Current,lf);
if(Current_criterion == 1) strcpy(Currentname, Current1);
if(Current_criterion == 2) strcpy(Currentname, Current2);

Read(n,d);
Read(nstep,d);

Input_Data_block(monitor);

if(strcmp(Theory,"Stokes")==0)
	{
	iff(Case,Wavelength)
		if(L > 10.)
			{
			printf("\nThe dimensionless wavelength is greater than 10.");
			printf("\nStokes theory should not be applied. Exiting.");
			getch();
			exit(1);
			}
	iff(Case,Period)
		if(T > 10.)
			{
			printf("\nThe dimensionless period is greater than 10.");
			printf("\nStokes theory should not be applied. Exiting.");
			getch();
			exit(1);
			}
	}

// Convergence criteria

Input2=fopen(Convergence_file,"r");
fgets(dummy,400,Input2);
fscanf(Input2,"%d", &number);fgets(dummy,400,Input2);
fscanf(Input2,"%le", &crit);fgets(dummy,400,Input2);
fclose(Input2);

// Number of data points to present results for

Input2 = fopen(Points_file,"r");
fgets(dummy,400,Input2);
// Number of points on surface profile (clustered quadratically near crest)
fscanf(Input2,"%d", &Surface_points);fgets(dummy,400,Input2);
// Number of vertical profiles
fscanf(Input2,"%d", &Nprofiles);fgets(dummy,400,Input2);
// Number of points in each profile
fscanf(Input2,"%d", &Points);fgets(dummy,400,Input2);

fclose(Input2);

return(1);
}

//	PRINT OUT TITLE BLOCKS

void Input_Data_block(FILE* file)
{
fprintf(file,"# %s", Title);
fprintf(file,"\n\n# Printing input data here to check");
fprintf(file,"\n\n# Height/Depth:%6.3f", MaxH);
iff(Case,Wavelength)
	{
	fprintf(file,"\n# Length/Depth:%7.2f", L);
	}
iff(Case,Period)
	{
	fprintf(file,"\n# Dimensionless Period T*sqrt(g/d):%7.2f", T);
	}
fprintf(file,"\n# Current criterion: %s,  Dimensionless value:%6.3lf", Currentname, Current);

if(strcmp(Theory,"Stokes")==0)
	{
	if(n<=5) sprintf(Method, "\n# Solution by %d-order Stokes theory", n);
	else
		{
		n = 5;
		sprintf(Method, "\n# Solution by %d-order Stokes theory", n);
		printf("\n\n# (A value of N > 5 has been specified for the Stokes theory.");
		printf("\n# I do not have a theory for that. The program has set N = 5)");
		}
	}
if(strcmp(Theory,"Fourier")==0)
	sprintf(Method, "\n# Solution by %d-term Fourier series", n);

fprintf(file,"\n%s\n", Method);
}

void Title_block(FILE* file)
{
// Highest wave - eqn (32) of Fenton (1990)
L = 2*pi/z[1];
Highest = (0.0077829*L*L*L+0.0095721*L*L+0.141063*L)
	/(0.0093407*L*L*L+0.0317567*L*L+0.078834*L+1);
fprintf(file,"# %s", Title);
fprintf(file,"\n%s\n", Method);
fprintf(file,"\n# Height/Depth:%6.3f, %3.0lf\%% of the maximum of H/d =%6.3f for this length:",
	z[2]/z[1],z[2]/z[1]/Highest*100., Highest);
fprintf(file,"\n# Length/Depth:%7.2f", 2*pi/z[1]);
fprintf(file,"\n# Dimensionless Period T*sqrt(g/d):%7.2f", z[3]/sqrt(z[1]));
fprintf(file,"\n# Current criterion: %s,  Dimensionless value:%6.3lf\n", Currentname, Current);
}

void Output(void)
{
int 		i, I;
double 	X, eta, y;
double	Surface(double), Point(double, double);

fprintf(monitor,"\n\n# Solution summary:\n\n");
Title_block(monitor);

// Print out summary file of solution

Title_block(Solution);

kd = z[1];<commit_msg>fix return type in forward declaration (#736)<commit_after>#include <math.h>
#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define	Subprograms
#define	Int	extern int
#define	Double	extern double
#include	"Headers.h"

 

extern double SU;

void
	Title_block(FILE*), Input_Data_block(FILE*);

/**********************************************************************/
int Read_data(void)
/**********************************************************************/
{
Readtext(Title);
iff(Title, FINISH) return(0);
Read(MaxH,lf);
fscanf(Input1,"%s", Case); Skip;
iff(Case,Wavelength)
	{
	Read(L,lf);
	Height = MaxH/L;
	}
iff(Case,Period)
	{
	Read(T,lf);
	Height = MaxH/(T*T);
	}
Read(Current_criterion,d);
Read(Current,lf);
if(Current_criterion == 1) strcpy(Currentname, Current1);
if(Current_criterion == 2) strcpy(Currentname, Current2);

Read(n,d);
Read(nstep,d);

Input_Data_block(monitor);

if(strcmp(Theory,"Stokes")==0)
	{
	iff(Case,Wavelength)
		if(L > 10.)
			{
			printf("\nThe dimensionless wavelength is greater than 10.");
			printf("\nStokes theory should not be applied. Exiting.");
			getch();
			exit(1);
			}
	iff(Case,Period)
		if(T > 10.)
			{
			printf("\nThe dimensionless period is greater than 10.");
			printf("\nStokes theory should not be applied. Exiting.");
			getch();
			exit(1);
			}
	}

// Convergence criteria

Input2=fopen(Convergence_file,"r");
fgets(dummy,400,Input2);
fscanf(Input2,"%d", &number);fgets(dummy,400,Input2);
fscanf(Input2,"%le", &crit);fgets(dummy,400,Input2);
fclose(Input2);

// Number of data points to present results for

Input2 = fopen(Points_file,"r");
fgets(dummy,400,Input2);
// Number of points on surface profile (clustered quadratically near crest)
fscanf(Input2,"%d", &Surface_points);fgets(dummy,400,Input2);
// Number of vertical profiles
fscanf(Input2,"%d", &Nprofiles);fgets(dummy,400,Input2);
// Number of points in each profile
fscanf(Input2,"%d", &Points);fgets(dummy,400,Input2);

fclose(Input2);

return(1);
}

//	PRINT OUT TITLE BLOCKS

void Input_Data_block(FILE* file)
{
fprintf(file,"# %s", Title);
fprintf(file,"\n\n# Printing input data here to check");
fprintf(file,"\n\n# Height/Depth:%6.3f", MaxH);
iff(Case,Wavelength)
	{
	fprintf(file,"\n# Length/Depth:%7.2f", L);
	}
iff(Case,Period)
	{
	fprintf(file,"\n# Dimensionless Period T*sqrt(g/d):%7.2f", T);
	}
fprintf(file,"\n# Current criterion: %s,  Dimensionless value:%6.3lf", Currentname, Current);

if(strcmp(Theory,"Stokes")==0)
	{
	if(n<=5) sprintf(Method, "\n# Solution by %d-order Stokes theory", n);
	else
		{
		n = 5;
		sprintf(Method, "\n# Solution by %d-order Stokes theory", n);
		printf("\n\n# (A value of N > 5 has been specified for the Stokes theory.");
		printf("\n# I do not have a theory for that. The program has set N = 5)");
		}
	}
if(strcmp(Theory,"Fourier")==0)
	sprintf(Method, "\n# Solution by %d-term Fourier series", n);

fprintf(file,"\n%s\n", Method);
}

void Title_block(FILE* file)
{
// Highest wave - eqn (32) of Fenton (1990)
L = 2*pi/z[1];
Highest = (0.0077829*L*L*L+0.0095721*L*L+0.141063*L)
	/(0.0093407*L*L*L+0.0317567*L*L+0.078834*L+1);
fprintf(file,"# %s", Title);
fprintf(file,"\n%s\n", Method);
fprintf(file,"\n# Height/Depth:%6.3f, %3.0lf\%% of the maximum of H/d =%6.3f for this length:",
	z[2]/z[1],z[2]/z[1]/Highest*100., Highest);
fprintf(file,"\n# Length/Depth:%7.2f", 2*pi/z[1]);
fprintf(file,"\n# Dimensionless Period T*sqrt(g/d):%7.2f", z[3]/sqrt(z[1]));
fprintf(file,"\n# Current criterion: %s,  Dimensionless value:%6.3lf\n", Currentname, Current);
}

void Output(void)
{
int 		i, I;
double 	X, eta, y;
 double	Surface(double);
 void Point(double, double);

fprintf(monitor,"\n\n# Solution summary:\n\n");
Title_block(monitor);

// Print out summary file of solution

Title_block(Solution);

kd = z[1];
{'fraction_non_alphanumeric': 0.22314485303809148, 'fraction_numerical': 0.03940951627784368, 'mean_word_length': 5.474402730375426, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '4478319', 'n_tokens_mistral': 3192, 'n_tokens_neox': 2964, 'n_words': 646}