-
Notifications
You must be signed in to change notification settings - Fork 49
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
ij index fix for issue #531 #549
base: main
Are you sure you want to change the base?
Conversation
Note: Still need to test UFS_forcing_ensemble_generator.py functionality on Hera. |
@grantfirl I wonder if either: |
@egrell Do you have any of the data saved somewhere on Hera that I could copy and test with to try to understand better what is going wrong? From your description, it sounds like what was intended for the -ij option just isn't what you're really looking for. This option is supposed to correspond to the native grid, not the output grid. We could probably add yet another option like "-ij_history" or something to do what you need. Nevertheless, I'd like to use some of your data to see if the algorithm is doing what was intended. It's certainly possible that something has changed in the SRW grid configuration to make the code wrong (or maybe it was never right - always possible). |
@egrell @hertneky As far as I can tell, the code is still doing what is intended. Providing the i and j indices correspond to the FV3 native grid, and this appears to still be correct. The script is looking in CXXXX_grid.tile7.halo3.nc to read in the supergrid, including halo points. Halo points are subtracted and every other point is kept, giving one the native grid. This all appears to be correct, as long as one sets n_halo_points in the script to correspond to the available CXXXX_grid.tile7.haloY.nc file correctly. Note that the native grid need not have much of a relationship to the output file grid (see https://ufs-weather-model.readthedocs.io/en/develop/InputsOutputs.html#output-files). The write component takes the output on the native grid and writes the output files how they are specified in
This grid is centered on the same point as the native grid, but uses a different projection. It also removes 20 points in the y direction and 24 points in the x direction, probably to not output data with boundary effects(?). Note that it is possible to configure the write component to write out the FV3 native grid, then the i,j indices should correspond to one-to-one to the native grid calculated from CXXXX_grid.tile7.haloY.nc, but this is not the default. If what is desired is to take indices from the files written from the write component (currently given names of dynf/phyfXXX.nc), translate those indices into lat/lon, then grab the closest point on the native grid, that is also possible, but it is basically the reverse of what is currently being done, and this doesn't really constitute a bug fix, but an added feature. @hertneky I've now tested the UFS_forcing_ensemble_generator.py addition and it works on Hera after a couple of bug fixes. This should be ready to review/approve/merge for the bug fix release. |
This has been done. It works fine as long as #563 is used. |
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.
Code changes look good. Tests provided expected results, checking that the correct point was extracted from the native grid. SCM from both produced data files ran fine.
Tested both UFS_case_gen.py:
./UFS_case_gen.py -ij 24 24 -t 4 -i /scratch1/BMC/gmtb/Dustin.Swales/SCM/replay/rt_3252959/control_c48_intel/INPUT/ -g /scratch1/BMC/gmtb/Dustin.Swales/SCM/replay/rt_3252959/control_c48_intel/INPUT/ -f /scratch1/BMC/gmtb/Dustin.Swales/SCM/replay/rt_3252959/control_c48_intel -n control_c48_intel_C_test_n000 -sc -fm 2 -vm 2
And ./UFS_forcing_ensemble_generator.py:
./UFS_forcing_ensemble_generator.py -d /scratch1/BMC/gmtb/Dustin.Swales/SCM/replay/rt_3252959/control_c48_intel -sc --C_RES 48 -dt 1200 -n control_c48_intel_C_test -sdf SCM_GFS_v17_p8 -tile 4 -is 24 -js 24
fixes #531