Skip to content

Commit

Permalink
200312
Browse files Browse the repository at this point in the history
  • Loading branch information
novarizark committed Mar 11, 2020
1 parent 245398f commit b4300a5
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 13 deletions.
6 changes: 2 additions & 4 deletions 1911-COAWST/ncl/200226-plot-d01-slp-vu10-gba.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ begin
;************************************************
; open file and read in data
;************************************************
casename="mangkhut-wrfonly"
casename="mangkhut"
wrfout_path="../data/1911-COAWST/"+casename+"/wrfout_d01"
g_font=0.02

Expand All @@ -34,9 +34,7 @@ begin
dim_y=dims(1)
dim_x=dims(2)

; get in wrf only tc data
wrf_tc = asciiread("../data/1911-COAWST/sandy/sandy.wrf.trck",(/dim_t,3/),"float"); (0)--lat, (1)--lon, (2)--slp


;ctrl_var2 = wrf_user_getvar(ctrl_in,"U10", -1)
;ctrl_var3 = wrf_user_getvar(ctrl_in,"V10", -1)

Expand Down
5 changes: 3 additions & 2 deletions 1911-COAWST/ncl/200304-plot-roms-SST-mangkhut.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ begin
"Oct","Nov","Dec"/)

casename="mangkhut"

fig_prefix="droms_sst_"

wrfout_path="../data/1911-COAWST/"+casename+"/wrfout_d01"
ocean_path="../data/1911-COAWST/"+casename+"/gba_ocean_his.nc"
obv_tck_file="../data/1911-COAWST/"+casename+"/trck.cma.simple"
Expand Down Expand Up @@ -174,7 +175,7 @@ do while(time_frame .lt. dim_t)
wks_type="png"
wks_type@wkWidth=800
wks_type@wkHeight=800
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/droms_sst_"+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/"+fig_prefix+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file

res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 25. ; set min contour level
Expand Down
4 changes: 2 additions & 2 deletions 1911-COAWST/ncl/200305-plot-droms-Hwave.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ begin
"Oct","Nov","Dec"/)

casename="mangkhut"

fig_prefix="droms_HWave_"
wrfout_path="../data/1911-COAWST/"+casename+"/wrfout_d01"
ocean_path="../data/1911-COAWST/"+casename+"/gba_ocean_his.nc"
obv_tck_file="../data/1911-COAWST/"+casename+"/trck.cma.simple"
Expand Down Expand Up @@ -175,7 +175,7 @@ do while(time_frame .lt. dim_t)
wks_type="png"
wks_type@wkWidth=800
wks_type@wkHeight=800
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/droms_HWave_"+sprinti("%0.3iFrm", time_frame)) ; send graphics to PNG file
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/"+fig_prefix+sprinti("%0.3iFrm", time_frame)) ; send graphics to PNG file
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 2.0 ; set min contour level
res@cnMaxLevelValF = 15 ; set max contour level
Expand Down
4 changes: 2 additions & 2 deletions 1911-COAWST/ncl/200305-plot-roms-SST-area-dep-mangkhut.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ begin
"Oct","Nov","Dec"/)

casename="mangkhut"

fig_prefix="droms_ssta_area_"
wrfout_path="../data/1911-COAWST/"+casename+"/wrfout_d01"
ocean_path="../data/1911-COAWST/"+casename+"/gba_ocean_his.nc"
obv_tck_file="../data/1911-COAWST/"+casename+"/trck.cma.simple"
Expand Down Expand Up @@ -179,7 +179,7 @@ do while(time_frame .lt. dim_t)
wks_type="png"
wks_type@wkWidth=800
wks_type@wkHeight=800
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/droms_dsst_"+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/"+fig_prefix+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file

res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = -1.5 ; set min contour level
Expand Down
4 changes: 2 additions & 2 deletions 1911-COAWST/ncl/200305-plot-roms-SST-dep-mangkhut.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ begin
"Oct","Nov","Dec"/)

casename="mangkhut"

