clipping of a state variable

5 views
Skip to first unread message

Ulf Graewe

unread,
Aug 6, 2019, 5:58:46 AM8/6/19
to FABM-devel
Hi all,
I would like to clip a state variable to max_conc.

I know, that I can do stuff like:
call self%register_state_variable(self%id_conc,'c','mg/l','concentration',     &
                                    c_init,minimum=0.0_rk,maximum=self%max_conc, ...

However, I would like to do a bookkeeping of the clipped amount.

call self%register_diagnostic_variable(self%id_clipped_conc_ws,'clipped_conc','mg/l', 'clipped concentration')

In do, I would like to do the following:

_GET_(self%id_conc,conc)
if ( conc .gt. self%max_conc ) then
    _SET_(self%conc,self%max_conc)
    _SET_DIAGNOSTIC_(self%id_clipped_conc,conc-self%conc)
else
    _SET_DIAGNOSTIC_(self%id_clipped_conc,0.0_rk)
endif

Can this be done?

Best,
ulf


--
Ulf Gräwe, Dr.

fon: +49-381-5197-358
fax: +49-381-5197-480
e-mail: ulf.g...@io-warnemuende.de
website: https://www.io-warnemuende.de/ulf-graewe-en.html
ORCID iD: https://orcid.org/0000-0003-4007-9764

Leibniz Institute for Baltic Sea Research Warnemünde
Physical Oceanography and Instrumentation
Seestrasse 15
18119 Rostock
Germany
Reply all
Reply to author
Forward
0 new messages