Replace "derf()" with standard "erf()" in SBM MP scheme#1183
Replace "derf()" with standard "erf()" in SBM MP scheme#1183kkeene44 merged 6 commits intowrf-model:release-v4.2.1from
Conversation
|
I clearly did something wrong with my fork - 532 changed files. Will correct and submit a new PR. |
|
Kelly, |
|
@davegill Good eye - thanks!! |
|
@kkeene44 @weiwangncar @dudhia Clearly, every other place has been patched up with various local definitions of this gaussian. The Due to precedent, I am OK with this being the only change made to the WRF source. |
|
Why has this only shown up now when it was also in some older schemes?
…On Mon, Apr 27, 2020 at 4:35 PM Dave Gill ***@***.***> wrote:
@kkeene44 <https://github.com/kkeene44> @weiwangncar
<https://github.com/weiwangncar> @dudhia <https://github.com/dudhia>
Folks,
There are a few places where we have this "derf" used:
> find . -name \*.F -exec grep -iw derf {} \; -print
t=derf((1.0d0-fract_volume_water)/fract_volume_water-0.2d0)
./phys/module_mp_SBM_polar_radar.F
! real derf,derfc, erf_alt
./phys/module_mp_morr_two_moment_aero.F
function derf(x)
derf = y
end function derf
#define ERF derf
real(r8) derf,derfc, erf_alt
!++ag replace sg erf with hm derf pre 1.68
! nact=nact+0.5*(1.-derf(x))*na(m)
! nact=nact+0.5*(1.-derf(x))*na(m)
! write(*,*)'nact',nact,derf(x),na(m),m
./phys/module_cu_mskf.F
dum1 = nanew1*0.5*(1.-derf(uu1)) ! activated number in kg-1 mode 1
dum2 = nanew2*0.5*(1.-derf(uu2)) ! activated number in kg-1 mode 2
real function DERF(X)
DERF = Y
end function DERF
./phys/module_mp_p3.F
module procedure derf
! subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
! Y=ERF(X) (or Y=DERF(X)),
FUNCTION DERF(X)
real(rk) :: DERF
CALL CALERF_r8(X, DERF, JINT)
END FUNCTION DERF
./phys/module_cam_error_function.F
real(r8) derf
#define ERF derf
real(r8) derf,derfc
real(r8) function derf(x)
derf = y
end function derf
./phys/module_cam_mp_microp_aero.F
Clearly, every other place has been patched up with various local
definitions of this gaussian.
The 'erfis an intrinsic from Fortran 2008 and on. [GNU ERF doc](
https://gcc.gnu.org/onlinedocs/gfortran/ERF.html) There is no need to
ever sayderf(which is an extension). However, there is no need to put the
letterdin front of a zillion functions in the physics directory:dsin, dcos,
dexp, dlog`, etc.
Due to precedent, I am OK with this being the only change made to the WRF
source.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1183 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77C3V7GFO4ZLP2HUE2TROYCBXANCNFSM4MSJK6KQ>
.
|
|
@dudhia @kkeene44 @weiwangncar
Jimy, |
|
thanks
…On Tue, Apr 28, 2020 at 9:37 AM Dave Gill ***@***.***> wrote:
@dudhia <https://github.com/dudhia> @kkeene44
<https://github.com/kkeene44> @weiwangncar
<https://github.com/weiwangncar>
Why has this only shown up now when it was also in some older schemes?
Jimy,
All of the other instances inside of WRF of the use of the "derf()"
intrinsic function were essentially user-defined. The only raw "derf()"
function is the single one that Kelly is modifying.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1183 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77EBRDO2FFTK63J7DXDRO3Z5HANCNFSM4MSJK6KQ>
.
|
TYPE: bug fix KEYWORDS: PGI, compile, mp_SBM_polar_radar, phys, erf, derf SOURCE: Bart Brashers (Ramboll) DESCRIPTION OF CHANGES: A fortran function (DErF) was being used in the module_mp_SBM_polar_radar file. This was causing a compiling fail for PGI (tested with versions 19.10.0 on user's machine and 19.3 on Cheyenne). According to this article: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/DErF-Intrinsic.html the DErF function is archaic. Modifying this function to ErF corrects the problem and allows the PGI compiler to build the WRF executable from source. LIST OF MODIFIED FILES: M phys/module_mp_SBM_polar_radar.F TESTS CONDUCTED: Verified that code does not compile in original state, but does with the modified code when using the PGI compiler. Reggie should be OK. RELEASE NOTE: A minor modification has been introduced into the SBM Polar Radar microphysics code to allow the WRF code to build with PGI compilers. The nonstandard derf() intrinsic has been replaced by the 2008 standard compliant erf() intrinsic.
Replace "derf()" with standard "erf()" in SBM MP scheme (wrf-model#1183)
TYPE: bug fix
KEYWORDS: PGI, compile, mp_SBM_polar_radar, phys, erf, derf
SOURCE: Bart Brashers (Ramboll)
DESCRIPTION OF CHANGES: A fortran function (DErF) was being used in the module_mp_SBM_polar_radar file. This was causing a compiling fail for PGI (tested with versions
19.10.0 on user's machine and 19.3 on Cheyenne). According to this article:
https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/DErF-Intrinsic.html
the DErF function is archaic. Modifying this function to ErF corrects the problem and allows the
PGI compiler to build the WRF executable from source.
LIST OF MODIFIED FILES:
M phys/module_mp_SBM_polar_radar.F
TESTS CONDUCTED:
using the PGI compiler.
RELEASE NOTE: A minor modification has been introduced into the SBM Polar Radar microphysics code to allow the WRF code to build with PGI compilers. The nonstandard derf() intrinsic has been replaced by the 2008 standard compliant erf() intrinsic.