D3DEnergetic / FIDASIM

A Neutral Beam and Fast-ion Diagnostic Modeling Suite
http://d3denergetic.github.io/FIDASIM/
Other
29 stars 19 forks source link

`-1 is out of range` error in run_tests.pro #149

Closed taihelsetw closed 6 years ago

taihelsetw commented 6 years ago

i have built FIDASIM successfully, and it compiled correctly.

[jiangdi@login110 FIDASIM]$ ./fidasim
   ____ ____ ___   ___    ____ ____ __  ___
  / __//  _// _ \ / _ |  / __//  _//  |/  /
 / _/ _/ / / // // __ | _\ \ _/ / / /|_/ / 
/_/  /___//____//_/ |_|/___//___//_/  /_/  

Version: v1.2.4-dirty

FIDASIM is released as open source code under the MIT Licence.
For more information visit http://d3denergetic.github.io/FIDASIM/

usage: ./fidasim namelist_file [num_threads]

But when i run the test case within IDL,something like that come out,what's the problem?

IDL> run_tests,"/nfs_share/users/jiangdi/Desktop/Taowei/fida_output"
% Compiled module: RUN_TESTS.
% Compiled module: GET_FIDASIM_DIR.
% Compiled module: SOURCE_FILE.
% Attempt to subscript RUN with <INT      (      -1)> is out of range.
% Execution halted at: RUN_TESTS          48
   /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/test/run_tests.pro
%                      $MAIN$          
lstagner commented 6 years ago

The problem is that run_tests uses some features that were introduced in IDL v8.0 which was released in the year ~2010. Specifically, the ability to index an array with a negative integer as a means of indexing from the end of the array. The line that is giving you problems is

if run[-1] eq 1 then run[*]=1

The preferred way to fix this is updating your IDL version (the latest is v8.7). If that is not possible, you can replace the line in run_tests.pro with

if run[n_elements(run)-1] eq 1 then run[*]=1

Alternatively, if you are feeling adventurous, you could use the development version of FIDASIM which has a Python version of run_tests.pro

taihelsetw commented 6 years ago

Thank you very much. i can't update the IDL because it's installed on the server.i try to fix all errors by modifying the code,but there remain some errors i can't fix. The pre-processing completed with several errors.

IDL> run_tests,"/nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output" Preparing test case TEST_1A Non-rotated, Non-tilted grid; flat profiles

in READG_FILE, reading info.file /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/test/g000001.01000 % Type conversion error: Unable to convert given STRING to Long. % Detected at: READG_FILE 463 /nfs_share/users/jiangdi/Desktop/Taowei/FI DASIM/deps/efit/readg.pro % READG_FILE: Trouble determining exact time. Filename gives: 1000.0000 but file contains: 1.00000 Energy min/max: 66.5191 76.2536 Pitch min/max: -0.120000 0.120000 Ntotal in phase space: 1.2136334e+19 INFO: Checking simulation settings... SUCCESS: Simulation settings are valid INFO: Checking interpolation grid... SUCCESS: Interpolation grid is valid INFO: Checking beam geometry... Machine center in beam grid coordinates [ 0.000, 0.000, 0.000] Beam injection start point in machine coordinates [ 0.000, -532.000, 0.000] Beam injection start point in beam grid coordinates [ 0.000, -532.000, 0.000] First aperture position in machine coordinates [ 0.000, -345.900, 0.000] First aperture position in beam grid coordinates [ 0.000, -345.900, 0.000] Beam grid rotation angles that would align it with the beam centerline alpha = 90.0000000000° beta = 0.0000000000° Beam centerline - grid intersection length length = 120.000 SUCCESS: Beam geometry is valid INFO: Checking plasma parameters... SUCCESS: Plasma parameters are valid INFO: Checking electromagnetic fields... INFO: Extra variable "geqdsk" found in structure WARNING: Electromagnetic fields time and input time do not match Input time: 1.0000000 Electromagnetic fields time: 1000.0000 SUCCESS: Electromagnetic fields are valid INFO: Checking fast-ion distribution Using a Guiding Center Fast-ion Density Function SUCCESS: Fast-ion distribution is valid INFO: Checking FIDA/BES inputs... 3 out of 3 chords crossed the beam grid SUCCESS: FIDA/BES geometry is valid INFO: Checking NPA geometry... 3 out of 3 channels crossed the beam grid SUCCESS: NPA geometry is valid INFO: Writing namelist file... SUCCESS: Namelist file created: /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output/test_1a_inputs.dat INFO: Writing geometry file... SUCCESS: Geometry file created: /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output/test_1a_geometry.h5 INFO: Writing equilibrium file... SUCCESS: Equilibrium file created: /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output/test_1a_equilibrium.h5 INFO: Writing fast-ion distribution file... SUCCESS: Distribution file created: /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output/test_1a_distribution.h5

SUCCESS: FIDASIM pre-processing completed To run FIDASIM use the following command /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fidasim /nfs_share/users/jiangdi/Desktop/Taowei/FIDASIM/fida_output/test_1a_inputs.dat

How can i fix it?

alvin-garcia commented 6 years ago

The error you are referring to does not affect the output of the run_tests procedure. If the code below executes, you can feel rest assured that you executed the procedure correctly. We are working on removing this small error/warning message and others.

SUCCESS: FIDASIM pre-processing completed
To run FIDASIM use the following command
/<path>/FIDASIM/fidasim /<path>/test_1a_inputs.dat
lstagner commented 6 years ago

Since nothing is actually wrong, EFIT errors aside, I am closing this issue.