Dear all,
I'm a new FABM user. Therefore, I hope you will not mind this question.
I tried to provide an external surface flux to a passive tracer following this post in fabm-users group:
https://groups.google.com/g/fabm-users/c/wN1NzDFDqxo/m/AZb75qmZAgAJ
I added a model instance to the yaml-file:
call model%link_horizontal_data(horizontal_id, flux_ex)
I got a compiling error of the form:
Found no matching specific binding for the call to the GENERIC ‘link_horizontal_data’ at
Is there a special way to use these built-in models within the physical model?
Is there any idea, what I could have done wrong or what I missed to do?
Best wishes, Karsten Lettmann
Hi Karsten,
That all looks fine, so I expect the issue is the way your flux_ex variable is declared. This should have the shape of a horizontal field and the data type of a normal FABM real variable. For a 3D model that could look like
real(rk), allocatable, target :: flux_ex(:,:)
The number of dimensions (:,:) will depend on the host model. The “target” attribute will not be the reason for your error, but it is formally required as FABM will keep a pointer to the field. The field does not have to be “allocatable” – it could also be “pointer” or have a static extent.
While debugging this issue, you could temporarily replace link_horizontal_data with link_horizontal_data_by_id – that should result in a clearer error message.
NB if your call to link_horizontal_data is a one-off, you could also skip the id altogether:
call model%link_horizontal_data('T2_flux_flux', flux_ex)
Cheers,
Jorn
--
You received this message because you are subscribed to the Google Groups "FABM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/8a6fef32-f992-4b9e-ac46-496177dade64n%40googlegroups.com.
Hi Karsten,
Glad to hear it worked!
For completeness: I expect that the flux_ex(1) option can be made to work too, but you’d have to send flux_ex(1) rather than flux_ex when you call link_horizontal_data. Alternatively, you could declare flux_ex as a scalar (e.g., “real, target :: flux_ex”), in which case you could send flux_ex directly.
I wonder though – if you end up adding such explicit surface flux handling directly into the 1D model, is there even a need to pass the fluxes to FABM and to use external_surface_flux? You could potentially add your fluxes directly to the output of model%get_surface_sources on the host side. The one reason I can think of to route them through FABM is that you have biogeochemical modules in there that need to know the total surface flux… The external_surface_flux option is mostly used with host models that have a generic infrastructure for passing named variables to FABM already in place; external_surface_flux then provides a mechanism to leverage that infrastructure to add surface fluxes.
NB it’s great that your system is working and the above comments are not meant to suggest it needs changing. But I thought the information could be useful in general, also if others revisit this thread at some later stage.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/0ba6d9f8-1f11-419b-a020-bc4275a07df8n%40googlegroups.com.
Hi Karsten,
Yes, that makes perfect sense, thanks for explaining. And nice to hear about the model combinations you plan to use!
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/5eb8d26e-d412-44b1-bf7a-3642ed0e3970n%40googlegroups.com.