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

Add Grib2 writing capabilities to the ocnicepost module #96

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

Conversation

AminIlia-NOAA
Copy link
Contributor

Description

The ocnicepost has been modified to include grib2 writing capabilities. The codes has been written and tested. The code creates grib2 files (2D and 3D) however the data is not on proper range. It seems some fill value remain and written into the data although I masked them with bitmap. Here are some points:

  • Large negative numbers have been written into the grib2 files .
  • I checked most of arrays and they look to be fine, beside fill values values all values are in reasonable range.
  • Got a Segmentation error for “addfield” when use template 5.0 simple packing. Program also was freezed for 5.40. Therefore I used complex packing 5.2. Only idrtmpl(3) set .
  • With bitmap enabled, the large negative data has not been written into the file .
  • Also many new parameters are unknow. I'm not sure if the g2 library is the latest and updated version.
  • The codes and parameterization seems to be fine to me.
  • The codes is running for both ice and ocean cases.

A working test case is available at /scratch2/NCEPDEV/ovp/Amin.Ilia/new/test_f6 on HERA. Please let me know if you have any questions.

Any suggestion or help on resolving the large negative numbers will be apricated.
Thanks All,

@edwardhartnett, @AlysonStahl-NOAA or @Hang-Lei-NOAA.
@WenMeng-NOAA or @GeorgeGayno-NOAA

Ref #89

Type of change

  • New feature (adds functionality)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? YES
  • Does this change require a documentation update? NO

How has this been tested?

  • Clone and build on HERA

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
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • [] I have made corresponding changes to the documentation if necessary

Amin Ilia added 30 commits November 21, 2024 11:20
@GeorgeGayno-NOAA
Copy link
Contributor

@AminIlia-NOAA - I looked at the ocean.0p25.gb2 file with Grads. Here is the water temperature record. Something is not correct. See the gif.
water_temp

It looks like there is an array mismatch somewhere. Are the dimensions of the data array what the g2 library is expecting? Is the array 8-byte, but the g2 library is expecting 4-byte? To simplify debugging, I might turn off the bitmap (you can set the land points to a value like 999) and try the simple packing.

@AminIlia-NOAA
Copy link
Contributor Author

AminIlia-NOAA commented Feb 10, 2025

@GeorgeGayno-NOAA thank you for your suggestion and plotting. I already had done/tested most of your suggestions. While I found minor typo in my code and fixed them however, the main issue here is the section 5 and scaling the numbers. The 8 bytes vs 4 bytes is not an issue as addfield also has not specified them.
Capture

I did a lot of work on it and performed a lot of search even went through the netcdf file to see different between C style written netCDF file and Fortran style written netCDF file. However there wasn't an issue from this point. The main issue is that the g2 library select a large negative number for reference value in section 5. That causes these large negative values and wrong scaled value parameters. Per your and others recommendation I set only idrtmpl(3).

I think someone should check to see if there is an issue in g2 library. Also, could you please let me know what equation g2 lib use for scaling the parameters. I found this at ECMWF website, Y * 10^D= R + (X1+X2) * 2^E.
Is it be used un NCEP G2 as well?

In addition I saw an wired behavior from the compiler for the original "ocnicepost". If you look at the cmakelist file, the arrays_mod.F90 which is depend on init_mod.F90 compiled before init_mod.F90. We should get an error here however we don't get an error.
Capture2

@GeorgeGayno-NOAA
Copy link
Contributor

@AminIlia-NOAA - not sure what the issue is. Which version of the G2 library are you using? Can you try an older version? Tagging the NCEPLIBS team for assistance - @edwardhartnett @AlexanderRichert-NOAA @Hang-Lei-NOAA

@AminIlia-NOAA
Copy link
Contributor Author

AminIlia-NOAA commented Feb 11, 2025

@AminIlia-NOAA - not sure what the issue is. Which version of the G2 library are you using? Can you try an older version? Tagging the NCEPLIBS team for assistance - @edwardhartnett @AlexanderRichert-NOAA @Hang-Lei-NOAA

The system is on maintenance today. I guess I loaded the latest version. Will check the version later and try with another.

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.

2 participants