Skip to content

add capability to dynamically generate GSI *info files #3472

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

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

Conversation

jswhit2
Copy link
Contributor

@jswhit2 jswhit2 commented Mar 18, 2025

Description

Currently config.anal has an if/then/else loop that sets env vars SATINFO, OZINFO, CONVINFO that contain paths to different gsi info files for different periods over the last several years. For reanalysis, we need a solution that works back to 1979. Rather than add to the if/then/else block in config.anal, I have created a set of scripts that generate *info files dynamically given a date (https://github.com/NOAA-PSL/build_gsinfo). What is needed is a way to use those scripts in global-workflow. Note this is only needed for GSI - for JEDI the needed functionality is included in observation_chronicle (https://github.com/NOAA-EMC/jcb-gdas/tree/develop/observation_chronicle/atmosphere).

Resolves #3293

Requires NOAA-EMC/GSI-fix#28

Enabled via USE_BUILD_GSINFO env var that can be set to YES in config.base (default is NO).
3 new scripts added (create_satinfo.sh, create_ozinfo.sh, create_convinfo.sh). These scripts generate the GSI *info for a given analysis date using data from build_gsinfo (which will live inside GSI-fix once NOAA-EMC/GSI-fix#28 is merged).

The OBS_INPUT table in the GSI namelist is removed from exglobal_atmos_analysis.sh to allow for separate options for NCEP ops and reanalysis. Both versions are included as text files in build_gsinfo/obs_input. The OBS_INPUT env var can be used to choose which version do use. The NCEP ops version is the default in config.anal.

A workaround for NOAA-EMC/GSI#752 is included in exglobal_atmos_analysis.sh (pointing to a separate directory for HIRS coefficient files). This hack can be removed once NOAA-EMC/GSI#783 is merged.

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? YES

  • Does this change require an update to any of the following submodules? YES

How has this been tested?

  • Clone and build on gaeac6 and hera
  • Cycled test on gaeac6 and hera

Checklist

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

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@jswhit2
Copy link
Contributor Author

jswhit2 commented Mar 18, 2025

@jack-woollen @jswhit2 Jeff I didn't figure out how to update your branch with the convinfo file containing complete satwnd definitions. Instead you can copy from /work2/noaa/da/jwoollen/RAEXPS/scripts/2021ozn1/build_gsinfo/convinfo/merged_convinfo.txt.

else
export OBS_INPUT=${FIXgfs}/gsi/build_gsinfo/obs_input/obs_input_ops.txt
fi
export HIRS_FIX=/gpfs/f6/drsa-precip4/proj-shared/Jeffrey.S.Whitaker/hirs_fix
Copy link
Contributor

Choose a reason for hiding this comment

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

noting a hard coded Gaea path here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @CoryMartin-NOAA - I think this needs to default to the CRTM_FIX directory and be configurable in config.anal. We won't need any of this when CRTM is updated though (hopefully).

@@ -0,0 +1,18 @@
# create global_ozinfo file for a given date
Copy link
Contributor

Choose a reason for hiding this comment

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

Need a shebang defined here?

@@ -0,0 +1,27 @@
# create global_ozinfo file for a given date
Copy link
Contributor

Choose a reason for hiding this comment

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

Another shebang needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally: These new scripts likely need to go in ush/ and need the style issues addressed

echo '! error error variational qc'
# loop over satellites
cd "${FIXgfs}/gsi/build_gsinfo/ozinfo" || exit 1
grep -v '^ *#' satellites | while IFS= read -r sat

Check notice

Code scanning / shellcheck

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
echo '!sensor/instr/sat chan iuse error error_cld ermax var_b var_pg icld_det icloud iaerosol'
# loop over satellites
cd "${FIXgfs}/gsi/build_gsinfo/satinfo" || exit 1
grep -v '^ *#' satellites | while IFS= read -r sat

Check notice

Code scanning / shellcheck

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Copy link
Contributor

@ClaraDraper-NOAA ClaraDraper-NOAA left a comment

Choose a reason for hiding this comment

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

@jswhit2 To include the soil analysis in the reanalysis / scout runs, we'll need to make changes to the convinfo and anavinfo. For the NRT system, those changes are here.

Can you please add these changes into your [conv/anav]info files? I'm not sure if it's better to include them always, or as an option.

@jswhit
Copy link

jswhit commented Apr 3, 2025

@ClaraDraper-NOAA I think you forgot to include the link. Would you be able to tell us specifically which lines to add to the. reanalysis version of convinfo (https://github.com/NOAA-PSL/build_gsinfo/blob/main/convinfo/merged_convinfo.txt)? The anavinfo changes won't be needed for the scout runs until we start running ensemble DA.

@ClaraDraper-NOAA
Copy link
Contributor

@jswhit2 To include the soil analysis in the reanalysis / scout runs, we'll need to make changes to the convinfo and anavinfo. For the NRT system, those changes are here.

Can you please add these changes into your [conv/anav]info files? I'm not sure if it's better to include them always, or as an option.

I did forget the link! It's here

@ClaraDraper-NOAA
Copy link
Contributor

ClaraDraper-NOAA commented Apr 3, 2025

If we want to assimilate 2m obs into the scout run (maybe not a great idea???), to see the changes you need, in fix/gsi/

diff global_convinfo_2mObs.txt global_convinfo.txt

If we just want to monitor them, you can leave convinfo as is. For monitoring or assim, we need to add t2m and q2m to the met_guess and state_derivative namelists in anavinfo. There's an example here on hera:

/scratch2/BMC/gsienkf/Clara.Draper/gerrit-hera/global-workflow_CNTRL/fix/global_anavinfo_2mDiag.l127.txt

@jswhit
Copy link

jswhit commented Apr 3, 2025

OK got it - thanks @ClaraDraper-NOAA

@DavidHuber-NOAA
Copy link
Contributor

Moving to draft while upstream issues are addressed. @jswhit feel free to re-mark this as ready for review when it is so.

@DavidHuber-NOAA DavidHuber-NOAA marked this pull request as draft April 10, 2025 12:25
@jswhit2 jswhit2 marked this pull request as ready for review April 15, 2025 18:46
jswhit2 added a commit to NOAA-PSL/global-workflow that referenced this pull request Apr 23, 2025
Copy link
Contributor

@DavidHuber-NOAA DavidHuber-NOAA left a comment

Choose a reason for hiding this comment

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

A few minor nit-picks. There are also a number of shell-check issues noted here: https://github.com/NOAA-EMC/global-workflow/actions/runs/14601534590/job/40960623756?pr=3472. Could you please also address these?

@@ -359,14 +367,26 @@ cd ${DATA} || exit 99
# Fixed files
${NLN} ${BERROR} berror_stats
${NLN} ${SATANGL} satbias_angle
${NLN} ${SATINFO} satinfo
if [[ ${SATINFO} == "generate" ]]; then
sh ${USHgfs}/create_satinfo.sh ${PDY}${cyc} > satinfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer that the create_satinfo.sh file be called directly. If it isn't already, that script should be made executable.

Suggested change
sh ${USHgfs}/create_satinfo.sh ${PDY}${cyc} > satinfo
${USHgfs}/create_satinfo.sh ${PDY}${cyc} > satinfo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

${NLN} ${RADCLOUDINFO} cloudy_radiance_info.txt
${NLN} ${ATMSFILTER} atms_beamwidth.txt
${NLN} ${ANAVINFO} anavinfo
${NLN} ${CONVINFO} convinfo
if [[ ${CONVINFO} == "generate" ]]; then
sh ${USHgfs}/create_convinfo.sh ${PDY}${cyc} > convinfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sh ${USHgfs}/create_convinfo.sh ${PDY}${cyc} > convinfo
${USHgfs}/create_convinfo.sh ${PDY}${cyc} > convinfo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

${NLN} ${vqcdat} vqctp001.dat
${NLN} ${INSITUINFO} insituinfo
${NLN} ${OZINFO} ozinfo
if [[ ${OZINFO} == "generate" ]]; then
sh ${USHgfs}/create_ozinfo.sh ${PDY}${cyc} > ozinfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sh ${USHgfs}/create_ozinfo.sh ${PDY}${cyc} > ozinfo
${USHgfs}/create_ozinfo.sh ${PDY}${cyc} > ozinfo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 12 to 19
for f in "${sat}"/*; do
if [[ ${f} != "${sat}/readme" ]]; then # skip readme file
datex=$(basename "${f}")
if [[ ${date} -ge ${datex} ]]; then
usedate=${datex}
fi
fi
done
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use consistent white spacing and avoid tab characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 24 to 25
echo "date not found for ${sat}"
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@danholdaway danholdaway requested a review from aerorahul May 21, 2025 19:50
@jswhit2
Copy link
Contributor Author

jswhit2 commented May 23, 2025

A few minor nit-picks. There are also a number of shell-check issues noted here: https://github.com/NOAA-EMC/global-workflow/actions/runs/14601534590/job/40960623756?pr=3472. Could you please also address these?

@DavidHuber-NOAA those shell-check errors do not appear to coming from lines I modified so I hesitate to change them.

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.

add the capabilty to dynamically generate GSI satinfo, convinfo ozinfo files for reanalysis
5 participants