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

Fix wave restarts and GEFS FHOUT/FHMAX #3009

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

WalterKolczynski-NOAA
Copy link
Contributor

@WalterKolczynski-NOAA WalterKolczynski-NOAA commented Oct 16, 2024

Description

Fixes some issues that were preventing wave restarts from operating correctly.

First, the wave restart files were not being correctly linked from $DATA to $DATArestart. The files are placed in the root of $DATA instead of in ${DATA}/WAVE_RESTART, so now links for the individual files are created.

Second, the incorrect filenames were being searches for and copied as part of a rerun. Filenames were geared towards multigrid waves, which use the grid names, but single grid just uses a ww3. Since multigrid waves are deprecated in workflow and will soon be removed (#2637), these were updated only supporting the single-grid option.

These fixes allow forecast segments (and emergency restarts) to work correctly when waves are on.

Additionally, the FHMAX (and FHOUT) for perturbed GEFS members was being overwritten by config.efcs due to remnant code from when it was copied from the EnKF version. This interfered with the segment setting for those GEFS members.

Resolves #3001

Type of change

  • Bug fix (fixes something broken)
  • New feature (adds functionality)
  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? NO

How has this been tested?

  • S2SW forecast-only test with segments on Hercules

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added
  • I have made corresponding changes to the system documentation if necessary

@WalterKolczynski-NOAA
Copy link
Contributor Author

ATTN: @weihuang-jedi

@@ -340,7 +340,7 @@ WW3_postdet() {
echo "Copying WW3 restarts for 'RUN=${RUN}' at '${restart_date}' from '${restart_dir}'"
local ww3_restart_file
for ww3_grid in ${waveGRD} ; do
ww3_restart_file="${restart_dir}/${restart_date:0:8}.${restart_date:8:2}0000.restart.${ww3_grid}"
ww3_restart_file="${restart_dir}/${restart_date:0:8}.${restart_date:8:2}0000.restart.ww3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line does not have a variables ww3_grid, so there is no need to loop

Comment on lines 367 to 366
for (( vdate = "${restart_date:-${PDY}${cyc}}"; vdate <= forecast_end_cycle;
vdate = $(date --utc -d "${vdate:0:8} ${vdate:8:2} + ${restart_interval} hours" +%Y%m%d%H) )); do
restart_file="${vdate:0:8}.${vdate:8:2}0000.restart.ww3"
${NLN} "${DATArestart}/WW3_RESTART/${restart_file}" "${restart_file}"
done
Copy link
Contributor

@aerorahul aerorahul Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should split this into 2 parts.
part 1 should be linking the restart for initialization. This is either the restarts at restart_date (if found above) or PDYcyc.
If it is PDYcyc, the restart_dir is COMIN_WAVE_RESTART. If it is a RERUN=YES, it is DATArestart/WW3_RESTART. This restart must exist.

part 2 is creating the links from restart_date+restart_interval to forecast_end_cycle
These are the restarts that will be created as the model integrates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a separate part to copy the initial restart in, if necessary. Just need to adjust the start date for the links when that happens.

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an issue in the forecast_postdet.sh part. Also a suggestion to break that into 2 parts.

Fixes some issues that were preventing wave restarts from operating
correctly.

First, the wave restart files were not being correctly linked from
`$DATA` to `$DATArestart`. The files are placed in the root of
`$DATA` instead of in `${DATA}/WAVE_RESTART`, so now links for the
individual files are created.

Second, the incorrect filenames were being searches for and copied
as part of a rerun. Filenames were geared towards multigrid waves,
which use the grid names, but single grid just uses a `ww3`. Since
multigrid waves are deprecated in workflow and will soon be removed
(NOAA-EMC#2637), these were updated only supporting the single-grid option.

These fixes allow forecast segments (and emergency restarts) to
work correctly when waves are on.

Resolves NOAA-EMC#3001
Removes an unnecessary loop when staging wave restarts and stops
creating output links for restart files that were already copied
in as ICs.

Also updates FHMIN_WAV when running with segments to stop creating
unneeded links from earlier in the forecast period.
@WalterKolczynski-NOAA
Copy link
Contributor Author

Will need to add in additional fixes for GEFS perturbed members, as they are ignoring the segments.

The gefs `config.efcs` still contained code from the enkf version
of the file that was overwriting the FHMAX set for segments.
@WalterKolczynski-NOAA WalterKolczynski-NOAA changed the title Fix wave restarts Fix wave restarts and GEFS FHOUT/FHMAX Oct 17, 2024
@weihuang-jedi
Copy link
Contributor

I have test the PR code on Hercules. I worked as expected. Fixed the segments issue.
Thanks @WalterKolczynski-NOAA !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible bug on GEFS fcst segment
3 participants