Skip to content

Commit

Permalink
added cf capability
Browse files Browse the repository at this point in the history
  • Loading branch information
CyprienBosserelle committed Feb 6, 2020
1 parent 0215ae5 commit b435bf1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
38 changes: 31 additions & 7 deletions Wave_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2020,13 +2020,38 @@ int main(int argc, char **argv)
printf("...done\n");
write_text_to_log_file("...done");
//// read cf map file
if (!XParam.cfmap.empty())
{
printf("cfmap file found\n");
write_text_to_log_file("cfmap file found");
int STnx, STny;
double STdx, STgrdalpha;
readbathyHead(XParam.cfmap, STnx, STny, STdx, STgrdalpha);
if (STnx != nx || STny != ny)
{
printf("Error cfmap dimension mismatch. Model will run with constant cf.\n");
write_text_to_log_file("ERROR: Scfmap dimension mismatch. Model will run with constant cf.");
}
else
{
readbathy(XParam.cfmap, cfm);
}
}
//// read Hard layer file
if (!XParam.SedThkfile.empty())
{
printf("Hard layer file found\n");
write_text_to_log_file("Hard layer file found");
printf("Sediment thickness file found\n");
write_text_to_log_file("Sediment thickness file found");
int STnx, STny;
double STdx, STgrdalpha;
Expand All @@ -2038,9 +2063,9 @@ int main(int argc, char **argv)
write_text_to_log_file("ERROR: Sediment thickness file (Hard layer file) dimension mismatch. Model will run with constant sediment thickness.");
}
}
else
{
Expand All @@ -2051,11 +2076,10 @@ int main(int argc, char **argv)
{
for (int i = 0; i < nx; i++)
{
stdep[i + j*nx] = 5.0f;
stdep[i + j * nx] = 5.0f;
}
}
}
//calculate coriolis force
Expand Down
4 changes: 3 additions & 1 deletion XBeachGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class XBGPUParam{

// File
std::string Bathymetryfile;// bathymetry file name
std::string SedThkfile; // Structure file
std::string SedThkfile; // Structure file
std::string cfmap; // Structure file

std::string wavebndfile;// wave bnd file
int wavebndtype = 2; // 1 is quasistationary wave spectrum; 2 is for infrgravity and long bound waves Xbeach type
std::string slbnd; // tide/surge bnd file
Expand Down
8 changes: 8 additions & 0 deletions read_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,14 @@ XBGPUParam readparamstr(std::string line, XBGPUParam param)
//std::cerr << "Bathymetry file found!" << std::endl;
}

parameterstr = "cfmap";
parametervalue = findparameter(parameterstr, line);
if (!parametervalue.empty())
{
param.cfmap = parametervalue;
//std::cerr << "Bathymetry file found!" << std::endl;
}

parameterstr = "wavebndfile";
parametervalue = findparameter(parameterstr, line);
if (!parametervalue.empty())
Expand Down

0 comments on commit b435bf1

Please sign in to comment.