marbl-ecosys / MARBL

Marine Biogeochemistry Library
https://marbl-ecosys.github.io
Other
14 stars 25 forks source link

Generalize marbl_surface_flux_output_type #417

Closed mnlevy1981 closed 1 year ago

mnlevy1981 commented 1 year ago

MOM6 wants the full 3D chlorophyll field instead of just surface chlorophyll when computing absorption. In talking with @klindsay28, we think the best plan forward would be to

  1. rename marbl_surface_flux_output_type -> marbl_output_for_GCM_type (also rename sfo_cnt -> output_count and add num_levels; may also need to split num_elements -> num_elements_surface_flux and introduce num_elements_interior_tendency)
  2. rename marbl_single_sfo_type -> marbl_single_output_type (also rename forcing_field -> forcing_field_0d and introduce forcing_field_1d; though that adds more work to the resolution of #190 )
  3. Introduce interior_tendency equivalents of the current surface_flux_output variables (and indices); have interior_tendency_compute() add chlorophyll in the correct spot
  4. In marbl_surface_flux_output_indexing_type, rename totalChl_id to surf_totalChl_id (and we'll use totalChl_id in the interior tendency equivalent)

I think renaming forcing_field -> forcing_field_0d and totalChl_id -> surf_totalChl_id will require updates on the GCM side of things. I don't plan on updating POP to use this tag, but am happy to do so if it would be beneficial (POP would continue to use the surface chlorophyll, and I doubt we will be supporting POP long enough for a future PR to introduce a feature that is needed in that model). @maltrud and @mark-petersen this could have implications in E3SM / MPAS-O as well, so I want to make sure you're aware of this issue ticket.

mnlevy1981 commented 1 year ago

It turns out that MOM6 needs access to totalChl before we call interior_tendency_compute() for in the time stepping loop, and that causes issues with the first time step... so I've created the marbl_output_for_GCM_type but we don't need interior_tendency_output at this time. Instead, we need a function (get_output_for_GCM()?) that can compute totalChl from the tracers; the first time MOM6 will call this function will be after reading initial conditions, so it will have a reasonable totalChl even if interior_tendency_compute() hasn't been called yet.

mnlevy1981 commented 1 year ago

fixed by #419