VALUE=new((/31,24,53/),string)
do i=1,31
if (i .lt. 10) then
file_obs="china_sites_2020080"+i+".csv"
else
file_obs="china_sites_202008"+i+".csv"
end if
row = 361
col = 1673
readvalue=new((/row,col/),string)
f_h = asciiread("sitelist.csv",-1,"string")
delim=","
site=str_get_field(f_h,1,delim)
allvalue=asciiread(file_obs,-1,"string")
allvalue@_Fillvalue="-999"
do u=1,col
readvalue(0:360,u-1)=str_get_field(allvalue,u,delim)
readvalue@_Fillvalue="-999"
end do
type=str_get_field(allvalue,3,delim)
Col=0
Row=0
do j=1,346,15
do k=3,col-1
if (any(site .eq. readvalue(0,k) )) then
VALUE(i-1,Row,Col) = readvalue(j,k)
Col=Col+1
end if
end do
Row=Row+1
Col=0
end do
end do
VALUE!0="day"
VALUE!1="hour"
VALUE!2="site"
reValue=VALUE(site|:,day|:,hour|:)
write_table("AQI8_27.csv","w",[/reValue(0,0,8:23),reValue(1,0,8:23),reValue(2,0,8:23),reValue(3,0,8:23),reValue(4,0,8:23),reValue(5,0,8:23),reValue(6,0,8:23),reValue(7,0,8:23),reValue(8,0,8:23),reValue(9,0,8:23),reValue(10,0,8:23),reValue(11,0,8:23),reValue(12,0,8:23),reValue(13,0,8:23),reValue(14,0,8:23),reValue(15,0,8:23),reValue(16,0,8:23),reValue(17,0,8:23),reValue(18,0,8:23),reValue(19,0,8:23),reValue(20,0,8:23),reValue(21,0,8:23),reValue(22,0,8:23),reValue(23,0,8:23),reValue(24,0,8:23),reValue(25,0,8:23),reValue(26,0,8:23)/],"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s")
write_table("AQI8_26.csv","w",[/reValue(27,0,8:23),reValue(28,0,8:23),reValue(29,0,8:23),reValue(30,0,8:23),reValue(31,0,8:23),reValue(32,0,8:23),reValue(33,0,8:23),reValue(34,0,8:23),reValue(35,0,8:23),reValue(36,0,8:23),reValue(37,0,8:23),reValue(38,0,8:23),reValue(39,0,8:23),reValue(40,0,8:23),reValue(41,0,8:23),reValue(42,0,8:23),reValue(43,0,8:23),reValue(44,0,8:23),reValue(45,0,8:23),reValue(46,0,8:23),reValue(47,0,8:23),reValue(48,0,8:23),reValue(49,0,8:23),reValue(50,0,8:23),reValue(51,0,8:23),reValue(52,0,8:23)/],"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s")
write_table("AQI8_27.csv","a",[/reValue(0,1:,:),reValue(1,1:,:),reValue(2,1:,:),reValue(3,1:,:),reValue(4,1:,:),reValue(5,1:,:),reValue(6,1:,:),reValue(7,1:,:),reValue(8,1:,:),reValue(9,1:,:),reValue(10,1:,:),reValue(11,1:,:),reValue(12,1:,:),reValue(13,1:,:),reValue(14,1:,:),reValue(15,1:,:),reValue(16,1:,:),reValue(17,1:,:),reValue(18,1:,:),reValue(19,1:,:),reValue(20,1:,:),reValue(21,1:,:),reValue(22,1:,:),reValue(23,1:,:),reValue(24,1:,:),reValue(25,1:,:),reValue(26,1:,:)/],"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s")
write_table("AQI8_26.csv","a",[/reValue(27,1:,:),reValue(28,1:,:),reValue(29,1:,:),reValue(30,1:,:),reValue(31,1:,:),reValue(32,1:,:),reValue(33,1:,:),reValue(34,1:,:),reValue(35,1:,:),reValue(36,1:,:),reValue(37,1:,:),reValue(38,1:,:),reValue(39,1:,:),reValue(40,1:,:),reValue(41,1:,:),reValue(42,1:,:),reValue(43,1:,:),reValue(44,1:,:),reValue(45,1:,:),reValue(46,1:,:),reValue(47,1:,:),reValue(48,1:,:),reValue(49,1:,:),reValue(50,1:,:),reValue(51,1:,:),reValue(52,1:,:)/],"%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s")
【无标题】
最新推荐文章于 2024-10-09 22:27:58 发布