Generate new heat and salt corrections - nick-klingaman/mckpp GitHub Wiki

Generating new heat and salt corrections

Typically, you need to generate new heat and salt corrections for MetUM-GOML because you want to do one of two things:

  1. Change the ocean mean state to which MetUM-GOML is constrained. For instance, you want to constrain MetUM-GOML:
  • to the ocean mean state of a coupled model with a fully dynamic ocean, such as MetUM-GC3, either globally or regionally (i.e., a hybrid of an observed climatology in some parts of the ocean and a model climatology elsewhere)
  • to the ocean mean state of a different observed climatology (different dataset or different time period)
  • to some combination of an ocean climatology and inter-annual variability, for instance adding a repeating ENSO cycle, or simulating a particular year or sequence of years.
  1. Change something about the MetUM atmospheric model (resolution, physics, aerosol or greenhouse gas concentrations) and limit the effect of that change on the ocean mean state, by "recalibrating" the heat and salt corrections for your new atmospheric configuration. Note that you should not compute new heat and salt corrections if you want to see the full effect of your change on the MetUM-GOML mean state. Computing new corrections essentially means that the model will maintain the given ocean climatology as best it can, reducing the effect of your changes on the mean state. For instance, if you increase CO2 and then recompute your corrections, the new corrections will cool the ocean to balance your CO2 increase. Limiting changes to the mean state does not necessarily limit changes to variability, however, due to the correction method.

To generate new corrections, follow this workflow:

1. Prepare your ocean climatologies

MC-KPP requires that the ocean temperature and salinity climatologies be on the same horizontal and vertical grid as MC-KPP. The climatologies can be regional or global, but if they are regional then the region must be at least as large as the MC-KPP coupling domain. Nearest-neighbour interpolation in the horizontal and linear interpolation in the vertical are normally sufficient.

For horizontal interpolation, you should ensure that your ocean temperature and salinity climatologies contain valid data at all MetUM gridpoints that are at least partially ocean (where land fraction is less than 1.0). MC-KPP runs at all gridpoints that are at least partially ocean. Missing values in temperature and salinity climatologies will cause the model to crash with NaN values in the output. Extrapolation along the coasts is normally sufficient.

For vertical interpolation, kpp_utils contains a function interpolate_to_kppvgrid that will read the MC-KPP vertical grid ancillary file and linearly interpolate your temperature or salinity field to vertical grid. The function requires temperature and salinity data in the form of an iris cube.

Typically, we use ocean climatologies that are either monthly means or temporally smoothed daily values (e.g., 31-day running means). High-frequency variability in the ocean climatology can lead to high-frequency variability in the heat and salt corrections, which can make the corrections less effective. If you use monthly means, then you can either interpolate these to daily values yourself, or provide the monthly means to KPP and enable the relevant options to interpolate in time (see below). In either case, you must first adjust the monthly values so that the interpolation to daily values preserves the original monthly mean. This is sometimes called the "AMIP correction"; see Taylor et al. (2000) . kpp_utils contains a function compute_amip_means to help you with this. The function requires input data in the form of an iris cube. There is also a function to interpolate from monthly to daily values, called interp_mmeans_dmeans.

Note that your climatologies need not be a single 12-month seasonal cycle. They can be a multi-year dataset, for instance if you are adding a repeating ENSO cycle or running a historical simulation with inter-annual variability. In this case, you will need to adjust the MC-KPP namelist options related to the periodicity of the climatologies (see below).

2. Prepare your ancillary files

You will need to add/replace four ancillary files in the MetUM-GOML simulation. Create these files and follow the variable and dimension name specifications in the documentation .

  • Ocean temperature
  • Ocean salinity
  • SST
  • Bottom-layer temperature (for no-flux boundary condition). Typically this is the temperature at the level closest to 1000m, assuming you use the standard MC-KPP vertical grid (100 points in 1000m).

Note that the SST and bottom-layer temperature must be in separate files from the ocean temperature dataset, even though the ocean temperature dataset also contains these data. MC-KPP does not read SST and bottom-layer temperature from the ocean temperature dataset.

3. Configure a MetUM-GOML relaxation simulation

a. Copy an existing relaxation simulation suite at your chosen resolution, assuming one exists; see the list of standard suites .

b. Add the paths to your ancillary files and configure the options to update them, if necessary:

Under KPP Namelist -> Forcing Datasets

  • Ocean temperature: ocnt_file
  • Ocean salinity: sal_file
  • Bottom layer temperature: bottomin_file

Under KPP Namelist -> Coupling Controls

  • SST: sstin_file

c. If you want MC-KPP to treat your climatologies as periodic in time, then ensure that the options l_periodic_climsst, l_periodic_bottom_temp, l_periodic_ocnt and l_periodic_sal are enabled. These are in the same panels as the options above for each variable.

