Using YAML for SOG infiles

One of the key features of the SOG Command Processor is the use of YAML syntax for SOG infiles. The command processor transforms infiles written in YAML to the key-value-description format that the SOG Fortran code reads.

YAML is used because it is easily read by both humans and software. Some of the benefits for humans of using YAML infiles are:

  • Richer metadata in the infile
  • Relaxes (to a large extent, but not completely) the order of the contents of the infile

Some of the software benefits of using YAML (that should turn out to be human benefits too) are:

  • Facilitate use of a base infile with one or more infile snippets that are applied to it as edits
  • Validation of infile contents independent of SOG Fortran code
  • Easier programmatic manipulation of infiles for things like genetic algorithm optimization of model parameters

The SOG command processor uses the PyYAML library to process YAML infiles in Python, so the recommended reference for YAML syntax is the PyYAML documentation

If your editor doesn’t already include a YAML syntax highlighter, you probably want to find one on the web. For emacs, there’s yaml-mode.el

SOG YAML Grammar

This is a brief summary of how YAML is used to write SOG infiles. It is neither a detailed description of YAML syntax (see PyYAML documentation for that), or an exhaustive list of the infile parameters and their purposes (see the Example SOG YAML infile and the SOG Fortran code for that).

The basic building block of a SOG YAML infile is a block mapping, one or more lines of key-value pairs with ”: ” (colon and space) as a separator:

value: 40
units: m
variable name: grid%D
description: depth of modelled domain

Block mappings can be nested:

grid:
  model_depth:
    value: 40
    units: m
    variable name: grid%D
    description: depth of modelled domain

You can think of this as a tree where grid is the parent node, and model_depth is a child node. Indentation defines the nesting levels of the tree. By convention, each level is indented by 2 spaces.

In the context of SOG, only “value nodes” (the deepest nodes in any tree branch) can have value, units, variable name, and description as children:

grid:
  model_depth:
    value: 40
    units: m
    variable name: grid%D
    description: depth of modelled domain
  grid_size:
    value: 80
    variable_name: grid%M
    description: number of grid points

Notice that units is optional in values nodes. It may be omitted if the value has no units.

The order of elements in a tree and the in value node block mappings doesn’t matter:

grid:
  grid_size:
    value: 80
    description: number of grid points
    variable_name: grid%M
  model_depth:
    variable name: grid%D
    description: depth of modelled domain
    value: 40
    units: m

is equivalent to the previous YAML snippet. The YAML infile itself is an implicit, top-level node, so, the high level blocks like grid and location (see Example SOG YAML infile) can be arranged in whatever order is logical for a given infile.

Lines starting with the # character are treated as comments in YAML. Blank lines are ignored, so they may be used to provide semantic separations to improve the readability of the infile.

In the SOG context The value element of a value node can be one of several types:

  • A number, expressed as an integer, float, or in scientific notation with e as the exponent separator; e.g. value: 40, value: 49.1253, value: 30e3, value: 11.67e-10. The SOG command processor takes care of transforming numbers to the format expected by the SOG infile processor, so, trailing decimals and zeros (40. or 40.0), and explicit indication of double precision (49.1253d0) are not required.
  • A string such as a file path and name; e.g. value: ../SOG-initial/chem/Chem-SOGS-2010-73.sog. Only use quotes in strings if the are part of the string. They are not required as delimiters.
  • A date/time in the format yyyy-mm-dd hh:mm:ss; e.g. value: 2005-10-11 00:22:00
  • A Boolean value; value: True or value: False.
  • A list of 1 or more numbers, enclosed in square brackets, and separated by commas; e.g. value: [0.33, 0.33, 0.33]. The expression rules above for single numbers apply to each number in the list, and expression formats may be mixed within a list; e.g. value: [42, 0.33, 1.2e-4].

The value element of a value node (unsurprisingly) specifies the value that will be read by SOG. The description element and the units element (if present) are combined to produce the descriptive string that SOG writes to stdout as it read the infile. So, the YAML fragment:

grid:
  model_depth:
    value: 40
    units: m
    variable name: grid%D
    description: depth of modelled domain

is transformed by the SOG command processor into the SOG infile line:

"maxdepth"  40.d0  "depth of modelled domain [m]"

The variable name element of a value node is purely informational, that is, it is metadata provided in the infile to document the SOG variable name in which the value is stored.

Adding a New infile Line

This section describes, by example, the code changes required to add an new line to the SOG infile; i.e. a new quantity to be read into SOG on startup. The example used is the addition of file names for the user profiles output base filename, and the user Hoffmueller data output filename.

The files that need to be changed are:

  • Fortran source file:
    • SOG-code/user_output.f90
  • Legacy infiles:
    • SOG-code/infile
    • SOG-code/infile_RI
    • SOG-code/infile_SoG_spring_diatoms
  • YAML infile:
    • SOG-code/infile.yaml
  • SOG command processor Python modules:
    • SOGcommand/SOG_YAML_schema.py
    • SOGcommand/SOG_infile_schema.py
  1. Edit the appropriate Fortran source file(s) to add getpar*() calls to read values form the infile, and add code to do whatever it is that you want to do with those values.

    In the example at hand, we’ll add 2 getpars() calls to the init_user_profiles() subroutine in SOG-code/user_output.f90:

    ...
    if (noprof > 0) then
       ! Read the user profiles results file base-name
       userprofilesBase_fn = getpars("user_profile_base")
    endif
    
    ! Read the user Hoffmueller results file name
    userHoffmueller_fn = getpars("user Hoffmueller file")
    ...
  2. Edit SOG-code/infile to add the lines for the getpar*() calls to read.

    In our example, we add 2 lines at the end of the “Profiles output” section:

    ...
    ! User profiles and Hoffmueller data files
    "user_profile_base"  "profiles/SOG-user"
        "user profile file base (datetime will be added)"
    "user Hoffmueller file"  "profiles/hoff-SOG-user.dat"
        "file for user Hoffmueller results"
    ...
    
  3. Test that the code and legacy infile changes have been made correctly by compiling the code and running it with the legacy infile:

    $ cd SOG-code-dev
    $ make
    $ cd ../SOG-dev-test
    $ SOG run ../SOG-code-dev/SOG ../SOG-code-dev/infile --legacy-infile --watch
    
  4. Once you are happy with the edits to the Fortran source file(s) and legacy infile, edit SOG-code/infile_RI and SOG-code/infile_SoG_spring_diatoms to add the lines for the getpar*() calls to read.

    In our example:

    SOG-code/infile_RI:

    ...
    ! User profiles and Hoffmueller data files
    "user_profile_base"  "profiles/RI-test-user"
        "user profile file base (datetime will be added)"
    "user Hoffmueller file"  "profiles/hoff-TI-test-user.dat"
        "file for user Hoffmueller results"
    ...
    

    SOG-code/infile_SoG_spring_diatoms

    ...
    ! User profiles and Hoffmueller data files
    "user_profile_base"
        "profiles/2002_spring_diatoms_user"
        "user profile file base (datetime will be added)"
    "user Hoffmueller file"
        "profiles/hoff_2002_spring_diatoms_user.dat"
        "file for user Hoffmueller results"
    ...
    
  5. Edit SOG-code/infile.yaml to add block mappings for the new input quantities.

    In our example, we add 2 blocks to the profile_results section:

    ...
    user_profile_file_base:
      value: profiles/SOG-user
      variable_name: userprofilesBase_fn
      description: path/filename base for user profiles (datetime appended)
    ...
    user_hoffmueller_file:
      value: profiles/hoff-SOG-user.dat
      variable_name: userHoffmueller_fn
      description: path/filename for user Hoffmueller results
    ...
    

    Recall that, so long as the block mappings in the YAML file are nested correctly, their order relative to their sibling “value nodes” does not matter.

  6. Edit SOGcommand/SOG_YAML_schema.py to add nodes to the appropriate schema classes.

    In the example at hand, we add 2 nodes to the _ProfilesResults class:

    ...
    user_profile_file_base = _SOG_String(
        infile_key='user_profile_base', var_name='userprofilesBase_fn',
        missing=_deferred_allow_missing)
    ...
    user_hoffmueller_file = _SOG_String(
        infile_key='user Hoffmueller file', var_name='userHoffmueller_fn',
        missing=_deferred_allow_missing)
    ...
    

    Here again, so long as the node declarations are in the correct schema class, order does not matter, but for code readability and maintainability, the nodes should be in the same order as they appear in SOG-code/infile.yaml.

    What is important is that:

    • The variable name to which the node declaration is assigned is the same as the key for the corresponding block mapping that was added to SOG-code/infile.yaml
    • The value assigned to the infile_key argument in the node declaration is the same as the first element (i.e. the getpar*() argument) of the corresponding line that was added to SOG-code/infile

    So, for the SOG-code/infile item:

    "user Hoffmueller file"  "profiles/hoff-SOG-user.dat"
        "file for user Hoffmueller results"
    

    and the SOG-code/infile.yaml block:

    user_hoffmueller_file:
      value: profiles/hoff-SOG-user.dat
      variable_name: userHoffmueller_fn
      description: path/filename for user Hoffmueller results
    

    we have the node declaration:

    user_hoffmueller_file = _SOG_String(
        infile_key='user Hoffmueller file', var_name='userHoffmueller_fn',
        missing=_deferred_allow_missing)
    
  7. Edit SOGcommand/SOG_infile_schema.py to:

    • Add nodes to the SOG_Infile class:

      ...
      user_profile_file_base = _SOG_String(name='user_profile_base')
      user_hoffmueller_file = _SOG_String(name='user Hoffmueller file')
      ...
      

      The variable names to which the node declarations are assigned are the same as the keys for the corresponding block mappings that were added to SOG-code/infile.yaml.

      The values assigned to the name argument in the node declarations are the same as the first element (i.e. the getpar*() argument) of the corresponding items that were added to SOG-code/infile.

      While the order of the node declarations in the SOG_Infile class, strictly speaking, doesn’t matter, code readability and maintability is greatly improved if the nodes are in the same order as their corresponding lines appear in SOG-code/infile.

    • Add keys to the SOG_KEYS list:

      ...
      'user_profile_base', 'user Hoffmueller file',
      ...
      

      The keys are the same as the first element (i.e. the getpar*() argument) of the corresponding items that were added to SOG-code/infile.

      The keys must appear in the order in which the items are arranged in SOG-code/infile. The SOG_KEYS list order defines the order of items in the generated infile, and the values in the list are the first element (i.e. the getpar*() argument) of the infile items.

  8. Test that the YAML infile changes have been made correctly by running to code with it:

    $ cd ../SOG-dev-test
    $ SOG run ../SOG-code-dev/SOG ../SOG-code-dev/infile.yaml --watch
    

