Skip to content

Commit

Permalink
../exp/snd/
Browse files Browse the repository at this point in the history
  • Loading branch information
natgeo-wong committed Aug 29, 2024
1 parent 9e8b9ca commit 63f8111
Show file tree
Hide file tree
Showing 13 changed files with 1,059 additions and 1,035 deletions.
256 changes: 128 additions & 128 deletions exp/snd/D1281km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/D2562km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/P1281km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/P1282km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/T0642km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/T1281km300V64

Large diffs are not rendered by default.

256 changes: 128 additions & 128 deletions exp/snd/T1282km300V64

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions notebooks/01-rcespinup.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.41
# v0.19.46

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -69,8 +69,12 @@ else
end

# ╔═╡ 20d88eb4-8035-43d3-bfd1-084e38726b4b
if prefix == "P" && iszero(dsize)
md"Toggle Horizontal Resolution: $(@bind hres PlutoUI.Slider(1:2,default=1))"
if iszero(dsize)
if prefix == "P"
md"Toggle Horizontal Resolution: $(@bind hres PlutoUI.Slider(0:2,default=1))"
else
md"Toggle Horizontal Resolution: $(@bind hres PlutoUI.Slider(0:1,default=1))"
end
else
hres = 1
md""
Expand Down Expand Up @@ -117,9 +121,17 @@ begin
md"Number of Vertical Levels: $(nvert)"
end

# ╔═╡ 2ec96d61-c6f5-4015-b9bb-f2b544914ab3
if (prefix == "P" || prefix == "T") && isone(hres) && iszero(dsize) && iszero(is2D) && iszero(isfsf)
md"Temperature? $(@bind sst PlutoUI.Slider(300:5:305,default=300))"
else
sst = 300
md""
end

# ╔═╡ ac8b9d4c-5ade-11eb-06f4-33bff063bbde
begin
config = "$(prefix)$(@sprintf("%03d",128*2. ^dsize))$(@sprintf("%d",2. ^hres))km300V$(nvert)"
config = "$(prefix)$(@sprintf("%03d",128*2. ^dsize))$(@sprintf("%d",2. ^hres))km$(sst)V$(nvert)"
if isone(is2D); config = "$(config)_2D" end
if isone(isfsf); config = "$(config)_FSF" end
nen = 10
Expand Down Expand Up @@ -347,6 +359,7 @@ end
# ╟─5940bed1-cf63-4caa-a954-b4aa8d3ab459
# ╟─8697387f-a384-41a6-bba1-f61f47056bd0
# ╟─fab65122-bf01-44d7-8a92-e0b842983a98
# ╟─2ec96d61-c6f5-4015-b9bb-f2b544914ab3
# ╟─ac8b9d4c-5ade-11eb-06f4-33bff063bbde
# ╟─7842e150-822b-11eb-1ded-f35ee4cc6d8c
# ╟─99dca670-81e5-11eb-24b8-cf1b23d8c1f7
Expand Down
14 changes: 7 additions & 7 deletions notebooks/02-wtgstrength.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.41
# v0.19.46

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -51,12 +51,12 @@ begin
pplt.close()
fig,axs = pplt.subplots(ncols=6,aspect=0.3,axwidth=0.9,sharey=0,wspace=[1,1,4,1,1])

ds_rceprcp = NCDataset(datadir("precipitation","RCE-P1282km300V64.nc"))
ds_rceprcp = NCDataset(datadir("precipitation","RCE-P0642km300V64.nc"))
prcp_RCE = ds_rceprcp["precipitation"][:,:] / 24
prcpRCEμ_P = mean(prcp_RCE[1001:2000,:])
close(ds_rceprcp)

ds_rceprcp = NCDataset(datadir("precipitation","RCE-T1282km300V64.nc"))
ds_rceprcp = NCDataset(datadir("precipitation","RCE-T0642km300V64.nc"))
prcp_RCE = ds_rceprcp["precipitation"][:,:] / 24
prcpRCEμ_T = mean(prcp_RCE[1001:2000,:])
close(ds_rceprcp)
Expand All @@ -68,7 +68,7 @@ begin

for conDGW in configDGW

fnc = "DGW-T1282km300V64-$(dampingstrprnt(conDGW)).nc"
fnc = "DGW-T0642km300V64-$(dampingstrprnt(conDGW)).nc"
ds_dgwprcp = NCDataset(datadir("precipitation",fnc))

prcp = ds_dgwprcp["precipitation"][:,:] / 24
Expand Down Expand Up @@ -132,7 +132,7 @@ begin

close(ds_dgwprcp)

fnc = "DGW-P1282km300V64-$(dampingstrprnt(conDGW)).nc"
fnc = "DGW-P0642km300V64-$(dampingstrprnt(conDGW)).nc"
ds_dgwprcp = NCDataset(datadir("precipitation",fnc))

prcp = ds_dgwprcp["precipitation"][:,:] / 24
Expand Down Expand Up @@ -168,7 +168,7 @@ begin

for conWTG in configWTG

fnc = "SPC-T1282km300V64-$(relaxscalestrprnt(conWTG)).nc"
fnc = "SPC-T0642km300V64-$(relaxscalestrprnt(conWTG)).nc"
ds_wtgprcp = NCDataset(datadir("precipitation",fnc))

prcp = ds_wtgprcp["precipitation"][:,:] / 24
Expand Down Expand Up @@ -230,7 +230,7 @@ begin

close(ds_wtgprcp)

