This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Oceananigans.Units | |
using GLMakie | |
# Wall time per time step in a large eddy simulation with 256^3 resolution. | |
# | |
# Numbers provided by Qing Li (HKUST Guangzhou, qingli411.github.io) | |
# | |
# Details for the "LESMIP" contained in | |
# https://github.com/qingli411/A2022_LESMIP/blob/main/notebook/Compare_LES-BF5hWD05WV00.ipynb | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
# This example implements the script | |
using Oceananigans | |
using Oceananigans.TurbulenceClosures: CATKEVerticalDiffusivity | |
using SeawaterPolynomials: TEOS10EquationOfState | |
gravitational_acceleration = 9.807 # m s⁻² | |
dissipation_parameter = 2.91 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
using Printf | |
using Oceananigans | |
using Oceananigans.Units | |
using Oceananigans.TurbulenceClosures: TKEBasedVerticalDiffusivity | |
##### | |
##### Parameters | |
##### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" glw's .vimrc for a MacBook pro | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
" Set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'JuliaEditorSupport/julia-vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function broadcastmult!(A, x, F; nloops=1000) | |
for i = 1:nloops | |
@. A = x*F | |
end | |
end | |
function regularmult!(A, X, F; nloops=1000) | |
for i = 1:nloops | |
@. A = X*F | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Define digraphs for alphabetic subscripts in .vimrc | |
execute "digraphs ks " . 0x2096 | |
execute "digraphs as " . 0x2090 | |
execute "digraphs es " . 0x2091 | |
execute "digraphs hs " . 0x2095 | |
execute "digraphs is " . 0x1D62 | |
execute "digraphs ks " . 0x2096 | |
execute "digraphs ls " . 0x2097 | |
execute "digraphs ms " . 0x2098 | |
execute "digraphs ns " . 0x2099 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: julia | |
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com> | |
" Last Change: 2013 feb 11 | |
if version < 600 | |
syntax clear | |
elseif exists("b:current_syntax") | |
finish | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def linecount_generator(reader): | |
"""Yield a generator object for the purpose of counting lines in a file | |
at speed. See | |
https://stackoverflow.com/questions/ | |
845058/how-to-get-line-count-cheaply-in-python/27518377#27518377 | |
""" | |
b = reader(1024*1024) | |
while b: | |
yield b | |
b = reader(1024*1024) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Line numbers. | |
set number | |
" Syntax highlighting. | |
syntax on | |
" Convert tab key to insert four spaces. | |
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab | |
" Remove extremely annoying red boxes that appears in |