Skip to content

Commit

Permalink
Add check codes in reading initial data from files for better use
Browse files Browse the repository at this point in the history
  • Loading branch information
sdhzhs committed Dec 31, 2023
1 parent 45099e1 commit 64a9368
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
29 changes: 16 additions & 13 deletions lib/Initial.f03
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Subroutine Initial
use Aero2DCOM
implicit none
integer i,j,ioerr
character(128) ioerrmsg
real(8),external:: interpl
real(8) Tni0
ca=1006.43
Expand Down Expand Up @@ -32,23 +33,25 @@ Subroutine Initial
Twi=rhoi*Tki/(mui*tvr)
end if
if(Init=='Y') then
open(unit=1,file=filename(9),form='unformatted',status='old')
read(1,iostat=ioerr) U
read(1,iostat=ioerr) U
read(1,iostat=ioerr) U
read(1,iostat=ioerr) V
read(1,iostat=ioerr) P
read(1,iostat=ioerr) T
read(1,iostat=ioerr) rho
open(unit=1,file=filename(9),form='unformatted',status='old',IOSTAT=ioerr,IOMSG=ioerrmsg)
if(ioerr>0) stop ioerrmsg
read(1,iostat=ioerr,IOMSG=ioerrmsg) U
read(1,iostat=ioerr,IOMSG=ioerrmsg) U
read(1,iostat=ioerr,IOMSG=ioerrmsg) U
read(1,iostat=ioerr,IOMSG=ioerrmsg) V
read(1,iostat=ioerr,IOMSG=ioerrmsg) P
read(1,iostat=ioerr,IOMSG=ioerrmsg) T
read(1,iostat=ioerr,IOMSG=ioerrmsg) rho
if(Turmod=='sa') then
read(1,iostat=ioerr) Tn
read(1,iostat=ioerr,IOMSG=ioerrmsg) Tn
else if(Turmod=='ke') then
read(1,iostat=ioerr) Tk
read(1,iostat=ioerr) Te
read(1,iostat=ioerr,IOMSG=ioerrmsg) Tk
read(1,iostat=ioerr,IOMSG=ioerrmsg) Te
else if(Turmod=='sst') then
read(1,iostat=ioerr) Tk
read(1,iostat=ioerr) Tw
read(1,iostat=ioerr,IOMSG=ioerrmsg) Tk
read(1,iostat=ioerr,IOMSG=ioerrmsg) Tw
end if
if(ioerr>0) STOP ioerrmsg
close(1)
print *,'Read initial data completed!'
else if(Init=='N') then
Expand Down
2 changes: 1 addition & 1 deletion src/console.f03
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Program RANSFOIL
print *,"should input a name of the configuration file."
print *,"usage: ",trim(argv(1))," [options] [configuration file]"
else if(trim(argv(2))=="--version") then
print *,"ransfoil version 2.2.16"
print *,"ransfoil version 2.2.17"
print *,"Copyright (c) 2012-2023, Hou Shuo"
else if(trim(argv(2))=="-h".or.trim(argv(2))=="--help") then
print *,"usage: ",trim(argv(1))," [options] [configuration file]"
Expand Down

0 comments on commit 64a9368

Please sign in to comment.