Skip to content

Noah-MP Dynamic Irrigation Packaged 2d fields#1456

Merged
davegill merged 4 commits intowrf-model:release-v4.3from
prasanthvkrishna:dyn_irr_Packaging
Apr 14, 2021
Merged

Noah-MP Dynamic Irrigation Packaged 2d fields#1456
davegill merged 4 commits intowrf-model:release-v4.3from
prasanthvkrishna:dyn_irr_Packaging

Conversation

@prasanthvkrishna
Copy link
Contributor

@prasanthvkrishna prasanthvkrishna commented Apr 4, 2021

TYPE: bug fix

KEYWORDS: Noah MP dynamic irrigation packaging 2d variables.

SOURCE: Prasanth Valayamkunnath (NCAR)

DESCRIPTION OF CHANGES:
Purpose: To package Noah MP dynamic irrigation variables.

LIST OF MODIFIED FILES:
Registry/Registry.EM_COMMON
Registry/Registry.NMM
phys/module_sf_noahmplsm.F (resolved issue with ISNAN in PGI)

TESTS CONDUCTED:

  1. Compiled the model using intel/19.0.5. No further testing is conducted as these are minor changes in the code.
  2. Jenkins testing OK

@dudhia
Copy link
Collaborator

dudhia commented Apr 5, 2021

Typically packaging needs a test to make sure not using this option is unaffected. If the arrays are still accessed in any way when the option is off, it could cause problems with unallocated space. Make sure these arrays are not in any executed code lines when the option is off.

@prasanthvkrishna
Copy link
Contributor Author

Typically packaging needs a test to make sure not using this option is unaffected. If the arrays are still accessed in any way when the option is off, it could cause problems with unallocated space. Make sure these arrays are not in any executed code lines when the option is off.

Sure, I will do a test. Thanks, Jimy

@davegill
Copy link
Contributor

davegill commented Apr 5, 2021

@prasanthvkrishna @cenlinhe

ISNAN is not supported by PGI compiler

This intrinsic became part of the standard with Fortran2003. We should be able to rely on isnan being present (not a slam on you, but on the PGI compiler that you are using).

I will defer to your decision.

@prasanthvkrishna
Copy link
Contributor Author

@prasanthvkrishna @cenlinhe

ISNAN is not supported by PGI compiler

This intrinsic became part of the standard with Fortran2003. We should be able to rely on isnan being present (not a slam on you, but on the PGI compiler that you are using).

I will defer to your decision.
@davegill
So you suggest using ISNAN? Should I make it active then?

@jamiebresch
Copy link
Contributor

@prasanthvkrishna @cenlinhe

ISNAN is not supported by PGI compiler

This intrinsic became part of the standard with Fortran2003. We should be able to rely on isnan being present (not a slam on you, but on the PGI compiler that you are using).

I will defer to your decision.

isnan can be implemented like

WRF/phys/module_mp_p3.F

Lines 5311 to 5315 in fb60d61

logical function isnan(arg1)
real,intent(in) :: arg1
isnan=( arg1 .ne. arg1 )
return
end function isnan

That function appears not actually used by P3, though.

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 5, 2021

@davegill @prasanthvkrishna Thanks. Not sure why the PGI compiler in Cheyenne does not include this intrinsic (I tested it using the latest PGI compiler pgi/20.4). How about this: let's remove this ISNAN in noahmplsm here for this WRF release, if we find any potential NaN issue that might occur to this variable (less likely) in the future applications, we will revisit it through bug fix.

@prasanthvkrishna
Copy link
Contributor Author

@prasanthvkrishna @cenlinhe

ISNAN is not supported by PGI compiler

This intrinsic became part of the standard with Fortran2003. We should be able to rely on isnan being present (not a slam on you, but on the PGI compiler that you are using).
I will defer to your decision.

isnan can be implemented like

WRF/phys/module_mp_p3.F

Lines 5311 to 5315 in fb60d61

logical function isnan(arg1)
real,intent(in) :: arg1
isnan=( arg1 .ne. arg1 )
return
end function isnan

That function appears not actually used by P3, though.

@jamiebresch Thanks :)

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 5, 2021

@prasanthvkrishna @cenlinhe

ISNAN is not supported by PGI compiler

This intrinsic became part of the standard with Fortran2003. We should be able to rely on isnan being present (not a slam on you, but on the PGI compiler that you are using).
I will defer to your decision.

isnan can be implemented like

WRF/phys/module_mp_p3.F

Lines 5311 to 5315 in fb60d61

