geoschem / HEMCO

The Harmonized Emissions Component (HEMCO), developed by the GEOS-Chem Support Team.
https://hemco.readthedocs.io
Other
15 stars 31 forks source link

User-defined extension not being read by HEMCO Standalone #237

Closed Row-Bean closed 9 months ago

Row-Bean commented 10 months ago

Name and Institution (Required)

Name: Robin Stevens Institution: Université de Montréal

Description of your issue or question

I am trying to implement a new extension into the HEMCO Standalone model, but I am tripping over the starting line on this project.

I created hcox_P6_mod.F90, following the other extensions as examples. I added it into HEMCO_Config.rc as extension 140. I modified hcox_driver_mod.F90, hcox_state_mod.F90 and CMakeLists.txt, following the examples of the other extensions.

However, the new code doesn't seem to be accessed at all. To confirm, I tried adding calls to HCO_ERROR in the new Init and Run subroutines, but neither one appears in any of the model output. I added a couple of new diagnostics (InvP6_SO2 and InvP6_SO4), and these do appear in the .nc file output, but with all values as zeroes. I can confirm that I am actually modifying the code and building it correctly, as I was able to add a call to HCO_ERROR in hcox_seaflux_mod.F90 and have that message appear in the output.

I attach copies below of some recent output, the HEMCO configuration file, and the Fortran code I added or modified. I added .txt to the names of the files to allow them to upload.

I imagine that I am missing something very simple, but I can't find what it is.

HEMCO_Config.rc.txt slurm-20806236.out.txt HEMCO.log.txt HEMCO_Diagn.rc.txt hcox_P6_mod.F90.txt hcox_driver_mod.F90.txt hcox_state_mod.F90.txt CMakeLists.txt

yantosca commented 10 months ago

Thanks for writing @Row-Bean, In routine HCOX_Init (in module hcox_driver_mod.F90), it looks like the HCOX_P6_Init routine is never called (although there is a USE statement that makes it available to the code). This might explain why the extension doesn't run, probably because the HEMCO state is never told that your extension exists.

Try adding the missing call to HCOX_P6_Init and see if you get output from that extension.

Row-Bean commented 9 months ago

Sorry for the slow response - other priorities came up, and they prevented me from working on this project.

The problem was the missing call, exactly as you said. Thank you very much! Now I'm getting lots of errors, but that's a good thing, because I can make progress debugging them on my own. I'll make a new issue if I get stuck again.

Thanks again!