bertrandplez / Turbospectrum_NLTE

Turbospectrum v20 with NLTE capability
GNU General Public License v3.0
17 stars 3 forks source link

NaN in out spectrum, gfortran spherical marcs models #17

Open drheitor opened 7 months ago

drheitor commented 7 months ago

Hi! I have been running TurboSpectrumv20 using gfortran in a M3. However, I ran into the issue when trying to run spherically symmetric MARCS models (e.g. red giants). As far as I understand, in the bsyn config, I need to change 'SPHERICAL:' to 'T'. However, in that case, my final spectra have NaNs in the output file for the flux. There are no actual crashes or obvious issues that I see from the printed output. Do you have any idea why it is happening? I am not able to reproduce the issue using the ifort compiler, by the way.

Thank you!

Heitor

bertrandplez commented 7 months ago

Hi, Is the model fed to babsma really a spherical MARCS model? Then, does babsma produce a non-empty file? To understand better I would need to see the standard output written by the program when running. Bertrand

drheitor commented 7 months ago

Hi,

Thanks for the quick reply! I used a model s3700_g+2.0_m1.0_t05_st_z0.75_a+0.30_c+0.00_n+0.00_o+0.30_r+0.00_s+0.00.mod, so I presume that it should be? Babsma produces a non-empty file. It seems to be the same-ish output files whether ifort or gfortran, so that is the confusing part.

Outputs and files are attached below.

Cheers,

Heitor

babsma_outBP.txt Bsyn_outBP.txt

s3700_g+2.0_m1.0_t05_st_z-0.75_a+0.30_c+0.00_n+0.00_o+0.30_r+0.00_s+0.00.mod_6707.2-6708.2_xit1.0-NLTE-windows.spec.txt

bertrandplez commented 7 months ago

I don't see anything obvious. Can you send me the opac file generated by babsma, as well as the script?

drheitor commented 7 months ago

Hi,

I am sending the files attached. If I run this exact script for this model with the spherical keyword 'T,' it will result in NaNs. But if I only change the spherical keyword to 'F' it does work.

Bspherical11042024.zip

Cheers, Heitor

drheitor commented 7 months ago

Hi,

I forgot to add the information that following the procedure in https://github.com/bertrandplez/Turbospectrum_NLTE/issues/13#issuecomment-1807747176

I changed the spectrum.inc My line 23 in spectrum.inc is:

  PARAMETER (NDP=109,NRAYS=180,lpoint=100000)

Cheers, Heitor

bertrandplez commented 7 months ago

Hi, Your setup runs smoothly on my computer (Mac intel i7) and I get a nice spectrum. Cheers, Bertrand

drheitor commented 7 months ago

Hi Bertrand,

I also tested in an intel. It works. Is it safe to say that the spherical models don't work for the gfortran compiler? Is there something I can do to fix that?

Many thanks, Heitor

bertrandplez commented 7 months ago

I ran the gfortran version on an intel Mac. I will have to borrow an Mx Mac to check and try to find out what the issue is. This is annoying.

drheitor commented 7 months ago

Hi, It is, indeed. Thank you very much for the support and quick replies. I will also try to figure out on my end what is happening.

Cheers, Heitor

stormnick commented 7 months ago

Hi,

I tried to run the same thing using my M2 Mac. I get the same issue when running with gfortran, but not when running with ifort on the exactly same Mac. For gfortran I used the following spectrum.inc parameters:

PARAMETER (NDP=102,NRAYS=132,lpoint=100000)

And I had to change -mcmodel=medium to -mcmodel=small in the Makefile because it complains that medium doesn't exist. Could mcmodel paramater be the issue here?

CrisWat commented 5 months ago

Hi!

I encountered the same problem, unfortunately, when compiling it with gfortran on my M3 Mac. This also happens when varying the parameters in the spectrum.inc file as indicated. (Just for testing) I also tried using to the 2019 version, and instead of NaNs, I get Fluxes=1 for all wavelengths when Spherical=True.

Cheers, Cristiano

bertrandplez commented 5 months ago

I will switch to an M2 mac soon (The Intel one is dying, unfortunately), and will have the opportunity to experience the same problem I guess...

bertrandplez commented 1 week ago

I have tested on my M3 mac, and get the same problem. Will investigate asap.