Skip to content

Preparing boundary conditions for CCS1

Matthew Harrison edited this page Jul 25, 2017 · 12 revisions

Generation of Lateral Open Boundary Conditions for CCS1

Open boundary conditions for CCS1 are generated using the brushcutter Python package. Follow the link for installation instructions.

The preprocessing script is contained in createOBCsegments.py

Script breakdown

For this example, OBC data are generated using output from a global MOM6 simulation. The following outlines the full script using sea surface height as an example

  1. Download input data

  2. Start a Python session and import required modules

    from brushcutter import lib_obc_variable as lov

    from brushcutter import lib_obc_segments as los

    from brushcutter import lib_ioncdf as ncdf

  3. Define the boundary using the los.obc_segment method

    south = los.obc_segment('segment_001',momgrd,istart=0,iend=360,jstart=0,jend=0)

    The label attached to this segment is segment_001, it can be anything you choose. momgrd is the path to the regional model FMS supergrid file. In this example, the model supergrid size equals 360x960 (a reminder that the supergrid has double the refinement of the tracer grid) and the boundary is defined along the south edge of the domain.

  4. Define the sea surface height (zeta) field to be interpolated to the boundary

    zeta_south = lov.obc_variable(south,'zeta',geometry='line',\

    obctype='flather',use_locstream=True)

    zeta will be the name given to the interpolated field in the file

  5. Load the source grid using the source supergrid file

    xsrc=nc.Dataset(srcgrd).variables['x'][1::2,1::2]

    ysrc=nc.Dataset(srcgrd).variables['y'][1::2,1::2]

  6. Now interpolate sea surface heights from the source model

    zeta_south.interpolate_from(ssh_data,'ssh',frame=kt,from_global=True,\

    x_coords=xsrc,y_coords=ysrc, drown='ncl')

  7. And save the data to a file for use by MOM6

    ncdf.write_obc_file([south],[zeta_south],[],time,output='obc_CCS1.nc')

Here is an visualization of the resulting surface heights at the CCS1 domain boundaries.

Clone this wiki locally