Skip to content

Adding large-scale blending step to regional_workflow.#540

Merged
guoqing-noaa merged 13 commits into
NOAA-GSL:feature/RRFS_dev1from
delippi:feature/RRFS_dev1
Nov 6, 2023
Merged

Adding large-scale blending step to regional_workflow.#540
guoqing-noaa merged 13 commits into
NOAA-GSL:feature/RRFS_dev1from
delippi:feature/RRFS_dev1

Conversation

@delippi
Copy link
Copy Markdown

@delippi delippi commented Jun 28, 2023

DESCRIPTION OF CHANGES:

Two python scripts were added to perform the blending and pre-blending steps: da_blending_fv3.py and da_chgres_cold2fv3.py. These python scripts perform the blending and pre-blending steps respectively by calling chgres_winds, remap_dwinds, and chgres_winds *.so files which should be compiled using f2py (see NOAA-GSL/rrfs_utl#38) such that they can be imported as python modules. The python scripts fit into the exregional_make_ics.sh script where all the necessary files are also linked or copied into the appropriate locations. Some default values for DO_BLENDING etc were also updated.

TESTS CONDUCTED:

Timing: Total added run time is about 90s. This is possible since the python scripts make use of the f2py modules and the netcdf4 library. The python is just used as glue and doesn't perform any expensive calculations.

Have tested these scripts in the context of a retro to make sure everything is called correctly, but there has not yet been any scientific evaluation. There have also not been any forecasts run from the newly blended files.

DEPENDENCIES:

Add blending and associated pre-processing tools to rrfs_utl:
NOAA-GSL/rrfs_utl#38

DOCUMENTATION:

BlendingGlobal_to_Regional_Proposal ppt: https://docs.google.com/presentation/d/1AGXqGar1rNtKOXXhoTTD_tZ6nFg8LeZQ/edit#slide=id.p1

Large Scale Blending Tests ppt:
https://docs.google.com/presentation/d/1dVN3ZphUlVv8EIpf9Tev3ZciTMHi3oUHbNUNBJjayKE/edit?pli=1#slide=id.g21875f2a523_0_15

Simplified schematic of how the blending steps fit into the workflow:
Blending and Pre-belnding drawio

v_w = np.float64(coldnc["v_w"][:, :, :]) # (128, 768, 769)

# grid data - usually has 2x as many grid points, so we need every other value.
gridx = np.float64(gridnc["x"][0:-1:2, 0:-1:2])
Copy link
Copy Markdown
Collaborator

@JacobCarley-NOAA JacobCarley-NOAA Jun 28, 2023

Choose a reason for hiding this comment

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

do you know why this has 2x as many points? is this the super grid?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No, I'm not sure why it has 2x as many. For example:

ncdump -h /lfs/h2/emc/global/noscrub/emc.global/FIX/fix/orog/20220805/C768/C768_grid.tile1.nc
netcdf C768_grid.tile1 {
dimensions:
        string = 255 ;
        nx = 1536 ;
        ny = 1536 ;
        nxp = 1537 ;
        nyp = 1537 ;

I just know that this part is related only to the wind rotation part which I was able to reproduce within rounding error.

JacobCarley-NOAA

This comment was marked as duplicate.

Comment thread ush/config_defaults.sh Outdated
# is because the radiance DA in EnKF relies the radiance procedures in the GSI-observer,
# which is mainly controled by DO_RADDA.
#
# DO_BLENDING:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggest changing DO_BLENDING to "DO_ENS_BLENDING" to make it more clear.
It is possible that we may do blending for the deterministic part in the future.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread scripts/exregional_make_ics.sh Outdated
#echo first_cycle date : ${DATE_FIRST_CYCL}${STARTHOUR}
#echo first blended cycle date : $FIRST_BLENDED_CYCLE_DATE
if [[ $cdate_crnt_fhr -ge ${FIRST_BLENDED_CYCLE_DATE} ]]; then
if [[ $DO_BLENDING == "TRUE" && $EXTRN_MDL_NAME_ICS == "GDASENKF" ]]; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Logically, lines 721-726 is expected to be put inside the if DO_BLENDING block.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, it looks like lines 726 and 727 can be combined into one line.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread scripts/exregional_make_ics.sh
Comment thread ush/config_defaults.sh Outdated
SKEBNORM="1"
SKEB_VDOF="10"
USE_ZMTNBLCK="FALSE"
BLENDING_LENGTHSCALE="960" # (Lx) in kilometers
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggest changing to "ENS_BLENDING_LENGTHSCAL"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

Comment thread scripts/da_blending_fv3.py
@delippi
Copy link
Copy Markdown
Author

delippi commented Jul 12, 2023

I'm going to close this PR and open an new PR in the new rrfs-workflow repo (https://github.com/NOAA-EMC/rrfs-workflow).

@delippi delippi closed this Jul 12, 2023
@delippi delippi reopened this Aug 11, 2023
@delippi
Copy link
Copy Markdown
Author

delippi commented Aug 11, 2023

I initially closed this to put into the other workflow, but I'm not sure where that stands so I reopened this one to get this in quicker. I also made some updates especially in run prep script for BKTYPE=3 which is warm starting from blended ics.

Comment thread scripts/exregional_make_ics.sh Outdated
ln_vrfy -sf $EXECDIR/raymond.cpython-38-x86_64-linux-gnu.so .
ln_vrfy -sf $EXECDIR/chgres_winds.cpython-38-x86_64-linux-gnu.so .
ln_vrfy -sf $EXECDIR/remap_scalar.cpython-38-x86_64-linux-gnu.so .
ln_vrfy -sf $EXECDIR/remap_dwinds.cpython-38-x86_64-linux-gnu.so .
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove the "cpython-38-x86_64-linux-gnu" text now

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@guoqing-noaa Right. Also, EXECDIR needs to be something like LIB64DIR? I don't see the path to lib64 defined anywhere.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had thought about installing those *.so files into bin/.

With this, it will be good that we change CMAKE_INSTALL_LIBDIR to CMAKE_INSTALL_BINDIR when building your blending code. CMAKE_INSTALL_LIBDIR currently holds intermediate results instead of final results. And I think these four *so files are final results.

If you agree, you may create a PR to rrfs_utl to make changes and we don't need to change EXECDIR here. Thanks!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@guoqing-noaa, I added the LIB64DIR variable.

Comment thread scripts/exregional_make_ics.sh Outdated
bndy=./gfs.bndy.nc

# Run convert coldstart files to fv3 restart (rotate winds and remap).
python da_chgres_cold2fv3.py $warm $cold $grid $akbk $akbkcold $orog
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

change "python" to "${BLENDINGPYTHON}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@guoqing-noaa, done.

Comment thread scripts/exregional_make_ics.sh Outdated
trcr=./fv_tracer.res.tile1.nc

# Blend.
python da_blending_fv3.py $Lx $glb $reg $trcr
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

change "python" to "${BLENDINGPYTHON}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@guoqing-noaa, done.

Copy link
Copy Markdown
Collaborator

@guoqing-noaa guoqing-noaa left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,229 @@
MACHINE="wcoss2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be merged with config.sh_rrfs_a_enks_c3_retro

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@hu5970 , I removed both of my blending specific configs and merged what was needed into config.sh_rrfs_a_enks_c3_retro.

Comment thread ush/config.sh_rrfs_a_c3_retro_blending Outdated
@@ -0,0 +1,142 @@
MACHINE="wcoss2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be merged with config.sh_rrfs_a_c3_retro

Comment thread ush/templates/FV3LAM_wflow.xml Outdated
</dependency>
</task>
{%- endif %}
{%- if do_ens_blending and not do_ensinit and do_spinup %}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should be combined with the recenter task in line 1282 - 1316

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@hu5970 , done. Thanks for this suggestion.

@guoqing-noaa guoqing-noaa merged commit fb2b56c into NOAA-GSL:feature/RRFS_dev1 Nov 6, 2023
@delippi delippi deleted the feature/RRFS_dev1 branch November 7, 2023 15:15
@delippi delippi restored the feature/RRFS_dev1 branch November 7, 2023 15:16
delippi pushed a commit to delippi/regional_workflow that referenced this pull request Nov 7, 2023
hu5970 pushed a commit that referenced this pull request Nov 9, 2023
Co-authored-by: donald lippi <donald.e.lippi@dlogin02.dogwood.wcoss2.ncep.noaa.gov>
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