Page 1 of 1

How to add debug lines inside a module

PostPosted: Thu Jul 04, 2013 12:05 pm
by alberto
Hello everybody,

I am trying to add debug lines inside the module_wind_fitch.F, and the compile.
I managed to do this in module_wind_generic.F, both inside the /phys/ directory, by using the following commands:

WRITE(message,*)'blablablabl'
CALL wrf_message(message)

and also
CALL wrf_debug(100,' Additional stuff'//messsage)

But trying this inside the fitch module produces no output in my rsl.* files, I checked my debug level, and it is set properly at 100,. I don't have running problems, but I need to see steps inside the new things I added to check if they work properly.

Sincerely,
Alberto Striedinger

Re: How to add debug lines inside a module

PostPosted: Sun Dec 01, 2013 9:56 am
by green_tea
Me too, I meet this problem, have you resolved it ?

Re: How to add debug lines inside a module

PostPosted: Mon Dec 02, 2013 10:16 am
by green_tea
Ok, the problem is resolved.
Set the debug_level value as 455 in namelist.input, or what ever number you want.
Then add in the program where you want to print:
CALL get_wrf_debug_level(debug_level_yu)
if (debug_level_yu.eq.455) then
WRITE( message , * ) 'fro_yu test on file, timestep = ', itimestep
CALL wrf_message ( message )
print *,'fro_yu test on screen'
endif

You must declare the variable debug_level_yu at the beginning:
integer debug_level_yu

Then in rsl.out.0000 you will have:
fro_yu test on file, timestep = 2
fro_yu test on screen