Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicecore: correct initial condition metadata #818

Merged
merged 2 commits into from
Mar 13, 2023

Commits on Mar 13, 2023

  1. ice_history_write: fix initial condition metadata under 'hist_avg'

    When writing averaged history outputs (hist_avg=.true.), this setting
    also affects the initial condition. Even if the actual data variables
    written to the initial condition are not averaged (they are taken
    more or less directly from the restart or the hard-coded defaults,
    modulo aggregation over categories), their attributes ('cell_method' and
    'time_rep') imply they are averaged, and the 'bound' attribute of the
    'time' variable refers to the 'time_bounds' variable.
    
    Make the metadata of the initial condition more correct by:
    - not writing the 'time_bounds' variable (and the corresponding 'd2' dimension)
    - not writing the 'bounds' attribute of the 'time' variable
    - not writing the 'cell_method' attributes of each variable
    - writing the 'time_rep' attribute of each variable as 'instantaneous'
    instead of 'averaged'.
    
    Do this by checking 'write_ic' at all places where we check for the
    value of 'hist_avg' to write the above variables and attributes in each
    of the 3 IO backends (binary, netcdf, pio2).
    phil-blain committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    9f4504d View commit details
    Browse the repository at this point in the history
  2. drivers/{nemo_concepts,standalone}: write initial condition at initia…

    …l time
    
    In CICE_InitMod::cice_init, we call ice_calendar::advance_timestep
    before writing the initial condition, such that the 'time' variable in
    the initial condition is not zero; it has a value of 1*dt (the model
    time step). The initial condition filename also reflects this, since
    'msec' (model seconds) also has a value of 1*dt and is used in
    ice_history_shared::construct_filename. This leads to the initial
    condition filename not corresponding to the model initialization
    date/time but rather 1*dt later.
    
    Since we call 'accum_hist' after initializing the forcing, any forcing
    field written to the initial condition has values corresponding to
    msec=dt, whereas the ice state corresponds to msec=0, leading to an
    inconsistency.
    
    Fix that by calling 'accum_hist' to write the initial condition _before_
    calling 'advance_timestep'. Since we now call 'accum_hist' before
    initializing the forcing, any forcing field written to the initial
    condition have its default, hard-coded value, instead of its value at
    time=dt. An improvement would be to read the forcing at time=dt, write
    the initial condition, advance the time step, and read the forcing
    again, but let's not complicate things too much for now.
    phil-blain committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    d72cdf9 View commit details
    Browse the repository at this point in the history