NOAA-GFDL/GFDL_atmos_cubed_sphere

intentional ps_reg=-9999999 bug in fv_regional_bc.F90 to hide lack of testing

Closed this issue · 1 comments

Describe the bug

After developing some very buggy software (#212, #213, #214) instead of testing it and fixing the bugs, the developer hid the issues by initializing surface pressure to -9999999. Due to several other errors (not caught due to the lack of testing), this propagated to the model, causing floating point exceptions when the model is run in debug mode with boundary conditions. Thanks to this intentional bug, the RRFS has not been tested in debug mode for a long time. In addition, there are gibberish values in all of the fields at the edge of processors and at the edge of the boundary due to interpolation with -9999999.

In fv_regional_bc.F90:

  allocate(ps_reg(is_input:ie_input,js_input:je_input)) ; ps_reg=-9999999 ! for now don't set to snan until remap dwinds is changed                                                                                                   

It should be noted that the problems are not restricted to "remap dwinds" but are throughout fv_regional_bc.F90 and even in the boundary condition files themselves, which do not provide "ps" on all wind points. Had this code been tested, instead of hidden behind a -9999999, these bugs would have been caught and fixed a long time ago.

To Reproduce
Read the code. Or, turn on debug mode and witness -9999999 showing up later in the model.

Expected behavior
This should never have been in a pull request, and certainly should not have passed review.

Will open new issue shortly.