d. If your climatologies are not a single annual cycle (360 days), then you will need to adjust the periods sal_period, ocnt_period, climsst_period` and bottom_temp_period`` to be equal to the length of your climatologies (in days). Note that MC-KPP does not assume that the period is equal to the length of the time dimension in the file. These are in the same panels as the options above for each variable.

e. If your ocean tempearture and salinity climatologies are monthly (or longer) means and you want MC-KPP to interpolate to daily data, then you should:

  • set l_interp_ocnt and l_interp_sal to TRUE.
  • change the number of timesteps between updates to the dataset, ndtupdocnt and ndtupdsal, to be the number of ocean model timesteps between values in your data. The typical timestep is 1 hour, or 720 timesteps per 30-day month.
  • ensure that ndt_interp_ocnt and ndt_interp_sal are set to the number of timesteps between interpolation steps (e.g., 24 for daily interpolation with a 1 hour timestep)

These options are in the "Temperature Corrections" and "Salinity Corrections" panels for temperature and salinity, respectively.

Note that MC-KPP does not support interpolating SST or bottom-layer temperature in time, as these are single-level fields and the interpolation was introduced to reduce disk-space requirements for the vertically resolved temperature and salinity fields. These should be provided as daily means.

f. Make sure that the relaxation of ocean temperature and salinity is enabled, through the following options under "Relaxation and Advection":

  • l_relax_ocnt
  • l_relax_sal
  • relax_ocnt_in and relax_sal_in take a list of the relaxation timescale (in days) for each latitude row. You can use Fortran namelist notation (e.g., 200*15 is 15 days for 200 latitude rows).

g. Make sure that MC-KPP is configured to output daily mean temperature and salinity increments that you need to compute the climatological corrections. These are 3D outputs 17 and 22; see the list https://puma.nerc.ac.uk/trac/KPP_ocean/wiki/DiagnosticList . You can configure daily-mean output of these increments by setting elements 17 and 22 of ndt_varout_mean to 24 (assuming a 1hr MC-KPP timestep).

4. Run your MetUM-GOML relaxation simulation

To build climatological temperature and salinity corrections, you should run your relaxation simulation for a length equal to at least 10 times the length of your temperature and salinity climatologies. This is important to sample a range of coupled atmospere-ocean states, across which you can average to create the climatological correction. For instance, if your climatologies are a single 12-month seasonal cycle, then you should run a 10-year simulation. If your climatologies include a repeating 3-yr ENSO cycle, then you should run a 30-year simulation.

Typically, we start MetUM-GOML simulations in September or December and discard the partial first year of the simulation, to allow the atmosphere and ocean to adjust.

5. Build the climatological corrections

From the output of your relaxation simulation, build climatological heat and salt corrections. These should be of equal length to the temperature and salinity climatologies you provided. Typically, in addition to averaging over all years (or all cycles if using multi-annual temperature and salinity climatologies), we smooth the resulting daily corrections with a 31-day running mean to remove high-frequency variability. You can also provide monthly-mean corrections and ask MC-KPP to interpolate these to daily means; see the options in section 6 below. If you use monthly-mean corrections, you must follow the AMIP method to adjust the monthly values so that the daily interpolation preserves the original monthly means.

You can place the heat and salt corrections in the same file, or use separate files. Note that the variable names MC-KPP expects for the heat and salt corrects differ from the variable names provided in the MC-KPP output of these corrections from the relaxation simulations. Ensure that your files conform to the specification in the documentation .

Once you have these files, you are ready to use them in a free-running MetUM-GOML simulation.

6. Perform a free-running MetUM-GOML simulation

You can either copy an existing MetUM-GOML free-running simulation from the list of standard suites , or copy your relaxation simulation and disable the relaxation options. If you do the latter, you can also disable the output of the temperature and salinity correction terms, to save disk space.

Ensure that MC-KPP is configured to read and apply your temperature and salinity corrections:

In the "Temperature Corrections" panel:

  • Enable l_fcorr_withz
  • Set fcorrin_file to the path to your temperature correction file
  • Enable l_upd_fcorr (unless you want to use a fixed correction that does not vary in time)
  • Set ndtupdfcorr to the number of MC-KPP timesteps between points in your temperature correction file (e.g., 24 for daily means or 720 for monthly means, if using a 1hr MC-KPP timestep).
  • If your correction is periodic in time, enable l_periodic_fcorr and set fcorr_period to the period (in days)
  • If you want MC-KPP to interpolate your correction in time, enable l_interp_fcorr and set ndt_interp_fcorr to the number of MC-KPP timesteps between interpolate steps (e.g., 24 for daily interpolation, if using a 1hr MC-KPP timestep).

Make the same changes in the "Salinity Corrections" panel for the salinity corrections.

Note that in some free-running simulations, it is useful to place a weak (~360-day) relaxation on temperature and salinity, to minimise model drift. If you find that your corrections do not maintain the mean state you desire, and you are willing to accept reduced inter-annual ocean variability in your simulation, then you may find such a weak relaxation helpful.

Most MetUM-GOML free-running simulations can be integrated for decades with minimal model drift.