Skip to content

CPP directive around use of ISNAN() intrinsic function#1460

Closed
davegill wants to merge 1 commit intowrf-model:release-v4.3from
davegill:isnan
Closed

CPP directive around use of ISNAN() intrinsic function#1460
davegill wants to merge 1 commit intowrf-model:release-v4.3from
davegill:isnan

Conversation

@davegill
Copy link
Contributor

@davegill davegill commented Apr 7, 2021

TYPE: enhancement

KEYWORDS: ISNAN, PGI compiler

SOURCE: Found by Prasanth, fixed by internal

DESCRIPTION OF CHANGES:
Problem:
Some PGI compilers do not support the 2003 intrinsic ISNAN() function.

Solution:
Put in an automatic test to include a CPP -Dflag if the ISNAN() function is not part of the compiler.

LIST OF MODIFIED FILES:
modified: configure
modified: phys/module_sf_noahmplsm.F
new file: tools/fortran_2003_isnan_test.F

TESTS CONDUCTED:

  1. Going to see if this addresses the user's problem
  2. Jenkins testing is OK (expected, as no real changes to the compiled code, except for a no opt CPP directive).

Apparently some PGI compilers do not support this ...

	modified:   configure
	modified:   phys/module_sf_noahmplsm.F
	new file:   tools/fortran_2003_isnan_test.F
@davegill davegill requested review from a team as code owners April 7, 2021 14:54
@davegill
Copy link
Contributor Author

davegill commented Apr 7, 2021

jenkins

Please find result of the WRF regression test cases in the attachment. This build is for Commit ID: b973eb63b9427d24e0c714c65d519981206501f0, requested by: davegill for PR: https://github.com/wrf-model/WRF/pull/1460. 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  : 163           161        0
    Number of Comparisons  : 103           102        0

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

@davegill
Copy link
Contributor Author

davegill commented Apr 7, 2021

@prasanthvkrishna
Would you test this PR out to see if the WRF code compiles with your PRG compiler?

@prasanthvkrishna
Copy link
Contributor

@prasanthvkrishna
Would you test this PR out to see if the WRF code compiles with your PRG compiler?

@davegill Sure, Dave. I can do a test.

@prasanthvkrishna
Copy link
Contributor

@prasanthvkrishna
Would you test this PR out to see if the WRF code compiles with your PRG compiler?

@davegill Could you please add a line after your ISNAN check?
"IF ( (IRRLOSS .GT. 100.0) .OR. (IRRLOSS .LT. 0.0) ) IRRLOSS=4.0 ! In case if IRRLOSS is out of range"
This is required as @Cenlin_He suggested for out-of-range values.

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 7, 2021

@prasanthvkrishna
Would you test this PR out to see if the WRF code compiles with your PRG compiler?

@davegill Could you please add a line after your ISNAN check?
"IF ( (IRRLOSS .GT. 100.0) .OR. (IRRLOSS .LT. 0.0) ) IRRLOSS=4.0 ! In case if IRRLOSS is out of range"
This is required as @Cenlin_He suggested for out-of-range values.

@prasanthvkrishna This range limit code can be added in your PR instead of Dave's PR here. I think it is better to have Dave' PR focusing on resolving the ISNAN issue.

@davegill
Copy link
Contributor Author

davegill commented Apr 7, 2021

#1456 "Noah-MP Dynamic Irrigation Packaged 2d fields" handles the intrinsic ISNAN() with a method already in place in the WRF model (P3 and TEMF).

We can address all of these at one time, LATER.

@davegill davegill closed this Apr 7, 2021
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