Skip to content

Commit af4c5a1

Browse files
fix doxygen and some code warnings (#120)
* fix doxygen * fixed some warnings * more warning fixes * more warning fixes * more warnings fixed * fixed more warnings * fixed more warnings * turned on -Werror * fixed warning * fixed warning * fixed warning
1 parent 740bd87 commit af4c5a1

File tree

5 files changed

+47
-43
lines changed

5 files changed

+47
-43
lines changed

.github/workflows/developer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
cd g2tmpl
3838
mkdir build
3939
cd build
40-
cmake -DENABLE_DOCS=ON -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall -Werror" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall" -DCMAKE_BUILD_TYPE=Debug ..
40+
cmake -DENABLE_DOCS=ON -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall -Werror" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -fsanitize=address -Wall -Werror" -DCMAKE_BUILD_TYPE=Debug ..
4141
make -j2 VERBOSE=1
4242
4343
- name: test

src/grib2_all_tables_module.F90

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ module grib2_all_tables_module
220220
data table1_4(8) /type_of_data('proc_rad_obs',7)/
221221
data table1_4(9) /type_of_data('event_prob',8)/
222222
data table1_4(10) /type_of_data('missing',255)/
223-
data table1_4(11) /type_of_data('experimental_products',192)/
223+
data table1_4(11) /type_of_data('experimental_product',192)/
224224
!
225225
!
226226
type type_of_gen_proc
@@ -1172,7 +1172,7 @@ module grib2_all_tables_module
11721172
data on388_tablea(112) /gen_proc('extra_trop_storm_surge_pacific',17)/
11731173
data on388_tablea(113) /gen_proc('prob_extra_trop_storm_surge',18)/
11741174
data on388_tablea(114) /gen_proc('linmit_fine_mesh_anal',19)/
1175-
data on388_tablea(115) /gen_proc('extra_trop_storm_surge_micronesia',20)/
1175+
data on388_tablea(115) /gen_proc('extra_trop_storm_surge_microne',20)/
11761176
data on388_tablea(116) /gen_proc('hur_weather_res_and_fcst',71)/
11771177
data on388_tablea(117) /gen_proc('hur_non-hydro_multi',72)/
11781178
!
@@ -1188,7 +1188,7 @@ module grib2_all_tables_module
11881188
!
11891189
data on388_tablea(120) /gen_proc('extra_trop_storm_surge_atl_3d',21)/
11901190
data on388_tablea(121) /gen_proc('extra_trop_storm_surge_pac_3d',22)/
1191-
data on388_tablea(122) /gen_proc('extra_trop_storm_surge_micro_3d',23)/
1191+
data on388_tablea(122) /gen_proc('extra_trop_storm_surge_micro_3',23)/
11921192

11931193
contains
11941194
!
@@ -1394,13 +1394,14 @@ end subroutine get_g2_unitoftimerange
13941394
!>
13951395
!> @param[in] key - GRIB2 character short key for fixed surface types from Table 4.5
13961396
!> @param[out] value - corresponding GRIB2 value from Table 4.5
1397-
!> @param[out] ierr - error messages
1397+
!> @param[out] ierr - 0 for success, 9 if key not found
13981398
!>
1399-
!> @author V. Krishna Kumar ORG: W/NP12 @date 2009-12-10
1399+
!> @author V. Krishna Kumar ORG: W/NP12 @date 2009-12-10
14001400
subroutine get_g2_fixedsurfacetypes(key, value, ierr)
14011401
character(len=*) :: key
14021402
integer :: value, n, ierr
14031403
!
1404+
ierr = 0
14041405
do n=1, MAXFIXEDSURFACETYPES
14051406
if (trim(table4_5(n)%fixedsurfacetypeskey).eq.trim(key)) then
14061407
value=table4_5(n)%fixedsurfacetypesval
@@ -1411,7 +1412,7 @@ subroutine get_g2_fixedsurfacetypes(key, value, ierr)
14111412
value=table4_5(66)%fixedsurfacetypesval
14121413
! print *, 'get_g2_fixedsurfacetypes key: ', trim(key), value, &
14131414
! ' not found in table 4.5'
1414-
! ierr=9
1415+
ierr=9
14151416
return
14161417
end subroutine get_g2_fixedsurfacetypes
14171418
!>
@@ -2034,9 +2035,9 @@ subroutine g2sec4_temp44(icatg, iparm, aer_type, typ_intvl_size, &
20342035
call get_g2_typeofintervals(typ_intvl_size, value, ierr)
20352036
ipdstmpl44(4) = value
20362037
ipdstmpl44(5) = scale_fac1_size
2037-
ipdstmpl44(6) = scale_val1_size
2038+
ipdstmpl44(6) = int(scale_val1_size)
20382039
ipdstmpl44(7) = scale_fac2_size
2039-
ipdstmpl44(8) = scale_val2_size
2040+
ipdstmpl44(8) = int(scale_val2_size)
20402041
!
20412042
call get_g2_typeofgenproc(typ_gen_proc_key, value, ierr)
20422043
ipdstmpl44(9) = value
@@ -2066,11 +2067,14 @@ subroutine g2sec4_temp44(icatg, iparm, aer_type, typ_intvl_size, &
20662067
!
20672068
end subroutine g2sec4_temp44
20682069
!>
2069-
!> This subroutine returns the Grib2 Section 4 Template 4.0 list for given keys
2070-
!> PDT 4.46 - Average, accumulation, and/or extreme values or other
2071-
!> statistically processed values at a horizontal level
2072-
!> or in a horizontal layer in a continuous or
2073-
!> non-continuous time interval for aerosol.
2070+
!> Returns the GRIB2 Section 4 Template 4.0 list.
2071+
!>
2072+
!> <pre>
2073+
!> PDT 4.46 - Average, accumulation, and/or extreme values or other
2074+
!> statistically processed values at a horizontal level
2075+
!> or in a horizontal layer in a continuous or
2076+
!> non-continuous time interval for aerosol.
2077+
!> </pre>
20742078
!>
20752079
!> @param[in] icatg - Parameter category (see Code table 4.1)
20762080
!> @param[in] iparm - Parameter number (see Code table 4.2)
@@ -2098,28 +2102,33 @@ end subroutine g2sec4_temp44
20982102
!> @param[in] hour_intvl - Hour Time of end of overall time interval
20992103
!> @param[in] min_intvl - Minute Time of end of overall time interval
21002104
!> @param[in] sec_intvl - Second Time of end of overall time interval
2101-
!> @param[in] num_time_range - n number of time ranges specifications describing
2102-
!> the time intervals used to calculate the
2103-
!> statistically-processed field
2104-
!> @param[in] stat_miss_val - Total number of data values missing in statistical process
2105-
!> Specification of the outermost (or only) time range over
2106-
!> which statistical processing is done
2107-
!> @param[in] type_of_stat_proc - Statistical process used to calculate the processed
2108-
!> field from the field at each time increment during the
2109-
!> time range (see Code Table 4.10)
2110-
!> @param[in] type_of_time_inc - Type of time increment between successive fields
2111-
!> used in the statistical processing (see Code Table 4.11)
2112-
!> @param[in] stat_unit_time_key - Indicator of unit of time for time range over which
2113-
!> statistical processing is done (see Code Table 4.4)
2114-
!> @param[in] leng_time_range_stat - Length of the time range over which statistical processing
2115-
!> is done, in units defined by the previous octet
2116-
!> @param[in] stat_unit_time_key_succ - Indicator of unit of time for the increment between the
2117-
!> successive fields used (see Code table 4.4)
2118-
!> @param[in] time_inc_betwn_succ_fld - Time increment between successive fields,
2119-
!> in units defined by the previous octet (see Notes 3 & 4)
2105+
!> @param[in] num_time_range - n number of time ranges
2106+
!> specifications describing the time intervals used to calculate
2107+
!> the statistically-processed field
2108+
!> @param[in] stat_miss_val - Total number of data values missing in
2109+
!> statistical process Specification of the outermost (or only) time
2110+
!> range over which statistical processing is done
2111+
!> @param[in] type_of_stat_proc - Statistical process used to
2112+
!> calculate the processed field from the field at each time
2113+
!> increment during the time range (see Code Table 4.10)
2114+
!> @param[in] type_of_time_inc - Type of time increment between
2115+
!> successive fields used in the statistical processing (see Code
2116+
!> Table 4.11)
2117+
!> @param[in] stat_unit_time_key - Indicator of unit of time for
2118+
!> time range over which statistical processing is done (see Code
2119+
!> Table 4.4)
2120+
!> @param[in] leng_time_range_stat - Length of the time range over
2121+
!> which statistical processing is done, in units defined by the
2122+
!> previous octet
2123+
!> @param[in] stat_unit_time_key_succ - Indicator of unit of time
2124+
!> for the increment between the successive fields used (see Code
2125+
!> table 4.4)
2126+
!> @param[in] time_inc_betwn_succ_fld - Time increment between
2127+
!> successive fields, in units defined by the previous octet (see
2128+
!> Notes 3 & 4)
21202129
!> @param[out] ipdstmpl46 - GRIB2 PDS Template 4.46 listing
21212130
!>
2122-
!> @author E. JAMES ORG: NOAA/GSL @date 2024-04-02
2131+
!> @author E. JAMES, NOAA/GSL @date 2024-04-02
21232132
subroutine g2sec4_temp46(icatg, iparm, aer_type, typ_intvl_size, &
21242133
scale_fac1_size, scale_val1_size, scale_fac2_size, &
21252134
scale_val2_size, typ_gen_proc_key, gen_proc_or_mod_key, &
@@ -2409,7 +2418,6 @@ subroutine g2sec5_temp0(dec_scale_fac, bin_scale_fac, tlnumbits, ifield5)
24092418
integer(4), intent(in) :: bin_scale_fac, dec_scale_fac, tlnumbits
24102419
integer(4), intent(out) :: ifield5(5)
24112420
! character(len=50) :: type_of_field
2412-
integer(4) :: value, ierr
24132421
!
24142422
ifield5(1) = 0 ! Any value. Will be later overwritten
24152423
ifield5(2) = bin_scale_fac
@@ -2439,8 +2447,6 @@ subroutine g2sec5_temp2(dec_scale_fac, bin_scale_fac, ifield5)
24392447
integer(4), intent(inout) :: ifield5(16)
24402448
integer(4), intent(in) :: dec_scale_fac, bin_scale_fac
24412449
!
2442-
integer(4) :: value, ierr
2443-
!
24442450
ifield5=0
24452451
ifield5(1) = 0 ! Any value. Will be later overwritten
24462452
ifield5(2) = bin_scale_fac
@@ -2519,8 +2525,6 @@ subroutine g2sec5_temp40(dec_scale_fac, bin_scale_fac, tlnumbits,
25192525
!--- local variable
25202526
integer(4) :: value, ierr
25212527
integer, parameter :: MAX_NUMBIT=16
2522-
integer ibm
2523-
integer, allocatable :: mg(:)
25242528
!
25252529
ifield5(1) = 0 ! Any value. Will be later overwritten
25262530
ifield5(2) = bin_scale_fac

tests/test_g2tmpl_pdt4_1.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Program test_g2tmpl_pdt4_1
1818
unit_of_time_key,lvl_type1,lvl_type2, &
1919
type_ens_fcst_key
2020

21-
integer(4) :: bckgnd_gen_proc_id ! defined by the center
21+
! integer(4) :: bckgnd_gen_proc_id ! defined by the center
2222

2323
integer(4) :: ipdstmpl1_old(18)=(/0, 4, 4, 0, 107, 0, 0, 1, 6, &
2424
103, 0, 2, 255, 0, 0, 3, 5, 10/)

tests/test_g2tmpl_pdt4_11.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Program test_g2tmpl_pdt4_11
2424
stat_unit_time_key,stat_unit_time_key_succ, &
2525
type_ens_fcst_key
2626
!
27-
integer(4) :: bckgnd_gen_proc_id ! defined by the center
27+
! integer(4) :: bckgnd_gen_proc_id ! defined by the center
2828
!
2929

3030
integer(4) :: ipdstmpl11_old(32)=(/0, 4, 4, 0, 107, 0, 0, 1, 6, &

tests/test_g2tmpl_pdt4_12.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Program test_g2tmpl_pdt4_12
1616
integer(4) :: year_intvl,mon_intvl,day_intvl,hour_intvl,min_intvl, &
1717
sec_intvl,num_time_range,stat_miss_val, &
1818
leng_time_range_stat,time_inc_betwn_succ_fld
19-
integer(4) :: perturb_num, num_fcst_ens
19+
integer(4) :: num_fcst_ens
2020
!
2121
character(len=80) :: typ_gen_proc_key,gen_proc_or_mod_key, &
2222
unit_of_time_key,lvl_type1,lvl_type2, &
2323
type_of_stat_proc,type_of_time_inc, &
2424
stat_unit_time_key,stat_unit_time_key_succ, &
2525
type_derive_fcst_key
2626
!
27-
integer(4) :: bckgnd_gen_proc_id ! defined by the center
27+
!integer(4) :: bckgnd_gen_proc_id ! defined by the center
2828
!
2929

3030
integer(4) :: ipdstmpl12_old(31)=(/0, 4, 4, 0, 107, 0, 0, 1, 6, &

0 commit comments

Comments
 (0)