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

Commit

Permalink
Removing unnecessary code for setting paths and locations
Browse files Browse the repository at this point in the history
  • Loading branch information
abowery authored Nov 15, 2022
1 parent c1103c9 commit 9d3dcbf
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions openifs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ int main(int argc, char** argv) {
std::string ifsdata_source = getTag(slot_path + std::string("/") + ifsdata_file + std::string(".zip"));

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

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


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

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

// Unzip the climate data zip file
std::string climate_zip = slot_path + std::string("/") + \
horiz_resolution + grid_type + \
std::string("/") + climate_data_file + std::string(".zip");
std::string climate_zip = climate_data_destination;
fprintf(stderr,"Unzipping the climate data zip file: %s\n",climate_zip.c_str());
retval = boinc_zip(UNZIP_IT,climate_zip.c_str(),\
slot_path+std::string("/")+horiz_resolution+grid_type);
retval = boinc_zip(UNZIP_IT,climate_zip.c_str(),climate_data_path);
if (retval) {
fprintf(stderr,"..Unzipping the climate data file failed\n");
return retval;
Expand Down

0 comments on commit 9d3dcbf

Please sign in to comment.