Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Usage example /examples/gaussian_reflector_model is not working properly #46

Closed
Dirack opened this issue Feb 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Dirack
Copy link
Owner

Dirack commented Feb 21, 2024

🐛 Bug report

Describe the bug

The parameters file input dimension n1 is not correct. The program sfnhcrssurf uses this dimension an an input to read RN, RNIP and BETA parameter from parameters file as a 1D vector. If n1 is minor then 3 the program does not read RNIP and BETA and assign a zero or a memory garbage to the parameter. It results that the non hyperbolic CRS surface generated by the program is full of INF and NAN values. After that the sfgrey program get stuck trying to read it.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Dirack Dirack added the bug Something isn't working label Feb 21, 2024
@Dirack Dirack self-assigned this Feb 21, 2024
@Dirack
Copy link
Owner Author

Dirack commented Feb 21, 2024

The problem is related with parameters file dimensions loading. The program sfnhcrssurf reads parameters file dimension from n1. But sfvfsacrsnh has changed n1 to be the t0 dimension instead of number of parameters dimension (read the snippet below). The behavior of this loading should change

       if(!sf_histint(par,"n1",&nc)) sf_error("No n1= in parameters input");

        if(! sf_getbool("verb",&verb)) verb=0;
        /* 1: active mode; 0: quiet mode */

        if (verb) {

                sf_warning("Active mode on!!!");
                sf_warning("Command line parameters: ");
                sf_warning("m0=%f v0=%f t0=%f",m0,v0,t0);
                sf_warning("Input file parameters: ");
                sf_warning("n1=%i d1=%f o1=%f",nh,dh,oh);
                sf_warning("n2=%i d2=%f o2=%f",nm,dm,om);
                sf_warning("Param file parameters: ");
                sf_warning("n1=%i",nc);
        }

        c = sf_floatalloc(nc);
        sf_floatread(c,nc,par);

        RN = c[0];
        RNIP = c[1];
        BETA  = c[2];

Dirack added a commit that referenced this issue Feb 21, 2024
Dirack added a commit that referenced this issue Feb 21, 2024
The parameters file in sfnhcrssurf should be a vector with at least 3
samples, RN, RNIP and BETA, and n1 should be at least 3.

The v0, RN, RNIP should not be too small
Dirack added a commit that referenced this issue Feb 21, 2024
Update examples documentation after bug correction
@Dirack Dirack closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant