|
| 1 | +! This is a test program for the NCEPLIBS-g2tmpl project. It tests the |
| 2 | +! g2sec4_temp9() subroutine. |
| 3 | +! |
| 4 | +! Edward Hartnett 4/16/24 |
| 5 | +Program test_g2tmpl_pdt4_9 |
| 6 | + use grib2_all_tables_module |
| 7 | + implicit none |
| 8 | + |
| 9 | + integer(4) :: ipdstmpl9(36) |
| 10 | + integer(4) :: icatg, iparm, hrs_obs_cutoff, min_obs_cutoff, fcst_time, & |
| 11 | + scale_fac1, scaled_val1, scale_fac2, scaled_val2, prob_num, tot_num_prob, & |
| 12 | + scale_fac_lower_limit, scale_fac_upper_limit |
| 13 | + integer(4) :: year_intvl, mon_intvl, day_intvl, hour_intvl, min_intvl, & |
| 14 | + sec_intvl, num_time_range, stat_miss_val, & |
| 15 | + leng_time_range_stat, time_inc_betwn_succ_fld |
| 16 | + |
| 17 | + real :: scale_val_lower_limit, scale_val_upper_limit |
| 18 | + |
| 19 | + character(len=80) :: typ_gen_proc_key, gen_proc_or_mod_key, & |
| 20 | + unit_of_time_key, lvl_type1, lvl_type2, type_of_prob1, & |
| 21 | + type_of_stat_proc, type_of_time_inc, & |
| 22 | + stat_unit_time_key, stat_unit_time_key_succ |
| 23 | + |
| 24 | + integer(4) :: ipdstmpl9_old(36)=(/ 2, 220, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, & |
| 25 | + 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /) |
| 26 | + integer ipdsnum, ipdstmpllen, j |
| 27 | + |
| 28 | + print *, 'Testing g2sec4_temp9...' |
| 29 | + |
| 30 | + icatg=2 |
| 31 | + iparm=220 |
| 32 | + typ_gen_proc_key = 'anal' |
| 33 | + gen_proc_or_mod_key = 'res' |
| 34 | + hrs_obs_cutoff = 0 |
| 35 | + min_obs_cutoff = 0 |
| 36 | + unit_of_time_key = 'minute' |
| 37 | + fcst_time = 0 |
| 38 | + lvl_type1 = 'xxx' |
| 39 | + scale_fac1 = 0 |
| 40 | + scaled_val1 = 0 |
| 41 | + lvl_type2 = 'xxx' |
| 42 | + scale_fac2 = 0 |
| 43 | + scaled_val2 = 0 |
| 44 | + prob_num = 0 |
| 45 | + tot_num_prob = 0 |
| 46 | + type_of_prob1 = 'prob_below_lower_limit' |
| 47 | + scale_fac_lower_limit = 0 |
| 48 | + scale_val_lower_limit = 0 |
| 49 | + scale_fac_upper_limit = 0 |
| 50 | + scale_val_upper_limit = 0 |
| 51 | + year_intvl = 0 |
| 52 | + mon_intvl = 0 |
| 53 | + day_intvl = 0 |
| 54 | + hour_intvl = 0 |
| 55 | + min_intvl = 0 |
| 56 | + sec_intvl = 0 |
| 57 | + num_time_range = 0 |
| 58 | + stat_miss_val = 0 |
| 59 | + type_of_stat_proc = 'AVE' |
| 60 | + type_of_time_inc = 'reserved' |
| 61 | + stat_unit_time_key = 'minute' |
| 62 | + leng_time_range_stat = 0 |
| 63 | + stat_unit_time_key_succ = 'minute' |
| 64 | + time_inc_betwn_succ_fld = 0 |
| 65 | + ipdsnum=9 |
| 66 | + ipdstmpllen=36 |
| 67 | + |
| 68 | + call g2sec4_temp9(icatg, iparm, typ_gen_proc_key, gen_proc_or_mod_key, & |
| 69 | + hrs_obs_cutoff, min_obs_cutoff, unit_of_time_key, & |
| 70 | + fcst_time, lvl_type1, scale_fac1, scaled_val1, lvl_type2, & |
| 71 | + scale_fac2, scaled_val2, prob_num, tot_num_prob, type_of_prob1, & |
| 72 | + scale_fac_lower_limit, scale_val_lower_limit, & |
| 73 | + scale_fac_upper_limit, scale_val_upper_limit, year_intvl, & |
| 74 | + mon_intvl, day_intvl, hour_intvl, min_intvl, sec_intvl, & |
| 75 | + num_time_range, stat_miss_val, type_of_stat_proc, & |
| 76 | + type_of_time_inc, stat_unit_time_key, & |
| 77 | + leng_time_range_stat, stat_unit_time_key_succ, & |
| 78 | + time_inc_betwn_succ_fld, ipdstmpl9) |
| 79 | + |
| 80 | + write(6,'(A,1x,i0,a,80(1x,I0))')'OLD_PRODUCT TEMPLATE 4.', & |
| 81 | + ipdsnum,' : ',(ipdstmpl9_old(j),j=1,ipdstmpllen) |
| 82 | + write(6,'(A,1x,i0,a,80(1x,I0))')'NEW_PRODUCT TEMPLATE 4.', & |
| 83 | + ipdsnum,' : ',(ipdstmpl9(j),j=1,ipdstmpllen) |
| 84 | + |
| 85 | + do j = 1, ipdstmpllen |
| 86 | + if (ipdstmpl9(j) .ne. ipdstmpl9_old(j)) stop 2 |
| 87 | + end do |
| 88 | + |
| 89 | + print *, 'OK!' |
| 90 | + print *, 'SUCCESS!' |
| 91 | + |
| 92 | +end Program test_g2tmpl_pdt4_9 |
0 commit comments