Adding a New Optional infile Line

This section describes, by example, the code changes required to add an new optional line to the SOG infile; i.e. a new quantity to be read into SOG on startup, the reading of which is triggered by the value of another parameter in the infile. Examples of optional infile lines are forcing quantity variations, northern boundary fresh water return flow influence parameters, and, forcing data average/historical files.

The example used to illustrate is the addition of the average/historical wind forcing date file name.

The Fortran source SOG-code/forcing.f90 already includes the code to trigger reading of the the average/hist wind parameter from the infile, so that won’t be addresses. Nor will changing the legacy infiles because the optional parameter lines are only included in those files when they are used; see SoG-bloomcast/2012_bloomcast_infile for an example.

The files that do need to be changed are:

  • YAML infile:
    • SOG-code/infile.yaml
  • SOG command processor Python modules:
    • SOGcommand/SOG_YAML_schema.py
    • SOGcommand/SOG_infile_schema.py

The “base” YAML infile for a run (to which edits may be applied) must include block mappings for all of the possibly optional parameters.

  1. Edit SOG-code/infile.yaml to add a block mapping for the new optional input quantities.

    In our example, we add a block to the forcing_data section:

    ...
    # The avg_historical_wind_file parameter is only used when
    # use_average_forcing_data == yes or fill or histfill
    avg_historical_wind_file:
      value: ../SOG-forcing/wind/SHavg
      variable_name: n/a
      description: average/historical wind forcing data path/filename
    ...
    

    Recall that, so long as the block mappings in the YAML file are nested correctly, their order relative to their sibling “value nodes” does not matter.

  2. Edit SOGcommand/SOG_YAML_schema.py to add nodes to the appropriate schema classes.

    In the example at hand, we add a node to the _ForcingData class:

    ...
    # Average/historical wind forcing data path/filename is only used when
    # use_average_forcing_data == yes or fill or histfill
    avg_historical_wind_file = _SOG_String(
        infile_key='average/hist wind', var_name='n/a',
        missing=None)
    ...
    

    Here again, so long as the node declarations are in the correct schema class, order does not matter, but for code readability and maintainability, the nodes should be in the same order as they appear in SOG-code/infile.yaml.

    What is important is that:

    • The variable name to which the node declaration is assigned is the same as the key for the corresponding block mapping that was added to SOG-code/infile.yaml
    • The value assigned to the infile_key argument in the node declaration is the same as the first element (i.e. the getpar*() argument) of the corresponding line that was added to SOG-code/infile

    and, most important for an optional parameter:

    • The value assigned to the missing argument in the node declaration is None, rather than the _deferred_allow_missing value used for required parameters.

    So, for the infile item:

    "average/hist wind"
        "../SOG-forcing/wind/SHavg"
        "average wind forcing data"
    

    and the SOG-code/infile.yaml block:

    avg_historical_wind_file = _SOG_String(
        infile_key='average/hist wind', var_name='n/a',
        missing=None)
    

    we have the node declaration:

    # Average/historical wind forcing data path/filename is only used when
    # use_average_forcing_data == yes or fill or histfill
    avg_historical_wind_file = _SOG_String(
        infile_key='average/hist wind', var_name='n/a',
        missing=None)
    
  3. Edit SOGcommand/SOG_infile_schema.py to:

    • Add a node to the SOG_Infile class:

      ...
      avg_historical_wind_file = _SOG_String(name='average/hist wind')
      ...
      

      The variable name to which the node declaration is assigned is the same as the key for the corresponding block mapping that was added to SOG-code/infile.yaml.

      The value assigned to the name argument in the node declaration is the same as the first element (i.e. the getpar*() argument) of the corresponding item that would be added to the infile with the optional parameter in use.

      While the order of the node declarations in the SOG_Infile class, strictly speaking, doesn’t matter, code readability and maintability is greatly improved if the nodes are in the same order as their corresponding lines appear in SOG-code/infile.

    • Add a value to the appropriate specially handled keys data structure, SOG_EXTRA_KEYS, or SOG_AVG_HIST_FORCING_KEYS. SOG_EXTRA_KEYS is for infile items that are to be added following a Boolean items like northern_return_flow_on. SOG_AVG_HIST_FORCING_KEYS is for the average/historical forcing data file items that precede normal forcing data file items when use average/hist forcing is set to yes, fill, or histfill.

    In our example, we add to the latter data structure:

    ...
    'wind': {
        'trigger': 'use average/hist forcing',
        'yes': ['average/hist wind'],
        'no': [],
        'fill': ['average/hist wind'],
        'histfill': ['average/hist wind'],
    },
    ...
    

    The SOG_EXTRA_KEYS and SOG_AVG_HIST_FORCING_KEYS data structures, and their use is complicated. Reading the code in SOGcommand/SOG_infile_schema.py and the dump() function in SGOcommand/SOG_infile.py is the best way to understand what’s going on and what needs to be done.

  4. Test that the YAML infile changes have been made correctly by running to code with it:

    $ cd ../SOG-dev-test
    $ SOG run ../SOG-code-dev/SOG ../SOG-code-dev/infile.yaml --watch
    

Example SOG YAML infile

This is a snapshot of SOG-code/infile.yaml as of March 17, 2014.

# SOG code infile template

# SOG code infile for 356.5 day run starting at cruise 04-14 station
# S3 CTD cast (2004-10-19 12:22 LST).

grid:
  model_depth:
    value: 40
    units: m
    variable_name: grid%D
    description: depth of modelled domain
  grid_size:
    value: 80
    variable_name: grid%M
    description: number of grid points
  lambda_factor:
    value: 0
    variable_name: lambda
    description: grid spacing parameter

location:
  latitude:
    value: 49.1253
    units: deg
    variable_name: latitude
    description: latitude of modelled estuary
  minor_axis:
    value: 30e3
    units: m
    variable_name: Lx
    description: length of minor axis (cross-estuary) of model domain
  major_axis:
    value: 120e3
    units: m
    variable_name: Ly
    description: length of major axis (along-estuary) of model domain
  open_ended_estuary:
    value: False
    variable_name: openEnd
    description: open basin system (True) or closed system (False)

initial_conditions:
  init_datetime:
    value: 2004-10-19 12:22:00
    variable_name: initDatetime
    description: initial CTD profile date/time
  CTD_file:
    value: ../SOG-initial/ctd/SG-S3-2004-10-19.sog
    variable_name: ctd_in
    description: path/filename for initialization CTD file
  # Give a path/filename for either STRATOGEM nutrients file
  # or IOS bottle file; set the other to N/A
  nutrients_file:
    value: ../SOG-initial/stratogem_nuts/Nuts-S3-2004-10-19.sog
    variable_name: nuts_in
    description: path/filename for STRATOGEM nutrients data file
  bottle_file:
    value: N/A
    variable_name: botl_in
    description: path/filename for IOS nutrients bottle data file
  chemistry_file:
    value: ../SOG-initial/chem/Chem-SOG42-2010-73.sog
    variable_name: chem_in
    description: path/filename for IOS chemistry bottle data file
  init_chl_ratios:
    value: [0.33, 0.33, 0.33]
    variable_name: Psplit
    description: initial micro/nano/pico phytoplankton ratios from chlorophyl
  nitrate_chl_conversion:
    value: 1.600
    units: mg/m^3 . uM N
    variable_name: N2chl
    description: phytoplankton nitrate to chlorophyl conversion factor
  pCO2_atm:
    value: 3.8e-4
    units: atm
    variable_name: pCO2_atm
    description: partial pressure of atmospheric CO2

