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/csm/contributed.ncl"
wrffile=addfile("/data1/loucx/COPY/WRF/WRF/run/wrfout_d03_2020-08-01_00:00:00","r")
lat2d=wrffile->XLAT(0,3:176,3:170)
lon2d=wrffile->XLONG(0,3:176,3:170)
dims = dimsizes(lat2d)
geofile1=addfile("/glade/home/loucx/cctm202008/ZJ_CMAQ_appmap.nc","r")
flag=geofile1->ZJ_1(0,0,:,:)
DataDir1 = "/data1/loucx/COPY/WRF/DATA/WRF/"
flist1 = systemfunc("ls "+DataDir1+"wrfout_d03_2020*")
Sfile1 = addfiles(flist1, "r")
ListSetType (Sfile1, "cat")
t2=Sfile1[:]->T2(:,3:176,3:170)-273.15 ;31 24 174 168
fushe=Sfile1[:]->SWDOWN(:,3:176,3:170)
jiangshui=Sfile1[:]->RAINNC(:,3:176,3:170)+Sfile1[:]->RAINC(:,3:176,3:170)+Sfile1[:]->RAINSH(:,3:176,3:170)
VALUE1=new((/31,174,168/),float)
VALUE2=new((/31,174,168/),float)
VALUE3=new((/31,174,168/),float)
do i=0,173
do j=0,167
VALUE1(0,i,j)=avg(t2(0:12,i,j))
VALUE2(0,i,j)=avg(fushe(0:12,i,j))
VALUE3(0,i,j)=jiangshui(12,i,j)
end do
end do
do i=0,173
do j=0,167
u=1
do s=24,720,24
VALUE1(u,i,j)=avg(t2(s:s+12,i,j))
VALUE2(u,i,j)=avg(fushe(s:s+12,i,j))
VALUE3(u,i,j)=jiangshui(s+12,i,j)-jiangshui(s,i,j) ;everyday
u=u+1
end do
end do
end do
L1=new((/31/),float)
L2=new((/31/),float)
L3=new((/31/),float)
do st=0,30
num1=0
sumflag=0.0
w=new((/29232/),float)
m=new((/29232/),float)
t=new((/29232/),float)
do i=0,173
do j=0,167
if(flag(i,j) .ne. 0) then
w(num1)=VALUE1(st,i,j)*flag(i,j)
m(num1)=VALUE2(st,i,j)*flag(i,j)
t(num1)=VALUE3(st,i,j)*flag(i,j)
num1=num1+1
sumflag=sumflag+flag(i,j)
end if
end do
end do
L1(st)=sum(w)/sumflag
L2(st)=sum(m)/sumflag
L3(st)=sum(t)/sumflag
end do
write_table("31qixiang.csv", "w", [/"T2,SWDOWN,precipitation"/], "%s,%s,%s")
write_table("31qixiang.csv","a",[/L1,L2,L3/],"%8.2f,%8.2f,%8.2f")
提取温度辐射降水量FigS图代码
最新推荐文章于 2024-11-13 21:56:56 发布