Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RAT Tutorial & Bug Fixed (#92) in Routing Code & download link updated #93

Merged
merged 4 commits into from
Feb 21, 2024

Conversation

SanchitMinocha
Copy link
Member

Added RAT Tutorial for beginners on 2019 Karnataka Floods.

Fixed Bug in Routing Code where it used to fail for end date in the month of February of a leap year. To address #92, we have updated Routing code as follows:

c     calculate number of days & months in simulation
      M=START_MO
      Y=START_YEAR
      NMONTHS = 0
      NDAY=0
      DO J=START_MO,12*(STOP_YEAR-START_YEAR)+STOP_MO
        IF(M.EQ.2) THEN
           LP=isaleap(Y)
        ELSE 
           LP=0
        ENDIF
        NDAY = NDAY+DAYS_IN_MONTH(M)+LP
        NMONTHS = NMONTHS + 1
        MO(NMONTHS) = M
        YR(NMONTHS) = Y
        M = M + 1
        IF (M .GT. 12) THEN
            M = 1
            Y  = Y + 1
        ENDIF
      END DO
      IF(NDAY.GT.DAYS) THEN
         PRINT*, 'IN ROUT.F RESET DAYS TO ', NDAY
         STOP
      ENDIF
      IF(STOP_MO.EQ.2) THEN
         LP=isaleap(STOP_YEAR)
      ELSE 
         LP=0
      ENDIF
	  NDAY = NDAY-(START_DAY-1)-(DAYS_IN_MONTH(STOP_MO)+LP-STOP_DAY)
      PRINT*,'NDAY = ',NDAY, ' NMONTHS = ',NMONTHS

The code has been changed from seventh last line to second last line.

Copy link
Member

@pritamd47 pritamd47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tutorial, thanks for adding instructions on how to get started with RAT. The code and added documentation files look good to be merged.

@pritamd47 pritamd47 merged commit 358911c into main Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Routing fails when end date is in the month of February of a leap year.
2 participants