- 积分
- 139
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-3-10
- 最后登录
- 1970-1-1
|
Fortran
系统平台: |
Fortran |
问题概况: |
Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument. [NINO]
Error 2 error #6633: The type of the actual argument differs from the type of the dummy argument. [NINOM]
Error 3 error #6633: The type of the actual argument differs from the type of the dummy argument. [NINOS] |
问题截图: |
- |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
1 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 superwawa 于 2017-4-6 09:45 编辑
program partialcorr
implicit none
integer i,j,k,irec
integer,parameter::ix=140,iy=180,it=29
real sh(it),r(ix,iy,it),nino(it),r12(ix,iy),r13,r23(ix,iy),pcor(ix,iy),shm,shs,rm(ix,iy),rs(ix,iy),ninom,ninos
open(11,file='D:\data\TP.SH.son.le10yr.1982-2010.MAM.txt',form='formatted')!读取春季感热资料
!open (44,file='D:\figure\sssss.txt')
do k=1,it
read(11,"(f8.5)") sh(k)
!write(44,"(f8.5)") sh(k)
end do
close(11)
!close(44)
open(unit=22,file='D:\figure\r_mam.dat',form='binary',access='direct',recl=4*ix*iy)!读取春季降水资料
irec=1
do k=1,it
read(22,rec=irec) ((r(i,j,k),i=1,ix),j=1,iy)
irec=irec+1
end do
close(22)
open(33,file='D:\data\nino.txt',form='formatted')!读取异常海温资料
!open (66,file='D:\figure\nnnnn.txt')
do k=1,it
read(33,"(f5.2)") nino(k)
!write(66,"(f5.2)") nino(k)
end do
close(33)
!close(66)
open(77,file='D:\figure\partialcor_mam.dat',form='binary',access='direct',recl=4*ix*iy)!写出偏相关系数资料
call cor12(sh,r,ix,iy,it,r12)
call cor13(sh,nino,it,r13)
call cor23(r,nino,ix,iy,it,r23)
do j=1,iy
do i=1,ix
pcor(i,j)=0.0
end do
end do
do j=1,iy
do i=1,ix
pcor(i,j)=(r12(i,j)-r13*r23(i,j))/(sqrt(1-r13*r13)*sqrt(1-r23(i,j)*r23(i,j)))
end do
end do
do j=1,iy
write(77,rec=irec) (pcor(i,j),i=1,ix)
irec=irec+1
end do
close(11)
close(22)
close(33)
close(77)
stop
end
subroutine cor12(sh,r,ix,iy,it,r12) !计算春季感热与春季降水的相关系数
dimension sh(it),r(ix,iy,it),r12(ix,iy),rm(ix,iy),rs(ix,iy)
call nor(sh,it,shm,shs)
call nors(r,ix,iy,it,rm,rs)
do j=1,iy
do i=1,ix
r12(i,j)=0.0
end do
end do
do k=1,it
do j=1,iy
do i=1,ix
r12(i,j)=r12(i,j)+sh(k)*r(i,j,k)
end do
end do
end do
!write(*,*) r(50,50,1),sh(6)
do j=1,iy
do i=1,ix
r12(i,j)=r12(i,j)/float(it)
end do
end do
return
end subroutine
subroutine cor13(sh,nino,it,r13) !计算春季感热与异常海温的相关系数
dimension sh(it),nino(it)
call nor(sh,it,shm,shs)
call nor(nino,it,ninom,ninos)
write(*,*) nino(6)
r13=0.0
do 13 k=1,it
13 r13=r13+sh(k)*nino(k)
r13=r13/float(it)
return
end subroutine
subroutine cor23(r,nino,ix,iy,it,r23) !计算春季降水与异常海温的相关系数
dimension r(ix,iy,it),nino(it),r23(ix,iy),rm(ix,iy),rs(ix,iy)
call nors(r,ix,iy,it,rm,rs)
call nor(nino,it,nm,ns)
do j=1,iy
do i=1,ix
r23(i,j)=0.0
end do
end do
do k=1,it
do j=1,iy
do i=1,ix
r23(i,j)=r23(i,j)+r(i,j,k)*nino(k)
end do
end do
end do
do j=1,iy
do i=1,ix
r23(i,j)=r23(i,j)/float(it)
end do
end do
return
end subroutine
subroutine nor(sh,it,shm,shs)
dimension sh(it)
shm=0.0
shs=0.0
do 1 k=1,it
shm=shm+sh(k)
shs=shs+sh(k)*sh(k)
1 continue
shm=shm/float(it)
shs=shs-it*shm*shm
shs=sqrt(shs/float(it))
do 2 k=1,it
2 sh(k)=(sh(k)-shm)/shs
return
end subroutine
subroutine nors(r,ix,iy,it,rm,rs)
dimension r(ix,iy,it),rm(ix,iy),rs(ix,iy)
do j=1,iy
do i=1,ix
rm(i,j)=0.0
rs(i,j)=0.0
end do
end do
do k=1,it
do j=1,iy
do i=1,ix
rm(i,j)=rm(i,j)+r(i,j,k)
rs(i,j)=rs(i,j)+r(i,j,k)*r(i,j,k)
end do
end do
end do
do j=1,iy
do i=1,ix
rm(i,j)=rm(i,j)/float(it)
rs(i,j)=rs(i,j)-it*rm(i,j)*rm(i,j)
rs(i,j)=sqrt(rs(i,j)/float(it))
end do
end do
do k=1,it
do j=1,iy
do i=1,ix
r(i,j,k)=(r(i,j,k)-rm(i,j))/rs(i,j)
end do
end do
end do
return
end subroutine
subroutine nor(nino,it,ninom,ninos)
dimension nino(it)
ninom=0.0
ninos=0.0
do 3 k=1,it
ninom=ninom+nino(k)
ninos=ninos+nino(k)*nino(k)
3 continue
ninom=ninom/float(it)
ninos=ninos-it*ninom*ninom
ninos=sqrt(ninos/float(it))
do 4 k=1,it
4 nino(k)=(nino(k)-ninom)/ninos
return
end subroutine
|
|