end_datetime:
  value: 2005-10-11 00:22:00
  variable_name: endDatetime
  description: end of run date/time

numerics:
  dt:
    value: 900
    units: s
    variable_name: dt
    description: time step
  chem_dt:
    value: 5
    units: s
    variable_name: chem_dt
    description: internal chemistry time step
  max_iter:
    value: 30
    variable_name: max_iter
    description: max number of implicit solver iterations per time step

vary:
  wind:
    value: False
    variable_name: vary%wind%enabled
    description: use variation of wind initial conditions or forcing
  # The following wind_* parameters are only used when wind == True
  wind_fixed:
    value: True
    variable_name: vary%wind%fixed
    description: use fixed value for wind initial conditions or forcing
  # The wind_value parameter is only used when wind == True and
  # wind_fixed == True
  wind_value:
    value: 0
    units: m/s
    variable_name: vary%wind%value
    description: fixed value for wind initial conditions or forcing
  # The wind_shift, wind_fraction and wind_addition parameters are
  # only used when wind == True wind_fixed == False
  wind_shift:
    value: 0
    units: yr
    variable_name: vary%wind%value
    description: fixed value for wind initial conditions or forcing
  wind_fraction:
    value: 1
    variable_name: vary%wind%value
    description: fixed value for wind initial conditions or forcing
  wind_addition:
    value: 0
    units: m/s
    variable_name: vary%wind%value
    description: fixed value for wind initial conditions or forcing
  cloud_fraction:
    value: False
    variable_name: vary%cf%enabled
    description: use variation of cloud fraction initial conditions or forcing
  # The following cloud_fraction_* parameters are only used when
  # cloud_fraction == True
  cloud_fraction_fixed:
    value: True
    variable_name: vary%cf%fixed
    description: use fixed value for cloud fraction initial conditions or forcing
  # The cloud_fraction_value parameter is only used when
  # cloud_fraction == True and cloud_fraction_fixed == True
  cloud_fraction_value:
    value: 0
    units: m/s
    variable_name: vary%cf%value
    description: fixed value for cloud fraction initial conditions or forcing
  # The cloud_fraction_shift, cloud_fraction_fraction and
  # cloud_fraction_addition parameters are only used when
  # cloud_fraction == True cloud_fraction_fixed == False
  cloud_fraction_shift:
    value: 0
    units: yr
    variable_name: vary%cf%value
    description: fixed value for cloud fraction initial conditions or forcing
  cloud_fraction_fraction:
    value: 1
    variable_name: vary%cf%value
    description: fixed value for cloud fraction initial conditions or forcing
  cloud_fraction_addition:
    value: 0
    units: m/s
    variable_name: vary%cf%value
    description: fixed value for cloud fraction initial conditions or forcing
  river_flows:
    value: False
    variable_name: vary%rivers%enabled
    description: use variation of river flows initial conditions or forcing
  # The following river_flows_* parameters are only used when river_flows == True
  river_flows_fixed:
    value: True
    variable_name: vary%rivers%fixed
    description: use fixed value for river flows initial conditions or forcing
  # The river_flows_value parameter is only used when river_flows == True and
  # river_flows_fixed == True
  river_flows_value:
    value: 0
    units: m/s
    variable_name: vary%rivers%value
    description: fixed value for river flows initial conditions or forcing
  # The river_flows_shift, river_flows_fraction and
  # river_flows_addition parameters are only used when river_flows ==
  # True river_flows_fixed == False
  river_flows_shift:
    value: 0
    units: yr
    variable_name: vary%rivers%value
    description: fixed value for river flows initial conditions or forcing
  river_flows_fraction:
    value: 1
    variable_name: vary%rivers%value
    description: fixed value for river flows initial conditions or forcing
  river_flows_addition:
    value: 0
    units: m/s
    variable_name: vary%rivers%value
    description: fixed value for river flows initial conditions or forcing
  temperature:
    value: False
    variable_name: vary%temperature%enabled
    description: use variation of air temperature initial conditions or forcing
  # The following temperature_* parameters are only used when temperature == True
  temperature_fixed:
    value: True
    variable_name: vary%temperature%fixed
    description: use fixed value for temperature initial conditions or forcing
  # The temperature_value parameter is only used when temperature == True and
  # temperature_fixed == True
  temperature_value:
    value: 0
    units: m/s
    variable_name: vary%temperature%value
    description: fixed value for temperature initial conditions or forcing
  # The temperature_shift, temperature_fraction and
  # temperature_addition parameters are only used when
  # temperature == True temperature_fixed == False
  temperature_shift:
    value: 0
    units: yr
    variable_name: vary%temperature%value
    description: fixed value for temperature initial conditions or forcing
  temperature_fraction:
    value: 1
    variable_name: vary%temperature%value
    description: fixed value for temperature initial conditions or forcing
  temperature_addition:
    value: 0
    units: m/s
    variable_name: vary%temperature%value
    description: fixed value for temperature initial conditions or forcing

timeseries_results:
  std_physics:
    value: timeseries/std_phys_SOG.out
    variable_name: std_phys_ts_out
    description: path/filename for standard physics time series output
  user_physics:
    value: timeseries/user_phys_SOG.out
    variable_name: user_phys_ts_out
    description: path/filename for user physics time series output
  std_biology:
    value: timeseries/std_bio_SOG.out
    variable_name: std_bio_ts_out
    description: path/filename for standard biology time series output
  user_biology:
    value: timeseries/user_bio_SOG.out
    variable_name: user_bio_ts_out
    description: path/filename for user biology time series output
  std_chemistry:
    value: timeseries/std_chem_SOG.out
    variable_name: std_chem_ts_out
    description: path/filename for standard chemistry time series output
  user_chemistry:
    value: timeseries/user_chem_SOG.out
    variable_name: user_chem_ts_out
    description: path/filename for user chemistry time series output

profiles_results:
  num_profiles:
    value: 1
    variable_name: noprof
    description: number of profiles to output
  # TODO: Replace year-day and day-second lists with a list of
  # date/times for profile outputs
  profile_days:
    value: [303]
    variable_name: profday
    description: list of year-days to output profiles for
  profile_times:
    value: [43200]
    variable_name: proftime
    description: list of day-seconds to output profiles for
  profile_file_base:
    value: profiles/SOG
    variable_name: profilesBase_fn
    description: path/filename base for profiles (datetime will be appended)
  user_profile_file_base:
    value: profiles/SOG-user
    variable_name: userprofilesBase_fn
    description: path/filename base for user profiles (datetime appended)
  halocline_file:
    value: profiles/halo-SOG.out
    variable_name: haloclines_fn
    description: path/filename for halocline results
  hoffmueller_file:
    value: profiles/hoff-SOG.dat
    variable_name: Hoffmueller_fn
    description: path/filename for Hoffmueller results
  user_hoffmueller_file:
    value: profiles/hoff-SOG-user.dat
    variable_name: userHoffmueller_fn
    description: path/filename for user Hoffmueller results
  # TODO: Replace Hoffmueller results start and end year, day & second
  # with date/times
  hoffmueller_start_year:
    value: 2004
    variable_name: Hoff_startyr
    description: year to start Hoffmueller results output
  hoffmueller_start_day:
    value: 294
    variable_name: Hoff_startday
    description: day to start Hoffmueller results output
  hoffmueller_start_sec:
    value: 43200
    variable_name: Hoff_startsec
    description: second to start Hoffmueller results output
  hoffmueller_end_year:
    value: 2005
    variable_name: Hoff_endyr
    description: year to end Hoffmueller results output
  hoffmueller_end_day:
    value: 305
    variable_name: Hoff_endday
    description: day to end Hoffmueller results output
  hoffmueller_end_sec:
    value: 43200
    variable_name: Hoff_endsec
    description: second to end Hoffmueller results output
  hoffmueller_interval:
    value: 1
    variable_name: Hoff_interval
    description: days between Hoffmueller results outputs

