| 482 | | // failed on very first open -> probably path is not correct |
| 483 | | fprintf( ioQQQ, "\nPROBLEM DISASTER I could not open the data file %s\n\n", fname ); |
| 484 | | fprintf( ioQQQ, "Although there may be other reasons you have received this error,\n"); |
| 485 | | fprintf( ioQQQ, "the most likely are that the path has not been properly set\n"); |
| 486 | | fprintf( ioQQQ, "or that the path points to an old version of the data.\n\n"); |
| 487 | | fprintf( ioQQQ, "Please have a look at the file path.h in the source directory\n"); |
| 488 | | fprintf( ioQQQ, "to check how the variable CLOUDY_DATA_PATH is set - \n"); |
| 489 | | fprintf( ioQQQ, "it should give the location of the data files I need.\n"); |
| 490 | | fprintf( ioQQQ, "These are the files in the data download from the web site.\n\n"); |
| 491 | | fprintf( ioQQQ, "Recompile the code with the correct data path set in path.h\n"); |
| 492 | | fprintf( ioQQQ, "or use the shell command \"set CLOUDY_DATA_PATH=path\" to set the\n"); |
| 493 | | fprintf( ioQQQ, "path from a command prompt.\n\n"); |
| 494 | | cpu.printDataPath(); |
| 495 | | |
| 496 | | fprintf( ioQQQ, " These are all the paths I tried:\n" ); |
| 497 | | for( vector<string>::size_type i=begin; i < end; ++i ) |
| 498 | | { |
| 499 | | if( cpu.chSearchPath[i].length() > 0 ) |
| 500 | | fprintf( ioQQQ, " ==%s==\n", cpu.chSearchPath[i].c_str() ); |
| 501 | | else |
| 502 | | fprintf( ioQQQ, " ==<local directory>==\n" ); |
| | 487 | if( scheme == AS_DATA_OPTIONAL ) |
| | 488 | // presence is optional -> make warning less scary... |
| | 489 | fprintf( ioQQQ, "\nI could not open the data file %s\n\n", fname ); |
| | 490 | else |
| | 491 | fprintf( ioQQQ, "\nPROBLEM DISASTER I could not open the data file %s\n\n", fname ); |
| | 492 | if( cpu.nFileDone == 0 || scheme == AS_DATA_ONLY ) |
| | 493 | { |
| | 494 | // failed on very first open -> most likely path is not correct |
| | 495 | // failed on AS_DATA_ONLY -> CLOUDY_DATA_PATH may point to obsolete data dir |
| | 496 | fprintf( ioQQQ, "Although there may be other reasons you have received this error,\n"); |
| | 497 | fprintf( ioQQQ, "the most likely are that the path has not been properly set\n"); |
| | 498 | fprintf( ioQQQ, "or that the path points to an old version of the data.\n\n"); |
| | 499 | fprintf( ioQQQ, "Please have a look at the file path.h in the source directory\n"); |
| | 500 | fprintf( ioQQQ, "to check how the variable CLOUDY_DATA_PATH is set - \n"); |
| | 501 | fprintf( ioQQQ, "it should give the location of the data files I need.\n"); |
| | 502 | fprintf( ioQQQ, "These are the files in the data download from the web site.\n\n"); |
| | 503 | fprintf( ioQQQ, "Recompile the code with the correct data path set in path.h\n"); |
| | 504 | fprintf( ioQQQ, "or use the shell command \"export CLOUDY_DATA_PATH=path\" to set the\n"); |
| | 505 | fprintf( ioQQQ, "path from a bash command prompt.\n\n"); |
| | 506 | cpu.printDataPath(); |
| | 507 | } |
| | 508 | else |
| | 509 | { |
| | 510 | // failed on search including local directory -> most likely the file name |
| | 511 | // was mistyped on a compile command, or Cloudy is run in the wrong directory |
| | 512 | // if scheme == AS_DATA_OPTIONAL, this most likely is a stellar grid that is not installed. |
| | 513 | fprintf( ioQQQ, "These are all the paths I tried:\n" ); |
| | 514 | for( vector<string>::size_type i=begin; i < end; ++i ) |
| | 515 | { |
| | 516 | if( cpu.chSearchPath[i].length() > 0 ) |
| | 517 | fprintf( ioQQQ, " ==%s==\n", cpu.chSearchPath[i].c_str() ); |
| | 518 | else |
| | 519 | fprintf( ioQQQ, " ==<local directory>==\n" ); |
| | 520 | } |
| | 521 | // AS_DATA_OPTIONAL files should provide their own message (currently only stellar grids) |
| | 522 | if( scheme != AS_DATA_OPTIONAL ) |
| | 523 | { |
| | 524 | fprintf( ioQQQ, "\nAlthough there may be other reasons you have received this error,\n"); |
| | 525 | fprintf( ioQQQ, "the most likely are that you mistyped the file name, or that you\n"); |
| | 526 | fprintf( ioQQQ, "are running Cloudy in the wrong directory. If you are running a\n"); |
| | 527 | fprintf( ioQQQ, "COMPILE command, this needs to be done in the data directory.\n\n"); |
| | 528 | fprintf( ioQQQ, "Otherwise, please have a look at the file path.h in the source\n"); |
| | 529 | fprintf( ioQQQ, "directory to check how the variable CLOUDY_DATA_PATH is set - \n"); |
| | 530 | fprintf( ioQQQ, "it should give the location of the data files I need.\n"); |
| | 531 | fprintf( ioQQQ, "These are the files in the data download from the web site.\n\n"); |
| | 532 | fprintf( ioQQQ, "Recompile the code with the correct data path set in path.h\n"); |
| | 533 | fprintf( ioQQQ, "or use the shell command \"export CLOUDY_DATA_PATH=path\" to set the\n"); |
| | 534 | fprintf( ioQQQ, "path from a bash command prompt.\n\n"); |
| | 535 | } |