Skip to content

Commit 23d9e67

Browse files
committed
try fix windows bug...
1 parent b5945d2 commit 23d9e67

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

source/world_builder/parameters.cc

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -790,40 +790,41 @@ namespace WorldBuilder
790790
{
791791
WBAssertThrow(false, "Could not convert values of /Litho1.0 path into a String. ");
792792
}
793-
constexpr int n1 = 40; //962;
794-
constexpr int n_layers = 9;
795-
float depth_data[n1 * n_layers];
796-
char tessfile[255];
797-
snprintf(tessfile, 254, "%s/litho_depth_data.bin", litho_1_0_path.c_str());
798-
FILE *fptrb = nullptr;
799-
if ((fptrb = fopen(tessfile, "rb")) == nullptr)
800-
{
801-
WBAssertThrow(false, "ERROR: Could not open file " << tessfile);
802-
}
803-
const size_t ret_code = fread(&depth_data, sizeof(float), n1 * n_layers, fptrb);
804-
WBAssertThrow(ret_code == n1 * n_layers, "Error in reading the Litho1.0 data.");
805-
fclose(fptrb);
806-
807-
snprintf(tessfile, 254, "%s/Icosahedron_Level7_LatLon_mod.txt",
808-
litho_1_0_path.c_str());
809-
FILE *fp = nullptr;
810-
if ((fp = fopen(tessfile, "r")) == nullptr)
811-
{
812-
WBAssertThrow(false, "ERROR: Could not open file " << tessfile);
813-
}
793+
/*
794+
constexpr int n1 = 40; //962;
795+
constexpr int n_layers = 9;
796+
float depth_data[n1 * n_layers];
797+
char tessfile[255];
798+
snprintf(tessfile, 254, "%s/litho_depth_data.bin", litho_1_0_path.c_str());
799+
FILE *fptrb = nullptr;
800+
if ((fptrb = fopen(tessfile, "rb")) == nullptr)
801+
{
802+
WBAssertThrow(false, "ERROR: Could not open file " << tessfile);
803+
}
804+
const size_t ret_code = fread(&depth_data, sizeof(float), n1 * n_layers, fptrb);
805+
WBAssertThrow(ret_code == n1 * n_layers, "Error in reading the Litho1.0 data.");
806+
fclose(fptrb);
807+
808+
snprintf(tessfile, 254, "%s/Icosahedron_Level7_LatLon_mod.txt",
809+
litho_1_0_path.c_str());
810+
FILE *fp = nullptr;
811+
if ((fp = fopen(tessfile, "r")) == nullptr)
812+
{
813+
WBAssertThrow(false, "ERROR: Could not open file " << tessfile);
814+
}
814815
815-
size_t counter_location_data = 0;
816-
float latitude, glatitude, longitude = 0;
817-
while (fscanf(fp, "%f %f %f", &latitude, &glatitude, &longitude) != EOF)
818-
{
819-
const size_t global_index = (counter_location_data/2)*n_layers+static_cast<size_t> (layer_type);
820-
result.first.emplace_back(depth_data[global_index]);
821-
result.second.emplace_back(longitude * Consts::PI / 180.);
822-
result.second.emplace_back(latitude * Consts::PI / 180.);
823-
counter_location_data += 2;
824-
}
816+
size_t counter_location_data = 0;
817+
float latitude, glatitude, longitude = 0;
818+
while (fscanf(fp, "%f %f %f", &latitude, &glatitude, &longitude) != EOF)
819+
{
820+
const size_t global_index = (counter_location_data/2)*n_layers+static_cast<size_t> (layer_type);
821+
result.first.emplace_back(depth_data[global_index]);
822+
result.second.emplace_back(longitude * Consts::PI / 180.);
823+
result.second.emplace_back(latitude * Consts::PI / 180.);
824+
counter_location_data += 2;
825+
}
825826
826-
fclose(fp);
827+
fclose(fp);*/
827828
}
828829
else
829830
{

0 commit comments

Comments
 (0)