Skip to content

Commit

Permalink
Merge pull request #514 from NCAR/mom6-time
Browse files Browse the repository at this point in the history
Bug-fix: Mom6 time
  • Loading branch information
hkershaw-brown authored Jul 27, 2023
2 parents 8cc6a2a + 8efab01 commit f996f26
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ individual files.

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

**July 27 2023 :: Bug-fixes for MOM6 and WRF. Tag v10.8.1**

- bug-fixes:

- MOM6 read_model_time converts to dart time to match observation sequences.
- MOM6 salinity units converted to MSU during model_interpolate.
- WRF get_dist calculation fixed for observations with VERTISUNDEF.

- doc-fixes:

- WOD and GTSPP converter documentation notes about salinity units.
- MOM6 documentation for setting the Gregorian calendar in CESM.
- comment fix in filter_mod.f90


**June 27 2023 :: CAM-DART observation preprocessor. Tag v10.8.0**

- Tool to remove observations above a given CAM level from an obs sequence file
Expand Down
2 changes: 1 addition & 1 deletion assimilation_code/modules/assimilation/filter_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ subroutine obs_space_sync_QCs(obs_fwd_op_ens_handle, &
io_task = map_pe_to_task(obs_fwd_op_ens_handle, 0)
my_task = my_task_id()

! write the obs_seq.final file
! create temp space for QC values
if (my_task == io_task) then
allocate(obs_temp(num_obs_in_set))
else
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '10.8.0'
release = '10.8.1'
master_doc = 'README'

# -- General configuration ---------------------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion models/MOM6/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -950,14 +950,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
42 changes: 42 additions & 0 deletions models/MOM6/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,48 @@ Instructions for using MOM6 in CESM are available on the `MOM_interface GitHub W

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

MOM6 time
---------

The default in CESM is to run with no leap years.
To assimilate real observations, we need to switch to the Gregorian
calendar to account for leap years.

.. code-block:: text
./xmlchange CALENDAR=GREGORIAN
To illustrate what happens if you do not set CALENDAR=GREGORIAN, here is
an example where the RUN_STARTDATE is set to 2015-02-01 and MOM6 is run for 10 days.

.. code-block:: text
./xmlchange RUN_STARTDATE=2015-02-01
The MOM6 restart file has the following meta data, where Time is days from year 1.

.. code-block:: text
double Time(Time) ;
Time:long_name = "Time" ;
Time:units = "days" ;
Time:axis = "T" ;
...
// global attributes:
:filename = "./c.T62_g16.ens3.mom6.r.2015-02-11-00000._0001.nc" ;
data:
Time = 735151 ;
}
The absence of leap years gives you inconsistent time information when comparing
to observation times in YYYY-MM-DD:

- Restart filename has the time 2015-02-11-00000.
- The Time variable is Time = 735151 days, which is 2013/10/11


MOM6 checksum of restart files
------------------------------

Expand Down

0 comments on commit f996f26

Please sign in to comment.