Skip to content

Commit f996f26

Browse files
Merge pull request #514 from NCAR/mom6-time
Bug-fix: Mom6 time
2 parents 8cc6a2a + 8efab01 commit f996f26

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

CHANGELOG.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ individual files.
2222

2323
The changes are now listed with the most recent at the top.
2424

25+
**July 27 2023 :: Bug-fixes for MOM6 and WRF. Tag v10.8.1**
26+
27+
- bug-fixes:
28+
29+
- MOM6 read_model_time converts to dart time to match observation sequences.
30+
- MOM6 salinity units converted to MSU during model_interpolate.
31+
- WRF get_dist calculation fixed for observations with VERTISUNDEF.
32+
33+
- doc-fixes:
34+
35+
- WOD and GTSPP converter documentation notes about salinity units.
36+
- MOM6 documentation for setting the Gregorian calendar in CESM.
37+
- comment fix in filter_mod.f90
38+
39+
2540
**June 27 2023 :: CAM-DART observation preprocessor. Tag v10.8.0**
2641

2742
- Tool to remove observations above a given CAM level from an obs sequence file

assimilation_code/modules/assimilation/filter_mod.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ subroutine obs_space_sync_QCs(obs_fwd_op_ens_handle, &
17111711
io_task = map_pe_to_task(obs_fwd_op_ens_handle, 0)
17121712
my_task = my_task_id()
17131713

1714-
! write the obs_seq.final file
1714+
! create temp space for QC values
17151715
if (my_task == io_task) then
17161716
allocate(obs_temp(num_obs_in_set))
17171717
else

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
author = 'Data Assimilation Research Section'
2222

2323
# The full version, including alpha/beta/rc tags
24-
release = '10.8.0'
24+
release = '10.8.1'
2525
master_doc = 'README'
2626

2727
# -- General configuration ---------------------------------------------------

models/MOM6/model_mod.f90

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,21 @@ function read_model_time(filename)
950950
integer :: ncid
951951
character(len=*), parameter :: routine = 'read_model_time'
952952
real(r8) :: days
953+
type(time_type) :: mom6_time
954+
integer :: dart_base_date_in_days, dart_days
953955

956+
dart_base_date_in_days = 584388 ! 1601 1 1 0 0
954957
ncid = nc_open_file_readonly(filename, routine)
955958

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

958961
call nc_close_file(ncid, routine)
959962

960-
read_model_time = set_time(0,int(days))
963+
! MOM6 counts days from year 1
964+
! DART counts days from 1601
965+
dart_days = int(days) - dart_base_date_in_days
966+
967+
read_model_time = set_time(0,dart_days)
961968

962969
end function read_model_time
963970

models/MOM6/readme.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,48 @@ Instructions for using MOM6 in CESM are available on the `MOM_interface GitHub W
99

1010
This DART-MOM6 interface was developed for `MOM6 <https://github.com/NCAR/MOM6>`_ within the CESM framework.
1111

12+
MOM6 time
13+
---------
14+
15+
The default in CESM is to run with no leap years.
16+
To assimilate real observations, we need to switch to the Gregorian
17+
calendar to account for leap years.
18+
19+
.. code-block:: text
20+
21+
./xmlchange CALENDAR=GREGORIAN
22+
23+
To illustrate what happens if you do not set CALENDAR=GREGORIAN, here is
24+
an example where the RUN_STARTDATE is set to 2015-02-01 and MOM6 is run for 10 days.
25+
26+
.. code-block:: text
27+
28+
./xmlchange RUN_STARTDATE=2015-02-01
29+
30+
The MOM6 restart file has the following meta data, where Time is days from year 1.
31+
32+
.. code-block:: text
33+
34+
double Time(Time) ;
35+
Time:long_name = "Time" ;
36+
Time:units = "days" ;
37+
Time:axis = "T" ;
38+
...
39+
// global attributes:
40+
:filename = "./c.T62_g16.ens3.mom6.r.2015-02-11-00000._0001.nc" ;
41+
data:
42+
43+
Time = 735151 ;
44+
}
45+
46+
47+
The absence of leap years gives you inconsistent time information when comparing
48+
to observation times in YYYY-MM-DD:
49+
50+
- Restart filename has the time 2015-02-11-00000.
51+
- The Time variable is Time = 735151 days, which is 2013/10/11
52+
53+
1254
MOM6 checksum of restart files
1355
------------------------------
1456

0 commit comments

Comments
 (0)