Skip to content

Commit

Permalink
Fix to repeat forcing day when exp is on leap day. #22
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Apr 15, 2020
1 parent c30e907 commit dab745c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion libcouple/src/accessom2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ module accessom2_mod
type(datetime) :: exp_cur_date, forcing_cur_date
type(datetime) :: run_start_date, run_end_date

integer, dimension(3) :: skip_date_mismatch_date

contains
private
procedure, pass(self), public :: init => accessom2_init
Expand Down Expand Up @@ -554,7 +556,19 @@ subroutine accessom2_progress_date(self, timestep)
self%forcing_cur_date%getDay() == 1)) then

self%forcing_cur_date = self%forcing_cur_date - timedelta(days=1)
check_for_date_mismatch = .false.
! Skip the date mismatch checking for the whole day
self%skip_date_mismatch_date(1) = self%exp_cur_date%getYear()
self%skip_date_mismatch_date(2) = self%exp_cur_date%getMonth()
self%skip_date_mismatch_date(3) = self%exp_cur_date%getDay()
endif

! Don't check for date mismatch if we are replaying the forcing day
if (self%exp_cur_date%getYear() == self%skip_date_mismatch_date(1) .and. &
self%exp_cur_date%getMonth() == self%skip_date_mismatch_date(2) .and. &
self%exp_cur_date%getDay() == self%skip_date_mismatch_date(3)) then
return
else
self%skip_date_mismatch_date(:) = 0
endif

! Expect the forcing date and experiment date to only differ on the year.
Expand Down

0 comments on commit dab745c

Please sign in to comment.