physics:
  bottom_boundary_conditions:
    constant_temperature:
      value: False
      variable_name: temp_constant
      description: is bottom temperature constant over time?
    temperature_fit_coefficients:
      value: [9.07, -0.088, -0.906, 0.0, -0.030, -0.088, 0.0]
      variable_name: c(:,2)
      description: temperature (constant, seasonal and biseasonal components)
    salinity_fit_coefficients:
      value: [29.62605865, 0.10374454, -0.03562458, 0, -0.14156091,
              -0.06348989, 0]
      variable_name: c(:,1)
      description: salinity (constant, seasonal and biseasonal components)
    phyto_fluor_fit_coefficients:
      value: [0.58316137, -0.11206845, 0.26241523, 0, 0, 0, 0]
      variable_name: c(:,3)
      description: phytoplankton from fluorescence (constant & seasonal)
    nitrate_fit_coefficients:
      value: [30.5, 0, 0, 0, 0, 0, 0]
      variable_name: c(:,4)
      description: nitrate bottom boundary condition (constant)
    silicon_fit_coefficients:
      value: [54, 0, 0, 0, 0, 0, 0]
      variable_name: c(:,5)
      description: silicon bottom boundary condition (constant)
    DIC_fit_coefficients:
      value: [2065.98993, 9.18035435, -3.15241908, 0, -12.52672493,
              -5.618220366, 0]
      variable_name: c(:,6)
      description: DIC (constant, seasonal & biseasonal from salinity fit)
    dissolved_oxygen_fit_coefficients:
      value: [198.9274, 28.6893, -46.9640, -3.7259, 6.4774, -2.7972, 0]
      variable_name: c(:,7)
      description: dissolved oxygen bottom boundary condition (constant)
    alkalinity_fit_coefficients:
      value: [2097.300118, 6.25890810, -2.14923091, 0, -8.540367,
              -3.83034506, 0]
      variable_name: c(:,8)
      description: alkalinity (constant, seasonal & biseasonal from salinity)
    ammonium_fit_coefficients:
      value: [1, 0, 0, 0, 0, 0, 0]
      variable_name: c(:,9)
      description: ammonium bottom boundary condition (constant)
    phyto_ratio_fit_coefficients:
      value: [1.25948868, 0, 0, 0, 0.97697686, 0.46289294, 0]
      variable_name: c(:,10)
      description: ratio of pico/micro phytoplankton (constant & biseasonal)

  turbulence:
    momentum_wave_break_diffusivity:
      value: 1.0e-4
      units: m^2/s
      variable_name: nu%m%int_wave
      description: internal wave breaking diffusivity for momentum qtys
    scalar_wave_break_diffusivity:
      value: 1.0e-5
      units: m^2/s
      variable_name: nu%T%int_wave, nu%S%int_wave
      description: internal wave breaking diffusivity for scalar qtys
    shear_diffusivity_smoothing:
      value: [0.375, 0.5]
      variable_name: shear_diff_smooth
      description: shear diffusivity smoothing parameters

  fresh_water:
    flux:
      mean_total_flow:
        value: 3624
        units: m^3/s
        variable_name: Qbar
        description: mean total fresh water flow
      common_exponent:
        value: 0.2
        variable_name: F_SOG
        description: exponential for SoG/RI common component of flux
      SoG_exponent:
        value: 1
        variable_name: F_RI
        description: exponent for extra SoG term component of flux
      scale_factor:
        value: 11.87e-10
        variable_name: Fw_scale
        description: fresh water scale factor for rivers flows
      add_freshwater_on_surface:
        value: False
        variable_name: Fw_surface
        description: add all of the fresh water on the surface?
      distribution_depth:
        value: 3
        units: m
        variable_name: Fw_depth
        description: depth to distribute fresh water flux over
      include_fresh_water_nutrients:
        value: True
        variable_name: use_Fw_nutrients
        description: include influence of fresh water nutrients in biology
      northern_return_flow:
        value: True
        variable_name: Northern_return
        description: include fresh water return flow from the north?
      # The next 7 "northern" parameters are only used when
      # northern_return_flow == True
      northern_influence_strength:
        value: 0.8863  # 1 / 43
        units: m
        variable_name: strength
        description: strength of northern influence
      northern_influence_integration_time_scale:
        value: 2
        units: d
        variable_name: tauN
        description: integration time scale for northern influence
      northern_water_depth_peak:
        value: 23
        units: m
        variable_name: central_depth
        description: depth peak of incoming northerrn water
      northern_water_upper_extension:
        value: 12
        units: m
        variable_name: upper_width
        description: upward extension of incoming northern water
      northern_water_lower_extension:
        value: 10
        units: m
        variable_name: lower_width
        description: downward extension of incoming northern water
      northern_water_power_riverflow_influence:
        value: 0.
        variable_name: power
        description: power on the river flow influence on northern water
      northern_water_normalization_riverflow_influence:
        value: 2500
        units: m^3/s
        variable_name: Fo
        description: normalization on the river flow influence on north water

    salinity_fit:
      bottom_salinity:
        value: 30
        variable_name: cbottom
        description: salinity at bottom of modelled domain
      alpha:
        value: 2440
        variable_name: calpha
        description: alpha coefficient of fresh water salinity fit
      alpha2:
        value: 1
        variable_name: calpha2
        description: alpha2 coefficient of fresh water salinity fit
        # For the Strait of Georgia the fresh water salinity fit
        # doesn't actually have an alpha2 coefficient but we set it to
        # 1 to avoid dividing by zero. The beta=0 value below causes
        # the terms containing alpha2 to be eliminated from the
        # calculation.
      gamma:
        value: 0.0633
        variable_name: cgamma
        description: gamma coefficient of fresh water salinity fit
      beta:
        value: 0
        variable_name: cbeta
        description: beta coefficient of fresh water salinity fit

    river_alkalinity_fit:
      river_alkalinity_zero:
        value: 888.8
        variable_name: river_Alk_0
        description: river alkalinity at zero discharge
      river_alkalinity_decay:
        value: -1.5e-4
        variable_name: river_Alk_decay
        description: river alkalinity decay with discharge
      river_pH:
        value: 7.7
        variable_name: pH_riv
        description: pH of river water

    upwelling:
      max_upwelling_velocity:
        value: 2.5e-5
        units: m/s
        variable_name: upwell_const
        description: maximum upwelling velocity
      variation_depth_param:
        value: 11.7
        units: m
        variable_name: d
        description: upwelling variation depth parameter

  K_PAR_fit:
    # Coefficients for Photosynthetic Available Radiation (PAR)
    # elimination (K) from Collins, et al (2008)
    ialpha:
      value: 0.091
      variable_name: ialpha
      description: alpha coefficient of K-PAR fit
    ibeta:
      value: 0.0433
      variable_name: ibeta
      description: beta coefficient of K-PAR fit
    igamma:
      value: 2.62e-22
      variable_name: igamma
      description: gamma coefficient of K-PAR fit
    isigma:
      value: 5.5
      variable_name: isigma
      description: sigma coefficient of K-PAR fit
    itheta:
      value: 0.445
      variable_name: itheta
      description: theta coefficient of K-PAR fit
    idl:
      value: 2.56
      variable_name: idl
      description: dl coefficient of K-PAR fit

