首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当尝试打开文本文件时,Fortran代码产生运行时错误'operation not supported‘

当尝试打开文本文件时,Fortran代码产生运行时错误'operation not supported‘
EN

Stack Overflow用户
提问于 2019-10-22 13:48:10
回答 1查看 189关注 0票数 0

我正在尝试运行一段用f95编写的fortran代码。我在Ubuntu中使用gfortran编译了它。

在代码中有一个读入文本文件的命令。当我运行它时,它给出了以下错误:

代码语言:javascript
复制
    Fortran runtime error: Cannot open file 'input_parameters.txt': Operation not supported

这是我们尝试读取文本文件之前的代码:

代码语言:javascript
复制
    program LSmodel
    implicit none !this is a fortran thing that means that all variables that start with i,j,k,l,m,n are integers. 

    real :: sec,ran,gasdev                        ! random generator variables
    real :: x,y,z,u,v,w,ut,vt,wt,t,dt             ! simulation variables
    real :: wg                                    ! seed parametes
    real :: Um,sigma_u,sigma_v,sigma_w,uw         ! wind statistics variables
    real :: dvaru_dz,dvarv_dz,dvarw_dz,duw_dz     ! wind statistics variables
    real :: dissip_m,TL                           ! vector over the range of ustars
    real :: zs,zg,zmax                            ! release height & boundaries
    real :: Ainv,C0inv                            ! inverse parameters
    real :: C0,A,b,au,av,aw,dt_on_TL              ! LS model parameters
    real :: dz_max,dt_max                         ! time step limit
    real :: CT,beta                               ! Crossing Trajectories correction
    real :: C_chi,chi,TKE,T_chi,omega             ! DI parameters
    real :: a_ln,b_ln,sigma_chi,dissip_s          ! DI parameters
    real :: rhop,rho,r,g,gt,Re,AIP,Cd,nu          ! IP parameters
    real :: up,vp,wp,upt,vpt,wpt,vr,dt_ip,alpha   ! IP parameters
real :: keepseed, maxheight
    integer :: seed                              ! random generator variables, keepseed decides whether to keep the same seed or not for comparison of simulation
    integer :: pnum, traj_exit     ! simulation parameters. traj_exit counts the number of particles that have exited from the topo f the wind flow. 
    integer :: i,j,jj,n,ii                        ! counting parameters
    integer :: n_ip,IP=1                          ! IP parameters
    character(len=80) :: filename, wgchar, foldername
    real, allocatable,dimension(:) ::  z_vec,Um_vec,sigma_u_vec,sigma_v_vec,sigma_w_vec,uw_vec
    real, allocatable,dimension(:) ::  dvaru_dz_vec,dvarv_dz_vec,dvarw_dz_vec,duw_dz_vec,dissip_m_vec


    ! input
    open (23,file='input_parameters.txt') !opening a file for the input parameters....
    read (23, *) x,C0,wg,zs,zg,beta,dt_on_TL,y,sigma_chi,C_chi,r,rhop,alpha,rho,nu, keepseed, foldername
    close(23)

我正在运行Ubuntu 18.04.2 LTS。

EN

回答 1

Stack Overflow用户

发布于 2019-10-24 12:06:44

更新-我已经找到了(我相信)这个代码不能工作的原因,尽管我不知道为什么。

文件夹在网络驱动器中,而不是在本地计算机上。一旦我把文件夹移到我的本地计算机上,我就不再收到这个错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58497773

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档