logical function isnan(arg1)
real,intent(in) :: arg1
isnan=( arg1 .ne. arg1 )
return
end function isnan

That function appears not actually used by P3, though.

@jamiebresch Thanks :)

This would also be an option.

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 5, 2021

@prasanthvkrishna @davegill OK, it seems that we could implement the isnan function to resolve this issue. Prasanth, could you please implement this function into module_sf_noahmplsm.F and do a quick test if it works?

@prasanthvkrishna
Copy link
Contributor Author

prasanthvkrishna commented Apr 5, 2021 via email

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 5, 2021

@davegill So if we implement the logical function as suggested above following module_mp_p3.F, we will use another function name "isnan_lsm" to avoid conflicts with "isnan" that is already an intrinsic function name for INTEL currently. Do you think this works for you?

@davegill
Copy link
Contributor

davegill commented Apr 7, 2021

@prasanthvkrishna @dudhia @weiwangncar
Prasanth,
Take a look at #1460
What if we removed the ISNAN part of this PR, and put the ISNAN change into my PR?

Comment on lines +8046 to +8052

logical function isnan_lsm(arg1)
real,intent(in) :: arg1
isnan_lsm = (arg1 .ne. arg1)
return
end function isnan_lsm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "roll your own" ISNAN() function is the technique used in other physics packages (P3 MP, TEMF BL). I am entirely OK with this solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @davegill, OK thanks. We will go with our solution here by defining the isnan_lsm function as done in other physics packages.

@davegill
Copy link
Contributor

davegill commented Apr 7, 2021

@davegill So if we implement the logical function as suggested above following module_mp_p3.F, we will use another function name "isnan_lsm" to avoid conflicts with "isnan" that is already an intrinsic function name for INTEL currently. Do you think this works for you?

Yes, this is just fine. It is done elsewhere in the model.

@davegill davegill self-requested a review April 7, 2021 17:41
Copy link
Contributor

@davegill davegill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Packaging is a good idea
  2. ISNAN() functionality is implemented as is already done in P3 and TEMF

@cenlinhe
Copy link
Contributor

cenlinhe commented Apr 7, 2021

Thanks, @davegill !

@prasanthvkrishna
Copy link
Contributor Author

  1. Packaging is a good idea
  2. ISNAN() functionality is implemented as is already done in P3 and TEMF

@davegill Thanks, Dave.

@davegill
Copy link
Contributor

davegill commented Apr 8, 2021

@prasanthvkrishna @cenlinhe @dudhia

Make sure these arrays are not in any executed code lines when the option is off.

Folks,
Jimy made the request above. Has this been verified?

@prasanthvkrishna
Copy link
Contributor Author

@prasanthvkrishna @cenlinhe @dudhia

Make sure these arrays are not in any executed code lines when the option is off.

Folks,
Jimy made the request above. Has this been verified?

@dudhia @davegill Yes Dave. I tested it by opting the unified Noah instead of Noah-MP. None of the dynamic irrigation 2d fields are in the WRF output. So, the packaging worked.

@dudhia
Copy link
Collaborator

dudhia commented Apr 8, 2021 via email

@davegill
Copy link
Contributor

@prasanthvkrishna

Another test should make sure NoahMP results are not changed when the
irrigation scheme is off before and after packaging.

What is the status of Jimy's requested test?

@prasanthvkrishna
Copy link
Contributor Author

@prasanthvkrishna

Another test should make sure NoahMP results are not changed when the
irrigation scheme is off before and after packaging.

What is the status of Jimy's requested test?

@dudhia @davegill
I checked the results. No difference between versions. Thanks.

@davegill davegill merged commit 6e29bca into wrf-model:release-v4.3 Apr 14, 2021
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: Noah MP, dynamic irrigation, packaging

SOURCE: Prasanth Valayamkunnath (NCAR)

DESCRIPTION OF CHANGES:
1. To package Noah MP dynamic irrigation variables (small clean-up before release).
2. Generate an internal ISNAN() function. This is already done with TEMF and P3 schemes.

LIST OF MODIFIED FILES: 
          Registry/Registry.EM_COMMON
          Registry/Registry.NMM 
          phys/module_sf_noahmplsm.F (resolve issue with ISNAN with PGI compiler)

TESTS CONDUCTED: 
1. Compiled the model using intel/19.0.5. 
2. Code builds with PGI compiler.
3. Results without NoahMP are identical before vs after.
4. Results with NoahMP are identical before vs after.
5. Jenkins testing OK
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.

5 participants