biology:
  include_phytoplankton:
    value: True
    variable_name: biology
    description: include phytoplankton in model? (init to zero if False)
  include_flagellates:
    value: True
    variable_name: flagellates
    description: include flagellates in model?
  include_remineralization:
    value: True
    variable_name: remineralization
    description: include remineralization in model?
  include_microzooplankton:
    value: True
    variable_name: microzooplankton
    description: include microzooplankton in model?
  single_species_light:
    value: False
    variable_name: strong_limitation
    description: high light limitation for single species case

  mesozooplankton:
    mesozoo_winter_conc:
      value: 0.369
      units: uM N
      variable_name: rate_mesozoo%winterconc
      description: mesozooplankton background concentration
    mesozoo_summer_conc:
      value: 1.0
      units: uM N
      variable_name: rate_mesozoo%summerconc
      description: mesozooplankton relative summer concentration
    mesozoo_summer_peak_magnitudes:
      value: [0.339,    0.0,    0.0]
      units: uM N
      variable_name: rate_mesozoo%sumpeakval
      description: magnitude of mesozooplankton summer concentration peaks
    mesozoo_summer_peak_days:
      value: [217.000,  229.000,  300.000]
      units: year-day
      variable_name: rate_mesozoo%sumpeakpos
      description: times of mesozooplankton summer concentration peaks
    mesozoo_summer_peak_widths:
      value: [114.0,   51.600,   40.000]
      units: year-days
      variable_name: rate_mesozoo%sumpeakwid
      description: widths of mesozooplankton summer concentration peaks
    mesozoo_max_ingestion:
      value: 1.39e-5
      units: uM N / s
      variable_name: rate_mesozoo%R
      description: mesozooplankton maximum ingestion rate @ 20 deg C
    mesozoo_assimilation_efficiency:
      value: 0.5
      variable_name: rate_mesozoo%eff
      description: mesozooplankton grazed mass assimilation efficiency
    mesozoo_natural_mortality:
      value: 2.3e-6
      units: uM N / s
      variable_name: rate_mesozoo%Rm
      description: mesozooplankton natural mortality rate @ 20 deg C
    mesozoo_excretion:
      value: 1.39e-6
      units: uM N / s
      variable_name: rate_mesozoo%excr
      description: mesozooplankton excretion rate @ 20 deg C
    mesozoo_grazing_limit:
      value: 0.500
      units: uM N
      variable_name: rate_mesozoo%PredSlope
      description: mesozooplankton total grazing limit
    mesozoo_grazing_half_saturation:
      value: 1.000
      units: uM N
      variable_name: rate_mesozoo%HalfSat
      description: mesozooplankton total grazing half saturation constant
    mesozoo_diatom_preference:
      value: 0.250
      variable_name: rate_mesozoo%MicroPref
      description: mesozooplankton preference for diatoms
    mesozoo_diatom_grazing_limit:
      value: 0.000
      units: uM N
      variable_name: rate_mesozoo%MicroPredSlope
      description: mesozooplankton diatom grazing limit
    mesozoo_diatom_grazing_half_saturation:
      value: 0.200
      units: uM N
      variable_name: rate_mesozoo%MicroHalfSat
      description: mesozooplankton diatom grazing half saturation constant
    mesozoo_nano_preference:
      value: 0.250
      variable_name: rate_mesozoo%NanoPref
      description: mesozooplankton preference for nano-phytoplankton
    mesozoo_nano_grazing_limit:
      value: 0.2
      units: uM N
      variable_name: rate_mesozoo%NanoPredSlope
      description: mesozooplankton nano-phyto grazing limit
    mesozoo_nano_grazing_half_saturation:
      value: 1.000
      units: uM N
      variable_name: rate_mesozoo%NanoHalfSat
      description: mesozooplankton nano-phyto grazing half saturation const
    mesozoo_pico_preference:
      value: 0.1
      variable_name: rate_mesozoo%PicoPref
      description: mesozooplankton preference for pico-phytoplankton
    mesozoo_pico_grazing_limit:
      value: 0.0
      units: uM N
      variable_name: rate_mesozoo%PicoPredSlope
      description: mesozooplankton pico-phyto grazing limit
    mesozoo_pico_grazing_half_saturation:
      value: 0.4
      units: uM N
      variable_name: rate_mesozoo%PicoHalfSat
      description: mesozooplankton pico-phyto grazing half saturation const
    mesozoo_PON_preference:
      value: 0.192
      variable_name: rate_mesozoo%PON_Pref
      description: mesozooplankton preference for PON
    mesozoo_PON_grazing_limit:
      value: 0.000
      units: uM N
      variable_name: rate_mesozoo%PON_PredSlope
      description: mesozooplankton PON feeding limit
    mesozoo_PON_grazing_half_saturation:
      value: 0.400
      units: uM N
      variable_name: rate_mesozoo%PON_HalfSat
      description: mesozooplankton PON feeding half saturation const
    mesozoo_microzoo_preference:
      value: 0.308
      variable_name: rate_mesozoo%Z_Pref
      description: mesozooplankton preference for microzooplankton
    mesozoo_microzoo_grazing_limit:
      value: 0.500
      units: uM N
      variable_name: rate_mesozoo%Z_PredSlope
      description: mesozooplankton microzooplankton grazing limit
    mesozoo_microzoo_grazing_half_saturation:
      value: 1.200
      units: uM N
      variable_name: rate_mesozoo%Z_HalfSat
      description: mesozooplankton microzoo grazing half saturation const

  mesodinium_rubrum:
    mesorub_max_ingestion:
      value: 0.8e-5
      units: uM N / s
      variable_name: rate_mesorub%R
      description: mesodinium rubrum maximum ingestion rate @ 20 deg C
    mesorub_assimilation_efficiency:
      value: 0.6
      variable_name: rate_mesorub%eff
      description: mesodinium rubrum grazed mass assimilation efficiency
    mesorub_grazing_limit:
      value: 0.4
      units: uM N
      variable_name: rate_mesozoo%PicoPredSlope
      description: mesodinium rubrum grazing limit
    mesorub_grazing_half_saturation:
      value: 1.0
      units: uM N
      variable_name: rate_mesozoo%PicoHalfSat
      description: mesodinium rubrum grazing half saturation constant

  microzooplankton:
    microzoo_max_ingestion:
      value: 1.5e-5 
      units: uM N / s
      variable_name: rate_uzoo%R
      description: microzooplankton maximum ingestion rate @ 20 deg C
    microzoo_assimilation_efficiency:
      value: 0.6
      variable_name: rate_uzoo%eff
      description: microzooplankton grazed mass assimilation efficiency
    microzoo_natural_mortality:
      value: 0.700E-06
      units: uM N / s
      variable_name: rate_uzoo%Rm
      description: microzooplankton natural mortality rate @ 20 deg C
    microzoo_excretion:
      value: 0.500E-07
      units: uM N / s
      variable_name: rate_uzoo%excr
      description: microzooplankton excretion rate @ 20 deg C
    microzoo_grazing_limit:
      value: 0.500
      units: uM N
      variable_name: rate_uzoo%PredSlope
      description: microzooplankton total grazing limit
    microzoo_grazing_half_saturation:
      value: 1.250
      units: uM N
      variable_name: rate_uzoo%HalfSat
      description: microzooplankton total grazing half saturation constant
    microzoo_pico_preference:
      value: 0.280
      variable_name: rate_uzoo%PicoPref
      description: microzooplankton preference for pico-phytoplankton
    microzoo_pico_grazing_limit:
      value: 0.400
      units: uM N
      variable_name: rate_uzoo%PicoPredSlope
      description: microzooplankton pico-phyto grazing limit
    microzoo_pico_grazing_half_saturation:
      value: 1.000
      units: uM N
      variable_name: rate_uzoo%PicoHalfSat
      description: microzooplankton pico-phyto grazing half saturation const
    microzoo_micro_preference:
      value: 0.280
      variable_name: rate_uzoo%MicroPref
      description: microzooplankton preference for micro-phytoplankton
    microzoo_micro_grazing_limit:
      value: 0.300
      units: uM N
      variable_name: rate_uzoo%MicroPredSlope
      description: microzooplankton micro-phyto grazing limit
    microzoo_micro_grazing_half_saturation:
      value: 1.000
      units: uM N
      variable_name: rate_uzoo%MicroHalfSat
      description: microzooplankton micro-phyto grazing half saturation const
    microzoo_nano_preference:
      value: 0.170
      variable_name: rate_uzoo%NanoPref
      description: microzooplankton preference for nano-phytoplankton
    microzoo_nano_grazing_limit:
      value: 0.500
      units: uM N
      variable_name: rate_uzoo%NanoPredSlope
      description: microzooplankton nano-phyto grazing limit
    microzoo_nano_grazing_half_saturation:
      value: 1.000
      units: uM N
      variable_name: rate_uzoo%NanoHalfSat
      description: microzooplankton nano-phyto grazing half saturation const
    microzoo_PON_preference:
      value: 0.090
      variable_name: rate_uzoo%PON_Pref
      description: microzooplankton preference for PON
    microzoo_PON_grazing_limit:
      value: 0.600
      units: uM N
      variable_name: rate_uzoo%PON_PredSlope
      description: microzooplankton PON grazing limit
    microzoo_PON_grazing_half_saturation:
      value: 2.000
      units: uM N
      variable_name: rate_uzoo%PON_HalfSat
      description: microzooplankton PON grazing half saturation const
    microzoo_microzoo_preference:
      value: 0.180
      variable_name: rate_uzoo%PON_Pref
      description: microzooplankton preference for microzoo cannibalism
    microzoo_microzoo_grazing_limit:
      value: 0.300
      units: uM N
      variable_name: rate_uzoo%PON_PredSlope
      description: microzooplankton microzoo grazing limit
    microzoo_microzoo_grazing_half_saturation:
      value: 0.500
      units: uM N
      variable_name: rate_uzoo%PON_HalfSat
      description: microzooplankton microzoo grazing half saturation const

  phytoplankton_growth:
    micro_max_growth:
      value: 0.600E-04
      units: 1/s
      variable_name: rate_micro%R
      description: micro-phyto maximum growth rate
      # Hitchcock 1980, 1.4 d-1 for T. nordenskelii at 10degrees
    nano_max_growth:
      value: 0.250E-04
      units: 1/s
      variable_name: rate_nano%R
      description: nano-phyto maximum growth rate
      # Yih 2004, 0.5 d-1 for Mesodinium rubrum (at 15 degrees) and
      # Q10**2 tuned up and at Q10**1
    pico_max_growth:
      value: 0.250E-04 
      units: 1/s
      variable_name: rate_pico%R
      description: pico-phyto maximum growth rate
    micro_optimal_light:
      value: 42.000
      units: W/m^2
      variable_name: rate_micro%Iopt
      description: micro-phyto growth optimal light level
      #  Durbin, 1974 3.3 lg/s for T. nordenskelii at 10 degrees
    nano_optimal_light:
      value: 37.000
      units: W/m^2
      variable_name: rate_nano%Iopt
      description: nano-phyto growth optimal light level
      # Yih plus Cloern 1977 Half-sat very similar
    pico_optimal_light:
      value: 10.000
      units: W/m^2
      variable_name: rate_pico%Iopt
      description: pico-phyto growth optimal light level
    micro_max_temperature:
      value: 35
      units: deg C
      variable_name: rate_micro%maxtemp
      description: micro-phyto growth high temperature limit
      # Durbin, 1974 T. nordenskelli cannot grow at 18 degrees
      # general diatoms increase this
    nano_max_temperature:
      value: 35
      units: deg C
      variable_name: rate_nano%maxtemp
      description: nano-phyto growth high temperature limit
      # Mesodinium, Cloern 1977
    pico_max_temperature:
      value: 35
      units: deg C
      variable_name: rate_pico%maxtemp
      description: pico-phyto growth high temperature limit
    micro_temperature_range:
      value: 5
      units: deg C
      variable_name: rate_micro%temprange
      description: micro-phyto growth limit range below max temperature
      # equal growth at 10 and 15 so range down 8
      # (which Q10 should be about const)
    nano_temperature_range:
      value: 5
      units: deg C
      variable_name: rate_nano%temprange
      description: nano-phyto growth limit range below max temperature
      # starts turning over earlier
    pico_temperature_range:
      value: 5
      units: deg C
      variable_name: rate_pico%temprange
      description: pico-phyto growth limit range below max temperature
    micro_Q10_exponent:
      value: 1
      variable_name: rate_micro%Q10exp
      description: micro-phyto growth Q10 temperature effect exponent
      # 1 for T. n.  but 2 is better for S.c.
    nano_Q10_exponent:
      value: 1
      variable_name: rate_nano%Q10exp
      description: nano-phyto growth Q10 temperature effect exponent
      # Cloern 1977 data 2.0 not working try 1.0
    pico_Q10_exponent:
      value: 1
      variable_name: rate_pico%Q10exp
      description: pico-phyto growth Q10 temperature effect exponent
    micro_gamma_loss:
      value: 0
      variable_name: rate_micro%gamma
      description: micro-phyto growth light limitation loss parameter
    nano_gamma_loss:
      value: 0
      variable_name: rate_nano%gamma
      description: nano-phyto growth light limitation loss parameter
    pico_gamma_loss:
      value: 0
      variable_name: rate_pico%gamma
      description: pico-phyto growth light limitation loss parameter
    micro_NO3_half_saturation:
      value: 2.0
      variable_name: rate_micro%k
      description: micro-phyto growth NO3 half-saturation constant
    nano_NO3_half_saturation:
      value: 0.5
      variable_name: rate_nano%k
      description: nano-phyto growth NO3 half-saturation constant
    pico_NO3_half_saturation:
      value: 0.1
      variable_name: rate_pico%k
      description: pico-phyto growth NO3 half-saturation constant
    micro_NO3_vs_NH_preference:
      value: 1.0
      variable_name: rate_micro%kapa
      description: micro-phyto growth preference for NO3 over NH factor
    nano_NO3_vs_NH_preference:
      value: 0.5
      variable_name: rate_nano%kapa
      description: nano-phyto growth preference for NO3 over NH factor
    pico_NO3_vs_NH_preference:
      value: 0.300
      variable_name: rate_pico%kapa
      description: pico-phyto growth preference for NO3 over NH factor
    micro_NH_inhibition_exponent:
      value: 0
      variable_name: rate_micro%gamma_o
      description: micro-phyto growth exponential NH inhibition of NO3 uptake
    nano_NH_inhibition_exponent:
      value: 0
      variable_name: rate_nano%gamma_o
      description: nano-phyto growth exponential NH inhibition of NO3 uptake
    pico_NH_inhibition_exponent:
      value: 0
      variable_name: rate_pico%gamma_o
      description: pico-phyto growth exponential NH inhibition of NO3 uptake
    micro_half_saturation:
      value: 0
      variable_name: rate_micro%N_o
      description: micro-phyto growth overal half-saturation constant
    nano_half_saturation:
      value: 0
      variable_name: rate_nano%N_o
      description: nano-phyto growth overal half-saturation constant
    pico_half_saturation:
      value: 0
      variable_name: rate_pico%N_o
      description: pico-phyto growth overal half-saturation constant
    micro_N_inhibition_exponent:
      value: 0
      variable_name: rate_micro%N_x
      description: micro-phyto growth N inhibition exponent
    nano_N_inhibition_exponent:
      value: 0
      variable_name: rate_nano%N_x
      description: nano-phyto growth N inhibition exponent
    pico_N_inhibition_exponent:
      value: 0
      variable_name: rate_pico%N_x
      description: pico-phyto growth N inhibition exponent
    micro_Si_N_ratio:
      value: 2.
      variable_name: rate_micro%Si_ratio
      description: micro-phyto silicon/nitrogen ratio
    nano_Si_N_ratio:
      value: 0
      variable_name: rate_nano%Si_ratio
      description: nano-phyto silicon/nitrogen ratio
    pico_Si_N_ratio:
      value: 0
      variable_name: rate_pico%Si_ratio
      description: pico-phyto silicon/nitrogen ratio
    micro_Si_half_saturation:
      value: 0.600
      variable_name: rate_micro%K_Si
      description: micro-phyto growth Si half saturation constant
    nano_Si_half_saturation:
      value: 0
      variable_name: rate_nano%K_Si
      description: nano-phyto growth Si half saturation constant
    pico_Si_half_saturation:
      value: 0
      variable_name: rate_pico%K_Si
      description: pico-phyto growth Si half saturation constant
    micro_natural_mortality:
      value: 0.265E-05
      units: 1/s
      variable_name: rate_micro%Rm
      description: micro-phyto natural mortality
    nano_natural_mortality:
      value: 0.270E-05
      units: 1/s
      variable_name: rate_nano%Rm
      description: nano-phyto natural mortality
    pico_natural_mortality:
      value: 0.250E-05
      units: 1/s
      variable_name: rate_pico%Rm
      description: pico-phyto natural mortality

  remineralization_rates:
    NH_remin_rate:
      value: 4e-7
      units: 1/s
      variable_name: remin%NH
      description: ammonium remineralization rate
      # 2 months at 10 degrees (Alain 0.1 d-1 at 10degrees)
      # Denman 0.01d-1 at 10 degrees (2e-7)
    DON_remin_rate:
      value: 2.3e-6
      units: 1/s
      variable_name: remin%D_DON
      description: DON detritus remineralization rate
      # Alain and Jeffery 0.2d-1
      # Debby: should be longer than PON but she did not include very
      # labile portion
    PON_remin_rate:
      value: 2.3e-6
      units: 1/s
      variable_name: remin%D_PON
      description: PON detritus remineralization rate
      # Jeffery 0.035 day-1 at 10 degrees (1 month agrees with 370 notes
      # but this is for deeply sinking and thus refractory stuff?)
      # Debby and Alain 0.2d-1
      # Denman 0.1d-1 at 10 degrees
    bSi_remin_rate:
      value: 3.24e-6
      units: 1/s
      variable_name: remin%D_bSi
      description: ammonium remineralization rate
      # from Alain 0.07 d-1 @ 0 degrees give 3.24e-6 @ 20 degrees
      # of same order as a number of papers including Brzezinski et al,;
      # Bidle and Azam 1998 without bacteria

  phytoplankton_mortality_waste:
    micro_mort_NH:
      value: 0
      variable_name: frac_waste_DNM%NH
      description: waste fraction from micro-phyto natural mortality to NH
    micro_mort_DON:
      value: 0.475
      variable_name: frac_waste_DNM%DON
      description: waste fraction from micro-phyto natural mortality to DON
      # Denman and Pena: about 1/2 to dissolved
    micro_mort_PON:
      value: 0.475
      variable_name: frac_waste_DNM%PON
      description: waste fraction from micro-phyto natural mortality to PON
    micro_mort_refr:
      value: 0.05
      variable_name: frac_waste_DNM%Ref
      description: waste fraction from micro-phyto natural mort to refractory
    micro_mort_bSi:
      value: 1
      variable_name: frac_waste_DNM%Bsi
      description: waste fraction from micro-phyto natural mortality to bSi
    nano_mort_NH:
      value: 0
      variable_name: frac_waste_NNM%NH
      description: waste fraction from nano-phyto natural mortality to NH
    nano_mort_DON:
      value: 0.475
      variable_name: frac_waste_NNM%DON
      description: waste fraction from nano-phyto natural mortality to DON
      # Denman and Pena: about 1/2 to dissolved
    nano_mort_PON:
      value: 0.475
      variable_name: frac_waste_NNM%PON
      description: waste fraction from nano-phyto natural mortality to PON
    nano_mort_refr:
      value: 0.05
      variable_name: frac_waste_NNM%Ref
      description: waste fraction from nano-phyto natural mort to refractory
    nano_mort_bSi:
      value: 1
      variable_name: frac_waste_NNM%Bsi
      description: waste fraction from nano-phyto natural mortality to bSi
    pico_mort_NH:
      value: 0
      variable_name: frac_waste_FNM%NH
      description: waste fraction from pico-phyto natural mortality to NH
    pico_mort_DON:
      value: 0.475
      variable_name: frac_waste_FNM%DON
      description: waste fraction from pico-phyto natural mortality to DON
      # Denman and Pena: about 1/2 to dissolved
    pico_mort_PON:
      value: 0.475
      variable_name: frac_waste_FNM%PON
      description: waste fraction from pico-phyto natural mortality to PON
    pico_mort_refr:
      value: 0.05
      variable_name: frac_waste_FNM%Ref
      description: waste fraction from pico-phyto natural mort to refractory
    pico_mort_bSi:
      value: 1
      variable_name: frac_waste_FNM%Bsi
      description: waste fraction from pico-phyto natural mortality to bSi

  mesozooplankton_waste:
    mesozoo_mort_NH:
      value: 0
      variable_name: frac_waste_MNM%NH
      description: waste fraction from meso-zoo natural mortality to NH
    mesozoo_mort_DON:
      value: 0.475
      variable_name: frac_waste_MNM%DON
      description: waste fraction from meso-zoo natural mortality to DON
    mesozoo_mort_PON:
      value: 0.475
      variable_name: frac_waste_MNM%PON
      description: waste fraction from meso-zoo natural mortality to PON
    mesozoo_mort_refr:
      value: 0.05
      variable_name: frac_waste_MNM%Ref
      description: waste fraction from meso-zoo natural mortality to refractory
    mesozoo_mort_bSi:
      value: 0
      variable_name: frac_waste_MNM%Bsi
      description: waste fraction from meso-zoo natural mortality to bSi
    mesozoo_excrete_NH:
      value: 1
      variable_name: frac_waste_MEX%NH
      description: waste fraction from meso-zoo excretion to NH
    mesozoo_excrete_DON:
      value: 0
      variable_name: frac_waste_MEX%DON
      description: waste fraction from meso-zoo excretion to DON
    mesozoo_excrete_PON:
      value: 0
      variable_name: frac_waste_MEX%PON
      description: waste fraction from meso-zoo excretion to PON
    mesozoo_excrete_refr:
      value: 0
      variable_name: frac_waste_MEX%Ref
      description: waste fraction from meso-zoo excretion to refractory
    mesozoo_excrete_bSi:
      value: 0
      variable_name: frac_waste_MEX%Bsi
      description: waste fraction from meso-zoo excretion to bSi

  microzooplankton_waste:
    microzoo_mort_NH:
      value: 0
      variable_name: frac_waste_ZNM%NH
      description: waste fraction from micro-zoo natural mortality to NH
    microzoo_mort_DON:
      value: 0.475
      variable_name: frac_waste_ZNM%DON
      description: waste fraction from micro-zoo natural mortality to DON
    microzoo_mort_PON:
      value: 0.475
      variable_name: frac_waste_ZNM%PON
      description: waste fraction from micro-zoo natural mortality to PON
    microzoo_mort_refr:
      value: 0.05
      variable_name: frac_waste_ZNM%Ref
      description: waste fraction from micro-zoo natural mortality to refractory
    microzoo_mort_bSi:
      value: 0
      variable_name: frac_waste_ZNM%Bsi
      description: waste fraction from micro-zoo natural mortality to bSi
    microzoo_excrete_NH:
      value: 1
      variable_name: frac_waste_ZEX%NH
      description: waste fraction from micro-zoo excretion to NH
    microzoo_excrete_DON:
      value: 0
      variable_name: frac_waste_ZEX%DON
      description: waste fraction from micro-zoo excretion to DON
    microzoo_excrete_PON:
      value: 0
      variable_name: frac_waste_ZEX%PON
      description: waste fraction from micro-zoo excretion to PON
    microzoo_excrete_refr:
      value: 0
      variable_name: frac_waste_ZEX%Ref
      description: waste fraction from micro-zoo excretion to refractory
    microzoo_excrete_bSi:
      value: 0
      variable_name: frac_waste_ZEX%Bsi
      description: waste fraction from micro-zoo excretion to bSi

  sloppy_eating:
    mesozoo_microphyto_grazing_NH:
      value: 0.03
      variable_name: frac_waste_DEM%NH
      description: waste fraction from mesozoo grazing microphyto to NH
      #  Alain, excretion rate to growth rate
    mesozoo_microphyto_grazing_DON:
      value: 0.2
      variable_name: frac_waste_DEM%DON
      description: waste fraction from mesozoo grazing microphyto to DON
      # Denman and Pena about 1/2 to dissolved
    mesozoo_microphyto_grazing_PON:
      value: 0.2
      variable_name: frac_waste_DEM%PON
      description: waste fraction from mesozoo grazing microphyto to PON
    mesozoo_microphyto_grazing_refr:
      value: 0.57
      variable_name: frac_waste_DEM%Ref
      description: waste fraction from mesozoo grazing microphyto to Ref
      # assimiliation minus excretion
    mesozoo_microphyto_grazing_bSi:
      value: 1
      variable_name: frac_waste_DEM%Bsi
      description: waste fraction from mesozoo grazing microphyto to Bsi
    mesozoo_nanophyto_grazing_NH:
      value: 0.03
      variable_name: frac_waste_NEM%NH
      description: waste fraction from mesozoo grazing nanophyto to NH
    mesozoo_nanophyto_grazing_DON:
      value: 0.2
      variable_name: frac_waste_NEM%DON
      description: waste fraction from mesozoo grazing nanophyto to DON
    mesozoo_nanophyto_grazing_PON:
      value: 0.2
      variable_name: frac_waste_NEM%PON
      description: waste fraction from mesozoo grazing nanophyto to PON
    mesozoo_nanophyto_grazing_refr:
      value: 0.57
      variable_name: frac_waste_NEM%Ref
      description: waste fraction from mesozoo grazing nanophyto to Ref
    mesozoo_nanophyto_grazing_bSi:
      value: 0
      variable_name: frac_waste_NEM%Bsi
      description: waste fraction from mesozoo grazing nanophyto to Bsi
    mesozoo_picophyto_grazing_NH:
      value: 0.03
      variable_name: frac_waste_FEM%NH
      description: waste fraction from mesozoo grazing picophyto to NH
    mesozoo_picophyto_grazing_DON:
      value: 0.2
      variable_name: frac_waste_FEM%DON
      description: waste fraction from mesozoo grazing picophyto to DON
    mesozoo_picophyto_grazing_PON:
      value: 0.2
      variable_name: frac_waste_FEM%PON
      description: waste fraction from mesozoo grazing picophyto to PON
    mesozoo_picophyto_grazing_refr:
      value: 0.57
      variable_name: frac_waste_FEM%Ref
      description: waste fraction from mesozoo grazing picophyto to Ref
    mesozoo_picophyto_grazing_bSi:
      value: 0
      variable_name: frac_waste_FEM%Bsi
      description: waste fraction from mesozoo grazing picophyto to Bsi
    mesozoo_PON_grazing_NH:
      value: 0.03
      variable_name: frac_waste_PEM%NH
      description: waste fraction from mesozoo grazing PON to NH
    mesozoo_PON_grazing_DON:
      value: 0.2
      variable_name: frac_waste_PEM%DON
      description: waste fraction from mesozoo grazing PON to DON
    mesozoo_PON_grazing_PON:
      value: 0.2
      variable_name: frac_waste_PEM%PON
      description: waste fraction from mesozoo grazing PON to PON
    mesozoo_PON_grazing_refr:
      value: 0.57
      variable_name: frac_waste_PEM%Ref
      description: waste fraction from mesozoo grazing PON to Ref
    mesozoo_PON_grazing_bSi:
      value: 0
      variable_name: frac_waste_PEM%Bsi
      description: waste fraction from mesozoo grazing PON to Bsi
    mesozoo_microzoo_grazing_NH:
      value: 0.03
      variable_name: frac_waste_ZEM%NH
      description: waste fraction from mesozoo grazing microzoo to NH
    mesozoo_microzoo_grazing_DON:
      value: 0.2
      variable_name: frac_waste_ZEM%DON
      description: waste fraction from mesozoo grazing microzoo to DON
    mesozoo_microzoo_grazing_PON:
      value: 0.2
      variable_name: frac_waste_ZEM%PON
      description: waste fraction from mesozoo grazing microzoo to PON
    mesozoo_microzoo_grazing_refr:
      value: 0.57
      variable_name: frac_waste_ZEM%Ref
      description: waste fraction from mesozoo grazing microzoo to Ref
    mesozoo_microzoo_grazing_bSi:
      value: 0
      variable_name: frac_waste_ZEM%Bsi
      description: waste fraction from mesozoo grazing microzoo to Bsi
    microzoo_microphyto_grazing_NH:
      value: 0
      variable_name: frac_waste_DEZ%NH
      description: waste fraction from microzoo grazing microphyto to NH
    microzoo_microphyto_grazing_DON:
      value: 0.5
      variable_name: frac_waste_DEZ%DON
      description: waste fraction from microzoo grazing microphyto to DON
    microzoo_microphyto_grazing_PON:
      value: 0.5
      variable_name: frac_waste_DEZ%PON
      description: waste fraction from microzoo grazing microphyto to PON
    microzoo_microphyto_grazing_refr:
      value: 0
      variable_name: frac_waste_DEZ%Ref
      description: waste fraction from microzoo grazing microphyto to Ref
    microzoo_microphyto_grazing_bSi:
      value: 1
      variable_name: frac_waste_DEZ%Bsi
      description: waste fraction from microzoo grazing microphyto to Bsi
    microzoo_nanophyto_grazing_NH:
      value: 0
      variable_name: frac_waste_NEZ%NH
      description: waste fraction from microzoo grazing nanophyto to NH
    microzoo_nanophyto_grazing_DON:
      value: 0.5
      variable_name: frac_waste_NEZ%DON
      description: waste fraction from microzoo grazing nanophyto to DON
    microzoo_nanophyto_grazing_PON:
      value: 0.5
      variable_name: frac_waste_NEZ%PON
      description: waste fraction from microzoo grazing nanophyto to PON
    microzoo_nanophyto_grazing_refr:
      value: 0
      variable_name: frac_waste_NEZ%Ref
      description: waste fraction from microzoo grazing nanophyto to Ref
    microzoo_nanophyto_grazing_bSi:
      value: 1
      variable_name: frac_waste_NEZ%Bsi
      description: waste fraction from microzoo grazing nanophyto to Bsi
    microzoo_picophyto_grazing_NH:
      value: 0
      variable_name: frac_waste_FEZ%NH
      description: waste fraction from microzoo grazing picophyto to NH
    microzoo_picophyto_grazing_DON:
      value: 0.5
      variable_name: frac_waste_FEZ%DON
      description: waste fraction from microzoo grazing picophyto to DON
    microzoo_picophyto_grazing_PON:
      value: 0.5
      variable_name: frac_waste_FEZ%PON
      description: waste fraction from microzoo grazing picophyto to PON
    microzoo_picophyto_grazing_refr:
      value: 0
      variable_name: frac_waste_FEZ%Ref
      description: waste fraction from microzoo grazing picophyto to Ref
    microzoo_picophyto_grazing_bSi:
      value: 1
      variable_name: frac_waste_FEZ%Bsi
      description: waste fraction from microzoo grazing picophyto to Bsi
    microzoo_PON_grazing_NH:
      value: 0
      variable_name: frac_waste_PEZ%NH
      description: waste fraction from microzoo grazing PON to NH
    microzoo_PON_grazing_DON:
      value: 0
      variable_name: frac_waste_PEZ%DON
      description: waste fraction from microzoo grazing PON to DON
    microzoo_PON_grazing_PON:
      value: 1
      variable_name: frac_waste_PEZ%PON
      description: waste fraction from microzoo grazing PON to PON
    microzoo_PON_grazing_refr:
      value: 0
      variable_name: frac_waste_PEZ%Ref
      description: waste fraction from microzoo grazing PON to Ref
    microzoo_PON_grazing_bSi:
      value: 0
      variable_name: frac_waste_PEZ%Bsi
      description: waste fraction from microzoo grazing PON to Bsi
    microzoo_microzoo_grazing_NH:
      value: 0
      variable_name: frac_waste_ZEZ%NH
      description: waste fraction from microzoo grazing microzoo to NH
    microzoo_microzoo_grazing_DON:
      value: 0.5
      variable_name: frac_waste_ZEZ%DON
      description: waste fraction from microzoo grazing microzoo to DON
    microzoo_microzoo_grazing_PON:
      value: 0.5
      variable_name: frac_waste_ZEZ%PON
      description: waste fraction from microzoo grazing microzoo to PON
    microzoo_microzoo_grazing_refr:
      value: 0
      variable_name: frac_waste_ZEZ%Ref
      description: waste fraction from microzoo grazing microzoo to Ref
    microzoo_microzoo_grazing_bSi:
      value: 0
      variable_name: frac_waste_ZEZ%Bsi
      description: waste fraction from microzoo grazing microzoo to Bsi
    mesorub_picophyto_grazing_NH:
      value: 0
      variable_name: frac_waste_FEN%NH
      description: waste fraction from mesorub grazing picophyto to NH
    mesorub_picophyto_grazing_DON:
      value: 0.5
      variable_name: frac_waste_FEN%DON
      description: waste fraction from mesorub grazing picophyto to DON
    mesorub_picophyto_grazing_PON:
      value: 0.5
      variable_name: frac_waste_FEN%PON
      description: waste fraction from mesorub grazing picophyto to PON
    mesorub_picophyto_grazing_refr:
      value: 0
      variable_name: frac_waste_FEN%Ref
      description: waste fraction from mesorub grazing picophyto to Ref
    mesorub_picophyto_grazing_bSi:
      value: 1
      variable_name: frac_waste_FEN%Bsi
      description: waste fraction from mesorub grazing picophyto to Bsi

  sinking_rates:
    microphyto_min_sink_rate:
      value: 0.5
      units: m/d
      variable_name: w_sink%Pmicro_min
      description: microphyto minimum sinking rate
      # Alain
    microphyto_max_sink_rate:
      value: 1.2
      units: m/d
      variable_name: w_sink%Pmicro_max
      description: microphyto maximum sinking rate
      # Alain
    PON_sink_rate:
      value: 8e-5
      units: m/s
      variable_name: w_sink%D_PON
      description: PON detritus sinking rate
      # Jeffery quoting Dune and Bacon
    refr_sink_rate:
      value: 0
      units: m/s
      variable_name: w_sink%D_refr
      description: refractory nitrogen detritus sinking rate
    bSi_sink_rate:
      value: 8e-5
      units: m/s
      variable_name: w_sink%D_bSi
      description: biogenic silicon detritus sinking rate
      # match NO3 particles

