arrays - Visual Studio 2022 - Fortran - Debugging Issue - Stack Overflow

时间: 2025-01-06 admin 业界

I have been working on a Fortran code in visual studio 2022 using intel OneAPI compiler. The code is compiling correctly and it is running fine. Recently when I try to debug the code, I am unable to view the values of array variables in local or quick watch and get the message "undefined address" or "undefined variable xxx". Where xxx is a cell_obj type variable that is defined globally.

For Ex. cel(i)%nn - is the array for number density with "i" number of cells. When I want to look at the value at cel(30)%nn in quick watch I get the message "undefined variable cel". The code is running without any issues and all the output files are printed correctly. I can even see the value when I use print statements but not in quick watch during debug.

I have been using this code for my research last 2 years and never had this problem which has started occurring recently. I don't remember making any changes to the settings or the code. Also, based on some recommendations in other posts, I have ensured that the optimization is disabled and the project is running under debug configuration not release configuration.

I would appreciate any insight into this situation.

Thank you