Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug for Irrigation parameter table read #115

Open
cenlinhe opened this issue Feb 7, 2024 · 0 comments
Open

bug for Irrigation parameter table read #115

cenlinhe opened this issue Feb 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@cenlinhe
Copy link
Collaborator

cenlinhe commented Feb 7, 2024

Users report this bug for WRF debug mode using Noah-MP: https://forum.mmm.ucar.edu/threads/floating-point-exception-phys-module_sf_noahmplsm-f-at-noahmp_sflx-subroutine.15638/#post-39058

Here is what from the WRF users. This needs to be fixed soon:
"
I agree, it does not make sense that the reading of namelist does not work in debug compilation mode. For sure is that, in debug mode, we can not operate with 'NaN' variables, which it is not checked in production mode and for sure compiled with optimization > -O2

I realized that the call to read the irrigation parameters (subroutine read_mp_irrigation_parameters from phys/module_sf_noahmpdrv.F) is done within NOAHMP_INIT called in phys/module_physics_init.F, which has:
Code:
if(iopt_irr >= 1) call read_mp_irrigation_parameters()
Therfore, as in my case, if you are not using irrigation iopt_irr=0, irrigation parameters are never read. Which might explain, why it does not have any value...?
So maybe, should the NOAHMP_INIT be modified, and introduce 'default' values to the irrigation_parameters values, to overcome the situation when irrigation is not used? Something like (I use the default values as they appear in read_mp_irrigation_parameters):
Code:
! Default values
IRR_FRAC_TABLE = -1.0E36 ! irrigation Fraction
IRR_HAR_TABLE = 0 ! number of days before harvest date to stop irrigation
IRR_LAI_TABLE = -1.0E36 ! Minimum lai to trigger irrigation
IRR_MAD_TABLE = -1.0E36 ! management allowable deficit (0-1)
FILOSS_TABLE = -1.0E36 ! fraction of flood irrigation loss (0-1)
SPRIR_RATE_TABLE = -1.0E36 ! mm/h, sprinkler irrigation rate
MICIR_RATE_TABLE = -1.0E36 ! mm/h, micro irrigation rate
FIRTFAC_TABLE = -1.0E36 ! flood application rate factor
IR_RAIN_TABLE = -1.0E36 ! maximum precipitation to stop irrigation trigger
if(iopt_irr >= 1) call read_mp_irrigation_parameters()
Although it would be more elegant if irrigation_parameters is called including the iopt_irr parameter and then inside:
Code:
(...)
IF (iopt_irr >= 1) THEN
inquire( file='MPTABLE.TBL', exist=file_named )
if ( file_named ) then
open(15, file="MPTABLE.TBL", status='old', form='formatted', action='read', iostat=ierr)
(...)
read(15,noahmp_irrigation_parameters)
close(15)
END IF
And modify its call from NOAHMP_INIT as:
Code:
call read_mp_irrigation_parameters(iopt_irr)
"

@cenlinhe cenlinhe added the bug Something isn't working label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant