There is a problem running ungrib with the Cray compiler.
Specifically, not all of the 4 soil levels were picked up from the GFS
in ungrib.exe.
In rd_grib2.F, there is a block
if ((g2code(4,j) .eq. 106) .and.
& (gfld%ipdtmpl(2) .eq. g2code(3,j)) .and.
& (glevel1 .eq. level1(j)) .and.
& ((glevel2 .eq. level2(j)) .or.
& (level2(j) .le. -88))) then
In the Cray compiler, there is a small difference between (glevel1 and level1(j))
and (glevel2 and level2(j)) that not all 4 soil levels from GFS are picked up.
A small fix was applied:
if ((g2code(4,j) .eq. 106) .and.
& (gfld%ipdtmpl(2) .eq. g2code(3,j)) .and.
& (abs(glevel1-level1(j)) .lt. 0.001 ) .and.
& ((abs(glevel2-level2(j)) .lt. 0.001) .or.
& (level2(j) .le. -88))) then
Credit goes to Francois Thomas from HPE who fixed this.
There are also a few additional modifications. I have the new and
old code attached.
This may be worth putting in for the new release.
I presume we need to do the same thing for the grib1 version.
Specifically, not all of the 4 soil levels were picked up from the GFS
in ungrib.exe.
In rd_grib2.F, there is a block
if ((g2code(4,j) .eq. 106) .and.
& (gfld%ipdtmpl(2) .eq. g2code(3,j)) .and.
& (glevel1 .eq. level1(j)) .and.
& ((glevel2 .eq. level2(j)) .or.
& (level2(j) .le. -88))) then
In the Cray compiler, there is a small difference between (glevel1 and level1(j))
and (glevel2 and level2(j)) that not all 4 soil levels from GFS are picked up.
A small fix was applied:
if ((g2code(4,j) .eq. 106) .and.
& (gfld%ipdtmpl(2) .eq. g2code(3,j)) .and.
& (abs(glevel1-level1(j)) .lt. 0.001 ) .and.
& ((abs(glevel2-level2(j)) .lt. 0.001) .or.
& (level2(j) .le. -88))) then
Credit goes to Francois Thomas from HPE who fixed this.
There are also a few additional modifications. I have the new and
old code attached.
This may be worth putting in for the new release.
I presume we need to do the same thing for the grib1 version.