Skip to content

filter_mod default for init_time #1041

@hkershaw-brown

Description

@hkershaw-brown

Note on this,
The default for init_time_days|seconds is 0,0

! if init_time_days and seconds are negative initial time is 0, 0
! for no restart or comes from restart if restart exists
integer :: init_time_days = 0
integer :: init_time_seconds = 0

So you have to give
filter_nml
init_time_days = -1
to read time from a restart file

The check in filter_set_inital_time is on only on days >=0 not on both namelist inputs as the comment suggests:

! Set a time type for initial time if namelist inputs are not negative
call filter_set_initial_time(init_time_days, init_time_seconds, time1, read_time_from_file)

subroutine filter_set_initial_time(days, seconds, dart_time, read_time_from_file)
integer, intent(in) :: days, seconds
type(time_type), intent(out) :: dart_time
logical, intent(out) :: read_time_from_file
if(days >= 0) then
dart_time = set_time(seconds, days)
read_time_from_file = .false.
else
dart_time = set_time(0, 0)
read_time_from_file = .true.
endif
end subroutine filter_set_initial_time

So not giving init_time_days

filter_nml
init_time_seconds = -1

ERROR FROM:
  source : time_manager_mod.f90
  routine: set_time
  message:  seconds, days are           -1           0  cannot be negative

https://docs.dart.ucar.edu/en/latest/assimilation_code/modules/assimilation/filter_mod.html#module-filter-mod

+------------------------------+---------------------+-------------------------------------------+
| init_time_days               | integer             | If negative, use the initial days read    |
|                              |                     | from the state data restart file.         |
|                              |                     | If positive, override the initial days    |
|                              |                     | read from state data restart files.       |
|                              |                     | Days since 1 Jan 1601.                    |
+------------------------------+---------------------+-------------------------------------------+
| init_time_seconds            | integer             | If negative use the initial seconds read  |
|                              |                     | from the state data restart file.         |
|                              |                     | If positive, override the initial seconds |
|                              |                     | read from state data restart files.       |
|                              |                     | Seconds since midnight.                   |
+------------------------------+---------------------+-------------------------------------------+

If you only give X seconds, the time is set to (0 days, X seconds)
not (model days, X seconds)

init_time_days is controlling the true|false from read_time_from_file and days, seconds can not be set independently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions