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

Allow building of the ufs-weather-model, WW3 pre/post execs for GFS, GEFS, SFS in the same clone of global-workflow #3098

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

Conversation

aerorahul
Copy link
Contributor

@aerorahul aerorahul commented Nov 14, 2024

Description

GFS and GEFS (and now SFS) uses different compile time options for the UFS-weather-model. For the purposes of CI testing, a multi-build pipeline under Jenkins was created by @TerrenceMcGuinness-NOAA. This served well, until now. With the inclusion of SFS, a third variety of the model is being built. Under the multi-build pipeline paradigm, a second (or third) clone and build of the global-workflow is required. This adds cloning and compilation time of the global-workflow.

This PR allows compiling the ufs-weather-model in a single clone of the global-workflow. The compiled executables based on the options for GFS, GEFS, and SFS results in a model executable as gfs_model.x, gefs_model.x, and sfs_model.x. The forecast script uses the right executable.

This PR also differentiates the WW3 pre/post executables based on gfs_ or gefs_. SFS variants need to be introduced, when NET=sfs is added.
In the process of updating the WW3 pre/post executable names, it was discovered (via grep) the following are not used:

  • ww3_prep
  • ww3_outf
  • ww3_ounf
  • ww3_ounp
    These need to be confirmed by running the workflow to ensure they are indeed not used at runtime.

This PR also updates the Jenkinsfile to use the multi-build from the single location.

Type of change

  • New feature (adds functionality)
  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

This PR does not update any submodules.

How has this been tested?

In progress

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
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

sorc/build_ww3prepost.sh Fixed Show fixed Hide fixed
scripts/exgfs_wave_post_pnt.sh Fixed Show fixed Hide fixed
ush/wave_grib2_sbs.sh Fixed Show fixed Hide fixed
ush/wave_grib2_sbs.sh Fixed Show fixed Hide fixed
ush/wave_grib2_sbs.sh Fixed Show fixed Hide fixed
ush/wave_grid_interp_sbs.sh Fixed Show fixed Hide fixed
ush/wave_grid_moddef.sh Fixed Show fixed Hide fixed
ush/wave_prnc_cur.sh Fixed Show fixed Hide fixed
@aerorahul aerorahul changed the title Allow building of the ufs-weather-model for GFS, GEFS, SFS in the same clone of global-workflow Allow building of the ufs-weather-model, WW3 pre/post execs for GFS, GEFS, SFS in the same clone of global-workflow Dec 5, 2024
@aerorahul
Copy link
Contributor Author

I am going to mark this as ready for review to gather feedback on the code changes before I commence extensive testing.

sorc/build_ww3prepost.sh Fixed Show fixed Hide fixed
sorc/build_ww3prepost.sh Show resolved Hide resolved
ush/wave_grid_interp_sbs.sh Outdated Show resolved Hide resolved
sorc/build_ww3prepost.sh Show resolved Hide resolved
ush/wave_grid_interp_sbs.sh Outdated Show resolved Hide resolved

export pgm="${NET,,}_ww3_outp.x"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does SFS get its own executable or does it use the GEFS executable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eventually, it will. For now, SFS_POST=YES will use the gefs prefix.

@@ -8,8 +8,9 @@ APP="S2SWA"
CCPP_SUITES="FV3_GFS_v17_p8_ugwpv1,FV3_GFS_v17_coupled_p8_ugwpv1,FV3_global_nest_v1" # TODO: does the g-w need to build with all these CCPP_SUITES?
PDLIB="ON"
HYDRO="OFF"
EXEC_NAME="ufs_model.x"
Copy link
Contributor

Choose a reason for hiding this comment

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

Under what circumstances should ufs_model.x be used? Since both config.fcsts reference gfs_model.x, gefs_model.x, or sfs_model.x, it may cause issues to have ufs_model.x as the default. I'd suggest at least a warning be raised if build_ufs.sh is called without specifying an executable to build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can completely remove ufs_model.x if that is the source of confusion. ufs_model.x is going to be used if EXEC_NAME is not provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK with a default, but I think it would make sense to have a default that is useable. How about defaulting to gfs_model.x?

sorc/build_all.sh Show resolved Hide resolved
sorc/build_ufs.sh Show resolved Hide resolved
sorc/build_ww3prepost.sh Show resolved Hide resolved
sorc/link_workflow.sh Outdated Show resolved Hide resolved
Comment on lines +305 to +317
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF" ]]; then # installed with PDLIB=OFF (Used in GEFS)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gefs_${ww3exe}.x" ]] && rm -f "gefs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF/bin/${ww3exe}" "${HOMEgfs}/exec/gefs_${ww3exe}.x"
done
fi

if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gfs_${ww3exe}.x" ]] && rm -f "gfs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON/bin/${ww3exe}" "${HOMEgfs}/exec/gfs_${ww3exe}.x"
done
fi
Copy link
Contributor

@WalterKolczynski-NOAA WalterKolczynski-NOAA Dec 10, 2024

Choose a reason for hiding this comment

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

Suggested change
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF" ]]; then # installed with PDLIB=OFF (Used in GEFS)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gefs_${ww3exe}.x" ]] && rm -f "gefs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF/bin/${ww3exe}" "${HOMEgfs}/exec/gefs_${ww3exe}.x"
done
fi
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gfs_${ww3exe}.x" ]] && rm -f "gfs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON/bin/${ww3exe}" "${HOMEgfs}/exec/gfs_${ww3exe}.x"
done
fi
declare -A wave_systems
wave_systems["gfs"]="pdlib_ON"
wave_systems["gefs"]="pdlib_OFF"
wave_systems["sfs"]="pdlib_OFF"
for sys in ${!wave_systems[@]}; do
build_loc="${wave_systems[${sys}]}"
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}" ]]; then
for ww3exe in "${ww3_exes[@]}"; do
target_ww3_exe="${sys}_${ww3exe}.x"
if [[ -s "${target_ww3_exe}" ]]; then
rm -f "${target_ww3_exe}"
fi
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}/bin/${ww3exe}.x" "${HOMEgfs}/exec/${target_ww3_exe}"
done
fi
done

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 is a typo in the suggestion. Line 310

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when GFS/GEFS/SFS change their wave option? Sorry I didn't catch this before, but seeing this brought it to my attention. This should be tied to the options you pass the build, not assumptions here.. and while yes, if someone did that there would be other changes to make in terms of grid choices, but this seems pretty hidden and potentially arbitrary.

ush/wave_grid_interp_sbs.sh Outdated Show resolved Hide resolved
scripts/exgfs_wave_post_pnt.sh Outdated Show resolved Hide resolved
ush/wave_outp_spec.sh Outdated Show resolved Hide resolved
ush/wave_prnc_cur.sh Outdated Show resolved Hide resolved
ush/wave_prnc_ice.sh Outdated Show resolved Hide resolved
aerorahul and others added 8 commits December 10, 2024 12:41
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
Co-authored-by: Walter Kolczynski - NOAA <Walter.Kolczynski@noaa.gov>
…missing the name of the GEFS variant model executable that caused the gefs test to fail
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.

4 participants