- 积分
 - 746
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2011-10-7
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
 
 楼主 |
发表于 2013-3-20 20:55:20
|
显示全部楼层
 
 
 
godenflame135 发表于 2013-3-16 15:50  
主要思想如下,其余请自我发挥。 
 
!------------------------------------------------------------  
谢谢了,编出来了 
subroutine readdata 
 use  param 
 z=1 
 tt=1 
 a=1 
 b=1 
open(1,file='D:\pra\pro\name.txt') 
     do i=1,nn 
            read(1,*) name(i) 
        !        write(*,*) name(i) 
      end do 
          c_big_path="D:\pra\pro\" 
 
 
 
 
    do n=1,nn 
            
           c=mod(n,5) 
            
          if(a==0) then 
                     z=z+1 
                         !print*,z 
                    end if  
 
 
 
                        if(b==0) then 
                     tt=tt+1 
                          z=1 
                         !print*,tt 
                    end if  
 
 
             a=mod(n,5) 
                 b=mod(n,55) 
                  
                    
 
 
 
 
          c_temp1=adjustl(trim(c_big_path))//adjustl(trim(name(n))) 
          select case(c) 
            case(1) 
                open(2,file=adjustl(trim(c_temp1))) 
                          read(2,*)      
                         do j=1,y 
                             read(2,100) (h(i,j,z,tt),i=1,x) 
                                                   end do  
                                     
                close(2) 
    
              
                case(2) 
                          open(2,file=adjustl(trim(c_temp1))) 
                       read(2,*)      
                         do j=1,y 
                           read(2,100) (q(i,j,z,tt),i=1,x) 
                                                   end do  
                                    
                close(2) 
    
                case(3) 
 
                 open(2,file=adjustl(trim(c_temp1))) 
                       read(2,*)      
                         do j=1,y 
                           read(2,100) (t(i,j,z,tt),i=1,x) 
                                                   end do  
                                     
                close(2) 
 
 
                case(4) 
 
                         open(2,file=adjustl(trim(c_temp1))) 
                       read(2,*)      
                         do j=1,y 
                           read(2,100) (u(i,j,z,tt),i=1,x) 
                                                   end do  
                                     
                close(2) 
                case(0) 
 
 
                         open(2,file=adjustl(trim(c_temp1))) 
                       read(2,*)      
                         do j=1,y 
                           read(2,100) (v(i,j,z,tt),i=1,x) 
                                                   end do  
                                    
                close(2) 
 
 
                 
          end select 
                     100        format(10f8.2)                 
                        end do 
 
 
 
          
      do j=1,y 
         lat(j)=10.0+float(j-1)*1.0    
      enddo  
           
           
end subroutine readdata 
   |   
 
 
 
 |