esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
149 stars 70 forks source link

Need improved precision for Schmidt transform at high resolution #228

Open tclune opened 4 months ago

tclune commented 4 months ago

Bill Putman recently ran into an issue where DP gave bad results with the stretch provided by Schmidt transform.

The improvement is to use higher precision (where available) and use a different value of "TINY".

Quick summary here, but hopefully can point you to an FV PR soon.

ifdef NO_QUAD_PRECISION
! 64-bit precision (kind=8)                                                                             
 integer, parameter:: f_p = selected_real_kind(15)
#else
! Higher precision (kind=16) for grid geometrical factors:                                              
 integer, parameter:: f_p = selected_real_kind(20)
#endif
    near_zero = tiny(near_zero)
mathomp4 commented 4 months ago

I might actually be able to make a PR here for this. But I'll probably work with @tclune and the ESMF folks about handling that precision issue in a "nice" way to avoid having to add to build_config. (That is, I think NVHPC still doesn't support 128-bit.)