Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow GCM to request certain output fields if base_bio_on is True #453

Merged
merged 14 commits into from
Feb 26, 2024

Commits on Jan 26, 2024

  1. Pin alabaster to pass CI

    alabaster 0.7.16 failed the CI; the last passing test used 0.7.13 so I am
    pinning that version
    mnlevy1981 committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    6f0630b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    420de7f View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2024

  1. Abort if requesting Chl output without base_bio

    There are also updates to the driver so that the call_compute_subroutines test
    still runs when abio_dic_on = T and base_bio_on = F. I suspect there will be
    baseline failures in that case due to changes in the output variables
    mnlevy1981 committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    c64e5b7 View commit details
    Browse the repository at this point in the history
  2. Use nco to remove 3 output fields

    output_for_GCM_flux_co2, output_for_GCM_total_Chl, and
    output_for_GCM_total_surfChl are no longer generated by the
    call_compute_subroutines test when using marbl_with_abio_only.settings so they
    have been removed from the baseline
    mnlevy1981 committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    28c87af View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Add registry for surface flux outputs

    The registry makes it easier to add new outputs for the GCM or to add more
    restrictions on when certain outputs are available while maintaining useful
    error messages.
    
    Also cleaned up some white space / alignment issues
    mnlevy1981 committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    63307d2 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2024

  1. Move 3D chlorophyll to output_for_GCM_type

    This required a lot of small changes.
    
    MARBL library:
    
    1. Rename surface_flux_output* -> output_for_gcm*
    2. Add total_Chl index to indexing type, and rename sfo_ind -> ofg_ind
    3, Remove marbl_instance%get_output_for_GCM()
    4. Add field_source to registry type as well as marbl_single_output_type (so
       GCM knows whether the field should be copied after surface_flux_compute() or
       after interior_tendency_compute())
    5. Generalize registry definition, and make more specific error messages
       (flux_o2 requires both base_bio_on and lflux_gas_o2 to be true)
    6. Pass output_for_GCM to interior_tendency_compute so it can populate
       total_Chl (if requested by GCM)
    
    Stand-alone driver:
    
    1. rename total_Chl -> interior_tendency_output, add num_vars dimension (this
       is the 3D equivalent to surface_flux_output). Note that there is an
       assumption that all outputs_for_GCM from surface_flux_compute are 2D, while
       all from interior_tendency_compute are 3D. This is fine for now, but we may
       need to introduce datatypes if future mods contradict that assumption
    2. Rely on field_source in output_for_GCM type to know what to copy out of the
       type / when to copy it
    3. Total Chl is no longer a special case in marbl_io_mod.F90, it comes through
       the output_for_GCM object
    mnlevy1981 committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    d572db6 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2024

  1. Split output_for_GCM back to two arrays

    Put surface_flux_output back on the interface, and also created
    interior_tendency_output. This change lets us drop field_source from the output
    type, and add_output_for_GCM() does all the error checking I had introduced
    into marbl_single_output_constructor (making sure the variable is registered
    and available).
    
    Note that add_output_for_GCM() now returns field_source as well, so the GCM can
    keep the surface flux output and interior tendency output separate when copying
    to local memory (without knowing what fields come from surface_flux_compute()
    vs interior_tendency_compute())
    mnlevy1981 committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    a33bf57 View commit details
    Browse the repository at this point in the history
  2. Revert back to surface_flux_output var name

    In surface_flux_mod.F90, I had changed the argument to
    marbl_surface_flux_compute() from output_for_gcm to surface_flux_output (this
    is what it was called before I tried to integrate the outputs for
    surface_flux_compute and interior_tendency_compute; I've split those outputs
    apart again, so the name change is not necessary)
    mnlevy1981 committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    b6b2f5a View commit details
    Browse the repository at this point in the history
  3. Lots of small fixes from code review

    1. Better comments in create_registry
    2. The registry error message is now prepended with the field name in
       add_output_for_GCM()
    3. create_registry can use base_bio_on, doesn't need it as an intent(in)
    4. better comment in add_output_for_GCM (logs an error message, doesn't return
       one)
    5. If ofg_ind is a target, components of output_for_gcm_type don't need to be
       pointers (registry%id => ofg_ind%* works)
    
    Still have a few slightly bigger changes to make in the next commit
    mnlevy1981 committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    89cf5b9 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

  1. Use a linked list for ofg registry

    Replace marbl_output_for_GCM_single_register_type with
    marbl_output_for_GCM_linked_list_type; array of former becomes a pointer to
    latter. This will make it much easier to add a new output_for_GCM, simply copy
    format of a block of code in create_registry() [and add entry to
    marbl_output_for_GCM_indexing_type]
    mnlevy1981 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    e23e71e View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. add_registry_entry() can be private

    it is called from create_registry, which is already in the
    marbl_output_for_GCM_registry_type class
    mnlevy1981 committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    03fa250 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2024

  1. Clean up linked list code (following review)

    1. Typo in marbl_interface.F90 -- abort if registered_output is not associated
       (was checking this%output_for_gcm_registry%registered_outputs by accident)
    2. Add comment about why create_registry() resets err_message to "" before each
       entry (and clean up errant white-space misalignment)
    3. Also, blocks in create_registry() are easier to read if we set err_message
       to "" and then use a continutation line for the if () rather than using
       if-else
    4. For adding to the registry linked list, order doesn't matter but the logic
       is simpler (and code is faster) if we prepend entries rather than looping
       through to the end of the list every time
    mnlevy1981 committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    c371b6a View commit details
    Browse the repository at this point in the history
  2. Add new available_output regression test

    Provides a mechanism to see what output_for_GCM fields are available for a
    given configuration. Note that output_for_gcm_registry is now a public member
    of the MARBL interface class so the standalone test can access it.
    mnlevy1981 committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    ef58f3b View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2024

  1. Update documentation to include output_for_GCM

    A new page explains what additional output is available from the GCM, and a
    second page shows how to add a new output. The new available_output test is
    also documented on the regression tests page.
    mnlevy1981 committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    1c59f37 View commit details
    Browse the repository at this point in the history