fig_prefix="droms_ssta_"
wrfout_path="../data/1911-COAWST/"+casename+"/wrfout_d01"
ocean_path="../data/1911-COAWST/"+casename+"/gba_ocean_his.nc"
obv_tck_file="../data/1911-COAWST/"+casename+"/trck.cma.simple"
Expand Down Expand Up @@ -176,7 +176,7 @@ do while(time_frame .lt. dim_t)
wks_type="png"
wks_type@wkWidth=800
wks_type@wkHeight=800
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/droms_dsst_"+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file
wks = gsn_open_wks(wks_type,"../fig/"+casename+"/"+fig_prefix+sprinti("%0.3iFrm", ampf*time_frame)) ; send graphics to PNG file

res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = -1. ; set min contour level
Expand Down
19 changes: 19 additions & 0 deletions 1911-COAWST/script/form_gif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

PREFIX=droms_zeta_
TOTAL_STEP=145
STRT_F=0
FRAME_DT=15 # n/100 second

rm -f *noborder*

for((I=$STRT_F;I<=${TOTAL_STEP};I++))
do
TFSTMP=`printf "%.3d" $I`
echo $TFSTMP
#convert -trim +repage -bordercolor white -background white -flatten ${PREFIX}${TFSTMP}H.png ${PREFIX}noborder_${TFSTMP}H.png
convert -trim +repage -bordercolor white -background white -flatten ${PREFIX}${TFSTMP}Frm.png ${PREFIX}noborder_${TFSTMP}Frm.png
done

convert -delay ${FRAME_DT} ${PREFIX}noborder_* ${PREFIX}result.gif
convert ${PREFIX}result.gif -layers Optimize ${PREFIX}result.gif
#convert result.gif -fuzz 5% -layers Optimize result.gif
2 changes: 1 addition & 1 deletion 1911-yeq-HALOGEN/ncl/200310-plot-d01-droms-sst.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ begin
;************************************************
; open file and read in data
;************************************************
casename="wrfonly"
casename="cpl"
multi_in=True
wrfout_path="/disk/v092.yhuangci/coawst/"+casename
roms_path="/disk/v092.yhuangci/coawst/cpl/gba_ocean_avg.nc"
Expand Down
54 changes: 54 additions & 0 deletions 1911-yeq-HALOGEN/ncl/200311-replace-wrf-sst-ts.ncl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
;*******************************************************
; lcnative_2.ncl
;*******************************************************
;
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
begin
;************************************************
; open file and read in data
;************************************************
source_path="/disk/v092.yhuangci/coawst/cpl"
out_path="/disk/v092.yhuangci/coawst/wrf-with-hfsst"
multi_in=True

casename="cpl"
wrfout_path="/disk/v092.yhuangci/coawst/"+casename
g_font=0.02

mask_in = addfile (out_path+"/wrfout_d01_2016-10-16_12:00:00", "r") ; note the "s" of addfile
lsmask = wrf_user_getvar(mask_in,"LANDMASK", -1)
if multi_in then
all_files=systemfunc("ls "+source_path+"/wrfout_d01*")
len_file=dimsizes(all_files)
do ii = 0, len_file-1
fn_array=str_split(all_files(ii),"/")
fn_array=fn_array(::-1)
print(all_files(ii)+" "+fn_array(0))
tgt_file=systemfunc("ls "+out_path+"/"+fn_array(0))
if strlen(tgt_file) .gt. 0 then
ctrl_in = addfile (all_files(ii), "r") ; note the "s" of addfile
ctrl_var1 = wrf_user_getvar(ctrl_in,"SST", -1)
ctrl_var2 = wrf_user_getvar(ctrl_in,"TMN", -1)
ctrl_var3 = wrf_user_getvar(ctrl_in,"TSK", -1)

out_in = addfile(tgt_file, "w")
out_var1 = wrf_user_getvar(out_in,"SST", -1)
out_var2 = wrf_user_getvar(out_in,"TMN", -1)
out_var3 = wrf_user_getvar(out_in,"TSK", -1)
out_var1=where(lsmask .eq. 0, ctrl_var1, out_var1)
out_var2=where(lsmask .eq. 0, ctrl_var2, out_var2)
out_var3=where(lsmask .eq. 0, ctrl_var3, out_var3)
out_in->SST=out_var1
out_in->TMN=out_var2
out_in->TSK=out_var3
end if

end do
else
ctrl_in = addfile (wrfout_path, "r") ; note the "s" of addfile
end if

end

0 comments on commit b4300a5

Please sign in to comment.