NOAA-EMC / ufs-land-driver

Creative Commons Zero v1.0 Universal
2 stars 15 forks source link

initialize real data to real*4 to prevent overflow with netcdf write #33

Closed barlage closed 1 year ago

barlage commented 1 year ago

When reorganizing the IO code, there was problem with writing a few variables (albedo_direct and albedo_diffuse) due to overflow. This is because the output files are single precision but the data fields are initialized with huge(1.0) which is double precision (due to compiler flags to set default real to be double). Simply initialize with huge(real(1.0,4)) to get the largest single precision value. After #32 this does not change answers.