ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

The latest version of chgres_cube does not support GEFS or any ensemble grib2 files as input #651

Closed ZhanZhang-NOAA closed 2 years ago

ZhanZhang-NOAA commented 2 years ago

@GeorgeGayno-NOAA The chgres_cube used to support reading in GEFS or any ensemble grib2 files, but the function is broken in the latest version. It doesn't support reading in GEFS or any ensemble grib2 files anymore. It looks like that the product definition template is hard-code to 0 in input_data,F90, which is only for deterministic forecast/analysis, while product definition template for ensemble product is 1, examples in input_data.F90: jpdtn = 0 and if (gfld%ipdtnum == 0) then

Is it possible to add an namelist parameter to switch reading deterministic and ensemble grib2 between jpdtn = 0 and 1 or through a better approach to recognize deterministic/ensemble automatically by the code? Also, it would be desirable to include a chgres_cube regression test for GEFS grib2 input.

GeorgeGayno-NOAA commented 2 years ago

@ZhanZhang-NOAA do you have a sample GRIB2 dataset that causes the failure?

ZhanZhang-NOAA commented 2 years ago

@GeorgeGayno-NOAA Yes, here is one example on jet: /mnt/lfs4/HFIP/hwrf-vd/Zhan.Zhang/hafstmp/H222_ensemble_bdygefs/2020082506/00L/atm_lbc001_ens/mem002/bc_f006/gep02.t06z.pgrb2abf06 I also copied the same file to WCOSS1: /gpfs/dell2/emc/modeling/noscrub/Zhan.Zhang/UFS_UTILS_test/gep02.t06z.pgrb2abf06

GeorgeGayno-NOAA commented 2 years ago

@ZhanZhang-NOAA I was able to reproduce the error. The logic can't find any vertical levels -

 - READ ATMOS DATA FROM GRIB2 FILE: .//gep02.t06z.pgrb2abf06
 - READ ATMOS DATA FROM GRIB2 FILE: .//gep02.t06z.pgrb2abf06
 - READ ATMOS DATA FROM GRIB2 FILE: .//gep02.t06z.pgrb2abf06
 cggg found this number of levels            0
 - FATAL ERROR: READING ATMOSPHERIC WATER VAPOR VARIABLE.
 - IOSTAT IS:            2

Let me work on a fix.

GeorgeGayno-NOAA commented 2 years ago

The GEFS data is identified in the ID section (section 1): https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect1.shtml

octets 6-7 are '7' (NCEP) https://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html octets 8-9 are '2' (NCEP Ensemble products) https://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html

GeorgeGayno-NOAA commented 2 years ago

I think I have a fix. Test scripts/data on Mars - /gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/zhan

GeorgeGayno-NOAA commented 2 years ago

@ZhanZhang-NOAA Can you try my fix? Close my branch, then checkout my branch:

git clone git@github.com:GeorgeGayno-NOAA/UFS_UTILS.git
git checkout bugfix/chgres_gefs
ZhanZhang-NOAA commented 2 years ago

I was on AL for the last two weeks, I will test your fix soon and let you know as soon as I get the results. Many thanks!

-Zhan

On Tue, May 24, 2022 at 4:27 PM GeorgeGayno-NOAA @.***> wrote:

@ZhanZhang-NOAA https://github.com/ZhanZhang-NOAA Can you try my fix? Close my branch, then checkout my branch:

git clone @.***:GeorgeGayno-NOAA/UFS_UTILS.git git checkout bugfix/chgres_gefs

— Reply to this email directly, view it on GitHub https://github.com/ufs-community/UFS_UTILS/issues/651#issuecomment-1136399385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE73MQWR2GMRIIT7MWTQLHDVLU3UPANCNFSM5WC2KBHQ . You are receiving this because you were mentioned.Message ID: @.***>

ZhanZhang-NOAA commented 2 years ago

@GeorgeGayno-NOAA I tested the bugfix version of chgres, it worked fine with GEFS input.

GeorgeGayno-NOAA commented 2 years ago

@GeorgeGayno-NOAA I tested the bugfix version of chgres, it worked fine with GEFS input.

Did you test the cold start files in the forecast model?

ZhanZhang-NOAA commented 2 years ago

Yes, I did. I ran the end-to-end HAFS system using GEFS as input for IC/BC, the forecast job completed successfully.

On Mon, Jun 13, 2022 at 9:19 AM GeorgeGayno-NOAA @.***> wrote:

@GeorgeGayno-NOAA https://github.com/GeorgeGayno-NOAA I tested the bugfix version of chgres, it worked fine with GEFS input.

Did you test the cold start files in the forecast model?

— Reply to this email directly, view it on GitHub https://github.com/ufs-community/UFS_UTILS/issues/651#issuecomment-1153905333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE73MQUZA4UXZYZYS4CYOS3VO4YN7ANCNFSM5WC2KBHQ . You are receiving this because you were mentioned.Message ID: @.***>

GeorgeGayno-NOAA commented 2 years ago

Yes, I did. I ran the end-to-end HAFS system using GEFS as input for IC/BC, the forecast job completed successfully.

That's great! I would like to turn your test into a new regression test for GEFS data. Can I get your input GEFS file, the chgres configuration namelist, and the coldstart files?

ZhanZhang-NOAA commented 2 years ago

My test run files are on jet:

  1. Directory to create initial condition (IC): 1a. GEFS input file: /mnt/lfs4/HFIP/hwrfv3/Zhan.Zhang/hafstmp/H222_ensemble_gefs_00/2020082506/00L/atm_ic/gec00.t06z.pgrb2abf00 1b. chgres namelist for IC: /mnt/lfs4/HFIP/hwrfv3/Zhan.Zhang/hafstmp/H222_ensemble_gefs_00/2020082506/00L/atm_ic/fort.41
  2. Directory to create lateral boundary condition (06h LBC): 2a. GEFS input file: /mnt/lfs4/HFIP/hwrfv3/Zhan.Zhang/hafstmp/H222_ensemble_gefs_00/2020082506/00L/atm_lbc001/bc_f006/gec00.t06z.pgrb2abf06 2b. chgres namelist for BLC /mnt/lfs4/HFIP/hwrfv3/Zhan.Zhang/hafstmp/H222_ensemble_gefs_00/2020082506/00L/atm_lbc001/bc_f006/fort.41
  3. output files from chgres: /mnt/lfs4/HFIP/hwrfv3/Zhan.Zhang/hafstmp/H222_ensemble_gefs_00/2020082506/00L/intercom/chgres 3a. IC: gfs_data.tile7.nc; 3b. LBC: gfs_bndy.tile7.???.nc