Enabling Dr Hook in the UM


I’ve been trying to run the UM code with Dr Hook enabled, but an error occurs during the compilation.

The "lhook = .TRUE.” and "lhook = .FALSE.” statements in the “drhook_control_mod.F90” file can’t compile because “lhook” hasn’t been defined. That flag should be defined in “yomhook.F90”, but that
source file is empty.

I enabled Dr Hook within Rose by following the instructions at “https://medium.com/cemac/drhook-the-um-ukca-profiling-tool-40f227e54888”. I also set the options to include wallprof and noself only.

Have those instructions been superseded?

Best wishes,


I’m not sure about this, as I get a 404 with your link and I don’t know if CEMAC people read this forum- also which version of the UM are you using?

I think that generally the lhook parameter is defined in yomhook.F90 - perhaps you have this file and can link?

Can you build without this?


If you are near the head of the UM trunk, there are configs for building which have link flags for DR HOOK - you can presumably see the online repository:

If your fcm make configs are like these, perhaps it will work?


I’m using UM 11.6 and it’s the u-ch330-EPCC suite that Grenville setup for me.
Re the link, did you accidentally include the trailing double quote?

When I saw the lhook error, I checked the “yomhook.F90” file under my n02 account on ARCHER2
and found that it was empty - I’ll check the online code repo.


Ok, I’ve done a submission (from Rose) with the Dr Hook settings turned off and when I
check the source code within my n02 ARCHER2 account, I find multiple non-empty “yomhook.F90”
that have lhook defined.


I’m not sure what happened when the Dr Hook options were turned on.
I’ll try again once my current submission has completed.

I recreated your errors whilst listening to the Archer2 talk. My colleague points out that we don’t have an installation or source for dr_hook, so I’ll try to find something.

I think that the files which are bundled with the UM are a dummy library.

Someone found some source at the end of yesterday. I’ve put the libraries where your suite is expecting them, and I’m building the UM with dr hook now. I will let you know if it works (try yourself beforehand if you’d like).

Ok. It built for me, but I’ve not run the model.
Please try at your convenience, and let me know how it goes

Thanks Dave, I’ll do that once Grenville has transferred some resource.

resource transferred

Unfortunately, the fcm_make2_um failed as before.

The “/work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/preprocess-atmos/src/um/src/control/dummy_libs/drhook/” folder on ARCHER2 contains three files.

-rw-r–r-- 1 mrbn02 n02 1679 Sep 8 10:54 drhook_control_mod.F90
-rw-r–r-- 1 mrbn02 n02 0 Sep 8 10:54 parkind1.F90
-rw-r–r-- 1 mrbn02 n02 0 Sep 8 10:54 yomhook.F90

“yomhook.F90” is empty.

I can’t see how attachment files, so I’ll simply post the content of the err.log file.

[FAIL] ftn -oo/drhook_control_mod.o -c -I./include -s default64 -e m -J ./include -I/work/y07/shared/umshared/gcom/cce10.0.3/gcom7.1/archer2_cray_mpp/build/include -O2 -Ovector1 -hfp0 -hflex_mp=strict -h omp -I/work/y07/shared/umshared/drhook/cce/vn1.2/include /work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/preprocess-atmos/src/um/src/control/dummy_libs/drhook/drhook_control_mod.F90 # rc=1
[FAIL] ftn-855 crayftn: ERROR DRHOOK_CONTROL_MOD, File = …/…/…/mnt/lustre/a2fs-work2/work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/preprocess-atmos/src/um/src/control/dummy_libs/drhook/drhook_control_mod.F90, Line = 20, Column = 8
[FAIL] The compiler has detected errors in module “DRHOOK_CONTROL_MOD”. No module information file will be created for this module.
[FAIL] ftn-326 crayftn: ERROR DRHOOK_CONTROL_ENABLE, File = …/…/…/mnt/lustre/a2fs-work2/work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/preprocess-atmos/src/um/src/control/dummy_libs/drhook/drhook_control_mod.F90, Line = 35, Column = 7
[FAIL] The left hand side of this assignment statement must not be a constant.
[FAIL] ftn-326 crayftn: ERROR DRHOOK_CONTROL_DISABLE, File = …/…/…/mnt/lustre/a2fs-work2/work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um/preprocess-atmos/src/um/src/control/dummy_libs/drhook/drhook_control_mod.F90, Line = 42, Column = 7
[FAIL] The left hand side of this assignment statement must not be a constant.
[FAIL] Cray Fortran : Version 12.0.3 (20210816174116_32d4751edd230fbbdc823f8b431bd5155e145fb9)
[FAIL] Cray Fortran : Compile time: 0.0309 seconds
[FAIL] Cray Fortran : 44 source lines
[FAIL] Cray Fortran : 3 errors, 0 warnings, 0 other messages, 0 ansi
[FAIL] Cray Fortran : “explain ftn-message number” gives more information about each message.
[FAIL] compile 0.3 ! drhook_control_mod.o ← um/src/control/dummy_libs/drhook/drhook_control_mod.F90
[FAIL] ! DRHOOK_CONTROL_MOD.mod: depends on failed target: drhook_control_mod.o
[FAIL] ! drhook_control_mod.o: update task failed

[FAIL] fcm make -C /work/n02/n02/mrbn02/cylc-run/u-ch330-EPCC/share/fcm_make_um -n 2 -j 1 # return-code=255
2022-09-08T10:49:14Z CRITICAL - failed/EXIT

I rebuilt this as a sanity check. Can you see my log at

and I presume you can see the shared library at

I don’t know if this is useful, but you are doing an incremental build - so perhaps it may be worth starting afresh in case something has changed?

rose suite-run --new
would be the command

I’m sorry to not have gone through the code - but as I just copied your suite it’s probably something simple that hence my ‘simple’ suggestion

Thanks Dave, I wondered if the old software was being cached.

Running ‘rose suite-run --new’ did the trick - the compilation was successful and
atmos_main is now running.

Hi Dave, I think this one can be closed now.
I’ve managed to run the u-ch330-EPCC suite for two months and produced Dr Hook output
for both um_atmos jobs.

Thanks again,