Skip to content

Replace "derf()" with standard "erf()" in SBM MP scheme#1246

Closed
davegill wants to merge 1 commit intowrf-model:release-v4.2.1from
davegill:derf_doh
Closed

Replace "derf()" with standard "erf()" in SBM MP scheme#1246
davegill wants to merge 1 commit intowrf-model:release-v4.2.1from
davegill:derf_doh

Conversation

@davegill
Copy link
Contributor

@davegill davegill commented Jul 9, 2020

TYPE: bug fix

KEYWORDS: derf, SBM

SOURCE: Nicolas Baldeck (OpenMeteoData)

DESCRIPTION OF CHANGES:
Problem:
Using derf for a double precision error function is not standard, and causes an error
with PGI 19.10:

441044-PGF90-S-0038-Symbol, derf, has not been explicitly declared (module_mp_SBM_polar_radar.f90)
441136- 0 inform, 0 warnings, 1 severes, 0 fatal for calc_dc_wet_snow

Solution:
The Fortran standard allows the TKR (type, kind, rank) of an argument to determine which
intrinsic function is being used. The erf function is part of the Fortran 2008 standard, and
has been previously available for GNU, Intel, and PGI.

The scheme's original developer has approved these mods.

ISSUE:
Fixes #1245 "PGI complains about Derf symbol in module_mp_SBM_polar_radar.F"

LIST OF MODIFIED FILES:
modified: phys/module_mp_SBM_polar_radar.F

TESTS CONDUCTED:

  1. Before mods, the PGI compiler complained. After fix, code builds and runs with PGI 19.
  2. With GNU 9 and Intel 19 compilers, code builds and runs as before. It is possible that older (non 2008 compliant)
    compilers will fail, but that standard is 12 years old, so not too much sympathy.
  3. Status of jenkins is all pass.

KEYWORDS: derf, SBM

SOURCE: Nicolas Baldeck (Edgehill University)

DESCRIPTION OF CHANGES:
Problem:
Using `derf` for a double precision error function is not standard, and causes an error
with PGI 19.10:
```
441044-PGF90-S-0038-Symbol, derf, has not been explicitly declared (module_mp_SBM_polar_radar.f90)
441136- 0 inform, 0 warnings, 1 severes, 0 fatal for calc_dc_wet_snow
```

Solution:
The Fortran standard allows the TKR (type, kind, rank) of an argument to determine which
intrinsic function is being used. The `erf` function is part of the Fortran 2008 standard, and
has been previously available for GNU, Intel, and PGI.

ISSUE:
Fixes wrf-model#1245 "PGI complains about Derf symbol in module_mp_SBM_polar_radar.F"

LIST OF MODIFIED FILES:
modified:   phys/module_mp_SBM_polar_radar.F

TESTS CONDUCTED:
1. Before mods, the PGI compiler complained. After fix, code builds and runs.
2. Status of jenkins???
@davegill davegill requested a review from a team as a code owner July 9, 2020 16:09
@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

@JS-WRF-SBM @dudhia @weiwangncar
Koby,
Please review this modification

@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

@nbald
Nikolas,
Does this fix the problem?

@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

Jenkins results:

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: cd0152159adcf3916aa708074baa77a7c9885e36, requested by: davegill for PR: https://github.com/wrf-model/WRF/pull/1246. For any query please send e-mail to David Gill.

    Test Type              | Expected  | Received |  Failed
    = = = = = = = = = = = = = = = = = = = = = = = =  = = = =
    Number of Tests        : 19           18
    Number of Builds       : 48           46
    Number of Simulations  : 166           164        0
    Number of Comparisons  : 105           104        0

    Failed Simulations are: 
    None
    Which comparisons are not bit-for-bit: 
    None

@JS-WRF-SBM
Copy link
Contributor

@JS-WRF-SBM @dudhia @weiwangncar
Koby,
Please review this modification

@davegill @nbald
Thanks for contacting me on this.
From my end the fix is OK - as it builds and run with Intel 19.0.1 as well.

@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

@JS-WRF-SBM
Koby,
Thanks for the quick response!

@nbald
Copy link

nbald commented Jul 9, 2020

I confirm it builds now with PGI 19.10

@davegill I am not affiliated with Edgehill University. You can attribute to Nicolas Baldeck (OpenMeteoData)

@nbald
Copy link

nbald commented Jul 9, 2020

Is this a duplicate? #1183

@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

@nbald
Nicolas,
well, yes it is!
I am closing this PR.

@davegill
Copy link
Contributor Author

davegill commented Jul 9, 2020

Look at #1183
This was found again. Perhaps we need to do minor releases more quickly. :)

@davegill davegill closed this Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants