提取温度辐射降水量FigS图代码

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")


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值