generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Uninitialized variables in NGEN/Snow-17 #50
Comments
Hi Steve, can you check how this relates to PR#48? I think I corrected
this issue. -Andy
…On Sat, Sep 7, 2024 at 1:20 PM StephenDrake-NOAA ***@***.***> wrote:
The values of precip_scf(nh) and forcing%pa are initialized as huge(1.0)
but never overwritten in the NGEN/Snow-17 executable.
Current behavior
When compiling Snow-17 with NGEN, the precip_scf output value in the
cat-*.csv file is "inf".
Expected behavior
The precip_scf output value should not be "inf"
Nature of the problem
The value of precip_scf(nh) is initialized as huge(1.0) in
forcingType.f90::initForcing() but never overwritten:
this%precip_scf(:) = huge(1.0)
forcingType.f90::initForcing(): this%precip_scf(:): 3.40282347E+38
When this value is multiplied by the catchment area, it becomes "inf".
In contrast, when snow-17 is run without NGEN, it calls
read_areal_forcing(). This is where precip_scf and forcing_pa(nh) are
initialized:
forcing%precip_scf(nh) = forcing%precip(nh) * parameters%scf(nh) ! scale input precip by snow correction factor
! (note: this is for output; model input
! precip is scaled in pack19()
call sfc_pressure(parameters%elev(nh), forcing%pa(nh)) ! fill in the surface pressure field
Solution
Minimally, precip_scf(nh) must be initialized. For completeness, the
surface pressure field should also be initialized although It is not clear
that it is used.
—
Reply to this email directly, view it on GitHub
<#50>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIKARLFAQVM2QKNIT7AILTZVNGZLAVCNFSM6AAAAABN2IPKZCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUYTEMBTGA4TCMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes, that is the same problem. I tested your file changes and they worked. I will close this comment. BTW, I'm working on another issue with units and I'll post that in case you've encountered it. I've seen some scuttlebutt on this issue but I don't know if it has been resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The values of precip_scf(nh) and forcing%pa are initialized as huge(1.0) but never overwritten in the NGEN/Snow-17 executable.
Current behavior
When compiling Snow-17 with NGEN, the precip_scf output value in the cat-*.csv file is "inf".
Expected behavior
The precip_scf output value should not be "inf"
Nature of the problem
The value of precip_scf(nh) is initialized as huge(1.0) in forcingType.f90::initForcing() but never overwritten:
When this value is multiplied by the catchment area, it becomes "inf".
In contrast, when snow-17 is run without NGEN, it calls read_areal_forcing(). This is where precip_scf and forcing_pa(nh) are initialized:
Solution
Minimally, precip_scf(nh) must be initialized. For completeness, the surface pressure field should also be initialized although It is not clear that it is used.
The text was updated successfully, but these errors were encountered: