Esmvaltool: Is there an option to have alternate variables?

Created on 18 Aug 2019  路  6Comments  路  Source: ESMValGroup/ESMValTool

Dear ESMValTool Development team,

I am trying to read an alternate variable in case the main variable is unavailable, problem explained in the example. For example - for a figure i need tauuo (main variable), but if tauuo is not available for a certain model then i want the ESMValTool to read tauu(alternate variable) for the same model. How can i read the alternate variable in this case? Also, is it possible to add multiple variables that can all be read in case the main variable is missing.

Thank you in advance,
Amarjiit

documentation standards

Most helpful comment

Is it possible to group alternate variables in under a common name?

Not really (except for fx files, as you ask for them inside the variable deinition), but...

for example if tauuo is not available then to read both tauu and areacello for the additional datasets?

... you can use yaml anchors (see https://blog.daemonl.com/2016/02/yaml.html) to solve this:

tauuo:
  additional_datasets:
    - {dataset: with_tauuo1}
    - {dataset: with_tauuo2}

tauu:
  additional_datasets: &alternative
    - {dataset: without_tauuo1}
    - {dataset: without_tauuo2}
  fx_files: [areacello]

var_with_tauu:
  additional_datasets: *alternative

All 6 comments

Let me get this straight - when you say a variable is not available you mean the data for that variable is not available or the variable itself is not to be found in the CMOR tables and needs derivation? The reason I'm asking is that there are two completely different answers depending on which case it is :beer:

I think he is asking about two variables that are provided by the models, but they sometimes only provide one

  • tauu: surface_downward_eastward_stress
  • tauuo: surface_downward_x_stress

I am afraid this is not possible right now, with the only workaround being to request both variables. I am not familiar enough with that part of the code to estimate how much effort is required to implement that feature

My suggestion will be to use the additional_datasets dictionary in the variables to avoid preprocessing data that you will not use:

tauuo:
  additional_datasets:
    - {dataset: with_tauuo1}
    - {dataset: with_tauuo2}

tauu:
  additional_datasets:
    - {dataset: without_tauuo1}
    - {dataset: without_tauuo2}

right! so if it's the first case (unavailability of data) - @jvegasbsc's is the answer indeed; the inter-coupling of variables is something I have started working on but it's not straightforward to implement just yet. Putting both variables in the recipe gives you the choice of playing around with the available (and preprocessed) datasets in the diagnostic and should be relatively straightforward to mix and match

thank you. Now i know it is possible to get alternate variables.
Is it possible to group alternate variables in under a common name? for example if tauuo is not available then to read both tauu and areacello for the additional datasets?

Is it possible to group alternate variables in under a common name?

Not really (except for fx files, as you ask for them inside the variable deinition), but...

for example if tauuo is not available then to read both tauu and areacello for the additional datasets?

... you can use yaml anchors (see https://blog.daemonl.com/2016/02/yaml.html) to solve this:

tauuo:
  additional_datasets:
    - {dataset: with_tauuo1}
    - {dataset: with_tauuo2}

tauu:
  additional_datasets: &alternative
    - {dataset: without_tauuo1}
    - {dataset: without_tauuo2}
  fx_files: [areacello]

var_with_tauu:
  additional_datasets: *alternative

Thank you!
I will let you know how it goes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

axel-lauer picture axel-lauer  路  5Comments

valeriupredoi picture valeriupredoi  路  4Comments

bouweandela picture bouweandela  路  4Comments

bouweandela picture bouweandela  路  3Comments

lukasbrunner picture lukasbrunner  路  4Comments