|
9 | 9 | %-------------------------------------------------------------------------- |
10 | 10 | % Writen by Iria Sala |
11 | 11 | % Created on 09.02.2023 |
| 12 | +% Edited by Bingzhang Chen (bingzhang.chen@strath.ac.uk) on 28.04.2025 |
12 | 13 | %========================================================================== |
13 | 14 |
|
14 | 15 | %========================================================================== |
|
17 | 18 | %.......................................................................... |
18 | 19 | EUL = 'Euler.nc'; |
19 | 20 | %.......................................................................... |
20 | | -Z_w = double(nc_varget(EUL,'Z_w')); % Depth (m) |
21 | | -Kv = double(nc_varget(EUL,'Kv')); % Vertical diffusivity (Kv, m2 s-1) |
| 21 | +Z_w = double(ncread(EUL,'Z_w')); % Depth (m) |
| 22 | +Kv = double(ncread(EUL,'Kv')); % Vertical diffusivity (Kv, m2 s-1) |
22 | 23 | %.......................................................................... |
23 | 24 | DMLD = 1:365; % Time vector (day) |
24 | 25 | %.......................................................................... |
25 | 26 | % Find the closest values to 10-4 to define the MLD: |
26 | | -val = 10e-4; |
| 27 | +val = 1e-4; |
27 | 28 | %.......................................................................... |
28 | 29 | for d = 1:365 |
29 | 30 |
|
30 | | - prof = Kv(d,:); |
| 31 | + prof = Kv(:,d); |
31 | 32 | [nu,ix] = min(abs(prof-val)); |
32 | 33 |
|
33 | 34 | zdep = Z_w(ix); |
|
40 | 41 | %========================================================================== |
41 | 42 | %% Load Lagrangian fields: |
42 | 43 | %========================================================================== |
43 | | -LAG = 'ParY6.nc'; |
| 44 | +LAG = 'ParY6.nc'; %Download from https://strath-my.sharepoint.com/:u:/g/personal/bingzhang_chen_strath_ac_uk/EWzT89WKyYxOg_vAfbnhuzsBGCK371cdqmuk3Zik4-boUQ?e=e6Lb1P |
44 | 45 | %.......................................................................... |
45 | | -DAYS = double(nc_varget(LAG,'DOY'))'; % Time (hours) |
| 46 | +DAYS = double(ncread(LAG,'DOY'))'; % Time (hours) |
46 | 47 | tPART = DAYS; |
47 | 48 | %.......................................................................... |
48 | | -zPART = double(nc_varget(LAG,'Z'))'; % Super-individuals depth position |
| 49 | +zPART = double(ncread(LAG,'Z'))'; % Super-individuals depth position |
49 | 50 | %========================================================================== |
50 | 51 |
|
51 | 52 | %========================================================================== |
52 | 53 | %% Load Pasive particles fields: |
53 | 54 | %========================================================================== |
54 | | -PAS = 'PassY6.nc'; |
| 55 | +PAS = 'PassY6.nc'; %Download from https://strath-my.sharepoint.com/:u:/g/personal/bingzhang_chen_strath_ac_uk/EUeaWW_WmypMrFoiK5W34tMBVD6wxhtOGFIB6BvpEy94jw?e=Cq4IUb |
55 | 56 | %.......................................................................... |
56 | | -DAYS = double(nc_varget(PAS,'DOY'))'; % Time (days) |
| 57 | +DAYS = double(ncread(PAS,'DOY'))'; % Time (days) |
57 | 58 | tPASS = DAYS; |
58 | 59 | %.......................................................................... |
59 | | -zPASS = double(nc_varget(PAS,'Z'))'; % Passive particle depth position |
| 60 | +zPASS = double(ncread(PAS,'Z'))'; % Passive particle depth position |
60 | 61 | %========================================================================== |
61 | 62 |
|
62 | 63 | %========================================================================== |
|
78 | 79 | %========================================================================== |
79 | 80 | for j = 1:length(D05)-1 |
80 | 81 |
|
81 | | - zSI = zPART(:,D05(j):D05(j)+4); |
82 | | - zPP = zPASS(:,D05(j):D05(j)+4); |
| 82 | + zSI = zPART(D05(j):D05(j)+4,:); |
| 83 | + zPP = zPASS(D05(j):D05(j)+4,:); |
83 | 84 |
|
84 | 85 | % Select super-individuals by depth level: |
85 | 86 | for i = 1:length(Z_w)-1 |
|
208 | 209 | set(gcf, 'PaperSize', [figPosition(3) figPosition(4)]); |
209 | 210 | %.......................................................................... |
210 | 211 | % Save the figure as a PDF using the print command |
211 | | -print(gcf, 'FIG05_SupIndvsPasPar.pdf', '-dpdf', '-bestfit'); |
| 212 | +exportgraphics(gcf, 'FIG05_SupIndvsPasPar.pdf', 'ContentType', 'vector'); |
| 213 | +close all; |
212 | 214 | %========================================================================== |
213 | 215 | return |
0 commit comments