Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit 9d3dcbf

Browse files
authored
Removing unnecessary code for setting paths and locations
1 parent c1103c9 commit 9d3dcbf

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

openifs.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ int main(int argc, char** argv) {
363363
std::string ifsdata_source = getTag(slot_path + std::string("/") + ifsdata_file + std::string(".zip"));
364364

365365
// Copy the ifsdata_file to the working directory
366-
std::string ifsdata_destination = slot_path + std::string("/ifsdata/") + ifsdata_file + std::string(".zip");
366+
std::string ifsdata_destination = ifsdata_folder + std::string("/") + ifsdata_file + std::string(".zip");
367367
fprintf(stderr,"Copying the ifsdata_file from: %s to: %s\n",ifsdata_source.c_str(),ifsdata_destination.c_str());
368368
retval = boinc_copy(ifsdata_source.c_str(),ifsdata_destination.c_str());
369369
if (retval) {
@@ -372,9 +372,9 @@ int main(int argc, char** argv) {
372372
}
373373

374374
// Unzip the ifsdata_file zip file
375-
std::string ifsdata_zip = slot_path + std::string("/ifsdata/") + ifsdata_file + std::string(".zip");
376-
fprintf(stderr,"Unzipping ifsdata_zip file: %s\n", ifsdata_zip.c_str());
377-
retval = boinc_zip(UNZIP_IT,ifsdata_zip.c_str(),slot_path+std::string("/ifsdata/"));
375+
std::string ifsdata_zip = ifsdata_folder + std::string("/") + ifsdata_file + std::string(".zip");
376+
fprintf(stderr,"Unzipping the ifsdata_zip file: %s\n", ifsdata_zip.c_str());
377+
retval = boinc_zip(UNZIP_IT,ifsdata_zip.c_str(),ifsdata_folder + std::string("/"));
378378
if (retval) {
379379
fprintf(stderr,"..Unzipping the ifsdata_zip file failed\n");
380380
return retval;
@@ -385,7 +385,7 @@ int main(int argc, char** argv) {
385385
}
386386

387387

388-
// Process the CLIMATE_DATA_FILE:
388+
// Process the climate_data_file:
389389
// Make the climate data directory
390390
std::string climate_data_path = slot_path + std::string("/") + horiz_resolution + grid_type;
391391
if (mkdir(climate_data_path.c_str(),S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) \
@@ -395,9 +395,7 @@ int main(int argc, char** argv) {
395395
std::string climate_data_source = getTag(slot_path + std::string("/") + climate_data_file + std::string(".zip"));
396396

397397
// Copy the climate data file to working directory
398-
std::string climate_data_destination = slot_path + std::string("/") + \
399-
horiz_resolution + grid_type + \
400-
std::string("/") + climate_data_file + std::string(".zip");
398+
std::string climate_data_destination = climate_data_path + std::string("/") + climate_data_file + std::string(".zip");
401399
fprintf(stderr,"Copying the climate data file from: %s to: %s\n",climate_data_source.c_str(),climate_data_destination.c_str());
402400
retval = boinc_copy(climate_data_source.c_str(),climate_data_destination.c_str());
403401
if (retval) {
@@ -406,12 +404,9 @@ int main(int argc, char** argv) {
406404
}
407405

408406
// Unzip the climate data zip file
409-
std::string climate_zip = slot_path + std::string("/") + \
410-
horiz_resolution + grid_type + \
411-
std::string("/") + climate_data_file + std::string(".zip");
407+
std::string climate_zip = climate_data_destination;
412408
fprintf(stderr,"Unzipping the climate data zip file: %s\n",climate_zip.c_str());
413-
retval = boinc_zip(UNZIP_IT,climate_zip.c_str(),\
414-
slot_path+std::string("/")+horiz_resolution+grid_type);
409+
retval = boinc_zip(UNZIP_IT,climate_zip.c_str(),climate_data_path);
415410
if (retval) {
416411
fprintf(stderr,"..Unzipping the climate data file failed\n");
417412
return retval;

0 commit comments

Comments
 (0)