ESCOMP / CAM

Community Atmosphere Model
77 stars 142 forks source link

time_bounds array should not be present in history files containing instantaneous output #1166

Open phillips-ad opened 3 weeks ago

phillips-ad commented 3 weeks ago

What happened?

The time_bounds array is present in instantaneous history files as seen in output from the CESM3 BMT1850 104 run. Based on previous discussions on this, the time_bounds array should not be present in instantaneous history files.

What are the steps to reproduce the bug?

An example of time_bounds being present in a monthly instantaneous history file: /glade/derecho/scratch/hannay/archive/b.e30_beta02.BMT1850.ne30_t232.104/atm/hist/b.e30_beta02.BMT1850.ne30_t232.104.cam.h0i.0010-01.nc

and in a daily instantaneous history file: /glade/derecho/scratch/hannay/archive/b.e30_beta02.BMT1850.ne30_t232.104/atm/hist/b.e30_beta02.BMT1850.ne30_t232.104.cam.h2i.0104-12-13-00000.nc

What CAM tag were you using?

cam6_4_014

What machine were you running CAM on?

CISL machine (e.g. cheyenne)

What compiler were you using?

Other (please specify below)

Path to a case directory, if applicable

/glade/campaign/cesm/cesmdata/cseg/runs/cesm2_0/b.e30_beta02.BMT1850.ne30_t232.104

Will you be addressing this bug yourself?

No

Extra info

No response

swrneale commented 2 weeks ago

Who is putting instantaneous data on monthly files? That seems odd (but maybe the maximum over a month would be a somewhat sensible output? Are we outputting h0i by default still though regardless if we have actually requested instantaneous output?

phillips-ad commented 2 weeks ago

I too do not know why there is instantaneous monthly output, or why someone would want it. I edited my original post to note that the time_bounds array is present in all h?i files and not just specifically the monthly h0i files.

brian-eaton commented 2 weeks ago

The reason you always get a monthly instantaneous file is due to the scalar data that is contained in the header, e.g., co2vmr, sol_tsi, etc. These data are written to the file at the same time the monthly avg values are written, i.e., at the end of the month. Since the timestamp for all averaged output was moved to the time interval midpoint, it was no longer correct for the scalars added at the end of the time period. The easy fix was to always add a corresponding instantaneous file whenever averaged data is requested, and that file contains the scalars that are written at the end of the time interval. As it turns out, the monthly file that Adam points to does have some instantaneous fields: SAD_AERO, SAD_SULFC, SAD_TROP. On the other hand, the instantaneous daily file only contains the scalar fields.