Hi Hakase,
The best place to put this would be in $GOTMDIR/src/gotm/gotm.F90, around line 285. There you can already see lines passing depth and atmospheric variables to FABM. You could use the same syntax to pass ice variables, with something like:
call model_fabm%link_horizontal_data(standard_variables_fabm%ice_temperature,ice_T1)
To do this, variable ice_T1 must be available, which may mean you need to add a use statement to gotm.F90 for the ice module that declares ice_T1. Also, this variable (ice_T1) will need to be declared with the “target” attribute, to allow FABM to keep a pointer to it.
Finally, if you follow the above syntax, you would need to create standard variables for each of your ice-related quantities (e.g., “ice_temperature” used above). You have to see I this makes sense (i.e., whether others would indeed consider them to be some sort of standard variable, definable for any ice model). You could take a look at the CF standard names (http://cfconventions.org/standard-names-26.html) to see if something suitable already exists. If it makes sense to create a standard variable, do so by editing $FABMDIR/util/standard_variables/variables.yaml, then execute $FABMDIR/util/standard_variables/parse_standard_variables.py (but pull in today’s change from the FABM repository first!). This should add your new variables to the fabm_standard_variables module.
Alternatively, - and this is much easier, but slightly less future-proof - if it does not (yet) make sense to make these into standard variables, you can just give them any arbitrary name, and substitute that for the standard variable like so:
call model_fabm%link_horizontal_data(‘ice_T1’,ice_T1)
After following these steps, you should be able to use register_dependency from biogeochemical models with either the new standard variable or your arbitrary string to get the value of ice variables…
Hope this helps,
Jorn
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
data for dependency "uvic_dms_ice_hi", defined on a horizontal slice of the model domain, have not been provided.
FATAL ERROR: fabm_check_ready: FABM is lacking required data.
STOP 1
Hi Hakase,
That all sounds good. What is the data type of id_ice_hi in the biogeochemical model? It should be of type_horizontal_dependency_id.
Cheers,
Hi Hakase,
Try replacing ‘ice_hi’ by type_horizontal_standard_variable(name=’ice_hi’) in both gotm.F90 and in the biogeochemical model. You might need to add “use fabm_standard_variables”. Does that help?
Hi Hakase,
Try replacing ‘ice_hi’ by type_horizontal_standard_variable(name=’ice_hi’) in both gotm.F90 and in the biogeochemical model. You might need to add “use fabm_standard_variables”. Does that help?Cheers,Jorn
Hi Hakase,
Great! Sorry for putting you on the wrong track originally. I forgot that a since a while ago, all communication between hydrodynamic and biogeochemical models happens through standard variable objects (no more raw strings).
Hi Hakase,
Great! Sorry for putting you on the wrong track originally. I forgot that a since a while ago, all communication between hydrodynamic and biogeochemical models happens through standard variable objects (no more raw strings).
Hakase
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email tofabm-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Hakase,
Did this problem pop up only recently, or do you think it has never worked in the past? One thing that comes to mind: if you’d register the horizontal diagnostic with the exact same name as the dependency, or if you assign it the same “standard variable” identity, FABM would assume you want the diagnostic to serve as the source of the dependency. That could give you such missing values… Any idea whether that could be the cause?
Cheers,
Jorn
Hakase
To unsubscribe from this group and stop receiving emails from it, send an email tofabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.

Hi Hakase,
Did this problem pop up only recently, or do you think it has never worked in the past? One thing that comes to mind: if you’d register the horizontal diagnostic with the exact same name as the dependency, or if you assign it the same “standard variable” identity, FABM would assume you want the diagnostic to serve as the source of the dependency. That could give you such missing values… Any idea whether that could be the cause?Cheers,Jorn
From: fabm-...@googlegroups.com [mailto:fabm-...@googlegroups.com] On Behalf Of Hakase Hayashida
Sent: 23 September 2014 21:00
To: fabm-...@googlegroups.com
Subject: Re: fabm-devel:788 How to make GOTM variables retrievable for FABM?
Hi Jorn,I think this method does not retrieve the variable I am looking for. I've noticed today, by comparing the surface ice temperature provided by GOTM with that provided by FABM (I save the variable as a horizontal diagnostic variable after retrieving it by following the method described in this topic), that the two outputs were not the same (the former being correct, and the latter incorrect). I thought this was happening only to our ice model branch (ns_ice), but I confirmed that's not the case by comparing the variable "ice_hi" between GOTM and FABM in master's uvic_ice branch. In this case, FABM retrieves a missing value when I try to access "ice_hi".Cheers,Hakase
On Tuesday, June 3, 2014 10:05:33 AM UTC-7, Jorn Bruggeman wrote:
Hi Hakase,Great! Sorry for putting you on the wrong track originally. I forgot that a since a while ago, all communication between hydrodynamic and biogeochemical models happens through standard variable objects (no more raw strings).Cheers,Jorn
Hi Hakase,
I’ve very quickly tested this (provide these standard variables from gotm, and retrieve their values from a FABM model) but did not experience any problems. Could you send a listing of your FABM model code with at least the section that declares the ids, the section that registers the dependencies and diagnostic variables, and the section that retrieves and sets their values?
Also make sure you have the latest FABM code (yesterday’s update could be relevant)
Cheers
To unsubscribe from this group and stop receiving emails from it, send an email tofabm-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FABM-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Hi Hakase,
I’ve very quickly tested this (provide these standard variables from gotm, and retrieve their values from a FABM model) but did not experience any problems. Could you send a listing of your FABM model code with at least the section that declares the ids, the section that registers the dependencies and diagnostic variables, and the section that retrieves and sets their values?Also make sure you have the latest FABM code (yesterday’s update could be relevant)CheersJornFrom: fabm-...@googlegroups.com [mailto:fabm-...@googlegroups.com] On Behalf Of Hakase Hayashida
Sent: 24 September 2014 03:08
To: fabm-...@googlegroups.com
Subject: Re: fabm-devel:789 How to make GOTM variables retrievable for FABM?Hi Jorn,Thank you for your quick reply.I believe this problem has existed ever since I first tried it out in June, but at that time, I was only testing to see if I could compile and run the code without an error (and I was able to). I recently started working on implementing the ice algae model and then now only noticed that such problem exists, as the ice algae was behaving weird (and I confirmed it was due to the values of these dependency variables).The answer to your question is no: I have different IDs for diagnostic and dependency variables for ns_ice branch. However, I might have used the same name for the uvic_ice branch, but it was just a quick test..One other thing I noticed now is that they all produce the same output which looks like this:
<image001.png>
This is strange because I give different names and variables for each ice variable. For example in gotm/gotm.F90:
callmodel_fabm%link_horizontal_data(type_horizontal_standard_variable(name='ice_hi'),ice_hi)callmodel_fabm%link_horizontal_data(type_horizontal_standard_variable(name='ice_tb'),ice_uvic_tb)
And in the ice algae model:
callself%register_horizontal_dependency(self%id_temp,type_horizontal_standard_variable(name='ice_tb'))callself%register_horizontal_dependency(self%id_ice_hi,type_horizontal_standard_variable(name='ice_hi'))
Hi Hakase,
Glad it works for you. Strangely, I tested by explicitly providing type_horizontal_standard_variable(name='tb') instead of adding it to the standard variables, and that worked fine for me as long as the names were identical on the GOTM and FABM sides.
I wouldn’t mind looking into this issue further, but as I see no possible causes in the code snippets you sent, I could do that only if I had the complete GOTM/FABM code that failed for you. It’d be great if you could provide that, but I appreciate you may be satisfied that it works now, and prefer to move on…
Hi all,
Just to let you know that this issue (custom standard variables not being coupled correctly) has now been fixed. It was due to changes committed on 23 September 2014, and has been fixed as of 10 October 2014. Only gfortran was affected, ifort was not.
Hakase, thanks very much for testing, and for making your code available!
Hi Hakase,
The method you are using is fine. The issue here is that most 1D arrays in GOTM, including u and v, have dimensions 0:nlev, with element 0 remaining unused (background: 0:nlev is used for variables defined at the layer interfaces, 1:nlev for variables at the layer centres). FABM therefore operates on elements 1:nlev only, and the following should work:
call model_fabm%link_bulk_data(standard_variables_fabm%zonal_current,u(1:nlev))
Cheers,
Jorn
From: fabm-...@googlegroups.com [mailto:fabm-...@googlegroups.com] On Behalf Of Hakase Hayashida
Sent: 30 July 2015 07:43
To: fabm-...@googlegroups.com