├── Data ├── Fig5.py ├── Fig6.py ├── Fig7.py ├── Figure1.ai ├── Figure2.py ├── Figure3.py ├── Figure4.py ├── Figure5.py ├── Figure6.py ├── GeneralVertCoord.ai ├── meanDrift.py ├── panel2.gif └── trEvolution.py ├── README.md └── mitgcm ├── BATH ├── bathy.ctl └── bathy.dat ├── Clean ├── DYE └── trInit.dat ├── EXF ├── wndStrs.ctl └── wndStrs.dat ├── FLT ├── flt_init.bin ├── initBreakIW.dat └── initBreakIWnonhydro.dat ├── IC ├── TInit.ctl └── TInit.dat ├── STDERR.0000 ├── STDOUT.0000 ├── available_diagnostics.log ├── data ├── data.diagnostics ├── data.flt ├── data.pkg ├── data.ptracers ├── eedata ├── eedata.mth ├── mitgcmuv ├── nonhydro.e96042 ├── nonhydro.o96042 ├── output ├── CombineStat ├── CombineSurf ├── Stat.ctl └── Surf.ctl └── qsub.pbs /Data/Fig5.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on 2020.02.28 4 | 5 | @author: MiniUFO 6 | """ 7 | #%% read_fields 8 | import xmitgcm 9 | 10 | path = 'I:/breakingIW/nonHydro/' 11 | 12 | dset = xmitgcm.open_mdsdataset(data_dir=path+'output/', 13 | grid_dir=path, 14 | prefix=['Stat'], delta_t=2) 15 | 16 | #%% 17 | import xarray as xr 18 | import numpy as np 19 | 20 | tcount = len(dset.time) 21 | 22 | dsKeff = xr.open_dataset(path + 'keff.nc') 23 | 24 | dsKeff.coords['time'] = np.linspace(0, 300*(tcount-1), tcount).astype('int') 25 | dsKeff = dsKeff.rename({'new':'Z'}) 26 | 27 | 28 | #%% all 29 | import numpy as np 30 | from GeoApps.GridUtils import add_MITgcm_missing_metrics 31 | from GeoApps.ContourMethods import ContourAnalysis 32 | 33 | 34 | def get_group(groups, name): 35 | """ 36 | Get DataArray or Dataset corresponding to a particular group label. 37 | """ 38 | gr = groups.groups 39 | 40 | if name not in gr: 41 | return None 42 | 43 | indices = gr.get(name) 44 | return groups._obj.isel(**{groups._group_dim: indices}).values 45 | 46 | 47 | dt = 300 48 | tlen = 100 49 | 50 | reM = [] 51 | reD = [] 52 | reC = [] 53 | 54 | for l in range(1, tcount, tlen): 55 | tstr = l 56 | tend = l + tlen 57 | 58 | if tend >= tcount: 59 | tend = tcount-2 60 | 61 | rng = dict(time=slice(tstr*dt, tend*dt)) 62 | 63 | print('%d %d' % (tstr, tend)) 64 | 65 | # cal_Yeq 66 | ds = dset.loc[rng] 67 | ds, grid = add_MITgcm_missing_metrics(ds) 68 | 69 | mask = ds['TRAC01'] != 0 70 | tracer = ds['TRAC01'].where(mask) 71 | 72 | cm = ContourAnalysis(ds, tracer, 73 | dims={'X':'XC','Z':'Z'}, 74 | dimEq={'Z':'Z'}, grid=grid, 75 | increase=True, lt=False) 76 | 77 | maskInvariant = tracer[0] 78 | maskInvariant += 1 - maskInvariant 79 | 80 | ctr = dsKeff.TRAC01 81 | area = dsKeff.intArea 82 | table = cm.cal_area_eqCoord_table(maskInvariant) 83 | Zeq = dsKeff.zEq 84 | 85 | # read_flt 86 | from utils.IOUtils import read_flt_bcolz 87 | 88 | fset = read_flt_bcolz(path + '.bcolz', 89 | cond="(time>="+str(tstr*dt)+") & (time<="+str(tend*dt)+")", 90 | # cond="(npart>10000000) & (npart<=10001000) & (time>0)", 91 | fields=['npart', 'time', 'x', 'z', 's'], 92 | out='xarray').dropna('npart') 93 | 94 | # interpolate 95 | # xpos = fset.x.where(fset.s!=0).dropna('time', 96 | # how='all').dropna('npart').loc[rng] 97 | # zpos = fset.z.where(fset.s!=0).dropna('time', 98 | # how='all').dropna('npart').loc[rng] 99 | xpos = fset.x.loc[rng] 100 | zpos = fset.z.loc[rng] 101 | time = fset.time.loc[rng] 102 | 103 | var1 = tracer.squeeze().loc[rng].load() 104 | 105 | if len(time) > len(var1.time): 106 | print(str(len(time)) + ' != ' + str(len(var1.time))) 107 | time = time[:len(var1.time)] 108 | xpos = xpos[:, :len(var1.time)] 109 | zpos = zpos[:, :len(var1.time)] 110 | 111 | xpos, time = xr.broadcast(xpos, time) 112 | 113 | trajT = var1.interp(coords={'XC':xpos, 'Z':zpos, 'time':time}) \ 114 | .reset_coords(drop=True) \ 115 | .dropna('npart') 116 | trajY = cm.interp_to_coords(trajT, 117 | ctr.loc[rng], Zeq.loc[rng], 118 | interpDim='Z') \ 119 | .transpose('npart','time') \ 120 | .reset_coords(drop=True) 121 | # trajY = xr.DataArray(table.lookup_coordinates(trajA), 122 | # dims=trajA.dims, coords=trajA.coords) 123 | # del trajA 124 | 125 | # dispersion 126 | for ll in range(tstr, tend): 127 | timNp1 = dt * (ll+1) 128 | timN = dt * ll 129 | 130 | contour = ctr.sel(time=timN).load() 131 | trajVal = trajT.sel(time=timN) 132 | 133 | Ynp1 = trajY.sel(time=timNp1) 134 | Yn = trajY.sel(time=timN) 135 | 136 | # group npart into contour bins 137 | reverse = xr.DataArray(trajVal.npart, dims='contours', 138 | coords={'contours':trajVal.values}).sortby('contours') 139 | 140 | bins = contour.values[::-1] 141 | groups = reverse.groupby_bins('contours', bins, labels=bins[:-1]) 142 | 143 | # if len(groups._group_indices) != 199: 144 | # print(len(groups._group_indices)) 145 | # raise Exception('okok') 146 | 147 | tmpD = [] 148 | tmpM = [] 149 | tmpC = [] 150 | 151 | for name in bins[::-1]: 152 | ids = get_group(groups, name) 153 | 154 | if ids is None: 155 | tmpD.append(xr.DataArray(np.nan)) 156 | tmpM.append(xr.DataArray(np.nan)) 157 | else: 158 | disp = (Ynp1.sel(npart=ids) - Yn.sel(npart=ids)) 159 | disM = disp.mean('npart') 160 | disA = disp - disM 161 | diff = (disA**2).mean('npart') 162 | tmpD.append(diff / (dt * 2.0)) 163 | tmpM.append(disM) 164 | tmpC.append(xr.DataArray(name)) 165 | 166 | reD.append(xr.concat(tmpD, dim='contour')) 167 | reM.append(xr.concat(tmpM, dim='contour')) 168 | reC.append(xr.concat(tmpC, dim='contour')) 169 | 170 | #%% 171 | diffu = xr.concat(reD, dim='time').rename('diffu') 172 | drift = xr.concat(reM, dim='time').rename('drift') 173 | ctrDA = xr.concat(reC, dim='time').rename('ctrDA') 174 | 175 | length = tcount-3 176 | 177 | diffu.coords['time' ] = dset.time[0:length] 178 | diffu.coords['contour'] = dsKeff['Z'].values 179 | drift.coords['time' ] = dset.time[0:length] 180 | drift.coords['contour'] = dsKeff['Z'].values 181 | ctrDA.coords['time' ] = dset.time[0:length] 182 | ctrDA.coords['contour'] = dsKeff['Z'].values 183 | 184 | diffu = diffu.rename({'contour':'Z'}) 185 | drift = drift.rename({'contour':'Z'}) 186 | ctrDA = ctrDA.rename({'contour':'Z'}) 187 | 188 | diffu.coords['time'] = np.linspace(0, 300*(length-1), length) 189 | drift.coords['time'] = np.linspace(0, 300*(length-1), length) 190 | ctrDA.coords['time'] = np.linspace(0, 300*(length-1), length) 191 | 192 | 193 | xr.merge([diffu, drift, ctrDA]).to_netcdf(path + 'LagDiff3.nc') 194 | 195 | #%% 196 | # preZ = np.linspace(0, -200, 101) 197 | 198 | # diffuInterp = cm.interp_to_coords(preZ, zEq[:length].squeeze(), diffu) 199 | # driftInterp = cm.interp_to_coords(preZ, zEq[:length].squeeze(), drift) 200 | # ctrDAInterp = cm.interp_to_coords(preZ, zEq[:length].squeeze(), ctrDA) 201 | 202 | #%% 203 | import matplotlib.pyplot as plt 204 | 205 | dsLag1 = xr.open_dataset(path + 'LagDiff3.nc') 206 | # dsLag1 = dsLag1.rename({'contour':'Z'}) 207 | dsLag2 = xr.open_dataset(path + 'LagDiff2.nc') 208 | 209 | #%% 210 | fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(12,8)) 211 | 212 | # .rolling(time=1, center=True, min_periods=1).mean() 213 | 214 | diff1 = dsLag1.diffu * 5e3 215 | diff1.plot(ax=ax[0], y='Z', cmap='jet', vmin=0, vmax=12) 216 | 217 | diff2 = dsLag2.diffu * 5e3 218 | diff2.plot(ax=ax[1], y='Z', cmap='jet', vmin=0, vmax=12) 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /Data/Fig6.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on 2020.06.23 4 | 5 | @author: MiniUFO 6 | """ 7 | #%% read_fields 8 | import xmitgcm 9 | 10 | path = 'I:/breakingIW/nonHydro/' 11 | 12 | dset = xmitgcm.open_mdsdataset(data_dir=path+'output/', 13 | grid_dir=path, 14 | prefix=['Stat'], delta_t=2) 15 | 16 | #%% 17 | import xarray as xr 18 | import numpy as np 19 | from GeoApps.ArrayUtils import interp1d 20 | 21 | tcount = len(dset.time) 22 | 23 | dsKeff = xr.open_dataset(path + 'KeffTrInterp.nc') 24 | 25 | dsKeff.coords['time'] = np.linspace(0, 300*(tcount-1), tcount).astype('int') 26 | dsKeff = dsKeff.rename({'new':'Z'}) 27 | 28 | 29 | def interp_coords(trajThe, TRAC01): 30 | interpDim = 'Z' 31 | coord = TRAC01[interpDim] 32 | 33 | trajThe = trajThe.rename({'Z':'tmp'}) 34 | 35 | increasing = False 36 | 37 | coord, TRAC01 = xr.broadcast(coord, TRAC01) 38 | 39 | varIntp = xr.apply_ufunc(interp1d, trajThe, TRAC01, coord, 40 | kwargs={'inc': increasing}, 41 | dask='allowed', 42 | input_core_dims =[[], [interpDim], [interpDim]], 43 | # output_core_dims=[[interpDim]], 44 | exclude_dims=set((interpDim,)), 45 | vectorize=True 46 | ).rename('zEq') 47 | 48 | return varIntp.rename({'tmp':'Z'}) 49 | 50 | # zpos = interp_coords(dset.TRAC01, dsKeff.TRAC01) 51 | 52 | re = [] 53 | 54 | for tim in dset.time: 55 | if (tim/300) % 50 == 0: 56 | print(tim.values) 57 | tr_xz = (dset.TRAC01.where(dset.TRAC01!=0)).squeeze().sel(time=tim) 58 | tr_XZ = dsKeff.TRAC01.squeeze().sel(time=tim) 59 | ke_XZ = dsKeff.nkeff.squeeze().sel(time=tim) 60 | ke_XZ[np.isnan(ke_XZ)] = 1 61 | 62 | zpos = interp_coords(tr_xz, tr_XZ) 63 | mask = np.isnan(zpos) 64 | zpos.values[mask.values] = 1 65 | ke_xz = ke_XZ.interp(coords={'Z':zpos}) 66 | ke_xz.values[mask.values] = np.nan 67 | re.append(ke_xz) 68 | 69 | nkeff = xr.concat(re, 'time').to_netcdf(path + 'nkeffxz.nc') 70 | 71 | kmean = nkeff.mean('time') 72 | kprof = kmean.mean('XC') 73 | 74 | #%% animate 75 | from utils.PlotUtils import animate 76 | 77 | ani=animate(nkeff, vmin=0, vmax=11) 78 | 79 | ani.save(path+'nkeffxz.gif', writer='imagemagick', fps=12) 80 | 81 | #%% time-mean 82 | import matplotlib.pyplot as plt 83 | import proplot as pplt 84 | 85 | pplt.rc.update({'figure.facecolor': 'white'}) 86 | pplt.rc['axesfacecolor'] = 'white' 87 | 88 | array = [ 89 | [1, 1, 2] 90 | ] 91 | 92 | fig, ax = pplt.subplots(array, figsize=(7,4), sharex=0) 93 | 94 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 95 | 96 | m1 = ax[0].contourf(kmean, cmap=plt.cm.jet, 97 | levels=pplt.arange(1,6,0.05), add_colorbar=False) 98 | ax[0].colorbar(m1, loc='bottom', width=0.1) 99 | ax[0].format(title='time mean $K_{WD}$', 100 | xlabel='x-distance (m)', 101 | ylabel='depth (m)') 102 | 103 | kprof.plot(ax=ax[1], y='Z') 104 | ax[1].format(title='x-mean of $K_{WD}$', 105 | xlabel='$K_{WD}$ ($m^2$ $s^{-1}$)', 106 | ylabel='depth (m)') 107 | 108 | -------------------------------------------------------------------------------- /Data/Fig7.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on 2020.06.23 4 | 5 | @author: MiniUFO 6 | """ 7 | #%% read_fields 8 | import xmitgcm 9 | 10 | path = 'I:/breakingIW/nonHydro/' 11 | 12 | dset = xmitgcm.open_mdsdataset(data_dir=path+'output/', 13 | grid_dir=path, 14 | prefix=['Stat'], delta_t=2) 15 | 16 | #%% 17 | import xarray as xr 18 | import numpy as np 19 | 20 | tcount = len(dset.time) 21 | 22 | dsKeff = xr.open_dataset(path + 'keff.nc') 23 | 24 | dsKeff.coords['time'] = np.linspace(0, 300*(tcount-1), tcount).astype('int') 25 | dsKeff = dsKeff.rename({'new':'Z'}) 26 | 27 | #%% 28 | import numpy as np 29 | from GeoApps.GridUtils import add_MITgcm_missing_metrics 30 | from GeoApps.ContourMethods import ContourAnalysis 31 | from xhistogram.xarray import histogram 32 | 33 | 34 | def get_group(groups, name): 35 | """ 36 | Get DataArray or Dataset corresponding to a particular group label. 37 | """ 38 | gr = groups.groups 39 | 40 | if name not in gr: 41 | return None 42 | 43 | indices = gr.get(name) 44 | return groups._obj.isel(**{groups._group_dim: indices}).values 45 | 46 | 47 | dt = 300 48 | tlen = 100 49 | 50 | histSum = [] 51 | histCnt = [] 52 | 53 | binX = np.linspace(0, 9000, 501) 54 | binZ = np.linspace(-200, 0, 41) 55 | 56 | for l in range(1, tcount, tlen): 57 | tstr = l 58 | tend = l + tlen 59 | 60 | if tend >= tcount: 61 | tend = tcount-2 62 | 63 | rng = dict(time=slice(tstr*dt, tend*dt)) 64 | 65 | print('%d %d' % (tstr, tend)) 66 | 67 | # cal_Yeq 68 | ds = dset.loc[rng] 69 | ds, grid = add_MITgcm_missing_metrics(ds) 70 | 71 | mask = ds['TRAC01'] != 0 72 | tracer = ds['TRAC01'].where(mask) 73 | 74 | cm = ContourAnalysis(ds, tracer, 75 | dims={'X':'XC','Z':'Z'}, 76 | dimEq={'Z':'Z'}, grid=grid, 77 | increase=True, lt=False) 78 | 79 | maskInvariant = tracer[0] 80 | maskInvariant += 1 - maskInvariant 81 | 82 | ctr = dsKeff.TRAC01 83 | area = dsKeff.intArea 84 | table = cm.cal_area_eqCoord_table(maskInvariant) 85 | Zeq = dsKeff.zEq 86 | 87 | # read_flt 88 | from utils.IOUtils import read_flt_bcolz 89 | 90 | fset = read_flt_bcolz(path + '.bcolz', 91 | cond="(time>="+str(tstr*dt)+") & (time<="+str(tend*dt)+")", 92 | # cond="(npart>10000000) & (npart<=10001000) & (time>0)", 93 | fields=['npart', 'time', 'x', 'z', 's'], 94 | out='xarray').dropna('npart') 95 | 96 | xpos = fset.x.loc[rng] 97 | zpos = fset.z.loc[rng] 98 | time = fset.time.loc[rng] 99 | 100 | var1 = tracer.squeeze().loc[rng].load() 101 | 102 | if len(time) > len(var1.time): 103 | print(str(len(time)) + ' != ' + str(len(var1.time))) 104 | time = time[:len(var1.time)] 105 | xpos = xpos[:, :len(var1.time)] 106 | zpos = zpos[:, :len(var1.time)] 107 | 108 | xpos, time = xr.broadcast(xpos, time) 109 | 110 | trajT = var1.interp(coords={'XC':xpos, 'Z':zpos, 'time':time}) \ 111 | .reset_coords(drop=True) \ 112 | .dropna('npart') 113 | trajY = cm.interp_to_coords(trajT, 114 | ctr.loc[rng], Zeq.loc[rng], 115 | interpDim='Z') \ 116 | .transpose('npart','time') \ 117 | .reset_coords(drop=True) 118 | 119 | diffY = trajY.diff('time') ** 2 / 300 120 | 121 | # remove nan according to trajY 122 | diffY, xpos = xr.align(diffY, xpos) 123 | diffY, zpos = xr.align(diffY, zpos) 124 | 125 | 126 | hsum = histogram(zpos, xpos, dim=['npart'], weights=np.abs(diffY), 127 | bins=[binZ, binX]) 128 | hcnt = histogram(zpos, xpos, dim=['npart'], 129 | bins=[binZ, binX]) 130 | 131 | histSum.append(hsum) 132 | histCnt.append(hcnt) 133 | 134 | 135 | # hstSum = xr.merge(histSum) 136 | # hstCnt = xr.merge(histCnt) 137 | 138 | 139 | #%% write files 140 | for data in histSum: 141 | for tim in data: 142 | tt = int(tim.time.values/300) 143 | print(tt) 144 | tim.expand_dims({'time':1}).to_netcdf("d:/tmp/testSum_{:0>4d}.nc".format(tt), 145 | mode='w', 146 | engine='netcdf4', 147 | format='NETCDF4') # 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_64BIT', 148 | 149 | for data in histCnt: 150 | for tim in data: 151 | tt = int(tim.time.values/300) 152 | print(tt) 153 | tim.expand_dims({'time':1}).to_netcdf("d:/tmp/testCnt_{:0>4d}.nc".format(tt), 154 | mode='w', 155 | engine='netcdf4', 156 | format='NETCDF4') # 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_64BIT', 157 | 158 | #%% combine 159 | dsSum = xr.open_mfdataset('d:/tmp/testSum_*.nc') 160 | dsCnt = xr.open_mfdataset('d:/tmp/testCnt_*.nc') 161 | 162 | xr.merge([dsSum.rename({'histogram_z_x':'sum'}), 163 | dsCnt.rename({'histogram_z_x':'count'})]).to_netcdf('d:/tmp/testDisp.nc') 164 | 165 | #%% 166 | bset = xr.open_dataset('d:/tmp/testDisp.nc') 167 | 168 | # smooth = bset['sum' ].rolling(time=3, center=True, min_periods=1).mean() 169 | # count = bset['count'].rolling(time=3, center=True, min_periods=1).mean() 170 | #%% 171 | delY = bset['sum']/bset['count'] 172 | 173 | dYsmth = delY.rolling(time=5, 174 | center=True, 175 | min_periods=1).mean().rolling(x_bin=3,center=True, 176 | min_periods=1).mean() 177 | 178 | #%% 179 | ani=animate(dYsmth, cmap='jet', vmax=2) 180 | ani2=animate(dset.TRAC01.where(dset.TRAC01!=0).squeeze(), cmap='jet',vmin=25.67) 181 | 182 | #%% 183 | 184 | 185 | -------------------------------------------------------------------------------- /Data/Figure1.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/Data/Figure1.ai -------------------------------------------------------------------------------- /Data/Figure2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2020.06.19 4 | 5 | @author: MiniUFO 6 | Copyright 2018. All rights reserved. Use is subject to license terms. 7 | ''' 8 | 9 | #%% load data 10 | import numpy as np 11 | import matplotlib.image as image 12 | import matplotlib.pyplot as plt 13 | import xmitgcm 14 | import xarray as xr 15 | from utils.PlotUtils import plot 16 | 17 | 18 | trName = 'THETA' 19 | 20 | path = 'I:/breakingIW/nonhydro/' 21 | 22 | ds = xmitgcm.open_mdsdataset(data_dir=path+'output/', 23 | grid_dir=path, 24 | delta_t=2, 25 | prefix=['Stat']) 26 | 27 | ds2 = xr.open_dataset(path + 'KeffThInterp.nc').rename({'new':'Z'}) 28 | # ds2.coords['time'] = np.linspace(0, 300*(tcount-1), tcount).astype('int') 29 | 30 | #%% Calculate N2 31 | 32 | T = ds.THETA.where(ds.THETA!=0) 33 | 34 | def cal_linear_insitu_density(THETA, SALT, 35 | tRef =20 , sRef=35, rhoRef=999.8, 36 | tAlpha=2E-4, sBeta=7.4E-4): 37 | # cal. in-situ density using linear EOS 38 | RHO = rhoRef * (sBeta * (SALT-sRef) - tAlpha * (THETA - tRef)) + rhoRef 39 | 40 | RHO.rename('RHO') 41 | 42 | return RHO 43 | 44 | density = cal_linear_insitu_density(ds2.THETA, 35, sRef=35, sBeta=0) 45 | 46 | N2 = 9.81 * np.log(density).diff('Z') 47 | N22 = 9.81 * (-2E-4*T/(1-2E-4*(T-20))).diff('Z') 48 | 49 | N2smth = N2.rolling(Z=11, center=True, min_periods=1).mean() * 1e5 50 | 51 | # N2smth = N2smth.rename({'new':'Z'}) 52 | 53 | 54 | #%% plotting 55 | import proplot as pplt 56 | 57 | array = [ 58 | [1, 1, 3], 59 | [2, 2, 4] 60 | ] 61 | 62 | pplt.rc.update({'figure.facecolor': 'white'}) 63 | 64 | 65 | fig, ax = pplt.subplots(array, figsize=(9,7), sharex=0, sharey=3) 66 | 67 | fontsize = 13 68 | 69 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 70 | 71 | lastIdx = -4 72 | 73 | m1 = ax[0].contourf(T[0].squeeze(), cmap=plt.cm.jet, levels=np.linspace(25.75, 26.25, 21)) 74 | ax[0].colorbar(m1, loc='bottom', width=0.1, ticks=0.05, extend='both') 75 | ax[0].set_xlabel('', fontsize=fontsize-2) 76 | ax[0].set_ylabel('depth (m)', fontsize=fontsize-2) 77 | ax[0].set_title('potential temperature (t=0 days)', fontsize=fontsize) 78 | ax[0].set_xlim([0, 9000]) 79 | ax[0].set_ylim([-200, 0]) 80 | 81 | ax[1].contourf(T[lastIdx].squeeze(), cmap=plt.cm.jet, levels=np.linspace(25.75, 26.25, 21)) 82 | ax[1].set_xlabel('x-distance (m)', fontsize=12) 83 | ax[1].set_ylabel('depth (m)', fontsize=fontsize-2) 84 | ax[1].set_title('potential temperature (t=5 days)', fontsize=fontsize) 85 | ax[1].set_xlim([0, 9000]) 86 | ax[1].set_ylim([-200, 0]) 87 | 88 | m1 = ax[2].plot(N2smth[ 0], N2smth.Z, lw=2, label=['day 0']) 89 | ax[2].set_ylabel('depth (m)', fontsize=fontsize-2) 90 | m2 = ax[2].plot(N2smth[-1], N2smth.Z, lw=2, label=['day 5']) 91 | ax[2].legend([m1, m2], loc='lr') 92 | ax[2].set_xlabel('$N^2$ ($10^{-5}$ $s^{-1})$', fontsize=fontsize-2) 93 | ax[2].set_ylabel('depth (m)', fontsize=fontsize-2) 94 | ax[2].set_title('$N^2$ after sorting', fontsize=fontsize) 95 | ax[2].set_xlim([0, 2]) 96 | 97 | m1 = ax[3].plot(ds2.THETA[ 0], ds2.Z, lw=2, label=['day 0']) 98 | ax[3].set_ylabel('depth (m)', fontsize=fontsize-2) 99 | m2 = ax[3].plot(ds2.THETA[lastIdx], ds2.Z, lw=2, label=['day 5']) 100 | ax[3].legend([m1, m2], loc='lr') 101 | ax[3].set_xlabel('temperature (degree)', fontsize=fontsize-2) 102 | ax[3].set_ylabel('depth (m)', fontsize=fontsize-2) 103 | ax[3].set_title('profile after sorting', fontsize=fontsize) 104 | ax[3].set_xlim([25.75, 26.25]) 105 | 106 | ax.format(ylabel='depth (m)') 107 | 108 | -------------------------------------------------------------------------------- /Data/Figure3.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2020.06.19 4 | 5 | @author: MiniUFO 6 | Copyright 2018. All rights reserved. Use is subject to license terms. 7 | ''' 8 | #%% Get IDs 9 | import xarray as xr 10 | import sys 11 | import xmitgcm 12 | sys.path.append('../../floater/') 13 | from GeoApps.GridUtils import add_MITgcm_missing_metrics 14 | from utils.IOUtils import read_flt_bcolz 15 | 16 | # folder = 'I:/cartRL_advSchemes/FLTReadTest/' 17 | folder = 'I:/breakingIW/nonHydro/' 18 | 19 | # npart, time, x, y, z, i, j, k, p, u, v, t, s 20 | fset = read_flt_bcolz(folder + '.bcolz', 21 | cond="((x>=996) & (x<=1004)) & (time==300) & (s!=0)", 22 | # cond="(npart>10000000) & (npart<=10001000) & (time>0)", 23 | fields=['npart', 'time', 'x', 's'], 24 | out='xarray').dropna('npart') 25 | 26 | #%% Read FLT by IDs 27 | ids = ['(npart=='+str(npart.values)+')' for npart in fset.npart] 28 | 29 | cond = ' | '.join(ids) 30 | 31 | fset = read_flt_bcolz(folder + '.bcolz', 32 | cond=cond, 33 | fields=['npart', 'time', 'x', 'z', 's'], 34 | out='xarray').dropna('npart') 35 | 36 | #%% Read Tracer 37 | import numpy as np 38 | 39 | dset = xmitgcm.open_mdsdataset(data_dir=folder+'output/', grid_dir=folder, 40 | prefix=['Stat'],delta_t=2) 41 | 42 | dset, grid = add_MITgcm_missing_metrics(dset, periodic='X') 43 | 44 | mask = dset['TRAC01'] != 0 45 | 46 | tcount = 1440 47 | ds2 = xr.open_dataset(folder + 'KeffThInterp.nc') 48 | ds2.coords['time'] = np.linspace(0, 300*(tcount-1), tcount).astype('int') 49 | 50 | #%% interpolate 51 | from GeoApps.ArrayUtils import interp1d 52 | 53 | fset2 = fset.isel(time=slice(0,-1)) 54 | 55 | xpos = fset2.x 56 | zpos = fset2.z 57 | time = fset2.time 58 | 59 | xpos, time = xr.broadcast(xpos, time) 60 | 61 | var1 = dset['THETA'].where(mask).squeeze().load() 62 | trajThe = var1.interp({'XC':xpos, 'Z':zpos, 'time':time}) 63 | trajThe_nonan = trajThe.dropna('npart') 64 | 65 | def interp_coords(trajThe, TRAC01): 66 | interpDim = 'new' 67 | coord = TRAC01[interpDim] 68 | 69 | increasing = False 70 | 71 | coord, TRAC01 = xr.broadcast(coord, TRAC01) 72 | 73 | varIntp = xr.apply_ufunc(interp1d, trajThe, TRAC01, coord, 74 | kwargs={'inc': increasing}, 75 | dask='allowed', 76 | input_core_dims =[[], [interpDim], [interpDim]], 77 | # output_core_dims=[[interpDim]], 78 | exclude_dims=set((interpDim,)), 79 | vectorize=True 80 | ).rename('zEq') 81 | 82 | return varIntp 83 | 84 | trajZeq = interp_coords(trajThe, ds2.THETA.isel(time=slice(1,tcount))) 85 | trajZeq_nonan = trajZeq.dropna('npart') 86 | 87 | id_nan = trajZeq.npart.where(xr.ufuncs.isnan(trajZeq.mean('time', skipna=False)), 88 | drop=True) 89 | 90 | trajZeq_nan = trajZeq.sel(npart=id_nan) 91 | 92 | # tmp = trajThe.where(xr.ufuncs.logical_and(fset.s[:,0]<20,fset.s[:,0]>18)) 93 | 94 | # trajZeq = trajZeq.rename('Zeq_all').reset_coords(drop=True) 95 | # trajZeq_nonan = trajZeq_nonan.rename('Zeq_nona').reset_coords(drop=True) 96 | # trajZeq_nan = trajZeq_nan.rename('Zeq_hasna').reset_coords(drop=True) 97 | 98 | # ds_traj = xr.merge([trajZeq, trajZeq_nonan, trajZeq_nan]) 99 | 100 | # ds_traj.to_netcdf(folder + 'traj.nc') 101 | 102 | 103 | #%% 104 | import matplotlib.pyplot as plt 105 | import proplot as pplt 106 | 107 | 108 | pplt.rc.update({'figure.facecolor': 'white'}) 109 | 110 | fig, ax = pplt.subplots(nrows=3, ncols=1, figsize=(5.5,8), sharey=0) 111 | 112 | skip = 18 113 | tlen = 1439 114 | 115 | zpos_nonan = zpos.sel(npart=trajZeq_nonan.npart) 116 | 117 | vtmp = zpos_nonan[::skip].copy() 118 | vtmp.coords['time'] = np.linspace(300/3600, 300*tlen/3600, tlen) 119 | vtmp.plot(ax=ax[0], hue='npart', lw=1.6, add_legend=False, yincrease=True) 120 | vtmp = trajThe_nonan[::skip].copy() 121 | vtmp.coords['time'] = np.linspace(300/3600, 300*tlen/3600, tlen) 122 | vtmp.plot(ax=ax[1], hue='npart', lw=1.6, add_legend=False, yincrease=True) 123 | vtmp = trajZeq_nonan[::skip].copy() 124 | vtmp.coords['time'] = np.linspace(300/3600, 300*tlen/3600, tlen) 125 | vtmp.plot(ax=ax[2], hue='npart', lw=1.6, add_legend=False, yincrease=True) 126 | 127 | ax.format( 128 | abc=True, abcloc='l', abcstyle='(a)', 129 | ) 130 | 131 | ax[0].set_title('original z-coordinates', fontsize=14) 132 | ax[0].set_ylabel('depth (m)', fontsize=12) 133 | ax[0].set_xlim([0, 120]) 134 | ax[0].set_xticks([0, 24, 48, 72, 96, 120]) 135 | ax[0].set_ylim([-200, 0]) 136 | 137 | ax[1].set_title('contour coordinates', fontsize=14) 138 | ax[1].set_ylabel('theta (°C)', fontsize=12) 139 | ax[1].set_xlim([0, 120]) 140 | ax[1].set_xticks([0, 24, 48, 72, 96, 120]) 141 | ax[1].set_ylim([25.75, 26.25]) 142 | 143 | ax[2].set_title('transformed Z-coordinates', fontsize=14) 144 | ax[2].set_ylabel('depth (m)', fontsize=12) 145 | ax[2].set_ylim([-200, 0]) 146 | ax[2].set_xlim([0, 120]) 147 | ax[2].set_xticks([0, 24, 48, 72, 96, 120]) 148 | ax[2].set_xlabel('time (hour)', fontsize=12) 149 | 150 | -------------------------------------------------------------------------------- /Data/Figure4.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2020.06.19 4 | 5 | @author: MiniUFO 6 | Copyright 2018. All rights reserved. Use is subject to license terms. 7 | ''' 8 | 9 | #%% load data 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | import xarray as xr 13 | 14 | 15 | trName = 'THETA' 16 | tcount = 1440 17 | 18 | path = 'I:/breakingIW/nonHydro/diags/' 19 | 20 | ds2 = xr.open_dataset(path + 'KeffThInterp_dec_gt2.nc') 21 | ds2.coords['time'] = np.linspace(0, 300*(tcount-1), tcount) / 3600 22 | 23 | ds3 = xr.open_dataset(path + 'LagDiffTh_dec_gt2.nc') 24 | ds3.coords['time'] = np.linspace(300, 300*(tcount-3), tcount-3) / 3600 25 | 26 | #%% calculate tracer change 27 | # tr1 = ds.TRAC01.where(ds.TRAC01!=0).mean('XC').squeeze().load() 28 | tr2 = ds2[trName] 29 | 30 | diff = ((tr2).differentiate('time') * 1e4).rolling(time=9, center=True, 31 | min_periods=9).mean() 32 | 33 | 34 | #%% calculate Knum 35 | import xmitgcm 36 | from GeoApps.GridUtils import add_MITgcm_missing_metrics 37 | from GeoApps.DiagnosticMethods import Dynamics 38 | 39 | 40 | path2 = 'I:/breakingIW/nonHydro/' 41 | ds = xmitgcm.open_mdsdataset(path2 + 'output/', grid_dir=path2, 42 | delta_t=2, prefix=['Stat']) 43 | dset, grid = add_MITgcm_missing_metrics(ds, periodic=['X']) 44 | 45 | tr = dset[trName].where(dset[trName]!=0).astype(np.float64) 46 | 47 | grdS = Dynamics(dset, grid).cal_squared_gradient(tr, dims=['X', 'Z']) 48 | 49 | area = grid.integrate(tr-tr+1, ['X', 'Z']).load() 50 | trave = grid.integrate(tr , ['X', 'Z']).load() 51 | tr2ave = grid.integrate(tr**2 , ['X', 'Z']).load() 52 | grdSave = grid.integrate(grdS , ['X', 'Z']).load() 53 | #%% 54 | # a = tr2ave.diff('time') / 300 55 | a = tr2ave.differentiate('time') 56 | b = grdSave[1:] 57 | Knum = (-a/b).squeeze().rolling(time=11, center=True, min_periods=1).mean() 58 | # Knum[:3] = 0 59 | Knum['time'] = np.linspace(300, 300*(tcount-1), tcount-1) / 3600 60 | 61 | #%% plotting 62 | import proplot as pplt 63 | 64 | array = [ 65 | [1], 66 | [2], 67 | [3] 68 | ] 69 | 70 | fig, ax = pplt.subplots(array, figsize=(6.5,8), sharey=3) 71 | 72 | 73 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 74 | 75 | lagDff = ds3.diffu.rolling(time=1, center=True, 76 | min_periods=1).mean().rolling(Z=1, center=True, 77 | min_periods=1).mean() 78 | 79 | m1 = ax[2].pcolormesh(diff.T, cmap=plt.cm.RdBu_r, levels=np.linspace(-9,9,19)) 80 | m2 = ax[0].pcolormesh(ds2.nkeff.T.rolling(new=3, center=True, min_periods=1).mean(), 81 | cmap=plt.cm.RdYlBu_r, levels=np.linspace(0, 12, 25)) 82 | m3 = ax[1].pcolormesh((lagDff.T/Knum).rolling(time=9, center=True, min_periods=1).mean(), 83 | cmap=plt.cm.RdYlBu_r, 84 | levels=np.linspace(0, 12, 25)) 85 | 86 | CS = ax[2].contour(ds2[trName].T, 87 | levels=[25.73, 25.74, 25.75, 25.76, 25.77, 25.78, 25.79, 25.80, 25.82, 88 | 25.85, 25.90, 25.95, 26, 26.05, 26.1, 26.15, 26.18, 26.2, 89 | 26.22], 90 | colors='k') 91 | ax[2].clabel(CS, CS.levels, inline=True, fontsize=12, fmt='%.2f') 92 | 93 | fontsize = 15 94 | 95 | ax[2].set_title('temporal changes of $\\theta$ in Z-coordinate', fontsize=fontsize) 96 | ax[2].set_xticks([0, 24, 48, 72, 96, 120]) 97 | a=ax[2].colorbar(m1, loc='r', width=0.15, ticks=[-9, -6, -3, 0, 3, 6, 9]) 98 | a.ax.tick_params(labelsize=11) 99 | 100 | ax[0].set_title('normalized $K_\\rho$ in Z-coordinate', fontsize=fontsize) 101 | a=ax[0].colorbar(m2, loc='r', width=0.15, row=2, ticks=[0, 3, 6, 9, 12]) 102 | a.ax.tick_params(labelsize=11) 103 | 104 | ax[1].set_title('normalized $K_L$ in Z-coordinate', fontsize=fontsize) 105 | a=ax[1].colorbar(m3, loc='r', width=0.15, ticks=[0, 3, 6, 9, 12]) 106 | a.ax.tick_params(labelsize=11) 107 | 108 | for a in ax: 109 | a.set_ylabel('depth (m)', fontsize=fontsize) 110 | a.set_xlabel('time (hour)', fontsize=fontsize) 111 | 112 | # ax[0].contour(ds2[trName].T, colors='k', levels=[25.774, 25.807, 25.822]) 113 | # ax[1].contour(ds2[trName].T, colors='k', levels=[25.774, 25.807, 25.822]) 114 | # ax[0].contour(ds2[trName].T, colors='k', levels=[25.81, 25.82, 25.825]) 115 | # ax[1].contour(ds2[trName].T, colors='k', levels=[25.81, 25.82, 25.825]) 116 | 117 | ax.axvline(13, color=(0.2,0.7,0.2), linestyle='--') 118 | ax.axvline(61, color=(0.2,0.7,0.2), linestyle='--') 119 | ax.axvline(105, color=(0.2,0.7,0.2), linestyle='--') 120 | # ax.axvline(112, color='k', linestyle='--') 121 | ax.set_xlim([0, 120]) 122 | 123 | -------------------------------------------------------------------------------- /Data/Figure5.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on 2020.06.23 4 | 5 | @author: MiniUFO 6 | """ 7 | #%% read_fields 8 | import xmitgcm 9 | import xarray as xr 10 | import numpy as np 11 | 12 | path = 'I:/breakingIW/nonHydro/' 13 | 14 | dset = xmitgcm.open_mdsdataset(data_dir=path+'output/', 15 | grid_dir=path, 16 | prefix=['Stat'], delta_t=2) 17 | 18 | bset = xr.open_dataset(path + '/diags/binning/binLagTh_dec_gt2.nc') 19 | 20 | #%% 21 | delY = bset['sumD']/bset['cntD'] 22 | 23 | dYsmth = delY.rolling(time=3, 24 | center=True, 25 | min_periods=1).mean().rolling(x_bin=1,center=True, 26 | min_periods=1).mean() 27 | tr = dset.THETA.where(dset.TRAC01!=0) 28 | 29 | grd = np.sqrt(tr.differentiate('XC')**2+tr.differentiate('Z')**2) 30 | 31 | 32 | #%% 33 | import proplot as pplt 34 | import matplotlib.pyplot as plt 35 | 36 | contours = np.array([25.81, 25.825, 25.82]) 37 | times = np.array([13, 61, 104]) * 3600 38 | 39 | fig, ax = pplt.subplots(nrows=3, ncols=2, figsize=(11,8), sharey=3, 40 | wspace=(0.1), hspace=(0.3,0.3)) 41 | 42 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 43 | 44 | for i, (ctr, tim) in enumerate(zip(contours, times)): 45 | m1 = ax[i*2].contourf(tr.sel(time=tim).squeeze(), cmap=plt.cm.jet, 46 | levels=np.linspace(25.74, 26.25, 20), extend='both') 47 | m2 = ax[i*2+1].contourf(np.log(dYsmth.sel(time=tim-300)), cmap=plt.cm.jet, 48 | levels=np.linspace(-9, -2, 29), extend='both') 49 | # m2 = ax[i*2+1].contourf(dYsmth.sel(time=tim-300), cmap=plt.cm.jet, 50 | # levels=np.linspace(0, 0.05, 33), extend='both') 51 | 52 | ax[i*2].contour(tr.sel(time=tim).squeeze(), levels=[ctr], colors='k') 53 | 54 | ax[i*2].format(title='$\\theta$ at {} hr'.format(tim/3600), 55 | ylabel='depth (m)', 56 | xlabel='x-distance (m)') 57 | ax[i*2].set_xlim([0, 8990]) 58 | ax[i*2].set_ylim([-200, 0]) 59 | 60 | ax[i*2+1].format(title='local disp. rate at {} hr'.format(tim/3600), 61 | ylabel='depth (m)', 62 | xlabel='x-distance (m)') 63 | ax[i*2+1].set_xlim([0, 8990]) 64 | ax[i*2+1].set_ylim([-200, 0]) 65 | 66 | ax[4].colorbar(m1, loc='b', width=0.15, ticks=0.1) 67 | ax[5].colorbar(m2, loc='b', width=0.15, ticks=1) 68 | 69 | for a in ax: 70 | a.set_ylabel('depth (m)', fontsize=13) 71 | a.set_xlabel('x-distance (m)', fontsize=13) 72 | 73 | #%% 74 | import proplot as pplt 75 | import matplotlib.pyplot as plt 76 | 77 | contours = np.array([25.775, 25.796, 25.82]) 78 | times = np.array([13, 54.5, 75.5]) * 3600 79 | 80 | fig, ax = pplt.subplots(nrows=3, ncols=3, figsize=(11,8), sharey=1, 81 | wspace=(0.1, 0.1), hspace=(0.3, 0.3)) 82 | 83 | ax.format(abc=True, abcloc='ul', abcstyle='(a)', 84 | collabels=['isopycnals ($\\theta$)', 85 | 'local diapycnal dispersion rate', 86 | 'tracer gradient']) 87 | 88 | for i, (ctr, tim) in enumerate(zip(contours, times)): 89 | m1 = ax[i*3].contourf(tr.sel(time=tim).squeeze(), cmap=plt.cm.jet, 90 | levels=np.linspace(25.74, 26.25, 20), extend='both') 91 | m2 = ax[i*3+1].contourf(np.log(dYsmth.sel(time=tim-300)), cmap=plt.cm.jet, 92 | levels=np.linspace(-9, -2, 33), extend='both') 93 | m3 = ax[i*3+2].contourf(grd.sel(time=tim).squeeze()*1e3, cmap=plt.cm.jet, 94 | levels=np.linspace(0, 40, 41), extend='both') 95 | 96 | ax[i*3].contour(tr.sel(time=tim).squeeze(), levels=[ctr], colors='k') 97 | 98 | ax[i*3].format(title='', 99 | ylabel='t = 13 hours', 100 | xlabel='x-distance (m)') 101 | ax[i*3].set_xlim([0, 9000]) 102 | ax[i*3].set_ylim([-200, 0]) 103 | 104 | ax[i*3+1].format(title='', 105 | ylabel='t = 54.5 hours', 106 | xlabel='x-distance (m)') 107 | ax[i*3+1].set_xlim([0, 9000]) 108 | ax[i*3+1].set_ylim([-200, 0]) 109 | 110 | ax[i*3+2].format(title='', 111 | ylabel='t = 75.5 hours', 112 | xlabel='x-distance (m)') 113 | ax[i*3+2].set_xlim([0, 9000]) 114 | ax[i*3+2].set_ylim([-200, 0]) 115 | 116 | ax[6].colorbar(m1, loc='b', width=0.1, ticks=0.1) 117 | ax[7].colorbar(m2, loc='b', width=0.1, ticks=1) 118 | ax[8].colorbar(m3, loc='b', width=0.1, ticks=5) 119 | 120 | 121 | #%% 122 | import proplot as pplt 123 | import matplotlib.pyplot as plt 124 | 125 | contours = np.array([25.775, 25.796, 25.82]) 126 | times = np.array([13, 54.5, 75.5]) * 3600 127 | 128 | fig, ax = pplt.subplots(nrows=2, ncols=3, figsize=(11,6), 129 | wspace=(0.1, 0.1), hspace=(0.3)) 130 | 131 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 132 | 133 | for i, (ctr, tim) in enumerate(zip(contours, times)): 134 | m1 = ax[i].contourf(tr.sel(time=tim).squeeze(), cmap=plt.cm.jet, 135 | levels=np.linspace(25.75, 26.25, 41), extend='both') 136 | m2 = ax[i+3].contourf(np.log(dYsmth.sel(time=tim-300)), cmap=plt.cm.jet, 137 | levels=np.linspace(-9, -2, 41), extend='both') 138 | 139 | ax[i].contour(tr.sel(time=tim).squeeze(), levels=[ctr], colors='k') 140 | 141 | ax[i].format(title='tracer ({} hr)'.format(tim/3600), 142 | ylabel='depth (m)', 143 | xlabel='x-distance (m)') 144 | ax[i].set_ylabel('depth (m)', fontsize=13) 145 | ax[i].set_xlim([0, 9000]) 146 | ax[i].set_ylim([-200, 0]) 147 | 148 | ax[i+3].format(title='local disp. rate ({} hr)'.format(tim/3600), 149 | ylabel='depth (m)', 150 | xlabel='x-distance (m)') 151 | ax[i+3].set_xlim([0, 9000]) 152 | ax[i+3].set_ylim([-200, 0]) 153 | 154 | ax[2].colorbar(m1, loc='r', width=0.1, ticks=0.05) 155 | ax[5].colorbar(m2, loc='r', width=0.1, ticks=1) 156 | -------------------------------------------------------------------------------- /Data/Figure6.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Created on 2020.07.08 4 | 5 | @author: MiniUFO 6 | """ 7 | #%% read_fields 8 | import xarray as xr 9 | import numpy as np 10 | 11 | path = 'I:/breakingIW/nonHydro/' 12 | 13 | bset1 = xr.open_dataset(path + 'diags/binning/binLagTh_dec_gt2.nc') 14 | bset2 = xr.open_dataset(path + 'diags/binning/binLagThDq_dec_gt2.nc') 15 | bset3 = xr.open_dataset(path + 'diags/nKeffXZ.nc', 16 | chunks={'time':1, 'Z':100, 'XC':1440}) 17 | bset4 = xr.open_dataset(path + 'diags/Knum.nc', decode_times=False) 18 | 19 | # dqPM = bset2.sumP.sum('time') / bset2.cntP.sum('time') 20 | # dqNM = bset2.sumN.sum('time') / bset2.cntN.sum('time') 21 | 22 | dYDM = bset1.sumD.sum('time') / bset1.cntD.sum('time') / bset4.Knum.mean('time') 23 | dqDM = bset2.sumD.sum('time') / bset2.cntD.sum('time') * 1e9 24 | 25 | dYDM2 = (bset1.sumD / bset4.Knum.rolling(time=11, center=True, 26 | min_periods=1).mean() / bset1.cntD).mean('time') 27 | dqDM2 = (bset2.sumD / bset2.cntD).mean('time') * 1e5 28 | 29 | keff = bset3.nkeff.mean('time').load() 30 | 31 | 32 | 33 | #%% 34 | import proplot as pplt 35 | import matplotlib.pyplot as plt 36 | 37 | 38 | fig, ax = pplt.subplots(nrows=1, ncols=3, figsize=(12,5), hspace=(0.1)) 39 | 40 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 41 | 42 | m1 = ax[0].contourf((keff-1), cmap=plt.cm.jet, 43 | values=np.linspace(0, 13, 27), extend='both') 44 | m2 = ax[1].contourf(dYDM.squeeze(), cmap=plt.cm.jet, 45 | values=np.linspace(0, 13, 27), extend='both') 46 | m3 = ax[2].contourf(dqDM.squeeze(), cmap=plt.cm.jet, 47 | values=np.linspace(0, 9, 19), extend='both') 48 | 49 | fontsize = 13 50 | 51 | ax[0].set_title('time-mean $K_{WD}$', fontsize=fontsize) 52 | ax[0].set_xlim([0, 8960]) 53 | ax[0].set_ylim([-200, 0]) 54 | ax[0].set_xlabel('x-distance (m)', fontsize=fontsize-2) 55 | ax[0].set_ylabel('depth (m)', fontsize=fontsize-2) 56 | ax[0].colorbar(m1, loc='b', width=0.15, ticks=1) 57 | 58 | ax[1].set_title('time-mean $(\\Delta Y)^2/\\Delta t/2$', fontsize=fontsize) 59 | ax[1].set_xlim([0, 8960]) 60 | ax[1].set_ylim([-200, 0]) 61 | ax[1].set_xlabel('x-distance (m)', fontsize=fontsize-2) 62 | ax[1].set_ylabel('depth (m)', fontsize=fontsize-2) 63 | ax[1].colorbar(m2, loc='b', width=0.15, ticks=1) 64 | 65 | ax[2].set_title('time-mean $(\\Delta \\rho)^2/\\Delta t/2$', fontsize=fontsize) 66 | ax[2].set_xlim([0, 8960]) 67 | ax[2].set_ylim([-200, 0]) 68 | ax[2].set_xlabel('x-distance (m)', fontsize=fontsize-2) 69 | ax[2].set_ylabel('depth (m)', fontsize=fontsize-2) 70 | ax[2].colorbar(m3, loc='b', width=0.15, ticks=1) 71 | 72 | 73 | #%% 74 | import proplot as pplt 75 | import matplotlib.pyplot as plt 76 | 77 | pplt.rc.update({'figure.facecolor': 'white'}) 78 | 79 | 80 | fig, ax = pplt.subplots(nrows=1, ncols=3, figsize=(9,4), hspace=(0.1)) 81 | 82 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 83 | 84 | m1 = ax[0].contourf(np.log(keff*2e-5*10), cmap=plt.cm.jet, 85 | values=np.linspace(-10, -5, 31), extend='both') 86 | m2 = ax[1].contourf(np.log(dYDM), cmap=plt.cm.jet, 87 | levels=np.linspace(-10, -5, 31), extend='both') 88 | m3 = ax[2].contourf(np.log(dqDM), cmap=plt.cm.jet, 89 | levels=np.linspace(-11, -6, 31), extend='both') 90 | 91 | fontsize = 13 92 | 93 | ax[0].set_title('time-mean $K_{WD}$', fontsize=fontsize) 94 | ax[0].set_xlim([0, 8990]) 95 | ax[0].set_ylim([-200, 0]) 96 | ax[0].set_xlabel('x-distance (m)', fontsize=fontsize-2) 97 | ax[0].set_ylabel('depth (m)', fontsize=fontsize-2) 98 | ax[0].colorbar(m1, loc='b', width=0.15, ticks=1) 99 | 100 | ax[1].set_title('time-mean $(\\Delta Y)^2/\\Delta t$', fontsize=fontsize) 101 | ax[1].set_xlim([0, 8990]) 102 | ax[1].set_ylim([-200, 0]) 103 | ax[1].set_xlabel('x-distance (m)', fontsize=fontsize-2) 104 | ax[1].set_ylabel('depth (m)', fontsize=fontsize-2) 105 | ax[1].colorbar(m2, loc='b', width=0.15, ticks=1) 106 | 107 | ax[2].set_title('time-mean $(\\Delta \\rho)^2/\\Delta t$', fontsize=fontsize) 108 | ax[2].set_xlim([0, 8990]) 109 | ax[2].set_ylim([-200, 0]) 110 | ax[2].set_xlabel('x-distance (m)', fontsize=fontsize-2) 111 | ax[2].set_ylabel('depth (m)', fontsize=fontsize-2) 112 | ax[2].colorbar(m3, loc='b', width=0.15, ticks=1) 113 | -------------------------------------------------------------------------------- /Data/GeneralVertCoord.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/Data/GeneralVertCoord.ai -------------------------------------------------------------------------------- /Data/meanDrift.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2020.06.19 4 | 5 | @author: MiniUFO 6 | Copyright 2018. All rights reserved. Use is subject to license terms. 7 | ''' 8 | 9 | #%% load data 10 | import numpy as np 11 | import matplotlib.pyplot as plt 12 | import xarray as xr 13 | 14 | 15 | trName = 'THETA' 16 | tcount = 1440 17 | 18 | path = 'I:/breakingIW/nonhydro/' 19 | 20 | ds2 = xr.open_dataset(path + 'KeffThInterp.nc') 21 | ds2.coords['time'] = np.linspace(0, 300*(tcount-1), tcount) / 3600 22 | 23 | ds3 = xr.open_dataset(path + 'LagDiffTh.nc') 24 | ds3.coords['time'] = np.linspace(300, 300*(tcount-3), tcount-3) / 3600 25 | 26 | #%% calculation 27 | keffGrd = ds2.nkeff.diff('new') / ds2['new'].diff('new') * 300 * 2e-5 28 | drift = ds3.drift.rolling(time=3, center=True, 29 | min_periods=1).mean().rolling(Z=3, center=True, 30 | min_periods=1).mean() 31 | 32 | #%% plotting 33 | import proplot as pplt 34 | 35 | pplt.rc.update({'figure.facecolor': 'white'}) 36 | 37 | array = [ 38 | [1], 39 | [2] 40 | ] 41 | 42 | fig, ax = pplt.subplots(array, figsize=(6.5,8), sharey=3) 43 | 44 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 45 | 46 | m1 = ax[0].contourf(keffGrd.T*12, cmap=plt.cm.RdBu_r, vmax=0.1, vmin=-0.08) 47 | m2 = ax[1].contourf(drift.T, cmap=plt.cm.RdBu_r, vmax=0.1, vmin=-0.08) 48 | 49 | fontsize = 15 50 | 51 | ax[0].set_title('gradient of KWD', fontsize=fontsize) 52 | a=ax[0].colorbar(m1, loc='r', width=0.15, row=2, extend='both') 53 | a.ax.tick_params(labelsize=11) 54 | 55 | ax[1].set_title('mean drift', fontsize=fontsize) 56 | a=ax[1].colorbar(m2, loc='r', width=0.15) 57 | a.ax.tick_params(labelsize=11) 58 | 59 | for a in ax: 60 | a.set_ylabel('depth (m)', fontsize=fontsize) 61 | a.set_xlabel('time (hour)', fontsize=fontsize) 62 | 63 | ax.axvline(13, color=(0.5,0.5,0.5), linestyle='--') 64 | ax.axvline(68.5, color=(0.5,0.5,0.5), linestyle='--') 65 | ax.axvline(75.5, color=(0.5,0.5,0.5), linestyle='--') 66 | # ax.axvline(112, color='k', linestyle='--') 67 | ax.set_xlim([0, 120]) 68 | ax.set_ylim([-200, 0]) 69 | 70 | -------------------------------------------------------------------------------- /Data/panel2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/Data/panel2.gif -------------------------------------------------------------------------------- /Data/trEvolution.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2020.06.19 4 | 5 | @author: MiniUFO 6 | Copyright 2018. All rights reserved. Use is subject to license terms. 7 | ''' 8 | 9 | #%% load data 10 | import numpy as np 11 | import matplotlib.image as image 12 | import matplotlib.pyplot as plt 13 | import xmitgcm 14 | import xarray as xr 15 | from utils.PlotUtils import plot 16 | 17 | 18 | trName = 'TRAC01' 19 | tcount = 1440 20 | 21 | path = 'I:/breakingIW/nonhydro/' 22 | 23 | ds = xmitgcm.open_mdsdataset(data_dir=path+'output/', 24 | grid_dir=path, 25 | delta_t=2, 26 | prefix=['Stat']) 27 | ds.coords['time'] = ds.coords['time'] / 3600 28 | 29 | ds2 = xr.open_dataset(path + 'keff.nc') 30 | ds2.coords['time'] = ds2.coords['time'] / 3600 31 | 32 | #%% calculation 33 | 34 | tr1 = ds.TRAC01.where(ds.TRAC01!=0).mean('XC').squeeze().load() 35 | tr2 = ds2.TRAC01 36 | 37 | 38 | #%% plotting 39 | fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(6,8)) 40 | 41 | plot(tr1, ax=ax[0], ptype='contour', y='Z', 42 | clevs=np.linspace(25.7, 26.2, 21), ylint=25, xlint=12) 43 | plot(tr2, ax=ax[1], ptype='contour', y='new', 44 | clevs=np.linspace(25.7, 26.2, 21), ylint=25, xlint=12) 45 | 46 | 47 | ax[0].set_title('theta evolution in x-z coordinate', x=0.5, y=1, fontsize=15) 48 | ax[0].set_xlabel('', fontsize=13) 49 | ax[0].set_ylim([-200, 0]) 50 | ax[0].set_ylabel('depth (m)', fontsize=13) 51 | ax[0].tick_params(axis='both', labelsize=12, rotation=0) 52 | ax[1].set_title('theta evolution in X-Z coordinate', x=0.5, y=1, fontsize=15) 53 | ax[1].set_xlabel('horizontal distance (m)', fontsize=13) 54 | ax[1].set_ylabel('depth (m)', fontsize=13) 55 | ax[1].tick_params(axis='both', labelsize=12, rotation=0) 56 | 57 | plt.tight_layout() 58 | 59 | #%% plotting 60 | import proplot as pplt 61 | 62 | pplt.rc.update({'figure.facecolor': 'white', 'fontsize': 17}) 63 | 64 | array = [ 65 | [1], 66 | [2] 67 | ] 68 | 69 | fig, ax = pplt.subplots(array, figsize=(7,6)) 70 | 71 | m1 = tr1.plot(ax=ax[0], add_colorbar=False, cmap=plt.cm.jet, y='Z', 72 | vmin=25.75, vmax=26.25) 73 | tr2.plot(ax=ax[1], add_colorbar=False, cmap=plt.cm.jet, y='new', 74 | vmin=25.75, vmax=26.25) 75 | 76 | 77 | ax.format(abc=True, abcloc='l', abcstyle='(a)') 78 | 79 | 80 | ax[0].format(title='theta evolution in x-z coordinate', 81 | ylabel='depth (m)', 82 | xlabel='time (hour)') 83 | 84 | ax[1].format(title='theta evolution in X-Z coordinate', 85 | ylabel='depth (m)', 86 | xlabel='time (hour)') 87 | ax[1].colorbar(m1, loc='bottom', width=0.15) 88 | 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InternalWaveBreaking 2 | 3 | ![Animation](./Data/panel2.gif) 4 | 5 | 6 | ## 1. Introduction 7 | This is a idealized simulation of internal wave breaking due to tide-topography interaction based on [MITgcm](http://mitgcm.org/). Left shows the isopycnals, middle is the local available potential energy [APE, ([Roullet and Klein 2009](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/available-potential-energy-diagnosis-in-a-direct-numerical-simulation-of-rotating-stratified-turbulence/906E71577A230B90B48D8CEB442EE873); [Winters and Barkan 2013](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/available-potential-energy-density-for-boussinesq-fluid-flow/563B240B07CEBFDCD68F77A78FBFED16))] and right is the local diapycnal diffusivity. 8 | 9 | --- 10 | -------------------------------------------------------------------------------- /mitgcm/BATH/bathy.ctl: -------------------------------------------------------------------------------- 1 | dset ^bathy.dat 2 | options big_endian 3 | undef -9999 4 | title bathy 5 | xdef 2000 linear 0 0.1 6 | ydef 1 linear 0 0.1 7 | zdef 1 linear 0 1 8 | tdef 1 linear 01Jan2000 1dy 9 | vars 1 10 | bath 0 99 bath 11 | endvars 12 | -------------------------------------------------------------------------------- /mitgcm/BATH/bathy.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/BATH/bathy.dat -------------------------------------------------------------------------------- /mitgcm/Clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm *.data 4 | rm *.meta 5 | rm STD* 6 | rm nonhydro.* 7 | 8 | -------------------------------------------------------------------------------- /mitgcm/DYE/trInit.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/DYE/trInit.dat -------------------------------------------------------------------------------- /mitgcm/EXF/wndStrs.ctl: -------------------------------------------------------------------------------- 1 | dset ^wndStrs.dat 2 | options big_endian 3 | undef -9999 4 | title wind stress 5 | xdef 2000 linear 0 0.1 6 | ydef 1 linear 0 0.1 7 | zdef 1 linear 0 1 8 | tdef 1 linear 01Jan2000 1dy 9 | vars 1 10 | taux 0 99 taux 11 | endvars 12 | -------------------------------------------------------------------------------- /mitgcm/EXF/wndStrs.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/EXF/wndStrs.dat -------------------------------------------------------------------------------- /mitgcm/FLT/flt_init.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/FLT/flt_init.bin -------------------------------------------------------------------------------- /mitgcm/FLT/initBreakIW.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/FLT/initBreakIW.dat -------------------------------------------------------------------------------- /mitgcm/FLT/initBreakIWnonhydro.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/FLT/initBreakIWnonhydro.dat -------------------------------------------------------------------------------- /mitgcm/IC/TInit.ctl: -------------------------------------------------------------------------------- 1 | dset ^TInit.dat 2 | options big_endian 3 | undef -9999 4 | title bathy 5 | xdef 2000 linear 0 0.1 6 | ydef 1 linear 0 0.1 7 | zdef 100 linear 10 10 8 | tdef 1 linear 01Jan2000 1dy 9 | vars 1 10 | t 100 99 t 11 | endvars 12 | -------------------------------------------------------------------------------- /mitgcm/IC/TInit.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/IC/TInit.dat -------------------------------------------------------------------------------- /mitgcm/STDERR.0000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/STDERR.0000 -------------------------------------------------------------------------------- /mitgcm/available_diagnostics.log: -------------------------------------------------------------------------------- 1 | Total Nb of available Diagnostics: ndiagt= 226 2 | ------------------------------------------------------------------------------------ 3 | Num |<-Name->|Levs| mate |<- code ->|<-- Units -->|<- Tile (max=80c) 4 | ------------------------------------------------------------------------------------ 5 | 1 |SDIAG1 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #1 6 | 2 |SDIAG2 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #2 7 | 3 |SDIAG3 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #3 8 | 4 |SDIAG4 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #4 9 | 5 |SDIAG5 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #5 10 | 6 |SDIAG6 | 1 | |SM L1|user-defined |User-Defined Surface Diagnostic #6 11 | 7 |SDIAG7 | 1 | |SU L1|user-defined |User-Defined U.pt Surface Diagnostic #7 12 | 8 |SDIAG8 | 1 | |SV L1|user-defined |User-Defined V.pt Surface Diagnostic #8 13 | 9 |SDIAG9 | 1 | 10 |UU L1|user-defined |User-Defined U.vector Surface Diag. #9 14 | 10 |SDIAG10 | 1 | 9 |VV L1|user-defined |User-Defined V.vector Surface Diag. #10 15 | 11 |UDIAG1 |100 | |SM MR|user-defined |User-Defined Model-Level Diagnostic #1 16 | 12 |UDIAG2 |100 | |SM MR|user-defined |User-Defined Model-Level Diagnostic #2 17 | 13 |UDIAG3 |100 | |SMR MR|user-defined |User-Defined Model-Level Diagnostic #3 18 | 14 |UDIAG4 |100 | |SMR MR|user-defined |User-Defined Model-Level Diagnostic #4 19 | 15 |UDIAG5 |100 | |SU MR|user-defined |User-Defined U.pt Model-Level Diag. #5 20 | 16 |UDIAG6 |100 | |SV MR|user-defined |User-Defined V.pt Model-Level Diag. #6 21 | 17 |UDIAG7 |100 | 18 |UUR MR|user-defined |User-Defined U.vector Model-Lev Diag.#7 22 | 18 |UDIAG8 |100 | 17 |VVR MR|user-defined |User-Defined V.vector Model-Lev Diag.#8 23 | 19 |UDIAG9 |100 | |SM ML|user-defined |User-Defined Phys-Level Diagnostic #9 24 | 20 |UDIAG10 |100 | |SM ML|user-defined |User-Defined Phys-Level Diagnostic #10 25 | 21 |SDIAGC | 1 | 22 |SM C L1|user-defined |User-Defined Counted Surface Diagnostic 26 | 22 |SDIAGCC | 1 | |SM L1|count |User-Defined Surface Diagnostic Counter 27 | 23 |ETAN | 1 | |SM M1|m |Surface Height Anomaly 28 | 24 |ETANSQ | 1 | |SM P M1|m^2 |Square of Surface Height Anomaly 29 | 25 |DETADT2 | 1 | |SM M1|m^2/s^2 |Square of Surface Height Anomaly Tendency 30 | 26 |THETA |100 | |SMR MR|degC |Potential Temperature 31 | 27 |SALT |100 | |SMR MR|psu |Salinity 32 | 28 |RELHUM |100 | |SMR MR|percent |Relative Humidity 33 | 29 |SALTanom|100 | |SMR MR|psu |Salt anomaly (=SALT-35; g/kg) 34 | 30 |UVEL |100 | 31 |UUR MR|m/s |Zonal Component of Velocity (m/s) 35 | 31 |VVEL |100 | 30 |VVR MR|m/s |Meridional Component of Velocity (m/s) 36 | 32 |WVEL |100 | |WM LR|m/s |Vertical Component of Velocity (r_units/s) 37 | 33 |THETASQ |100 | |SMRP MR|degC^2 |Square of Potential Temperature 38 | 34 |SALTSQ |100 | |SMRP MR|(psu)^2 |Square of Salinity 39 | 35 |SALTSQan|100 | |SMRP MR|(psu)^2 |Square of Salt anomaly (=(SALT-35)^2 (g^2/kg^2) 40 | 36 |UVELSQ |100 | 37 |UURP MR|m^2/s^2 |Square of Zonal Comp of Velocity (m^2/s^2) 41 | 37 |VVELSQ |100 | 36 |VVRP MR|m^2/s^2 |Square of Meridional Comp of Velocity (m^2/s^2) 42 | 38 |WVELSQ |100 | |WM P LR|m^2/s^2 |Square of Vertical Comp of Velocity 43 | 39 |UE_VEL_C|100 | 40 |UMR MR|m/s |Eastward Velocity (m/s) (cell center) 44 | 40 |VN_VEL_C|100 | 39 |VMR MR|m/s |Northward Velocity (m/s) (cell center) 45 | 41 |UV_VEL_C|100 | 41 |UMR MR|m^2/s^2 |Product of horizontal Comp of velocity (cell center) 46 | 42 |UV_VEL_Z|100 | 42 |UZR MR|m^2/s^2 |Meridional Transport of Zonal Momentum (m^2/s^2) 47 | 43 |WU_VEL |100 | |WU LR|m.m/s^2 |Vertical Transport of Zonal Momentum 48 | 44 |WV_VEL |100 | |WV LR|m.m/s^2 |Vertical Transport of Meridional Momentum 49 | 45 |UVELMASS|100 | 46 |UUr MR|m/s |Zonal Mass-Weighted Comp of Velocity (m/s) 50 | 46 |VVELMASS|100 | 45 |VVr MR|m/s |Meridional Mass-Weighted Comp of Velocity (m/s) 51 | 47 |WVELMASS|100 | |WM LR|m/s |Vertical Mass-Weighted Comp of Velocity 52 | 48 |PhiVEL |100 | 45 |SMR P MR|m^2/s |Horizontal Velocity Potential (m^2/s) 53 | 49 |PsiVEL |100 | 48 |SZ P MR|m.m^2/s |Horizontal Velocity Stream-Function 54 | 50 |UTHMASS |100 | 51 |UUr MR|degC.m/s |Zonal Mass-Weight Transp of Pot Temp 55 | 51 |VTHMASS |100 | 50 |VVr MR|degC.m/s |Meridional Mass-Weight Transp of Pot Temp 56 | 52 |WTHMASS |100 | |WM LR|degC.m/s |Vertical Mass-Weight Transp of Pot Temp (K.m/s) 57 | 53 |USLTMASS|100 | 54 |UUr MR|psu.m/s |Zonal Mass-Weight Transp of Salinity 58 | 54 |VSLTMASS|100 | 53 |VVr MR|psu.m/s |Meridional Mass-Weight Transp of Salinity 59 | 55 |WSLTMASS|100 | |WM LR|psu.m/s |Vertical Mass-Weight Transp of Salinity 60 | 56 |UVELTH |100 | 57 |UUR MR|degC.m/s |Zonal Transport of Pot Temp 61 | 57 |VVELTH |100 | 56 |VVR MR|degC.m/s |Meridional Transport of Pot Temp 62 | 58 |WVELTH |100 | |WM LR|degC.m/s |Vertical Transport of Pot Temp 63 | 59 |UVELSLT |100 | 60 |UUR MR|psu.m/s |Zonal Transport of Salinity 64 | 60 |VVELSLT |100 | 59 |VVR MR|psu.m/s |Meridional Transport of Salinity 65 | 61 |WVELSLT |100 | |WM LR|psu.m/s |Vertical Transport of Salinity 66 | 62 |UVELPHI |100 | 63 |UUr MR|m^3/s^3 |Zonal Mass-Weight Transp of Pressure Pot.(p/rho) Anomaly 67 | 63 |VVELPHI |100 | 62 |VVr MR|m^3/s^3 |Merid. Mass-Weight Transp of Pressure Pot.(p/rho) Anomaly 68 | 64 |RHOAnoma|100 | |SMR MR|kg/m^3 |Density Anomaly (=Rho-rhoConst) 69 | 65 |RHOANOSQ|100 | |SMRP MR|kg^2/m^6 |Square of Density Anomaly (=(Rho-rhoConst)^2) 70 | 66 |URHOMASS|100 | 67 |UUr MR|kg/m^2/s |Zonal Transport of Density 71 | 67 |VRHOMASS|100 | 66 |VVr MR|kg/m^2/s |Meridional Transport of Density 72 | 68 |WRHOMASS|100 | |WM LR|kg/m^2/s |Vertical Transport of Density 73 | 69 |WdRHO_P |100 | |WM LR|kg/m^2/s |Vertical velocity times delta^k(Rho)_at-const-P 74 | 70 |WdRHOdP |100 | |WM LR|kg/m^2/s |Vertical velocity times delta^k(Rho)_at-const-T,S 75 | 71 |PHIHYD |100 | |SMR MR|m^2/s^2 |Hydrostatic Pressure Pot.(p/rho) Anomaly 76 | 72 |PHIHYDSQ|100 | |SMRP MR|m^4/s^4 |Square of Hyd. Pressure Pot.(p/rho) Anomaly 77 | 73 |PHIBOT | 1 | |SM M1|m^2/s^2 |Bottom Pressure Pot.(p/rho) Anomaly 78 | 74 |PHIBOTSQ| 1 | |SM P M1|m^4/s^4 |Square of Bottom Pressure Pot.(p/rho) Anomaly 79 | 75 |PHI_SURF| 1 | |SM M1|m^2/s^2 |Surface Dynamical Pressure Pot.(p/rho) 80 | 76 |PHIHYDcR|100 | |SMR MR|m^2/s^2 |Hydrostatic Pressure Pot.(p/rho) Anomaly @ const r 81 | 77 |PHI_NH |100 | |SMR MR|m^2/s^2 |Non-Hydrostatic Pressure Pot.(p/rho) 82 | 78 |MXLDEPTH| 1 | |SM M1|m |Mixed-Layer Depth (>0) 83 | 79 |DRHODR |100 | |SM LR|kg/m^4 |Stratification: d.Sigma/dr (kg/m3/r_unit) 84 | 80 |CONVADJ |100 | |SMR LR|fraction |Convective Adjustment Index [0-1] 85 | 81 |oceTAUX | 1 | 82 |UU U1|N/m^2 |zonal surface wind stress, >0 increases uVel 86 | 82 |oceTAUY | 1 | 81 |VV U1|N/m^2 |meridional surf. wind stress, >0 increases vVel 87 | 83 |atmPload| 1 | |SM U1|Pa |Atmospheric pressure loading 88 | 84 |sIceLoad| 1 | |SM U1|kg/m^2 |sea-ice loading (in Mass of ice+snow / area unit) 89 | 85 |oceFWflx| 1 | |SM U1|kg/m^2/s |net surface Fresh-Water flux into the ocean (+=down), >0 decreases salinity 90 | 86 |oceSflux| 1 | |SM U1|g/m^2/s |net surface Salt flux into the ocean (+=down), >0 increases salinity 91 | 87 |oceQnet | 1 | |SM U1|W/m^2 |net surface heat flux into the ocean (+=down), >0 increases theta 92 | 88 |oceQsw | 1 | |SM U1|W/m^2 |net Short-Wave radiation (+=down), >0 increases theta 93 | 89 |oceFreez| 1 | |SM U1|W/m^2 |heating from freezing of sea-water (allowFreezing=T) 94 | 90 |TRELAX | 1 | |SM U1|W/m^2 |surface temperature relaxation, >0 increases theta 95 | 91 |SRELAX | 1 | |SM U1|g/m^2/s |surface salinity relaxation, >0 increases salt 96 | 92 |surForcT| 1 | |SM U1|W/m^2 |model surface forcing for Temperature, >0 increases theta 97 | 93 |surForcS| 1 | |SM U1|g/m^2/s |model surface forcing for Salinity, >0 increases salinity 98 | 94 |TFLUX | 1 | |SM U1|W/m^2 |total heat flux (match heat-content variations), >0 increases theta 99 | 95 |SFLUX | 1 | |SM U1|g/m^2/s |total salt flux (match salt-content variations), >0 increases salt 100 | 96 |RCENTER |100 | |SM MR|m |Cell-Center Height 101 | 97 |RSURF | 1 | |SM M1|m |Surface Height 102 | 98 |TOTUTEND|100 | 99 |UUR MR|m/s/day |Tendency of Zonal Component of Velocity 103 | 99 |TOTVTEND|100 | 98 |VVR MR|m/s/day |Tendency of Meridional Component of Velocity 104 | ------------------------------------------------------------------------------------ 105 | Num |<-Name->|Levs| mate |<- code ->|<-- Units -->|<- Tile (max=80c) 106 | ------------------------------------------------------------------------------------ 107 | 100 |TOTTTEND|100 | |SMR MR|degC/day |Tendency of Potential Temperature 108 | 101 |TOTSTEND|100 | |SMR MR|psu/day |Tendency of Salinity 109 | 102 |MoistCor|100 | |SM MR|W/m^2 |Heating correction due to moist thermodynamics 110 | 103 |gT_Forc |100 | |SMR MR|degC/s |Potential Temp. forcing tendency 111 | 104 |gS_Forc |100 | |SMR MR|psu/s |Salinity forcing tendency 112 | 105 |AB_gT |100 | |SMR MR|degC/s |Potential Temp. tendency from Adams-Bashforth 113 | 106 |AB_gS |100 | |SMR MR|psu/s |Salinity tendency from Adams-Bashforth 114 | 107 |gTinAB |100 | |SMR MR|degC/s |Potential Temp. tendency going in Adams-Bashforth 115 | 108 |gSinAB |100 | |SMR MR|psu/s |Salinity tendency going in Adams-Bashforth 116 | 109 |AB_gU |100 | 110 |UUR MR|m/s^2 |U momentum tendency from Adams-Bashforth 117 | 110 |AB_gV |100 | 109 |VVR MR|m/s^2 |V momentum tendency from Adams-Bashforth 118 | 111 |AB_gW |100 | |WM LR|m/s^2 |W momentum tendency from Adams-Bashforth 119 | 112 |ADVr_TH |100 | |WM LR|degC.m^3/s |Vertical Advective Flux of Pot.Temperature 120 | 113 |ADVx_TH |100 | 114 |UU MR|degC.m^3/s |Zonal Advective Flux of Pot.Temperature 121 | 114 |ADVy_TH |100 | 113 |VV MR|degC.m^3/s |Meridional Advective Flux of Pot.Temperature 122 | 115 |DFrE_TH |100 | |WM LR|degC.m^3/s |Vertical Diffusive Flux of Pot.Temperature (Explicit part) 123 | 116 |DFxE_TH |100 | 117 |UU MR|degC.m^3/s |Zonal Diffusive Flux of Pot.Temperature 124 | 117 |DFyE_TH |100 | 116 |VV MR|degC.m^3/s |Meridional Diffusive Flux of Pot.Temperature 125 | 118 |DFrI_TH |100 | |WM LR|degC.m^3/s |Vertical Diffusive Flux of Pot.Temperature (Implicit part) 126 | 119 |SM_x_TH |100 | 120 |UM MR|degC |Pot.Temp. 1rst Order Moment Sx 127 | 120 |SM_y_TH |100 | 119 |VM MR|degC |Pot.Temp. 1rst Order Moment Sy 128 | 121 |SM_z_TH |100 | |SM MR|degC |Pot.Temp. 1rst Order Moment Sz 129 | 122 |SMxx_TH |100 | 123 |UM MR|degC |Pot.Temp. 2nd Order Moment Sxx 130 | 123 |SMyy_TH |100 | 122 |VM MR|degC |Pot.Temp. 2nd Order Moment Syy 131 | 124 |SMzz_TH |100 | |SM MR|degC |Pot.Temp. 2nd Order Moment Szz 132 | 125 |SMxy_TH |100 | |SM MR|degC |Pot.Temp. 2nd Order Moment Sxy 133 | 126 |SMxz_TH |100 | 127 |UM MR|degC |Pot.Temp. 2nd Order Moment Sxz 134 | 127 |SMyz_TH |100 | 126 |VM MR|degC |Pot.Temp. 2nd Order Moment Syz 135 | 128 |SM_v_TH |100 | |SM P MR|(degC)^2 |Pot.Temp. sub-grid variance 136 | 129 |ADVr_SLT|100 | |WM LR|psu.m^3/s |Vertical Advective Flux of Salinity 137 | 130 |ADVx_SLT|100 | 131 |UU MR|psu.m^3/s |Zonal Advective Flux of Salinity 138 | 131 |ADVy_SLT|100 | 130 |VV MR|psu.m^3/s |Meridional Advective Flux of Salinity 139 | 132 |DFrE_SLT|100 | |WM LR|psu.m^3/s |Vertical Diffusive Flux of Salinity (Explicit part) 140 | 133 |DFxE_SLT|100 | 134 |UU MR|psu.m^3/s |Zonal Diffusive Flux of Salinity 141 | 134 |DFyE_SLT|100 | 133 |VV MR|psu.m^3/s |Meridional Diffusive Flux of Salinity 142 | 135 |DFrI_SLT|100 | |WM LR|psu.m^3/s |Vertical Diffusive Flux of Salinity (Implicit part) 143 | 136 |SALTFILL|100 | |SM MR|psu.m^3/s |Filling of Negative Values of Salinity 144 | 137 |SM_x_SLT|100 | 138 |UM MR|psu |Salinity 1rst Order Moment Sx 145 | 138 |SM_y_SLT|100 | 137 |VM MR|psu |Salinity 1rst Order Moment Sy 146 | 139 |SM_z_SLT|100 | |SM MR|psu |Salinity 1rst Order Moment Sz 147 | 140 |SMxx_SLT|100 | 141 |UM MR|psu |Salinity 2nd Order Moment Sxx 148 | 141 |SMyy_SLT|100 | 140 |VM MR|psu |Salinity 2nd Order Moment Syy 149 | 142 |SMzz_SLT|100 | |SM MR|psu |Salinity 2nd Order Moment Szz 150 | 143 |SMxy_SLT|100 | |SM MR|psu |Salinity 2nd Order Moment Sxy 151 | 144 |SMxz_SLT|100 | 145 |UM MR|psu |Salinity 2nd Order Moment Sxz 152 | 145 |SMyz_SLT|100 | 144 |VM MR|psu |Salinity 2nd Order Moment Syz 153 | 146 |SM_v_SLT|100 | |SM P MR|(psu)^2 |Salinity sub-grid variance 154 | 147 |VISCAHZ |100 | |SZ MR|m^2/s |Harmonic Visc Coefficient (m2/s) (Zeta Pt) 155 | 148 |VISCA4Z |100 | |SZ MR|m^4/s |Biharmonic Visc Coefficient (m4/s) (Zeta Pt) 156 | 149 |VISCAHD |100 | |SM MR|m^2/s |Harmonic Viscosity Coefficient (m2/s) (Div Pt) 157 | 150 |VISCA4D |100 | |SM MR|m^4/s |Biharmonic Viscosity Coefficient (m4/s) (Div Pt) 158 | 151 |VISCAHW |100 | |WM LR|m^2/s |Harmonic Viscosity Coefficient (m2/s) (W Pt) 159 | 152 |VISCA4W |100 | |WM LR|m^4/s |Biharmonic Viscosity Coefficient (m4/s) (W Pt) 160 | 153 |VAHZMAX |100 | |SZ MR|m^2/s |CFL-MAX Harm Visc Coefficient (m2/s) (Zeta Pt) 161 | 154 |VA4ZMAX |100 | |SZ MR|m^4/s |CFL-MAX Biharm Visc Coefficient (m4/s) (Zeta Pt) 162 | 155 |VAHDMAX |100 | |SM MR|m^2/s |CFL-MAX Harm Visc Coefficient (m2/s) (Div Pt) 163 | 156 |VA4DMAX |100 | |SM MR|m^4/s |CFL-MAX Biharm Visc Coefficient (m4/s) (Div Pt) 164 | 157 |VAHZMIN |100 | |SZ MR|m^2/s |RE-MIN Harm Visc Coefficient (m2/s) (Zeta Pt) 165 | 158 |VA4ZMIN |100 | |SZ MR|m^4/s |RE-MIN Biharm Visc Coefficient (m4/s) (Zeta Pt) 166 | 159 |VAHDMIN |100 | |SM MR|m^2/s |RE-MIN Harm Visc Coefficient (m2/s) (Div Pt) 167 | 160 |VA4DMIN |100 | |SM MR|m^4/s |RE-MIN Biharm Visc Coefficient (m4/s) (Div Pt) 168 | 161 |VAHZLTH |100 | |SZ MR|m^2/s |Leith Harm Visc Coefficient (m2/s) (Zeta Pt) 169 | 162 |VA4ZLTH |100 | |SZ MR|m^4/s |Leith Biharm Visc Coefficient (m4/s) (Zeta Pt) 170 | 163 |VAHDLTH |100 | |SM MR|m^2/s |Leith Harm Visc Coefficient (m2/s) (Div Pt) 171 | 164 |VA4DLTH |100 | |SM MR|m^4/s |Leith Biharm Visc Coefficient (m4/s) (Div Pt) 172 | 165 |VAHZLTHD|100 | |SZ MR|m^2/s |LeithD Harm Visc Coefficient (m2/s) (Zeta Pt) 173 | 166 |VA4ZLTHD|100 | |SZ MR|m^4/s |LeithD Biharm Visc Coefficient (m4/s) (Zeta Pt) 174 | 167 |VAHDLTHD|100 | |SM MR|m^2/s |LeithD Harm Visc Coefficient (m2/s) (Div Pt) 175 | 168 |VA4DLTHD|100 | |SM MR|m^4/s |LeithD Biharm Visc Coefficient (m4/s) (Div Pt) 176 | 169 |VAHZSMAG|100 | |SZ MR|m^2/s |Smagorinsky Harm Visc Coefficient (m2/s) (Zeta Pt) 177 | 170 |VA4ZSMAG|100 | |SZ MR|m^4/s |Smagorinsky Biharm Visc Coeff. (m4/s) (Zeta Pt) 178 | 171 |VAHDSMAG|100 | |SM MR|m^2/s |Smagorinsky Harm Visc Coefficient (m2/s) (Div Pt) 179 | 172 |VA4DSMAG|100 | |SM MR|m^4/s |Smagorinsky Biharm Visc Coeff. (m4/s) (Div Pt) 180 | 173 |momKE |100 | |SMR MR|m^2/s^2 |Kinetic Energy (in momentum Eq.) 181 | 174 |momHDiv |100 | |SMR MR|s^-1 |Horizontal Divergence (in momentum Eq.) 182 | 175 |momVort3|100 | |SZR MR|s^-1 |3rd component (vertical) of Vorticity 183 | 176 |Strain |100 | |SZR MR|s^-1 |Horizontal Strain of Horizontal Velocities 184 | 177 |Tension |100 | |SMR MR|s^-1 |Horizontal Tension of Horizontal Velocities 185 | 178 |UBotDrag|100 | 179 |UUR MR|m/s^2 |U momentum tendency from Bottom Drag 186 | 179 |VBotDrag|100 | 178 |VVR MR|m/s^2 |V momentum tendency from Bottom Drag 187 | 180 |USidDrag|100 | 181 |UUR MR|m/s^2 |U momentum tendency from Side Drag 188 | 181 |VSidDrag|100 | 180 |VVR MR|m/s^2 |V momentum tendency from Side Drag 189 | 182 |Um_Diss |100 | 183 |UUR MR|m/s^2 |U momentum tendency from Dissipation 190 | 183 |Vm_Diss |100 | 182 |VVR MR|m/s^2 |V momentum tendency from Dissipation 191 | 184 |Um_Advec|100 | 185 |UUR MR|m/s^2 |U momentum tendency from Advection terms 192 | 185 |Vm_Advec|100 | 184 |VVR MR|m/s^2 |V momentum tendency from Advection terms 193 | 186 |Um_Cori |100 | 187 |UUR MR|m/s^2 |U momentum tendency from Coriolis term 194 | 187 |Vm_Cori |100 | 186 |VVR MR|m/s^2 |V momentum tendency from Coriolis term 195 | 188 |Um_dPHdx|100 | 189 |UUR MR|m/s^2 |U momentum tendency from Hydrostatic Pressure grad 196 | 189 |Vm_dPHdy|100 | 188 |VVR MR|m/s^2 |V momentum tendency from Hydrostatic Pressure grad 197 | 190 |Um_Ext |100 | 191 |UUR MR|m/s^2 |U momentum tendency from external forcing 198 | 191 |Vm_Ext |100 | 190 |VVR MR|m/s^2 |V momentum tendency from external forcing 199 | 192 |Um_AdvZ3|100 | 193 |UUR MR|m/s^2 |U momentum tendency from Vorticity Advection 200 | 193 |Vm_AdvZ3|100 | 192 |VVR MR|m/s^2 |V momentum tendency from Vorticity Advection 201 | 194 |Um_AdvRe|100 | 195 |UUR MR|m/s^2 |U momentum tendency from vertical Advection (Explicit part) 202 | 195 |Vm_AdvRe|100 | 194 |VVR MR|m/s^2 |V momentum tendency from vertical Advection (Explicit part) 203 | 196 |Wm_Diss |100 | |WMr LR|m/s^2 |W momentum tendency from Dissipation 204 | 197 |Wm_Advec|100 | |WMr LR|m/s^2 |W momentum tendency from Advection terms 205 | 198 |WSidDrag|100 | |WMr LR|m/s^2 |Vertical momentum tendency from Side Drag 206 | 199 |ADVx_Um |100 | 200 |UM MR|m^4/s^2 |Zonal Advective Flux of U momentum 207 | ------------------------------------------------------------------------------------ 208 | Num |<-Name->|Levs| mate |<- code ->|<-- Units -->|<- Tile (max=80c) 209 | ------------------------------------------------------------------------------------ 210 | 200 |ADVy_Um |100 | 199 |VZ MR|m^4/s^2 |Meridional Advective Flux of U momentum 211 | 201 |ADVrE_Um|100 | |WU LR|m^4/s^2 |Vertical Advective Flux of U momentum (Explicit part) 212 | 202 |ADVx_Vm |100 | 203 |UZ MR|m^4/s^2 |Zonal Advective Flux of V momentum 213 | 203 |ADVy_Vm |100 | 202 |VM MR|m^4/s^2 |Meridional Advective Flux of V momentum 214 | 204 |ADVrE_Vm|100 | |WV LR|m^4/s^2 |Vertical Advective Flux of V momentum (Explicit part) 215 | 205 |VISCx_Um|100 | 206 |UM MR|m^4/s^2 |Zonal Viscous Flux of U momentum 216 | 206 |VISCy_Um|100 | 205 |VZ MR|m^4/s^2 |Meridional Viscous Flux of U momentum 217 | 207 |VISrE_Um|100 | |WU LR|m^4/s^2 |Vertical Viscous Flux of U momentum (Explicit part) 218 | 208 |VISrI_Um|100 | |WU LR|m^4/s^2 |Vertical Viscous Flux of U momentum (Implicit part) 219 | 209 |VISCx_Vm|100 | 210 |UZ MR|m^4/s^2 |Zonal Viscous Flux of V momentum 220 | 210 |VISCy_Vm|100 | 209 |VM MR|m^4/s^2 |Meridional Viscous Flux of V momentum 221 | 211 |VISrE_Vm|100 | |WV LR|m^4/s^2 |Vertical Viscous Flux of V momentum (Explicit part) 222 | 212 |VISrI_Vm|100 | |WV LR|m^4/s^2 |Vertical Viscous Flux of V momentum (Implicit part) 223 | 213 |TRAC01 |100 | |SMR MR|g/m^3 |dye1 concentration 224 | 214 |UTRAC01 |100 | 215 |UUr MR|g/m^3.m/s |Zonal Mass-Weighted Transp of dye1 225 | 215 |VTRAC01 |100 | 214 |VVr MR|g/m^3.m/s |Merid Mass-Weighted Transp of dye1 226 | 216 |WTRAC01 |100 | |WM MR|g/m^3.m/s |Vert Mass-Weighted Transp of dye1 227 | 217 |ForcTr01|100 | |SMR MR|g/m^3/s |dye1 forcing tendency 228 | 218 |AB_gTr01|100 | |SMR MR|g/m^3/s |dye1 tendency from Adams-Bashforth 229 | 219 |ADVrTr01|100 | |WM LR|g/m^3.m^3/s |Vertical Advective Flux of dye1 230 | 220 |ADVxTr01|100 | 221 |UU MR|g/m^3.m^3/s |Zonal Advective Flux of dye1 231 | 221 |ADVyTr01|100 | 220 |VV MR|g/m^3.m^3/s |Meridional Advective Flux of dye1 232 | 222 |DFrETr01|100 | |WM LR|g/m^3.m^3/s |Vertical Diffusive Flux of dye1 (Explicit part) 233 | 223 |DFxETr01|100 | 224 |UU MR|g/m^3.m^3/s |Zonal Diffusive Flux of dye1 234 | 224 |DFyETr01|100 | 223 |VV MR|g/m^3.m^3/s |Meridional Diffusive Flux of dye1 235 | 225 |DFrITr01|100 | |WM LR|g/m^3.m^3/s |Vertical Diffusive Flux of dye1 (Implicit part) 236 | 226 |Add2EmP | 1 | |SM U1|kg/m^2/s |additional EmP from salt relaxation 237 | ------------------------------------------------------------------------------------ 238 | Num |<-Name->|Levs| mate |<- code ->|<-- Units -->|<- Tile (max=80c) 239 | ------------------------------------------------------------------------------------ 240 | -------------------------------------------------------------------------------- /mitgcm/data: -------------------------------------------------------------------------------- 1 | # ==================== 2 | # | Model parameters | 3 | # ==================== 4 | # 5 | # Continuous equation parameters 6 | &PARM01 7 | sRef= 100*35., 8 | # viscAr=1.E-5, 9 | # viscAh=1.E-5, 10 | # viscC2Smag=1, 11 | viscA4Grid=0.08, 12 | viscA4GridMax=0.6 13 | viscA4GridMin=0.03 14 | no_slip_sides=.FALSE., 15 | no_slip_bottom=.FALSE., 16 | bottomDragLinear=5e-3, 17 | diffKhT=2.E-5, 18 | diffKrT=2.E-5, 19 | f0=0, 20 | beta=0.E-11, 21 | eosType='LINEAR', 22 | tAlpha=2.E-4, 23 | sBeta =0.E-4, 24 | gravity=9.81, 25 | multiDimAdvection=.TRUE., 26 | tempAdvScheme=80, 27 | tempVertAdvScheme=80, 28 | # implicitFreeSurface=.TRUE., 29 | # implicSurfPress=0.5, 30 | # implicDiv2DFlow=0.5, 31 | # implicitDiffusion=.TRUE., 32 | # implicitViscosity=.TRUE., 33 | # exactConserv=.TRUE., 34 | nonHydrostatic=.TRUE., 35 | rigidLid=.TRUE., 36 | hFacMin=0.2, 37 | hFacMinDr=0.3 38 | staggerTimeStep=.TRUE., 39 | # nonlinFreeSurf=3, 40 | # hFacInf=0.3, 41 | # hFacSup=1, 42 | saltStepping=.FALSE., 43 | #- not safe to use globalFiles in multi-processors runs 44 | #globalFiles=.TRUE., 45 | readBinaryPrec=32, 46 | writeBinaryPrec=32, 47 | writeStatePrec=32, 48 | useSingleCpuIo=.TRUE., 49 | & 50 | 51 | # Elliptic solver parameters 52 | &PARM02 53 | cg2dMaxIters=1000, 54 | cg2dTargetResidual=1.E-12, 55 | cg3dMaxIters=500, 56 | cg3dTargetResidual=1.E-12, 57 | & 58 | 59 | # Time stepping parameters 60 | &PARM03 61 | # nIter0=14400, 62 | startTime=0., 63 | endTime=432000, 64 | # endTime=10, 65 | deltaT=2, 66 | abEps=0.1, 67 | pChkptFreq=43200., 68 | chkptFreq=0., 69 | dumpFreq=0., 70 | dumpInitAndLast = .FALSE., 71 | monitorFreq=1800., 72 | monitorSelect=2, 73 | & 74 | 75 | # Gridding parameters 76 | &PARM04 77 | usingCartesianGrid=.TRUE., 78 | delX=4480*2, 79 | delY=10, 80 | delR=100*2., 81 | & 82 | 83 | # Input datasets 84 | &PARM05 85 | bathyFile='./BATH/bathy.dat', 86 | hydrogThetaFile = './IC/TInit.dat', 87 | # zonalWindFile = './EXF/wndStrs.dat', 88 | the_run_name = 'breakingIW', 89 | & 90 | -------------------------------------------------------------------------------- /mitgcm/data.diagnostics: -------------------------------------------------------------------------------- 1 | # Diagnostic Package Choices 2 | #-------------------- 3 | # dumpAtLast (logical): always write output at the end of simulation (default=F) 4 | # diag_mnc (logical): write to NetCDF files (default=useMNC) 5 | #--for each output-stream: 6 | # fileName(n) : prefix of the output file name (max 80c long) for outp.stream n 7 | # frequency(n):< 0 : write snap-shot output every |frequency| seconds 8 | # > 0 : write time-average output every frequency seconds 9 | # timePhase(n) : write at time = timePhase + multiple of |frequency| 10 | # averagingFreq : frequency (in s) for periodic averaging interval 11 | # averagingPhase : phase (in s) for periodic averaging interval 12 | # repeatCycle : number of averaging intervals in 1 cycle 13 | # levels(:,n) : list of levels to write to file (Notes: declared as REAL) 14 | # when this entry is missing, select all common levels of this list 15 | # fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n 16 | # (see "available_diagnostics.log" file for the full list of diags) 17 | # missing_value(n) : missing value for real-type fields in output file "n" 18 | # fileFlags(n) : specific code (8c string) for output file "n" 19 | #-------------------- 20 | # This example dumps EXF diagnostics as snapshot after 10 time-steps 21 | # Note: EXF air-sea fluxes over Sea-Ice are wrong 22 | &DIAGNOSTICS_LIST 23 | dumpAtLast = .FALSE., 24 | #-- 25 | fields(1:4,1) = 'UVEL ','WVEL ','THETA ','TRAC01 ', 26 | # 'RHOAnoma','PHIHYD ','PHI_NH ', 27 | fileName(1) = './output/Stat', 28 | frequency(1) = -300., 29 | timePhase(1) = 0., 30 | 31 | fields(1:2,2) = 'PHI_SURF','PHIBOT ', 32 | fileName(2) = './output/Surf', 33 | frequency(2) = 0., 34 | timePhase(2) = 0., 35 | 36 | # fields(1:2,3) = 'KPPhbl ','KPPfrac ', 37 | # fileName(3) = 'KPPSurf', 38 | # frequency(3) = -31104000., 39 | 40 | # fields(1:4,4) = 'KPPghatK','KPPviscA','KPPdiffS','KPPdiffT', 41 | # fileName(4) = 'KPPLevs', 42 | # frequency(4) = -31104000., 43 | 44 | # fields(1:4,5) = 'VISCAHZ ','VISCA4Z ','VAHZSMAG','VA4ZSMAG', 45 | # fileName(5) = 'viscosity', 46 | # frequency(5) = -31104000., 47 | & 48 | 49 | #-------------------- 50 | # Parameter for Diagnostics of per level statistics: 51 | #-------------------- 52 | # diagSt_mnc (logical): write stat-diags to NetCDF files (default=diag_mnc) 53 | # diagSt_regMaskFile : file containing the region-mask to read-in 54 | # nSetRegMskFile : number of region-mask sets within the region-mask file 55 | # set_regMask(i) : region-mask set-index that identifies the region "i" 56 | # val_regMask(i) : region "i" identifier value in the region mask 57 | #--for each output-stream: 58 | # stat_fName(n) : prefix of the output file name (max 80c long) for outp.stream n 59 | # stat_freq(n):< 0 : write snap-shot output every |stat_freq| seconds 60 | # > 0 : write time-average output every stat_freq seconds 61 | # stat_phase(n) : write at time = stat_phase + multiple of |stat_freq| 62 | # stat_region(:,n) : list of "regions" (default: 1 region only=global) 63 | # stat_fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n 64 | # (see "available_diagnostics.log" file for the full list of diags) 65 | #-------------------- 66 | &DIAG_STATIS_PARMS 67 | #stat_fields(1:5,1) = 'ETAN ','UVEL ','VVEL ','WVEL ', 'THETA ', 68 | # stat_fName(1) = 'dynStDiag', 69 | # stat_freq(1) = -36000., 70 | # stat_phase(1) = 0., 71 | & 72 | 73 | -------------------------------------------------------------------------------- /mitgcm/data.flt: -------------------------------------------------------------------------------- 1 | # ********************* 2 | # Float Namelist 3 | # ********************* 4 | &FLT_NML 5 | flt_int_traj = 300., 6 | flt_int_prof = 0., 7 | flt_noise = 0.0, 8 | # flt_Iter0 = 0, 9 | # flt_Iter0 = 2280960, 10 | flt_file = './FLT/initBreakIWnonhydro.dat', 11 | & 12 | 13 | -------------------------------------------------------------------------------- /mitgcm/data.pkg: -------------------------------------------------------------------------------- 1 | # Packages 2 | &PACKAGES 3 | # useOBCS=.FALSE., 4 | # useKPP =.FALSE., 5 | useFLT=.TRUE., 6 | useDiagnostics=.TRUE., 7 | usePTRACERS=.TRUE., 8 | & 9 | -------------------------------------------------------------------------------- /mitgcm/data.ptracers: -------------------------------------------------------------------------------- 1 | # Dye set-up: tracer is initialized after 10 years 2 | # of spin-up of the dynamical fields. 3 | # dye.bin has a dye concentration of 1 in a single grid cell 4 | # near the left boundary (i=2, j=30, k=1), zero otherwise; 5 | # generated with matlab using gendata.m 6 | # 7 | &PTRACERS_PARM01 8 | PTRACERS_numInUse=1, 9 | PTRACERS_Iter0=0, 10 | PTRACERS_monitorFreq=1800., 11 | # tracer 1 12 | PTRACERS_advScheme(1)=80, 13 | PTRACERS_diffKh(1)=2E-5, 14 | PTRACERS_diffK4(1)=0.E9, 15 | PTRACERS_diffKr(1)=2E-5, 16 | PTRACERS_useGMRedi(1)=.FALSE., 17 | PTRACERS_useKPP(1)=.FALSE., 18 | PTRACERS_initialFile(1)='./DYE/trInit.dat', 19 | PTRACERS_names(1)='dye1', 20 | PTRACERS_long_names(1)='dye1', 21 | PTRACERS_units(1)='g/m^3', 22 | & 23 | -------------------------------------------------------------------------------- /mitgcm/eedata: -------------------------------------------------------------------------------- 1 | # Example "eedata" file 2 | # Lines beginning "#" are comments 3 | # nTx - No. threads per process in X 4 | # nTy - No. threads per process in Y 5 | &EEPARMS 6 | nTx=1, 7 | nTy=1, 8 | & 9 | # Note: Some systems use & as the 10 | # namelist terminator. Other systems 11 | # use a / character (as shown here). 12 | -------------------------------------------------------------------------------- /mitgcm/eedata.mth: -------------------------------------------------------------------------------- 1 | # Example "eedata" file for multi-threaded test 2 | # (copy "eedata.mth" to "eedata" to use it) 3 | # Lines beginning "#" are comments 4 | # nTx - No. threads per process in X 5 | # nTy - No. threads per process in Y 6 | &EEPARMS 7 | nTx=2, 8 | nTy=1, 9 | & 10 | # Note: Some systems use & as the namelist terminator (as shown here). 11 | # Other systems use a / character. 12 | -------------------------------------------------------------------------------- /mitgcm/mitgcmuv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miniufo/InternalWaveBreaking/92dcfdab8ae6a49e3d677c157120cc4b38c46bfc/mitgcm/mitgcmuv -------------------------------------------------------------------------------- /mitgcm/nonhydro.e96042: -------------------------------------------------------------------------------- 1 | NORMAL END 2 | NORMAL END 3 | NORMAL END 4 | NORMAL END 5 | NORMAL END 6 | NORMAL END 7 | NORMAL END 8 | NORMAL END 9 | NORMAL END 10 | NORMAL END 11 | NORMAL END 12 | NORMAL END 13 | NORMAL END 14 | NORMAL END 15 | NORMAL END 16 | NORMAL END 17 | NORMAL END 18 | NORMAL END 19 | NORMAL END 20 | NORMAL END 21 | NORMAL END 22 | NORMAL END 23 | NORMAL END 24 | NORMAL END 25 | NORMAL END 26 | NORMAL END 27 | NORMAL END 28 | NORMAL END 29 | NORMAL END 30 | NORMAL END 31 | NORMAL END 32 | NORMAL END 33 | NORMAL END 34 | NORMAL END 35 | NORMAL END 36 | NORMAL END 37 | NORMAL END 38 | NORMAL END 39 | NORMAL END 40 | NORMAL END 41 | NORMAL END 42 | NORMAL END 43 | NORMAL END 44 | NORMAL END 45 | NORMAL END 46 | NORMAL END 47 | NORMAL END 48 | NORMAL END 49 | NORMAL END 50 | NORMAL END 51 | NORMAL END 52 | NORMAL END 53 | NORMAL END 54 | NORMAL END 55 | NORMAL END 56 | NORMAL END 57 | real 99721.02 58 | user 2696011.03 59 | sys 69319.85 60 | -------------------------------------------------------------------------------- /mitgcm/nonhydro.o96042: -------------------------------------------------------------------------------- 1 | This jobs is 96042.mgr@batch 56 /opt/gridview//pbs/dispatcher/aux//96042.mgr 2 | -------------------------------------------------------------------------------- /mitgcm/output/CombineStat: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | fname='Stat.dat' 4 | 5 | if [ -f ${fname} ] 6 | then 7 | rm ${fname} 8 | fi 9 | 10 | for vars in $@ 11 | do 12 | count=0 13 | 14 | for file in ${vars}.*.data 15 | do 16 | cat ${file} >> ${fname} 17 | count=`expr ${count} + 1` 18 | done 19 | 20 | # rm ${vars}.*.data 21 | # rm ${vars}.*.meta 22 | 23 | echo "total count for ${vars}: ${count}" 24 | done 25 | 26 | -------------------------------------------------------------------------------- /mitgcm/output/CombineSurf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | fname='Surf.dat' 4 | 5 | if [ -f ${fname} ] 6 | then 7 | rm ${fname} 8 | fi 9 | 10 | for vars in $@ 11 | do 12 | count=0 13 | 14 | for file in ${vars}.*.data 15 | do 16 | cat ${file} >> ${fname} 17 | count=`expr ${count} + 1` 18 | done 19 | 20 | # rm ${vars}.*.data 21 | # rm ${vars}.*.meta 22 | 23 | echo "total count for ${vars}: ${count}" 24 | done 25 | 26 | -------------------------------------------------------------------------------- /mitgcm/output/Stat.ctl: -------------------------------------------------------------------------------- 1 | dset ^Stat.dat 2 | title Stat 3 | undef 0 4 | options big_endian 5 | xdef 4480 linear 0 0.001 6 | ydef 1 linear 0 0.1 7 | zdef 100 linear 0 2 8 | tdef 1440 linear 1Jan2000 5mn 9 | vars 4 10 | u 100 99 u 11 | w 100 99 w 12 | T 100 99 T 13 | tr 100 99 T 14 | endvars 15 | 16 | -------------------------------------------------------------------------------- /mitgcm/output/Surf.ctl: -------------------------------------------------------------------------------- 1 | dset ^Surf.dat 2 | title Surf 3 | undef 0 4 | options big_endian 5 | xdef 1960 linear 0 0.001 6 | ydef 1 linear 0 0.1 7 | zdef 1 linear 0 5 8 | tdef 76 linear 1Jan2000 30mn 9 | vars 3 10 | eta 0 99 eta 11 | phis 0 99 phi_surf 12 | phib 0 99 phi_bot 13 | endvars 14 | 15 | -------------------------------------------------------------------------------- /mitgcm/qsub.pbs: -------------------------------------------------------------------------------- 1 | #PBS -N nonhydro 2 | #PBS -l nodes=2:ppn=28 3 | #PBS -l walltime=720:00:00 4 | #PBS -q batch 5 | #PBS -V 6 | #PBS -S /bin/bash 7 | 8 | 9 | 10 | ### intel mpi 11 | source /public/software/profile.d/mpi_mvapich2-2.2b-intel.sh 12 | 13 | cd $PBS_O_WORKDIR 14 | EXEC=/public/home/qianyk/MITgcm_c66g/verification/breakingIW/nonHydro/mitgcmuv 15 | 16 | NSLOTS=`cat $PBS_NODEFILE | wc -l` 17 | echo "This jobs is "$PBS_JOBID@$PBS_QUEUE" "$NSLOTS" "$PBS_NODEFILE 18 | 19 | 20 | time -p mpirun -np 56 -machinefile $PBS_NODEFILE $EXEC 21 | 22 | --------------------------------------------------------------------------------