Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 415

Syntax errors

$
0
0

I'm new in Fortran and Visual Studio. I need to compile and run one code from the reference manual of one commercial software.

When I directly open (from windows explorer) "bintst.F" then Visual Studio recognizes that "c" and "*deck" are comments automatically. But when I create new project and copy/paste the text from "bintst.F" - syntax errors are appeared and "c" and "*deck" are not recognized. Help me please to fix it.

IDE (This project was started with a template "Intel(R) Visual Fortran console application" I switched an extension from .f90 to .F manually, just for test):

I use:

Visual Studio 2015 Professional.

Intel Visual Fortran Compiler 17.0.1.143

Windows 7 x64

Compiler is launched with:

ifort /nologo /debug:full /Od /fpp /I"C:\ANSYS\v171\ansys\customize\include" /free /warn:all /module:"Debug" /object:"Debug" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /extfor:F /Qlocation,link,"C:\MV14\VC\\bin" /Qm32 "D:\tmp\fortran\vs1\Console1\Console1\bintst.F"

 

Source code:

*deck,bintst                 USERDISTRIB                              ansys
      program bintst
c *** primary function: dumps a binary file with the name, file.rst,
c     to the screen. it then takes that file and copies it to a new
c     file, file2.rst. lastly, it dumps the file, file2.rst, to the
c     screen for comparison purposes
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c Copyright ANSYS.  All Rights Reserved.
c *** ansys, inc.
c
c  common variables:
c     iout      (int,sc,comm)     - output unit number
c     intpdp    (int,sc,comm)     - number of integers per double precision word
c     lenfnm    (int,sc,comm)     - number of characters in the filename
c     reclng    (int,sc,comm)     - system record length
c
c                           NOTE: bintst is not part of binlib.a.  it is
c                                 included only as an aid to users.
c
#include "impcom.inc"
#include "unixpm.inc"

      external binini,bintrd,bintwr,biniqr,bintfo,modinfo
      integer  biniqr
c
      integer        units, code

      character*80   title(2)
      character*260  pname,nname
      character*250  jobnam
c
      integer         iout,intpdp,lenfnm,reclng
      common /bintcm/ iout,intpdp,lenfnm,reclng
c
c          **********  define application exit mode   **********        system
      call modinfo(1,1)
c          **********  define the output unit number  **********        system
      iout   = 6
c          **********  define the number of integers per double precision
      intpdp = biniqr (0,2)
c          **********  define the number of characters in the file name
      lenfnm = biniqr (0,3)
c          **********  define the i/0 buffer page length (integer*4 words)
      reclng = biniqr (0,1)
c
c          **********  define the file names  **********                system
      pname = 'file.rst'
      nname = 'file2.rst'
c
c          **********  initialize the bin routines  **********
      call binini (iout)
c
c          **********  initialize the header common  **********
      title(1) = 'New title as given by BINTST'
      title(2) = 'New subtitle as given by BINTST'
      jobnam   = 'file    '
      units    = 0
c ---  the value for code below should be changed to appropriate 3rd party code
      code     = 200
      call bintfo (title,jobnam,units,code)

c          **********  read and list the file file.rst  **********
      call bintrd (pname)
c
c          **********  copy file file.rst to file file2.rst  **********
      call bintwr (pname,nname)
c
c          **********  read and list the file file2.rst  **********
      call bintrd (nname)
c
      stop
      end

 

 

 


Viewing all articles
Browse latest Browse all 415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>