forcing_data:
  years_of_forcing_data:
    value: 2
    variable_name: NY
    description: number of years of forcing data to read
  use_average_forcing_data:
    value: "no"
    # NOTE: value must be quoted because yes/no == True/False in YAML
    variable_name: use_average_forcing_data
    description: yes=avg only; no=fail if data runs out; fill=historic then avg

  wind_forcing_file:
    value: ../SOG-forcing/wind/SH_total_31Dec2011.dat
    variable_name: n/a
    description: wind forcing data path/filename
  # The avg_historical_wind_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_wind_file:
    value: ../SOG-forcing/wind/SHavg
    variable_name: n/a
    description: average/historical wind forcing data path/filename

  air_temperature_forcing_file:
    value: ../SOG-forcing/met/YVRhistAT
    variable_name: n/a
    description: air temperature forcing data path/filename
  # The avg_historical_air_temperature_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_air_temperature_file:
    value: ../SOG-forcing/met/YVRavgAT
    variable_name: n/a
    description: average/historical air temperature forcing data path/filename

  cloud_fraction_forcing_file:
    value: ../SOG-forcing/met/YVRhistCF
    variable_name: n/a
    description: cloud fraction forcing data path/filename
  # The avg_historical_cloud_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_cloud_file:
    value: ../SOG-forcing/met/YVRavgCF
    variable_name: n/a
    description: average/historical cloud fraction forcing data path/filename

  humidity_forcing_file:
    value: ../SOG-forcing/met/YVRhistHum
    variable_name: n/a
    description: relative humidity forcing data path/filename
  # The avg_historical_humidity_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_humidity_file:
    value: ../SOG-forcing/met/YVRavgHum
    variable_name: n/a
    description: average/historical humidity forcing data path/filename

  major_river_forcing_file:
    value: ../SOG-forcing/rivers/Fraser_total_10Jul2012.dat
    variable_name: n/a
    description: major river flow forcing data path/filename
  # The avg_historical_major_river_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_major_river_file:
    value: ../SOG-forcing/rivers/fraser_average
    variable_name: n/a
    description: average/historical major river forcing data path/filename
  use_river_temperature:
    value: True
    variable_name: UseRiverTemp
    description: include cooling/heating effect of major river water
  river_nutrients_file:
    value: ../SOG-forcing/rivers/fraser_nuts.dat
    variable_name: n/a
    description: file containing monthly climatology values of NO3 and Si

  minor_river_forcing_file:
    value: ../SOG-forcing/rivers/Englishman_total_21Aug2012.dat
    variable_name: Eriver
    description: minor river flow forcing data path/filename
  # The avg_historical_minor_river_file parameter is only used when
  # use_average_forcing_data == yes or fill or histfill
  avg_historical_minor_river_file:
    value: ../SOG-forcing/rivers/englishman_average
    variable_name: n/a
    description: average/historical minor river forcing data path/filename
  alt_minor_river_forcing_file:
    value: ../SOG-forcing/rivers/NanimoNorm_historic.dat
    variable_name: n/a
    description: alternative minor river flow forcing data path/filename
  minor_river_integration_days:
    value: 20
    units: d
    variable_name: integ_days
    description: number of days to integrate minor river flow over

Table Of Contents

Previous topic

SOG Command Processor

Next topic

SOG buildbot Automated Testing System

This Page