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

hailwat tracer index is uninitialized in setup_pt_NH_BC #328

Closed
SamuelTrahanNOAA opened this issue Mar 8, 2024 · 0 comments
Closed

hailwat tracer index is uninitialized in setup_pt_NH_BC #328

SamuelTrahanNOAA opened this issue Mar 8, 2024 · 0 comments

Comments

@SamuelTrahanNOAA
Copy link

SamuelTrahanNOAA commented Mar 8, 2024

Describe the bug
In subroutine setup_pt_NH_BC within fv_nesting.F90, you will find this code:

   integer :: liq_wat, ice_wat, rainwat, snowwat, graupel, hailwat
...
   liq_wat = get_tracer_index (MODEL_ATMOS, 'liq_wat')
   ice_wat = get_tracer_index (MODEL_ATMOS, 'ice_wat')
   rainwat = get_tracer_index (MODEL_ATMOS, 'rainwat')
   snowwat = get_tracer_index (MODEL_ATMOS, 'snowwat')
   graupel = get_tracer_index (MODEL_ATMOS, 'graupel')

...
   if (hailwat > 0) then
      hailwatBC_west  => q_BC(hailwat)%west_t1
      hailwatBC_east  => q_BC(hailwat)%east_t1
      hailwatBC_north => q_BC(hailwat)%north_t1
      hailwatBC_south => q_BC(hailwat)%south_t1
   else
      hailwatBC_west  => dum_west
      hailwatBC_east  => dum_east
      hailwatBC_north => dum_north
      hailwatBC_south => dum_south
   endif

Notice the hailwat is never initialized.

I suspect the correct solution is to add this line:

   hailwat = get_tracer_index (MODEL_ATMOS, 'hailwat')

To Reproduce
There is no straightforward way to reproduce this behavior at runtime, but it is obvious from the code.

Expected behavior
Variables should be initialized and array indexes should be correct.

System Environment
N/A - the error is plainly visible in the source code

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants