You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In the direct netcdf output the partitioned mean wave direction fields, PDIR, produces some numeric values where binary WW3 outputs not a number (NaN) values. This is the case across all partitions. Where binary WW3 output has numeric values they are equivalent to the values from the netcdf parallel output.
Expected behavior
Running ww3_ounf on binary WW3 output should produce identical output to the netcdf parallel output, with
PDIR(:,:,1) identical to pdir0(:), PDIR(:,:,2) identical to pdir1(:), etc.
Screenshots
None as of now
Additional context
The discrepancies in mean direction partition fields are due to a transformation from radians to degrees which does not check for NaN’s at application of the modulus function. The discrepancy can be resolved with a small change to subroutine write_var3d. Lines 613-615 of wav_history_mod.F90 (within subroutine write_var3d)
if (mapsta(mapsf(isea,2),mapsf(isea,1)) > 0 ) then ! existing code
varloc(:) = mod(630. - rade*varloc(:), 360.)
end if
needs to account for NaN's in varloc (the mod function maps NaN's onto bogus numeric values). So lines 613+ ... should be:
if (mapsta(mapsf(isea,2),mapsf(isea,1)) > 0 ) then ! recommended change
do k = 1, size(varloc,1)
if (varloc(k) .ne. undef) varloc(k) = mod(630. - rade*varloc(k), 360.)
end do
end if
This issue may be compiler or flag dependent (we used the intel fortran compiler in our test). Jessica Meixner and I are going to continue to check other fields written directly to netcdf for inconsistencies with the binary WW3 output.
The text was updated successfully, but these errors were encountered:
Describe the bug
In the direct netcdf output the partitioned mean wave direction fields, PDIR, produces some numeric values where binary WW3 outputs not a number (NaN) values. This is the case across all partitions. Where binary WW3 output has numeric values they are equivalent to the values from the netcdf parallel output.
To Reproduce
Jessica Meixner has a test case that demonstrates the error at: https://github.com/jessicameixner-noaa/ufs-weather-model
Expected behavior
Running ww3_ounf on binary WW3 output should produce identical output to the netcdf parallel output, with
PDIR(:,:,1) identical to pdir0(:), PDIR(:,:,2) identical to pdir1(:), etc.
Screenshots
None as of now
Additional context
The discrepancies in mean direction partition fields are due to a transformation from radians to degrees which does not check for NaN’s at application of the modulus function. The discrepancy can be resolved with a small change to subroutine write_var3d. Lines 613-615 of wav_history_mod.F90 (within subroutine write_var3d)
needs to account for NaN's in varloc (the mod function maps NaN's onto bogus numeric values). So lines 613+ ... should be:
This issue may be compiler or flag dependent (we used the intel fortran compiler in our test). Jessica Meixner and I are going to continue to check other fields written directly to netcdf for inconsistencies with the binary WW3 output.
The text was updated successfully, but these errors were encountered: