GENIE BiogemTutorial

From SourceWiki
Jump to navigation Jump to search

Andy Ridgwell (andy@seao2.org)

Exercise 1. Climate-only

Expected learning outcome stuff:

  1. Set up and running genie_eb_go_gs_ac_bg
  2. Configure data saving (time-slice and time-series operation)
  3. Explore basic biogem data output (about the physical climate system)

Instructions

  1. First, download the configuration set biogem_exp_1.tar.gz from:
    1. www.seao2.org/genie_workshop/
    2. to $HOME/genie_input
    3. and unpack ($ tar zxf biogem_exp_1.tar.gz)
  2. Using a text editor, explore the contents of the tracer selection files: gem_config_atm.par, gem_config_atm.par, gem_config_atm.par
    1. Note that the only tracers selected are temperature and salinity (humidity in the case of the atmospheric tracers).
    2. Also note that in biogem_config.par, no biological option is selected (or rather, the ‘null’ option NONE is selected, with the corresponding biological configuration file biogem_bio_NONE_config.par containing no parameter information.
  3. Run the model for 1 year (refer to the rungenie.README file for the description of the options passed to the rungenie configuration script), i.e.:
    1. $ ./rungenie genie_eb_go_gs_ac_bg_itfclsd_08l n 0 1 biogem_exp_1
  4. Now browse the results directory: genie_output/genie_eb_go_gs_ac_bg_itfclsd_08l.biogem_exp_1/biogem
    1. The cupboard is (almost) bare. A re-start file has been saved for biogem (biogem), but if you attempt to open either of the the netCDF output files you will get an error message. No data has been saved, for two reasons:
      1. No year has been set for a results time-slice in the file biogem_save_timeslice.dat (in $HOME/genie_input/biogem_exp_1). Actually, you were warned to this fact in the run-time output as biogem was initialized:
        1. WARNING -> Originating location in code [module,subroutine]: biogem_data,sub_init_data_save -> ERROR MESSAGE: No time-slice dates listed in file biogem_save_timeslice.dat fall within the model start and end years -> ERROR ACTION: CONTINUING
      2. No data categories for time-slice saving have been selected in biogem_config.par.
  5. Re-run the model, but with a time-slice mid-point of 0.5 years set in biogem_save_timeslice.dat (any earlier or later that this will not work because the integration interval is set as 1.0 years by default in biogem_config.par (near the bottom of the I/O - TIME-SERIES section) and the run is only 1 year long …), and select (as t) ocean 'physical' properties as a time-slice data save in biogem_config.par. Explore the contents of fields_biogem_3d.nc. Note that much of the physical grid information is as dull as ditchwater (and also note that ocn_sal and ocn_temp fields are erroneously created, but with no data saved to them – a bug to be fixed :o) ). Also note that nothing is being saved yet in the 2-D netCDF file: fields_biogem_2d.nc.
  6. The important ‘physics’ is saved by selecting miscellaneous properties as a time-slice data save. De-select ocean 'physical' properties and select miscellaneous properties instead and re-run.
  7. A second type of data that can be saved is ‘time-series’ data: i.e., time series of global of surface averaged properties. The time-series configuration file: biogem_save_sig.dat is already populated for you. This file contains the mid-point years at which a time-series data point are to be saved. Again the data is time-integrated, with the integration interval specified in biogem_config.par (near the bottom of the I/O - TIME-SERIES section). Try selecting miscellaneous properties time-series data saving and re-run the model. The results directory now contains time-series files in ASCII (plain text) format. There is a header describing the information and units of each column.
  8. Do any other playing with the options you like.

Exercise 2. Basic ocean carbon cycling

Expected learning outcomey things stuff:

  1. Configure and run a full ocean carbon cycle
  2. Configure and explore further data saving capabilities
  3. Explore surface processes such as biological export and air-sea gas exchange
  4. Explore useful global diagnostics

Instructions

  1. Download and unpack configuration set biogem_exp_2.tar.gz.
  2. Try running the model:
    1. $ ./rungenie genie_eb_go_gs_ac_bg_itfclsd_08l n 0 1 biogem_exp_2
    2. O, too bad – you don’t have the correct biological options configuration file … ?
    3. You have been provided with a basic phosphate-based configuration of ocean biogeochemical cycling – biogem_bio_1N1T_PO4MM_config.par. You need to change the biological option selected in biogem_config.par to 1N1T_PO4MM. (the string takes the form: OPTION, with the corresponding complete file name being: biogem_bio_OPTION_config.par.).
    4. Try running again.
  3. Still no luck … ?
    1. You don’t have any gaseous (atm), dissolved (ocn), or particulate (sed) tracers selected yet.
    2. The minimum useful selection of atmospheric tracers (in file gem_config_atm.par) would be pCO2. Select it (by a t in the first column).
    3. The corresponding dissolved tracer (gem_config_ocn.par) to CO2 gas is DIC (dissolved inorganic carbon) – select it. You will also need alkalinity (ALK) and the (single) nutrient: PO4. Some of the organic matter is partitioned into dissolved form (indicated by a non-zero value for the parameter: fraction of export production in the form of DOC in the biological configuration file: biogem_bio_1N1T_PO4MM_config.par), so you will need to select the dissolved tracers: DOM_C (the carbon component of dissolved organic matter) and DOM_P (the phosphate component).
    4. Finally, organic matter is produced in particulate form as well of course, so you will need to select a couple of sediment tracers (gem_config_sed.par): POC, POP, and CaCO3.
  4. Now try re-running the model.
    1. Whoa! Now it wants to go and completely re-compile itself :-(
      1. (Because the number of tracers selected dictates some fundamental array sizes in the ocean circulation model, which must be compiled in, everything has to start from scratch.)
    2. But after it has finished compiling, it does at least now run :-)
      1. Note that the list of tracers selected is listed during the initialization of biogem in the run-time output.
      2. Ignore the 1st ‘error’ message (about the POC and O2 tracers) – ‘tis a bug to be corrected …
      3. Also ignore the 2nd error message, which is simply telling you that you do not have dissolved calcium (Ca2+) selected as a tracer, so biogem does not know where to get Ca2+ from when creating CaCO3 and where to put it when it dissolves. However, biogem will happily estimate oceanic Ca2+ concentrations from salinity in the absence of an explicit Ca2+ cycle, and takes into account the alkalinity removal and release during CaCO3 precipitation and dissolution anyway.
        1. (The fact that genie does not halt upon either ‘error’ message indicates that biogem does not consider your configuration to be fundamentally incorrect, but rather it just contains issues that you might like to know about.)
  5. Now go to the results directory:
    1. $HOME/genie_output/genie_eb_go_gs_ac_bg_itfclsd_08l.biogem_exp_2/biogem
    2. As before, you don’t have any output saved yet. Start by defining a time-slice at 0.5 years and selecting ocean composition time-slice data to be saved. Re-run. You will now see a list of ocean (dissolved) tracers in fields_biogem_3d.nc, both related to the physical climate system (temperature and salinity) and biogeochemistry (ALK, DIC, PO4, and dissolved organic matter constituents). You can plot these both as vertical (latitude-depth) and horizontal (longitude-latitude) sections, as well as global averages and view the raw data in the Panopoly viewer.
  6. Go back to biogem_config.par and select aqueous carbonate system properties time-slice data to be saved. Re-run. You now have information about the aqueous carbonate system available to you.
  7. Selecting 'biological' fluxes will give you fields of particulate matter fluxes.
  8. Selecting miscellaneous properties will some further information based on what you have already been saving.
  9. Selecting ocean-atmosphere flux gives you new information in fields_biogem_2d.nc about 2-D property fields, such as the surface ocean to atmosphere pCO2 difference, and CO2 gas exchange.
  10. Similarly, time-series can be added to the data that is saved, try adding some …
  11. However, to save having to search through multiple time-series files, some simple global diagnostics are provided at the time-slice intervals in a single ASCII file. You can request these by selecting save global diagnostics under I/O – MISC in biogem_config.par. You will get a file with a name of the format: biogem_year_x_yyy_diag_GLOBAL.res (where x is the integer component of the year (mid-point) and yyy is the fractional part). Diagnostics include:
    1. time mid-point and integration interval
    2. global ocean surface area and volume
    3. mean global sir-sea gas exchange coefficient (for CO2)
    4. mean atmospheric tracer concentrations + total inventory
    5. mean ocean tracer concentrations + total inventory
    6. mean + total global productivity
    7. mean + total global sedimentation