Fix 4 bugs and add numerous upgrades for genesis detection
Add several bug fixes and numerous upgrades
Here are four bugs that are fixed in this update:
(1) Value of the array index for readgenflag in subroutine
get_gen_diags was incorrectly set, preventing 850 mb
moisture divergence from ever being calculated.
(2) In subroutine first_ges_center, a bunch of counters needed to
be upgraded from 4-byte to 8-byte integers. As 4-byte ints,
they were unable to hold the values that were being summed,
and as a result the cutoff for the search for new storms at a
given lead time was being incorrectly set.
(3) Sam Trahan updated the file-waiting routines that he wrote,
i.e., cwaitfor.c and module_waitfor.f. There were a lot of
variables in these routines that needed to be upgraded from
4-byte to 8-byte in order for this waiting procedure to
continue working properly for checking on the existence of
files with large sizes > 2 GB.
(4) There was an error in the formatting of the output atcfunix
record. An extra comma was included. I gave a separate fix
for this one to Zhan Zhang back in June, but I am just getting
to adding it to GitHub now.
New features include, for TC genesis runs, adding an additional check
for a low-level wind circulation, in order to be more consistent with
how NHC diagnoses genesis for observed storms. A new subroutine,
check_for_closed_wind_circulation, was added for this purpose.
I added an option that allows the user to request to have the MSLP
data smoothed first before searching for new storms, when run in
genesis mode. This was done as a result of a lot of testing I did when
running the tracker in genesis mode on hi-res (3 km) T-SHiELD data.
The MSLP data was particularly noisy, especially for pre-formation
disturbances in the model, and this was tripping up the various
algorithms in the tracker that check for things like radial MSLP
gradients and closed MSLP contours. There is now a flag in the
namelist which a user can set to specify using this smoothing, and
that smoothing is done in subroutine find_all_maxmins.
I added many tweaks and new checks in subroutine
check_mslp_radial_gradient, which is a relatively newer routine for
checking in a 360-degree fasion surrounding the storm and also has a
requirement for scale of a MSLP disturbance.
A major rewrite was done for the I/O for NetCDF files. Previously,
I had it set for just using 4-byte reals, because the only files I had
ever tested with were GFDL SHiELD NetCDF files, which use 4-byte
reals. However, this caused problems with 4-byte vs. 8-byte arithmetic
when used with other files, and so I changed all the code surrounding
NetCDF I/O such that it first uses NetCDF library commands to check to
see if the data values are 4-byte or 8-byte and then calls the required
routines accordingly.