- 积分
- 2021
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-8-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这是我根据官网的例子写的prepbufr,恳求大神帮我看看是我哪里有问题!
program prepbufr_encode_upperair
!
! write a upper air observation into prepbufr file
!
implicit none
! integer, parameter :: mxmn=9, mxlv=58
integer, parameter :: mxlv=58
character(80):: hdstr='SID XOB YOB DHR TYP ELV SAID T29'
character(80):: obstr='POB QOB TOB ZOB'
character(80):: qcstr='PQM QQM TQM ZQM'
character(80):: oestr='POE QOE TOE NUL'
real(8) :: hdr(8,1),obs(4,mxlv),qcf(4,mxlv),oer(4,mxlv)
character(8) :: subset
integer :: unit_out=10,unit_table=20,idate,iret,nlvl
character(8) :: c_sid
real(8) :: rstation_id
equivalence(rstation_id,c_sid)
integer::num,istat
real(8)::ot(1,mxlv)
character(len=*),parameter::fdir=‘/comGSI_v3.2/caseobs/2014070300/'
!
! write observation into prepbufr file
!
open(unit_table,file='prepobs_prep.bufrtable',action='read')
open(unit=24,file=trim(fdir)//'ob20140703_00.txt',action='read',form='formatted')
open(unit_out,file=trim(fdir)//'gdas1.t00z.prepbufr',action='write',form='unformatted')
call datelen(10)
call openbf(unit_out,'OUT',unit_table)
idate=2014070300 ! cycle time: YYYYMMDDHH
subset='ADPUPA' ! upper-air (raob, drops) reports
call openmb(unit_out,subset,idate)
! set headers
hdr=10.0e10
c_sid='58238'; hdr(1,1)=rstation_id
hdr(2,1)=118.80; hdr(3,1)=32.00; hdr(4,1)=0; hdr(6,1)=7.0;
hdr(5,1)=120 ! report type: sounding
obs=10.0e10;qcf=10.0e10;oer=10.0e10
do num=1,58
read(24,*,IOSTAT=istat) obs(1,num),obs(4,num),obs(3,num),obs(2,num),ot(1,num)
qcf(1,num)=0
qcf(2,num)=0
qcf(3,num)=0
qcf(4,num)=0
oer(1,num)=0.5
oer(2,num)=1.4
oer(3,num)=1.5
if(istat/=0) exit
end do
! nlvl=num-1
print *, obs
call ufbint(unit_out,hdr,8,1,iret,hdstr)
call ufbint(unit_out,obs,4,58,iret,obstr)
call ufbint(unit_out,oer,4,58,iret,oestr)
call ufbint(unit_out,qcf,4,58,iret,qcstr)
call writsb(unit_out)
call closmg(unit_out)
call closbf(unit_out)
end program
|
|