GEOS-ESM / swell

Workflow system for coupled data assimilation applications
https://geos-esm.github.io/swell/
Apache License 2.0
14 stars 4 forks source link

Cycling FGAT for `geos_marine` and towards erasing `geos_ocean` #419

Open Dooruk opened 2 weeks ago

Dooruk commented 2 weeks ago

This works on my end but currently in draft form because I'm adding a few features that I would like to get feedback while I proceed further with it. This is a step towards getting rid of geos_ocean model section and sticking with geos_marine but that will require further testing and verification beyond the scope of this.

For context, SOCA (marine component of JEDI) is designed to handle different model types such as ocean(mom6), sea-ice (cice6), waves(ww3), and BGC. This means, there will be optional tasks (such as SOCA2CICE) that not need triggered while CICE model is not active. Additionally, there are optional configuration entries for the input config YAML, for instance ice_filename and wav_filename below in the state section are optional entries. More detailed information here.

state:
  read_from_file: 1
  basename: ./INPUT/
  ocn_filename: MOM.res.nc
  ice_filename: cice.res.nc
  wav_filename: wav.res.nc
  date: 2018-04-15T00:00:00Z
  state variables: [cicen, hicen, socn, tocn, ssh, hocn, uocn, vocn, swh]

To handle this, this PR introduces a new key called marine_models to be used in flow.cylc and various tasks. Jinja is able to utilize this key using if statements, I tested it with both flow.cylc and EVA YAMLs. Not sure if there is a more elegant solution for this with the YAMLs?

Second, I added a dynamic_keys feature, (see utilities/render_jedi_interface_files.py). These are entries that are dynamic, for instance states in PseudoModel would be dependent on window_length and background_frequency as well as marine_models, see below for it's output, it has two entries because background_frequency is 3H and window_length is 6H:

name: PseudoModel
states:
- basename: ./
    date: '2021-07-02T06:00:00Z'
    ice_filename: ice.fc.2021-07-02T03:00:00Z.PT3H.nc
    ocn_filename: ocn.fc.2021-07-02T03:00:00Z.PT3H.nc
    read_from_file: 1
- basename: ./
    date: '2021-07-02T09:00:00Z'
    ice_filename: ice.fc.2021-07-02T03:00:00Z.PT6H.nc
    ocn_filename: ocn.fc.2021-07-02T03:00:00Z.PT6H.nc
    read_from_file: 1
tstep: PT3H

Also not sure if there is a better way to handle that, happy to hear feedback on it.

Dooruk commented 1 week ago

Thank you for the reviews! Before this one, the following needs to be merged: https://github.com/GEOS-ESM/swell/pull/430

Then I will work on your suggestions.