momgrd,
                       istart=0,
                       iend=0,
                       jstart=0,
                       jend=960)
domain = los.obc_segment('domain',
                         momgrd,
                         istart=0,
                         iend=360,
                         jstart=0,
                         jend=960)

# ---------- define variables on each segment ------------------
temp_south = lov.obc_variable(south,
                              'temp',
                              geometry='surface',
                              obctype='radiation',
                              use_locstream=False)
temp_north = lov.obc_variable(north,
                              'temp',
                              geometry='surface',
                              obctype='radiation',
                              use_locstream=False)
temp_west = lov.obc_variable(west,
                             'temp',
                             geometry='surface',
                             obctype='radiation',
                             use_locstream=False)
temp_domain = lov.obc_variable(domain,
                               'temp',
                               geometry='surface',
コード例 #2
0
from PyCNAL_regridding import lib_ioncdf as ncdf
from PyCNAL_regridding import lib_timemanager as ltim
import numpy as np
import sys

# this example demonstrate how to make analytical obc

momgrd = '../data/ocean_hgrid_v2.nc'

# ---------- define segments on MOM grid -----------------------
south = los.obc_segment('segment_001',momgrd,istart=0,iend=360,jstart=0,  jend=0  )
north = los.obc_segment('segment_002',momgrd,istart=0,iend=360,jstart=960,jend=960)
west  = los.obc_segment('segment_003',momgrd,istart=0,iend=0,  jstart=0,  jend=960)

# ---------- define variables on each segment ------------------
temp_south = lov.obc_variable(south,'temp',geometry='surface',obctype='radiation')
temp_north = lov.obc_variable(north,'temp',geometry='surface',obctype='radiation')
temp_west  = lov.obc_variable(west, 'temp',geometry='surface',obctype='radiation')

salt_south = lov.obc_variable(south,'salt',geometry='surface',obctype='radiation')
salt_north = lov.obc_variable(north,'salt',geometry='surface',obctype='radiation')
salt_west  = lov.obc_variable(west, 'salt',geometry='surface',obctype='radiation')

u_south = lov.obc_variable(south,'u',geometry='surface',obctype='radiation')
u_north = lov.obc_variable(north,'u',geometry='surface',obctype='radiation')
u_west  = lov.obc_variable(west, 'u',geometry='surface',obctype='radiation')

v_south = lov.obc_variable(south,'v',geometry='surface',obctype='radiation')
v_north = lov.obc_variable(north,'v',geometry='surface',obctype='radiation')
v_west  = lov.obc_variable(west, 'v',geometry='surface',obctype='radiation')
コード例 #3
0
woatemp = '../data/temp_WOA13-CM2.1_monthly_CCS.nc'
woasalt = '../data/salt_WOA13-CM2.1_monthly_CCS.nc'
momgrd = '../data/ocean_hgrid_v2.nc'

# ---------- define segments on MOM grid -----------------------
domain = los.obc_segment('segment_001',
                         momgrd,
                         istart=0,
                         iend=360,
                         jstart=0,
                         jend=960)

# ---------- define variables on each segment ------------------
temp_domain = lov.obc_variable(domain,
                               'temp',
                               geometry='surface',
                               obctype='radiation',
                               use_locstream=False)
salt_domain = lov.obc_variable(domain,
                               'salt',
                               geometry='surface',
                               obctype='radiation',
                               use_locstream=False)

# ---------- interpolate T/S from WOA monthly file, frame = 0 (jan) and using locstream (x2 speedup)
temp_domain.interpolate_from(woatemp,
                             'temp',
                             frame=0,
                             depthname='st_ocean',
                             from_global=False,
                             coord_names=['geolon_t', 'geolat_t'])
コード例 #4
0
                        momgrd,
                        istart=0,
                        iend=360,
                        jstart=960,
                        jend=960)
west = los.obc_segment('segment_003',
                       momgrd,
                       istart=0,
                       iend=0,
                       jstart=0,
                       jend=960)

# ---------- define variables on each segment ------------------
temp_south = lov.obc_variable(south,
                              'temp',
                              geometry='surface',
                              obctype='radiation',
                              use_locstream=True)
temp_north = lov.obc_variable(north,
                              'temp',
                              geometry='surface',
                              obctype='radiation',
                              use_locstream=True)
temp_west = lov.obc_variable(west,
                             'temp',
                             geometry='surface',
                             obctype='radiation',
                             use_locstream=True)

salt_south = lov.obc_variable(south,
                              'salt',