Keyword to activate/deactivate a routine

Hello,

I have made some changes in the code as per my requirement. I want to run cases with and without those changes on the same branch.
Is it possible to have some keyword added in the .nts file so that once it’s added, the changes may be called else not ( In order to avoid making changes of commenting and compiling again)

If yes, may I know the procedure.
Thanks

Hi,

Use the ‘export’ keyword in the .nts files.

Example:

Anywhere in your .nts file:

integer test = 1;
export test;

Anywhere in your Fortran code:

use variables_user
integer :: test

test = user_get_integer("test")

select case(test)
case(1)
   ! some code
case(2)
   ! some other code
end select

Antoine

Hello,
I tried that and its not working.
It says the variable is being used without being defined.
No error during compilation though.

I have ensured that use variables_user was mentioned in the subroutine.
Also, I placed integer test=1; statement just before the domain block.
Any suggestions to see where could be the problem.

Thank you

Hello,

You may have missed something. You did not forget the “export” keyword?

Please send us a snippet of your code showing what I wrote in my previous message.

Antoine

Hello,

I checked and found that I missed the call ( test = user_get_integer(“test”) ).
Sorry, my mistake.

Thanks