Implementation of Dr Hook in the code

For the developers, in order DR_HOOK to run, each subroutine has to contain several further instructions :

USE YOMHOOK, ONLY : LHOOK, DR_HOOK
USE PARKIND1, ONLY : JPRB

REAL(KIND=JPRB) :: ZOOK_HANDLE

Then, just after declarations :
IF (LHOOK) CALL DR_HOOK(’name of the subroutine’,0, ZHOOK_HANDLE)

And, each time a subroutine is left (ie before each RETURN and before the END SUBROUTINE) :
IF (LHOOK) CALL DR_HOOK(’name of the subroutine’,1,ZHOOK_HANDLE)

Some scripts to automatically insert these instructions in .F90 or .F routines exist:

Also in this section