precipitation as a standard variable

8 views
Skip to first unread message

Svetla Marinova

unread,
Jul 20, 2021, 11:24:42 AM7/20/21
to FABM-users
Hello fellow FABM users and devs,
I failed to use precipitation as a standard variable.
I wrote: 
use fabm_standard_variables
 type_horizontal_standard_variable(name='precipitation',units='m/s')

and receive an error message:
type_horizontal_standard_variable(name='precipitation',units='m/s')
                                    1
Error: Derived type ‘type_horizontal_standard_variable’ cannot be used as a variable at (1)

I'm not sure where exactly in the module to put:
type_horizontal_standard_variable(name='precipitation',units='m/s')

May I type it like horizontal dependency?

type (type_horizontal_dependency_id)       :: id_precip 
call self%register_dependency(self%id_precip,standard_variables%precipitation)

Thank you for considering my request,
With my best wishes,
Svetla

Jorn Bruggeman

unread,
Jul 20, 2021, 11:38:27 AM7/20/21
to fabm-...@googlegroups.com

Hi Svetla,

 

If you’re aiming to define your own, custom standard variable, you can do it like this:

 

type (type_horizontal_standard_variable), parameter :: precipitation = type_horizontal_standard_variable(name='precipitation',units='m/s')

 

You can then use “precipitation” whenever you want the specify a standard variable (e.g., instead of standard_variables%xx)

 

You could potentially also skip the definition of the parameter and directly do something like

 

call self%register_dependency(self%id_precip, type_horizontal_standard_variable(name='precipitation',units='m/s'))

 

That’s formally correct, but worth noting that there are at least some compilers (old Cray ones in particular) that have trouble with this.

 

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/a1506453-b067-4e11-9e7f-3ade67c46610n%40googlegroups.com.

Svetla Marinova

unread,
Jul 21, 2021, 8:22:52 AM7/21/21
to FABM-users
Thank you Jorn.
The direct call works for me and the compilation is successful.
The next open question is whether this "call" will transfer meteorological data for precipitation from GETM?
I'm not ready with the forcing data to run the model, so I don't have an answer right now.
I'll keep you posted.
Thank you again,
Svetla

Jorn Bruggeman

unread,
Jul 21, 2021, 11:09:22 AM7/21/21
to fabm-...@googlegroups.com

Hi Svetla,

 

I’m not aware of GETM (or GOTM) providing precipitation to FABM by default. But if your GETM version doesn’t, you can relatively easily make it do so by editing src/3d/getm_fabm.F90. There, you’ll already find

 

call model%link_horizontal_data(id_bottom_depth_below_geoid,H(i,j))

call model%link_horizontal_data(id_bottom_depth,D(i,j))

 

You can send precipitation by adding

 

call model%link_horizontal_data(type_horizontal_standard_variable(name='precipitation',units='m/s'),precip(i,j))

 

As long as the standard variable name and units used by GETM and by your BGC model match, FABM will ensure the data gets across.

miladinov...@gmail.com

unread,
Jul 23, 2021, 5:59:36 AM7/23/21
to fabm-...@googlegroups.com
Dear Jorn,

Thank you for the help. 
I will try to add precipitation in getm_fabm.F90.
Actually, there is a conflict between the last FABM version and my GETM version (error in fabm.F90).
For this reason I am using an old FABM version.
Thank you again,
Wishes,
Svetla


Reply all
Reply to author
Forward
0 new messages