-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb7401f
commit ab1489b
Showing
26 changed files
with
823 additions
and
352 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[![DOI](https://zenodo.org/badge/287464756.svg)](https://zenodo.org/badge/latestdoi/287464756) | ||
|
||
**This repository contains the MATLAB scripts used in the paper "Evaluating Monin-Obukhov scaling in the unstable oceanic surface layer"** | ||
**This repository contains the MATLAB scripts used in the paper "Evaluating Monin-Obukhov Scaling in the Unstable Oceanic Surface Layer", J. Phys. Oceanogr., doi:10.1175/JPO-D-20-0201.1.** | ||
|
||
You can reach me at [[email protected]](mailto:[email protected]) for questions related to the usage of this code. | ||
|
||
|
@@ -24,7 +24,7 @@ It also uses some external toolboxes/functions, as listed below: | |
- [tight_subplot](https://www.mathworks.com/matlabcentral/fileexchange/27991-tight_subplot-nh-nw-gap-marg_h-marg_w) | ||
|
||
### Data | ||
The data used in this work are mostly publicly available (see the "Data availability statement" in our paper). For convience, a copy of the original data can be downloaded either from [this Google Drive link](https://drive.google.com/file/d/13UYYOT9AXFufjMw6_wr4-hoNv7M3tT7v/view?usp=sharing), or from the most recent [release](https://github.com/zhihua-zheng/EvaMO_UOSL_code/releases/tag/v1.0) of this repository. | ||
The data used in this work are mostly publicly available (see the "Data availability statement" in our paper). For convience, a copy of the original data can be downloaded either from [this Google Drive link](https://drive.google.com/file/d/13UYYOT9AXFufjMw6_wr4-hoNv7M3tT7v/view?usp=sharing), or from the most recent [release](https://github.com/zhihua-zheng/EvaMO_UOSL_code/releases/tag/v1.1) of this repository. | ||
|
||
### Work flow | ||
1. Download this repository to your local computer. Alternatively, you can clone it using the command line in Terminal, | ||
|
@@ -38,11 +38,11 @@ Add this repository to your MATLAB search path | |
addpath(genpath('<path to this repository>')) | ||
``` | ||
|
||
2. Download the data file `EvaMO_UOSL_data.zip` as described in the previous [Data](#-data) section. Unzip it into the `EvaMO_UOSL_code` directory. | ||
2. Download the data file `EvaMO_UOSL_data.zip` following the [Data](#-data) section. Unzip it into the top-level directory of the repository `EvaMO_UOSL_code`. | ||
|
||
3. Run the main analysis script `evaMO_main.m`. | ||
|
||
### Attribution | ||
This code is freely available for reuse as described in the MIT License. However, if you use this code in an academic publication, a propriate citation to the source would be appreciated: | ||
This set of scripts is free for reuse as described in the MIT License. However, if you use this code in an academic publication, a propriate citation to the source would be appreciated: | ||
|
||
* Zhihua Zheng. (2020, August 17). Analysis scripts for "Evaluating Monin-Obukhov scaling in the unstable oceanic surface layer" (Version v1.0). Zenodo. doi:10.5281/zenodo.3988503 | ||
* Zhihua Zheng. (2020, December 22). Analysis scripts for "Evaluating Monin-Obukhov Scaling in the Unstable Oceanic Surface Layer". Zenodo. doi:10.5281/zenodo.3988503 |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
function Fin = Fin_from_dws(WQ,fctr,bw,ws,wdir,fop) | ||
% | ||
% Fin_from_dws | ||
%========================================================================== | ||
% | ||
% USAGE: | ||
% Fin = Fin_from_dws(WQ,fctr,bw,ws,wdir,fop) | ||
% | ||
% DESCRIPTION: | ||
% Compute the rate of wind energy input accroding to Plant 1982, or | ||
% Donelan and Pierson 1987. | ||
% | ||
% INPUT: | ||
% | ||
% WQ - timetable for spectral wave data | ||
% fctr - bin center frequency | ||
% bw - bandwidth for frequency bins | ||
% ws - [1,t] wind stress, or [f,t] wind speed at height pi/k | ||
% wdir - [1,t] direction of wind, clockwise from N [degree, from] | ||
% fop - formula option: | ||
% 'P82': Plant 1982 | ||
% 'DP87': Donelan and Pierson 1987 | ||
% | ||
% OUTPUT: | ||
% | ||
% Fin - the rate of energy input from wind | ||
% | ||
% AUTHOR: | ||
% Sep 6 2020, Zhihua Zheng [ [email protected] ] | ||
%========================================================================== | ||
|
||
%% Loading | ||
|
||
datm = WQ.datm; | ||
a0 = WQ.wave_spec'/pi; | ||
a1 = WQ.wave_a1'; | ||
b1 = WQ.wave_b1'; | ||
a2 = WQ.wave_a2'; | ||
b2 = WQ.wave_b2'; | ||
|
||
%% Constants | ||
|
||
rhow = 1025; | ||
rhoa = 1.225; | ||
g = 9.81; | ||
fc = fctr(end) + bw(end)/2; % right edge cutoff frequency [Hz] | ||
ntm = length(datm); | ||
|
||
%% Reshaping | ||
|
||
df = repmat(bw, 1,ntm); | ||
f = repmat(fctr,1,ntm); | ||
|
||
%% Resolved spectrum | ||
|
||
switch fop | ||
case 'P82' | ||
multi = 0.04*8*pi^3/g/rhoa.*ws; | ||
mu = pi*(cosd(wdir).*a1 + sind(wdir).*b1); | ||
Fin_re = multi .* sum(f.^3 .* mu .* df); | ||
|
||
case 'DP87' | ||
c = g/2/pi./f; | ||
multi = 0.194*8*pi^3*rhoa/rhow/g; | ||
mu = pi*(ws.^2.*(a0 + cosd(2*wdir).*a2 + sind(2*wdir).*b2)/2 + ... | ||
a0.*c.^2 - ... | ||
2*ws.*c.*(cosd(wdir).*a1 + sind(wdir).*b1)); | ||
Fin_re = multi * sum(f.^3 .* mu .* df); | ||
end | ||
|
||
%% Append analytical high frequency tail (Breivik et al. 2014) | ||
|
||
a1_tail = a1(end,:); | ||
b1_tail = b1(end,:); | ||
|
||
tailC = multi * fc^4; | ||
|
||
switch fop | ||
case 'P82' | ||
muC = pi*(cosd(wdir).*a1_tail + sind(wdir).*b1_tail); | ||
Fin_tail = tailC .* muC; | ||
|
||
case 'DP87' | ||
muC = pi*(ws(end,:).^2.*(a0(end,:) + cosd(2*wdir).*a2(end,:) + ... | ||
sind(2*wdir).*b2(end,:))/2 + ... | ||
a0(end,:)*c(end)^2 - ... | ||
2*ws(end,:)*c(end).*(cosd(wdir).*a1_tail + ... | ||
sind(wdir).*b1_tail)); | ||
Fin_tail = tailC * muC; | ||
end | ||
|
||
%% Add up | ||
|
||
Fin = Fin_re + Fin_tail; | ||
|
||
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
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
Oops, something went wrong.