Program o : newdate
program progo
implicit none
external newdate
integer newdate,result
integer i,date,time,date2,time2,tdate,runnb,stamp
do i=0,200
date=19000101+i*10000
time=00000000
* printable to stamp
result=newdate(stamp,date,time,3)
if (result.ne.0) print *,'error:mode 3:printable to stamp'
* stamp to truedate
result=newdate(tdate,stamp,runnb,1)
if (result.ne.0) print *,'error:mode 1:stamp to truedate'
* truedate to printable
result=newdate(tdate,date2,time2,-2)
if (result.ne.0) print *,
# 'error:mode -2:truedate to printable'
* printable to truedate
result=newdate(tdate,date2,time2,2)
if (result.ne.0) print *,'error:mode 2:printable to truedate'
* truedate to stamp
result=newdate(tdate,stamp,runnb,-1)
if (result.ne.0) print *,'error:mode -1:truedate to stamp'
* stamp to printable
result=newdate(stamp,date2,time2,-3)
if (result.ne.0) print *,'error:mode -3:stamp to printable'
if ((date.ne.date2) .or. (time.ne.time2)) then
print *,'error',date,'!=',date2,' or',time,'!=',time2
endif
enddo
if(nberr.eq.0) then
print *,'Test successful'
stop
end