Hi
I'm translating a old FORTRAN 77 program to MATLAB R2007. Everything was ok, until it appeared the following statement:
CODE
1 SUBROUTINE gday(idd,imm,iyear,kd)
.
.
.
20 ENTRY dmy(idd,imm,iyear,kd)
21
22 ! GIVEN THE (GREGORIAN) DAY#, KD, AS CALCULATED ABOVE IN THIS ROUTINE,
23 ! ENTRY DMY RETURNS THE (GREGORIAN) DAY, MONTH, YEAR AND CENTURY.
24
25 ! TEST FOR VALID INPUT:
26 IF(kd <= 0) WRITE(lp,5040)kd
27 5040 FORMAT(' KD = ',i7,' INVALID INPUT. DMY STOP.')
28 !
29 ! SAVE KD
30 kkd=kd
.
.
.
In the main program there is a calling to
dmy subroutine, but obviously MATLAB doesn't find the subroutine/function
dmy. My questions are:
1. Can i cut the code from line 20 to the end, paste it in a new file, and save like a separate subroutine?
2. Is there any dependence between variables previouslly declared from lines 1 to 19 and variables before line 20?
3. If answer to question 1 is no, What should i do?
Thanks!
This post has been edited by henryl: 12 Oct, 2009 - 06:21 AM