fnc = "SPC-P1282km300V64-$(relaxscalestrprnt(conWTG)).nc"
fnc = "SPC-P0642km300V64-$(relaxscalestrprnt(conWTG)).nc"
ds_wtgprcp = NCDataset(datadir("precipitation",fnc))

prcp = ds_wtgprcp["precipitation"][:,:] / 24
Expand Down
6 changes: 3 additions & 3 deletions notebooks/03-timeseriesanalysis.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.41
# v0.19.42

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -110,7 +110,7 @@ begin
if isfile(datadir("precipitation",fnc))
ds_dgwprcp = NCDataset(datadir("precipitation",fnc))
dt = ds_dgwprcp["time"][:]
prcp = ds_dgwprcp["precipitation"][:] / 24
prcp = ds_dgwprcp["precipitation"][:,:] / 24
ats[1].plot(dt,prcp,c=blues_WTG[ic])
close(ds_dgwprcp)
end
Expand Down Expand Up @@ -149,7 +149,7 @@ begin
nmem = 0
if isfile(datadir("precipitation",fnc))
ds_dgwprcp = NCDataset(datadir("precipitation",fnc))
prcp = ds_dgwprcp["precipitation"][:] / 24
prcp = ds_dgwprcp["precipitation"][:,:] / 24
close(ds_dgwprcp)
for imem = 1 : 15
if sum(.!isnan.(prcp[:,imem])) == 6000
Expand Down
42 changes: 26 additions & 16 deletions notebooks/05-2Doutput.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.27
# v0.19.42

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -49,12 +49,12 @@ In this notebook, we investigate and develop a way to implement the WTG forcing

# ╔═╡ a63de98c-5b35-11eb-0a8f-b7a1ebd441b6
begin
configWTG = [0.02,0.05,0.1,0.2,0.5,1,2,5]
configWTG = [0.1,0.2,0.5,1]
nconWTG = length(configWTG)
blues_WTG = pplt.get_colors("Blues",(nconWTG))
lgd_WTG = Dict("frame"=>false,"ncols"=>3)
md"Loading time dimension and defining the damping experiments ..."
prcp = zeros(Float32,32,32,480,8)
olr = zeros(Float32,32,32,480,8)
md"Some preallocation and setup"
end

Expand All @@ -66,47 +66,57 @@ begin
if isone(isanim)
for ic in 1 : nconWTG

prcpii = @view prcp[:,:,:,ic]
olrii = @view olr[:,:,:,ic]

fnc = datadir(
"DGW","T0642km300V64",dampingstrprnt(configWTG[ic]),"OUT_2D",
"DGW_ExploreWTGSpace-T0642km300V64-member01-OUT2D_32.2Dcom_1.nc"
)
ds_dgwprcp = NCDataset(datadir(fnc))
NCDatasets.load!(ds_dgwprcp["TB"].var,prcpii,:,:,:)
NCDatasets.load!(ds_dgwprcp["TB"].var,olrii,:,:,:)
close(ds_dgwprcp)

end
mkpath(plotsdir("02Doutput"))

for ii = 1 : 480
pplt.close()
fts,ats = pplt.subplots(nrows=2,ncols=4,axwidth=1)
fts,ats = pplt.subplots(ncols=4,axwidth=1)

lvls = 200 : 5 : 300

for ic = 1 : nconWTG
ats[ic].pcolormesh(1:2:63,1:2:63,prcp[:,:,ii,ic],levels=lvls,cmap="Blues",extend="both")
lvls = 200 : 10 : 300

c =
ats[1].pcolormesh(1:2:63,1:2:63,olr[:,:,ii,1],levels=lvls,cmap="Blues",extend="both")
for ic = 2 : nconWTG
ats[ic].pcolormesh(1:2:63,1:2:63,olr[:,:,ii,ic],levels=lvls,cmap="Blues",extend="both")
end

for ax in ats
ax.format(
xlim=(0,64),ylim=(0,64),
xlim=(0,64),xlocator=0:16:64,xlabel="X / km",
ylim=(0,64),ylocator=0:16:64,ylabel="Y / km",
)
end

fts.savefig(plotsdir("02Doutput-$ii.png"),transparent=false,dpi=150)

ats[1].format(ltitle=L"$a_m=$0.1 day$^{-1}$")
ats[2].format(ltitle=L"$a_m=$0.2 day$^{-1}$")
ats[3].format(ltitle=L"$a_m=$0.5 day$^{-1}$")
ats[4].format(ltitle=L"$a_m=$1 day$^{-1}$")

fts.colorbar(c,label=L"$T_b$ / K")
fts.savefig(plotsdir("02Doutput/$ii.png"),transparent=false,dpi=150)
end
end
end

# ╔═╡ 42024543-700e-42bf-acd2-b9edabe73cf6
load(plotsdir("02Doutput-1.png"))
load(plotsdir("02Doutput/1.png"))

# ╔═╡ Cell order:
# ╟─e78a75c2-590f-11eb-1144-9127b0309135
# ╟─681658b0-5914-11eb-0d65-bbace277d145
# ╟─6dce35fc-5914-11eb-0ce2-0d4e164e1898
# ╟─a63de98c-5b35-11eb-0a8f-b7a1ebd441b6
# ╠═a63de98c-5b35-11eb-0a8f-b7a1ebd441b6
# ╟─be7a062d-7424-48d9-bea2-a4c58b132030
# ╟─dc06d1f6-b3ab-4c7e-9f30-cfe1bb5e9cbd
# ╟─42024543-700e-42bf-acd2-b9edabe73cf6
# ╠═42024543-700e-42bf-acd2-b9edabe73cf6
Loading

0 comments on commit 63f8111

Please sign in to comment.