Skip to content

Commit

Permalink
converts mom6 time (days from year 0) to dart time (from 1601)
Browse files Browse the repository at this point in the history
see #494 for discusion.
I'm still not sure whether write_time should match the obs or the
model
  • Loading branch information
hkershaw-brown committed Jul 18, 2023
1 parent 1b76f3a commit b2363b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion models/MOM6/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -945,14 +945,21 @@ function read_model_time(filename)
integer :: ncid
character(len=*), parameter :: routine = 'read_model_time'
real(r8) :: days
type(time_type) :: mom6_time
integer :: dart_base_date_in_days, dart_days

dart_base_date_in_days = 584388 ! 1601 1 1 0 0
ncid = nc_open_file_readonly(filename, routine)

call nc_get_variable(ncid, 'Time', days, routine)

call nc_close_file(ncid, routine)

read_model_time = set_time(0,int(days))
! MOM6 counts days from year 1
! DART counts days from 1601
dart_days = int(days) - dart_base_date_in_days

read_model_time = set_time(0,dart_days)

end function read_model_time

Expand Down

0 comments on commit b2363b7

Please sign in to comment.