Closed edwardhartnett closed 6 months ago
This test code succeeds, so perhaps the answer is to drop the final character so it fits, which is what fortran seems to be doing:
! Note that the file grib2_all_tables_module.f90 has 'experimental_products'.
call get_g2_typeofdata('experimental_product', val1, ierr)
if (val1 .ne. 192) stop 6
Also this entry exceeds it's limit of 30:
data on388_tablea(115) /gen_proc('extra_trop_storm_surge_micronesia',20)/
@BoiVuong-NOAA @Hang-Lei-NOAA any suggestions for this problem?
Remove the length definition, or give a large number?
We should increase the length of definition. character(len=30) :: genprockey ===> character(len=100) :: genprockey and character(len=20) :: typeofdatakey ====> character(len=50) :: typeofdatakey
Currently, the only way these work is to give the truncated version. For example this works:
call get_g2_typeofdata('experimental_product', val1, ierr)
Now if we increase the length, this will no longer work.
So anyone who wanted to use these codes will be using the truncated versions, and when we increase the length we will break their code.
Is this OK? Do we know that these codes are not used in the UFS?
Yes, I think no one is using it. We can have truncated version. If you have chance, we can increase the length at later time.
OK, I truncated all char strings that were too long, so that it would not break backward compatibility.
I have turned on -Wall and -Werror in the CI, to prevent more warnings from being introduced, which will prevent this problem occurring again.
We have this code in grib2_all_tables_module.F90:
Note that 'experimental_products' is 21 chars long!
I'm not sure what should be done to fix this...