NOAA-PSL / stochastic_physics

Contains the stochastic physics pattern generator for the Unified Forecast System
Other
6 stars 41 forks source link

Change ifdef statement for quad precision in kinddef.F90 #53

Closed climbfuji closed 2 years ago

climbfuji commented 2 years ago

Fixes https://github.com/noaa-psd/stochastic_physics/issues/52 by replacing #ifdef _PGI with #ifdef NO_QUAD_PRECISION.

This is the same CPP directive that is used for the FV3 dycore (GFDL_atmos_cubed_sphere). Since it doesn't change the default (which is to use quad precision), it should be safe to merge unless there is an application using PGI. This application would need to pass -DNO_QUAD_PRECISION to work.

NEEDS TO BE TESTED!

pjpegion commented 2 years ago

In spectral_transforms.F90 you will need to replace line 1975: real(kind=kind_qdt_prec), parameter :: eps = 1.d-20

with

ifdef NO_QUAD_PRECISION

  real(kind=kind_qdt_prec), parameter :: eps = 1.d-12

else

  real(kind=kind_qdt_prec), parameter :: eps = 1.d-20

endif

in order to not get stuck in the infinite loop

junwang-noaa commented 2 years ago

@pjpegion RT passed in ufs-weather-model PR#1028. Would you please commit this PR? I will update my ufs-weather-model branch then. Thanks

climbfuji commented 2 years ago

@pjpegion Since you already approved and since the regression tests passed, I'll go ahead and merge it.

pjpegion commented 2 years ago

@DomHeinzeller thanks