-
Notifications
You must be signed in to change notification settings - Fork 168
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
Copy land increments and land DA confs to COM #1797
Changes from 8 commits
bdd67fc
5dd9539
d38d227
0060e35
a56a834
69f1d67
35104d9
81cd817
a5e36be
4e22b5a
696fbf1
c32b1b4
7c4b99c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,7 @@ def __init__(self, config): | |||||
|
||||||
_res = int(self.config['CASE'][1:]) | ||||||
_window_begin = add_to_datetime(self.runtime_config.current_cycle, -to_timedelta(f"{self.config['assim_freq']}H") / 2) | ||||||
_window_begin = add_to_datetime(_window_begin, -to_timedelta(f"1S")) | ||||||
_letkfoi_yaml = os.path.join(self.runtime_config.DATA, f"{self.runtime_config.RUN}.t{self.runtime_config['cyc']:02d}z.letkfoi.yaml") | ||||||
|
||||||
# Create a local dictionary that is repeatedly used across this class | ||||||
|
@@ -44,7 +45,7 @@ def __init__(self, config): | |||||
'npz_ges': self.config.LEVS - 1, | ||||||
'npz': self.config.LEVS - 1, | ||||||
'LAND_WINDOW_BEGIN': _window_begin, | ||||||
'LAND_WINDOW_LENGTH': f"PT{self.config['assim_freq']}H", | ||||||
'LAND_WINDOW_LENGTH': f"PT{self.config['assim_freq']}H1S", | ||||||
'OPREFIX': f"{self.runtime_config.RUN}.t{self.runtime_config.cyc:02d}z.", | ||||||
'APREFIX': f"{self.runtime_config.RUN}.t{self.runtime_config.cyc:02d}z.", | ||||||
'jedi_yaml': _letkfoi_yaml | ||||||
|
@@ -323,8 +324,10 @@ def execute(self) -> None: | |||||
def finalize(self) -> None: | ||||||
"""Performs closing actions of the Land analysis task | ||||||
This method: | ||||||
- copies analysis back to COM/ from DATA/ | ||||||
- tar and gzips the JEDI diagnostic files | ||||||
- tar and gzip the output diag files and place in COM/ | ||||||
- copy the generated YAML file from initialize to the COM/ | ||||||
- copy the analysis files to the COM/ | ||||||
- copy the increment files to the COM/ | ||||||
|
||||||
Parameters | ||||||
---------- | ||||||
|
@@ -336,6 +339,15 @@ def finalize(self) -> None: | |||||
statfile = os.path.join(self.task_config.COM_LAND_ANALYSIS, f"{self.task_config.APREFIX}landstat.tgz") | ||||||
self.tgz_diags(statfile, self.task_config.DATA) | ||||||
|
||||||
logger.info("Copy full YAML to COM") | ||||||
src = os.path.join(self.task_config['DATA'], f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.letkfoi.yaml") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, isn't this already defined as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @aerorahul for quick review. Good catch, and I made the changes as suggested. |
||||||
dest = os.path.join(self.task_config.COM_LAND_ANALYSIS, f"{self.task_config['CDUMP']}.t{self.runtime_config['cyc']:02d}z.letkfoi.yaml") | ||||||
yaml_copy = { | ||||||
'mkdir': [self.task_config.COM_LAND_ANALYSIS], | ||||||
'copy': [[src, dest]] | ||||||
} | ||||||
FileHandler(yaml_copy).sync() | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not? This is a few kb file that is a record of the exact configuration needed to reproduce results. Especially in the land case, this is different at 18z than it is at other cycles. When observations and QC have to be turned on/off these YAMLs will not always be identical and should be retained. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @CoryMartin-NOAA. In addition, I include copying the YAML files for archive to keep consistent with other DA component such as aero DA. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An update to this comment: After discussions w/ NCO, if we wish to retain cycle specific configuration artifacts such as namelists, etc. that are not already part of This will require creating a Please let me know if you have any questions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @aerorahul for the updates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As suggested, I create |
||||||
|
||||||
logger.info("Copy analysis to COM") | ||||||
template = f'{to_fv3time(self.task_config.current_cycle)}.sfc_data.tile{{tilenum}}.nc' | ||||||
anllist = [] | ||||||
|
@@ -346,6 +358,16 @@ def finalize(self) -> None: | |||||
anllist.append([src, dest]) | ||||||
FileHandler({'copy': anllist}).sync() | ||||||
|
||||||
logger.info('Copy increments to COM') | ||||||
template = f'landinc.{to_fv3time(self.task_config.current_cycle)}.sfc_data.tile{{tilenum}}.nc' | ||||||
aerorahul marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
inclist = [] | ||||||
for itile in range(1, self.task_config.ntiles + 1): | ||||||
filename = template.format(tilenum=itile) | ||||||
src = os.path.join(self.task_config.DATA, 'anl', filename) | ||||||
dest = os.path.join(self.task_config.COM_LAND_ANALYSIS, filename) | ||||||
inclist.append([src, dest]) | ||||||
FileHandler({'copy': inclist}).sync() | ||||||
|
||||||
@staticmethod | ||||||
@logit(logger) | ||||||
def get_bkg_dict(config: Dict) -> Dict[str, List[str]]: | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to do this "correctly, now don't we need to make the window_length 6hours + 1 second?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoryMartin-NOAA I conducted and compared two runs: one with window length 6 hours and the other with 6 hours + 1 second. They do show some difference from the land increment files as below:
Let's talk at tomorrow's meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoryMartin-NOAA @barlage When I conducted the snow DA cycling run with window length
6 hours + 2 seconds
which make the DA window centering at the cycle time, all thenan
values were gone. Therefore, the DA window centering at the cycle time is important.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CORRECTIONS:
My above statements are incorrect, because there are still
nan
values when the above setting with the DA window beginning at 1 second back and window length 6 hours + 2 seconds.The above with no nan values came from the experiment with the DA window beginning at 2 second back and window length 6 hours + 1 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @CoryMartin-NOAA questioned in the meeting earlier, we looked at an increment file and not all of the grids are NaN, only about 100-200 and they look to be in locations where there are snow observations, which can seen from the above nccmp. Also, there must be some increment limits in the add_increment code since these do not affect the analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CoryMartin-NOAA Okay, I will change the window length to 6hr 1sec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, if the results are the same for 6hr, 6hr-1s, 6hr+1s, then why make the change?
Also, shouldn't this be handled in the observation processing part rather than in the workflow?
Consider the case where the observations are in a single file for 24h (for e.g.), shouldn't this be teased out in the yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aerorahul this is because the 'JEDI' window convention is the opposite of the 'NCEP' window convention, and we lost that battle with Yannick a while ago. While it may be identical in this case, it shouldn't be. Observations at exactly 03z would not make it into the 06z analysis without this change. I don't quite understand you comment in the second sentence, this is what defines the window variable that goes into the templated YAML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. Lets discuss offline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CoryMartin-NOAA for the detailed explanations.
@aerorahul Without this change, about several hundreds of observations will be lost in each cycle. For example, the observations increased from 1718 to 2161 with this changes.