Looping over interior diags

13 views
Skip to first unread message

Carsten Lemmen

unread,
May 20, 2021, 5:29:10 PM5/20/21
to FABM-users
Dear FABM community,

when I run the gotm/npzd model with three diags
      call self%register_diagnostic_variable(self%id_PPR,  'PPR', 'mmol m-3 d-1', 'gross primary production rate')
      call self%register_diagnostic_variable(self%id_NPR,  'NPR', 'mmol m-3 d-1', 'net community production rate')
      call self%register_diagnostic_variable(self%id_dPAR, 'PAR', 'W m-2',        'photosynthetically active radiation')

and later loop over all variables in my host, I get 20 diags:

FABM/SCHISM: Integrating averaged diagnostic   1 npzd_nut_sms
FABM/SCHISM: Integrating averaged diagnostic   2 npzd_nut_w
FABM/SCHISM: Integrating averaged diagnostic   3 npzd_phy_sms
FABM/SCHISM: Integrating averaged diagnostic   4 npzd_phy_w
FABM/SCHISM: Integrating averaged diagnostic   5 npzd_zoo_sms
FABM/SCHISM: Integrating averaged diagnostic   6 npzd_zoo_w
FABM/SCHISM: Integrating averaged diagnostic   7 npzd_det_sms
FABM/SCHISM: Integrating averaged diagnostic   8 npzd_det_w
FABM/SCHISM: Integrating averaged diagnostic   9 npzd_dic_sms
FABM/SCHISM: Integrating averaged diagnostic  10 npzd_dic_w
FABM/SCHISM: Integrating averaged diagnostic  11 npzd_PPR
FABM/SCHISM: Integrating averaged diagnostic  12 npzd_NPR
FABM/SCHISM: Integrating averaged diagnostic  13 npzd_PAR
FABM/SCHISM: Integrating averaged diagnostic  14 npzd__constant_1
FABM/SCHISM: Integrating averaged diagnostic  15 npzd__attenuation_coefficient_of_photosynthetic_radiative_flux
FABM/SCHISM: Integrating averaged diagnostic  16 zero
FABM/SCHISM: Integrating averaged diagnostic  17 total_nitrogen_calculator_result
FABM/SCHISM: Integrating averaged diagnostic  18 attenuation_coefficient_of_photosynthetic_radiative_flux_calculator_result
FABM/SCHISM: Integrating averaged diagnostic  19 zero_sms_tot
FABM/SCHISM: Integrating averaged diagnostic  20 zero_w_tot

Where are these auto-generated diags documented, and how can I exclude them if I only want the ones I registered (PPR, NPR, PAR)?

Thanks,
Carsten



Jorn Bruggeman

unread,
May 21, 2021, 3:05:32 AM5/21/21
to fabm-...@googlegroups.com

Hi Carsten,

 

Most of these are used by FABM internally to store rates (“sms”) or vertical velocities (“w”). They are by default not selected for output and not processed by FABM, which you can tell from their “save” attribute: model%diagnostic_variables(i)%save  will be .false. Thus, the quick solution for your issue would be to filter your diagnostics based on that save attribute. The values of diagnostics with save=.false. will not be meaningful in any case.

 

Worth noting that if you would set save to .true. on such a diagnostic before calling model%start, you tell FABM that you do want that diagnostic to be computed and made available to the host. Also, if you know in advance which diagnostics you’ll be outputting (e.g., based on the user’s output configuration), you’d optimize performance by setting save=.false. on all diagnostics, and then selectively to .true. only for those that you need. That avoids FABM doing unnecessary storage and processing.

 

This behaviour is not described in a lot of detail on the wiki, but there are some hints here:

 

https://github.com/fabm-model/fabm/wiki/Using-FABM-from-a-physical-model#initialize-the-model

https://github.com/fabm-model/fabm/wiki/Using-FABM-from-a-physical-model#complete-initialization-of-the-model-object

 

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/880af58e-7c3a-4652-b3b3-50046856e1f3n%40googlegroups.com.

Carsten Lemmen

unread,
May 21, 2021, 3:41:00 AM5/21/21
to fabm-...@googlegroups.com
Dear Jorn, 

thanks for the elaborate explanation, it helped to resolve the problem in the SCHISM host. And, again, I learned a great deal!

Cheers,
Carsten

Reply all
Reply to author
Forward
0 new messages