Add METplus-based ensemble verification#575
Conversation
…tat with METplus. Updated MET and METplus config files.
…grid-stat vx. Updated run_gridstatvx script.
…og/, rather than default logs/.
…elop to this feature branch
jwolff-ncar
left a comment
There was a problem hiding this comment.
Provided some inline comments. I am happy to chat about any of these if we need to iterate on them.
|
|
||
| os.system('cp '+MRMS_PROD_DIR+'/'+valid.strftime('%Y%m%d')+'/dcom/us007003/ldmdata/obs/upperair/mrms/conus/'+MRMS_PRODUCT+'/'+filename1+' '+VALID_DIR+'/'+filename2) | ||
| os.system('gunzip '+VALID_DIR+'/'+filename2) | ||
| os.system('gunzip '+VALID_DIR+'/'+filename2) |
There was a problem hiding this comment.
This change is also associated with PR #571 so they just need to be coordinated depending on timing of which one goes in first.
| @@ -42,6 +42,8 @@ RUN_TASK_GET_OBS_MRMS="FALSE" | |||
| RUN_TASK_GET_OBS_NDAS="FALSE" | |||
There was a problem hiding this comment.
Do we want to add anything in this file as a place holder for ensemble runs? Not required, but I mention it for thoughts from others? (Turn off ensemble but list it? For example:)
DO_ENSEMBLE="FALSE"
NUM_ENS_MEMBERS="2"
There was a problem hiding this comment.
I think that'd be appropriate.
There was a problem hiding this comment.
Thanks - I added this into ush/config.community.sh
| # | ||
| # Load the .local module file if available for the given task | ||
| # | ||
| set +u |
There was a problem hiding this comment.
This will also need to be coordinated with PR#571 - still in progress to get to the final settings here.
There was a problem hiding this comment.
Since PR #571 is now merged, does the develop branch just need to be merged in?
| <taskdep task="&GET_OBS_CCPA_TN;"/> | ||
| <and> | ||
| <taskdep task="&GET_OBS_CCPA_TN;"/> | ||
| {%- if write_dopost %} |
There was a problem hiding this comment.
Why are some if statements {%- and some not?)
There was a problem hiding this comment.
We need {%- ... %} blocks for every "if" statement to avoid unnecessary blank lines in the final XML file.
There was a problem hiding this comment.
Thanks for the explanation, Jeff! All if blocks now have {%- ... %}.
| // | ||
| mask = { | ||
| grid = []; | ||
| poly = [ "${MASKS}/EAST.nc", |
There was a problem hiding this comment.
I think in develop we have this passed in through the METplus conf file and just have this set to CONUS.nc for resource purposes only. Maybe be consistent here (for all these new config files)?
There was a problem hiding this comment.
For ensemble-stat, the functionality to pass in the verification mask via METplus conf file did not exist in released versions prior to v4.0.0. Since we updated to run with METplus v4.0.0, I updated our METplus conf files to pass in the vx poly files and removed the hard-coded NC files in the MET config files (but this will not work with versions prior to METplus v4.0.0!).
| @@ -0,0 +1,259 @@ | |||
| //////////////////////////////////////////////////////////////////////////////// | |||
There was a problem hiding this comment.
Does this need a separate _upper_air file?
There was a problem hiding this comment.
No, I removed unneeded files, so now we have PointStatConfig_prob and PointStatConfig_mean.
| mask = { | ||
| grid = ${POINT_STAT_GRID}; | ||
| // poly = [ | ||
| // "${FIXverif_global}/vx_mask_files/grid2obs/CONUS.nc", |
There was a problem hiding this comment.
Remove commented out vx regions if this file remains.
There was a problem hiding this comment.
This has been removed!
| @@ -0,0 +1,94 @@ | |||
| # Ensemble Mean Composite Reflectivity | |||
There was a problem hiding this comment.
Did we decide to include the mean for REFC just as an example or remove it? I don't think we are using it, correct?
There was a problem hiding this comment.
Yes! This won't be included in the generation of the workflow, but we decided to keep the functionality (in case we are able to find a good way to configure MET with NEP and NMEP to use mean REFC/RETOP in a meaningful way).
| @@ -0,0 +1,95 @@ | |||
| # Ensemble Mean Composite Reflectivity | |||
There was a problem hiding this comment.
Similar to REFC , are we using this one?
There was a problem hiding this comment.
Same as REFC (that is, we are not using it).
|
|
||
| # location of grid_stat MET config file | ||
| GRID_STAT_CONFIG_FILE = {CONFIG_DIR}/GridStatConfig_REFL | ||
| GRID_STAT_CONFIG_FILE = {CONFIG_DIR}/GridStatConfig_REFC |
There was a problem hiding this comment.
I think this should this be RETOP.
There was a problem hiding this comment.
In develop, there is currently only a reflectivity MET config file -- I think since the RETOP and REFC files would be the same, it was decided to only have one? (You might know the history better than me, though!).
JeffBeck-NOAA
left a comment
There was a problem hiding this comment.
Please let me know if any of my comments aren't correct or need clarification!
| #mkdir_vrfy -p "${ensemblestat_dir}" | ||
|
|
||
| #cd_vrfy "${ensemblestat_dir}" | ||
| # |
There was a problem hiding this comment.
Is this commented block of code above still needed? If not, I would recommend removing it.
There was a problem hiding this comment.
Ah, good catch. The commented out section is not needed (commented out for testing purposes but never removed)!
| #mkdir_vrfy -p "${gridstat_mean_dir}" | ||
|
|
||
| #cd_vrfy "${gridstat_mean_dir}" | ||
| # |
There was a problem hiding this comment.
Same argument as previous comment regarding commented code.
There was a problem hiding this comment.
Same response as above -- not needed, will remove.
| #mkdir_vrfy -p "${gridstat_prob_dir}" | ||
|
|
||
| #cd_vrfy "${gridstat_prob_dir}" | ||
| # |
There was a problem hiding this comment.
Same comment about commented code.
There was a problem hiding this comment.
Same response as above -- not needed, will remove.
| #mkdir_vrfy -p "${ensemblestat_dir}" | ||
|
|
||
| #cd_vrfy "${ensemblestat_dir}" | ||
| # |
There was a problem hiding this comment.
Same comment about commented code block above.
There was a problem hiding this comment.
Same response as above -- not needed, will remove.
| #mkdir_vrfy -p "${pointstat_mean_dir}" | ||
|
|
||
| #cd_vrfy "${pointstat_mean_dir}" | ||
| # |
There was a problem hiding this comment.
Question about commented code block above.
There was a problem hiding this comment.
Same response as above -- not needed, will remove.
| {%- endif %} | ||
|
|
||
|
|
||
| {%- if run_task_get_obs_ccpa %} |
There was a problem hiding this comment.
Extra emply line not needed here?
| {%- endif %} | ||
| </dependency> | ||
|
|
||
| </task> |
There was a problem hiding this comment.
Same question as above?
| <metataskdep metatask="&RUN_POST_TN;{{ uscore_ensmem_name }}"/> | ||
| {%- endif %} | ||
| </dependency> | ||
|
|
There was a problem hiding this comment.
Same question as above.
| @@ -0,0 +1,129 @@ | |||
| # Ensemble Stat | |||
|
|
|||
There was a problem hiding this comment.
Should the following files also be listed as "Examples" in the title like the previous files? Probably should be listed as "Ensemble Stat Precipitation Example" as well.
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| # Export some environment variables passed in by the XML |
There was a problem hiding this comment.
I don't think you need to export these since the XML already does it for you (using <envar>). Any variable declared using <envar> in the xml should be available in any scripts, sub-scripts, functions, nested functions, etc. called by the j-job and ex-script. Maybe try commenting out these lines and see if it still works.
Same comment in other ex-scripts that re-export variables declared in the XML.
There was a problem hiding this comment.
@gsketefian - I ran a test with the commenting out the exports that are declared in the XML. Some ended up being necessary, but I did remove the ones that were unnecessary.
| #----------------------------------------------------------------------- | ||
| # | ||
| if [ ${VAR} == "APCP" ]; then | ||
| export acc="${ACCUM}h" # for stats output prefix in EnsembleStatConfig |
There was a problem hiding this comment.
I'm a stickler for not exporting variables if they are only needed locally. That way your environment contains only what you absolutely need and you don't end up using a variable that you inadvertently set in some other script. It looks like acc is used only on line 155 below. If so, can we remove the export in its definition? Thx.
| @@ -0,0 +1,186 @@ | |||
| #!/bin/sh -l | |||
There was a problem hiding this comment.
Let's change this to #!/bin/bash and without the -l. because (a) we're using bash; sh usually points to bash but no guarantee; and (2) the -l will source the user's .bashrc or .login (or both; I forget which), and we don't want that (environment should be the same for all users).
Same comment anywhere else this appears.
There was a problem hiding this comment.
@gsketefian - I addressed this for all instance it existed for the vx.
| fhr_last=`echo ${FHR} | awk '{ print $NF }'` | ||
| export fhr_last | ||
|
|
||
| fhr_list=`echo ${FHR} | sed "s/ /,/g"` |
There was a problem hiding this comment.
Where is fhr_list used? I don't see it anywhere in the rest of this script (except the export command that's next), and I don't see it in the master_metplus.py script (at /contrib/METplus/METplus-4.0.0/ush on Hera) either.
There was a problem hiding this comment.
Sorry, I'm still learning how the verification code works. I see now that it is in one of the METPlus configuration files.
|
@michelleharrold After looking at the PR a bit more, I think we can make it more compact (and so reduce repeated code) by using some of the capabilities in the workflow. What I mean is:
I realize this is a lot of extra work, so I'm happy to help where I can. I can do an example of how to combine the j-jobs and ex-scripts from which you can generalize, and happy to do telecons if that would help. If you need to get this PR in ASAP, we can create new issues to get it later (but it's better to do it now since if we make issues, more than likely we won't get to them for a long time!). |
| export CDATE | ||
| export hh | ||
|
|
||
| fhr_last=`echo ${FHR} | awk '{ print $NF }'` |
There was a problem hiding this comment.
Is this "fhr_last" the last forecast lead to process?
There was a problem hiding this comment.
Based on the syntax I see here, yes.
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| print_info_msg "$VERBOSE" "Starting ensemble-stat verification" |
There was a problem hiding this comment.
"Starting ensemble-stat verification" --> "Starting point-stat verification"?
There was a problem hiding this comment.
Note: I changed it to say point-based ensemble-stat verification (to be more descriptive)
| print_input_args valid_args | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| # Begin grid-to-grid vx on ensemble output. |
There was a problem hiding this comment.
Typo? "grid-to-grid" --> "grid-to-point"
bluefinweiwei
left a comment
There was a problem hiding this comment.
As Gerard suggested, it'd be nice if we can combine some of the nearly repeated files into one, for example, the files with APCP01, 03, 06, 24?
|
@bluefinweiwei - a number of the ensemble grid/point tasks can likely be combined, but unfortunately, I don't think the APCP files can (forecast length can change and the settings/accumulations between them are different). |
|
@gsketefian - After looking through this a bit more, I 100% agree that there are multiple areas where the ensemble verification could be made more compact (and after looking at some of your suggestions, there are also ways to make the pre-existing deterministic verification more compact as well). After talking with @jwolff-ncar, she advised it would be best to get this PR in ASAP (due to project needs), and as soon as it is merged, we will immediately make a new PR to make the verification more compact. (Tangentially related, there are some METplus config/code changes coming that will require a little bit of an overhaul, some of which will require some significant changes -- that might be a good time to re-evaluate how to make our current set-up more efficient.) |
bluefinweiwei
left a comment
There was a problem hiding this comment.
Looks good! @jwolff-ncar @michelleharrold @JeffBeck-NOAA
|
@michelleharrold @jwolff-ncar @JeffBeck-NOAA @bluefinweiwei I'll repeat here what I talked about with Jeff so everyone is in the loop. I attended an EPIC/Raytheon introduction/tutorial yesterday on something called Agile/SAFe. There was a lot of business-speak for sure, but one of the points they were emphatic about is that developers need to build good code the first time around. Going back later to fix things is a definite no-no. @JeffBeck-NOAA seemed to think that it's possible to use Michelle's fork for the stochastic work. I hope that's the case. The problem with making putting unready code into the develop branch a habit (and hoping you'll fix it later) is that the bad code will build up, and after a few weeks it will be hard for others to understand and modify. It is ok if it's in someone's personal fork and they use it for their research, but when it's something that will be shared with the whole community, it should be high quality. (And I'm not saying that I follow what I'm preaching all the time either, but I try.) It looks like EPIC is going to force this (and other changes in our work habits) on us anyway, and it's going to be an issue most people in the DTC will have to deal with (since most are scientists, not expert programmers). |
|
@gsketefian Thank you for your thorough review and comments, most of which were addressed. We agree that there are ways to improve the implementation but that is nearly always the case with software development (it is never perfect the first time). This is a high priority item that works as intended and needs to be merged. A subsequent issue will be created to address simplifying the scripts but due to the nature of that work it will be done in a separate PR. |
jwolff-ncar
left a comment
There was a problem hiding this comment.
Approve for merge given a new issue will be created to address remaining concerns to enhance/reduce the number of scripts required. Thank you for all your work on this!
* enhancements and bug fix for v0.7.1:
1) max_output_fields = 500
2) run soil/lake surgery using operation rap/hrrr
3) use netcdf parallel for model forecast product IO
* Add function to cycle surface and satbias from a common location
during machine switch and system version update.
Turn on smoke/dust and CLM for EnKF DA cycles.
* Add ${APRUN} to all executables in exregional_run_prepstart.sh
* Make output file type as an option in configure:
WRTCMP_output_file = netcdf_parallel
will turn on the parallel netcdf IO and compression.
* Only skip cold start gsi on WCOSS2 for now.
Cold start GSI crashes on WCOSS2.
---------
Co-authored-by: ming hu <ming.hu@clogin07.cactus.wcoss2.ncep.noaa.gov>
Co-authored-by: ming hu <ming.hu@dlogin03.dogwood.wcoss2.ncep.noaa.gov>
DESCRIPTION OF CHANGES:
This PR adds the capability to perform METplus-based ensemble verification within the regional_workflow. In addition to ensemble verification, modifications were made to the existing verification to allow for deterministic verification of each individual ensemble member.
Created jjobs and ex-scripts for running EnsembleStat, GridStat, and PointStat jobs for ensemble verification. Updated the generation, setup and valid param scripts, and FV3LAM_wflow.xml template to include the ensemble verification tasks (and modify deterministic verification for individual ensemble members). Added MET (EnsembleStat, GridStat, and PointStat) and METplus (APCP, REFC, RETOP, and sfc/upper-air) configuration file templates for ensemble verification. Added envars to the config_defaults.sh to set ensemble-related fields and to turn grid- and point-based ensemble verification on/off (w/ RUN_TASK_VX_ENSGRID and RUN_TASK_VX_ENSPOINT, respectively).
Other small modifications were made to already established deterministic verification-related jjobs, ex-scripts, and MET/METplus configuration files to address adding verification of individual ensemble members, removing unneeded passed arguments, and adding more appropriate logging info.
A WE2E test was added for ensemble verification: tests/WE2E/test_configs/wflow_features/config.MET_ensemble_verification.sh. It is based on config.MET_verification.sh but adds capability to test a 2 member ensemble, including verification. When testing, a small bug was found with the paths to the IC/LBC files on Hera. A fix suggested by Gerard Ketefian was added to tests/WE2E/run_WE2E_tests.sh to correct the path to IC/LBC files on Hera. Paths were also changed for the staged observation files from: /scratch2/BMC/det/UFS_SRW_app/v1p0/obs_data to /scratch2/BMC/det/UFS_SRW_app/develop/obs_data.
This PR also addresses a recent CCPA bug fix (CCPAv4.1.3) that was implemented into production on 5/4/2021. The bug remains in the 00Z directory, 1-hour CCPA data from 7/18/2018-5/4/2021. Logic has been added in the exregional_get_ccpa_files.sh script to address the bug fix.
TESTS CONDUCTED:
Two single case studies were run (2019061500 and 2020061500, 36-h forecasts). This has only been tested on Hera; there are plans to add Cheyenne as an available platform in the near future. Tested with METv10.0.0 and METplusv4.0.0 for RRFS_CONUS_25km domain with FV3_GSD_SAR physics suite.
DEPENDENCIES:
None.
DOCUMENTATION:
Documentation for verification is pending.
CONTRIBUTORS (optional):
Jamie Wolff and Lindsay Blank