50 use snowdat, only : nesdis_res, &
61 snow_dep_afwa_global, &
81 bad_afwa_nh, bad_afwa_sh
85 real,
allocatable :: snow_cvr_mdl(:,:)
86 real,
allocatable :: snow_dep_mdl(:,:)
167 integer,
parameter :: km=1
169 integer :: i, j, ii, jj, ij
170 integer :: ijmdl2, istart, iend, imid, iii
171 integer,
allocatable :: idum(:,:)
172 integer :: int_opt, ipopt(20), ibi(km)
173 integer :: kgds_mdl_tmp(200)
174 integer :: no, ibo(km), iret, nret
176 logical*1,
allocatable :: bitmap_mdl(:,:)
178 real :: gridi(1), gridj(1)
179 real :: lats(1), lons(1)
180 real,
allocatable :: lsmask_1d(:)
181 real,
allocatable :: snow_cvr_mdl_1d(:,:)
182 real,
allocatable :: snow_dep_mdl_tmp(:,:)
183 real :: sumc, sumd, x1, r, fraction, gridis, gridie
184 real,
parameter :: undefined_value = -999.
193 if (minval(lats_mdl) < -10.0 .and. .not. use_global_afwa .and. .not. use_sh_afwa .and. .not. use_autosnow)
then
194 print*,
"- FATAL ERROR: MUST SELECT EITHER AFWA OR AUTOSNOW DATA FOR MODEL GRID WITH SH POINTS."
195 call w3tage(
'SNOW2MDL')
205 if (maxval(lats_mdl) < 0.0)
then
215 if (maxval(lats_mdl) > 0.0 .and. .not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_nesdis)
then
216 print*,
"- FATAL ERROR: MUST SELECT EITHER NESDIS/IMS OR AFWA DATA FOR MODEL GRID WITH NH POINTS."
217 call w3tage(
'SNOW2MDL')
227 if (minval(lats_mdl) > 0.0)
then
236 nesdis_ims :
if (use_nesdis)
then
240 if (nesdis_res < (0.5*resol_mdl))
then
241 print*,
"- INTERPOLATE NH NESDIS/IMS DATA TO MODEL GRID USING BUDGET METHOD."
245 ipopt(20) = nint(100.0 / nesdis_res) + 1
246 kgds_mdl_tmp = kgds_mdl
247 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
251 print*,
"- INTERPOLATE NH NESDIS/IMS DATA TO MODEL GRID USING NEIGHBOR METHOD."
252 ipopt(1) = nint(100.0 / nesdis_res) + 1
253 kgds_mdl_tmp = kgds_mdl
259 allocate (snow_cvr_mdl_1d(ijmdl,km))
260 snow_cvr_mdl_1d = 0.0
262 allocate (bitmap_mdl(ijmdl,km))
267 call ipolates(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, &
268 (inesdis*jnesdis), ijmdl, &
269 km, ibi, bitmap_nesdis, snow_cvr_nesdis, &
270 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
271 snow_cvr_mdl_1d, iret)
273 deallocate (bitmap_nesdis, snow_cvr_nesdis)
276 print*,
"- FATAL ERROR: IN INTERPOLATION ROUTINE. IRET IS: ", iret
277 call w3tage(
'SNOW2MDL')
290 if (lats_mdl(ij) < 0.0) cycle
291 if (.not. bitmap_mdl(ij,km))
then
292 if (lats_mdl(ij) <= lat_threshold)
then
293 snow_cvr_mdl_1d(ij,km) = 0.0
297 call gdswzd(kgds_nesdis,-1,1,undefined_value,gridi,gridj, &
300 print*,
"- WARNING: MODEL POINT OUTSIDE NESDIS/IMS GRID: ", ipts_mdl(ij), jpts_mdl(ij)
301 snow_cvr_mdl_1d(ij,km) = 0.0
305 if (sea_ice_nesdis(ii,jj) == 1)
then
306 snow_cvr_mdl_1d(ij,km) = 100.0
308 snow_cvr_mdl_1d(ij,km) = 0.0
315 deallocate (sea_ice_nesdis)
316 deallocate (bitmap_mdl)
324 global_afwa :
if (use_global_afwa)
then
333 if (afwa_res < (0.5*resol_mdl))
then
334 print*,
"- INTERPOLATE GLOBAL AFWA DATA TO MODEL GRID USING BUDGET METHOD."
337 ipopt(20) = nint(100.0 / afwa_res) + 1
338 kgds_mdl_tmp = kgds_mdl
339 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
343 print*,
"- INTERPOLATE GLOBAL AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
344 ipopt(1) = nint(100.0 / afwa_res) + 1
345 kgds_mdl_tmp = kgds_mdl
351 allocate (snow_dep_mdl_tmp(ijmdl,km))
352 snow_dep_mdl_tmp = 0.0
354 allocate (bitmap_mdl(ijmdl,km))
357 call ipolates(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, &
358 (iafwa*jafwa), ijmdl, &
359 km, ibi, bitmap_afwa_global, snow_dep_afwa_global, &
360 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
361 snow_dep_mdl_tmp, iret)
363 deallocate(bitmap_afwa_global, snow_dep_afwa_global)
366 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
367 call w3tage(
'SNOW2MDL')
379 if (.not. bitmap_mdl(ij,km))
then
380 if (abs(lats_mdl(ij)) >= lat_threshold)
then
381 snow_dep_mdl_tmp(ij,km) = min_snow_depth
383 snow_dep_mdl_tmp(ij,km) = 0.0
388 deallocate(bitmap_mdl)
396 nh_afwa :
if (use_nh_afwa)
then
405 if (afwa_res < (0.5*resol_mdl))
then
406 print*,
"- INTERPOLATE NH AFWA DATA TO MODEL GRID USING BUDGET METHOD."
409 ipopt(20) = nint(100.0 / afwa_res) + 1
410 kgds_mdl_tmp = kgds_mdl
411 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
415 print*,
"- INTERPOLATE NH AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
416 ipopt(1) = nint(100.0 / afwa_res) + 1
417 kgds_mdl_tmp = kgds_mdl
423 allocate (snow_dep_mdl_tmp(ijmdl,km))
424 snow_dep_mdl_tmp = 0.0
426 allocate (bitmap_mdl(ijmdl,km))
429 call ipolates(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, &
430 (iafwa*jafwa), ijmdl, &
431 1, ibi, bitmap_afwa_nh, snow_dep_afwa_nh, &
432 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
433 snow_dep_mdl_tmp, iret)
435 deallocate(bitmap_afwa_nh, snow_dep_afwa_nh)
438 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
439 call w3tage(
'SNOW2MDL')
451 if (lats_mdl(ij) >= 0.)
then
452 if (.not. bitmap_mdl(ij,km))
then
453 if (abs(lats_mdl(ij)) >= lat_threshold)
then
454 snow_dep_mdl_tmp(ij,km) = min_snow_depth
456 snow_dep_mdl_tmp(ij,km) = 0.0
462 deallocate(bitmap_mdl)
471 allocate (snow_dep_mdl(imdl,jmdl))
472 allocate (snow_cvr_mdl(imdl,jmdl))
476 if (use_global_afwa .and. use_nesdis)
then
477 print*,
"- BLEND NESDIS/IMS AND AFWA DATA IN NH."
479 if (lats_mdl(ij) >= 0.0)
then
480 if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold)
then
481 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
482 max(snow_dep_mdl_tmp(ij,km), min_snow_depth)
484 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km)
487 deallocate (snow_cvr_mdl_1d)
488 elseif (use_nh_afwa .and. use_nesdis)
then
489 print*,
"- BLEND NESDIS/IMS AND AFWA DATA IN NH."
491 if (lats_mdl(ij) >= 0.0)
then
492 if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold)
then
493 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
494 max(snow_dep_mdl_tmp(ij,km), min_snow_depth)
496 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km)
499 deallocate (snow_cvr_mdl_1d)
500 deallocate (snow_dep_mdl_tmp)
501 elseif (use_global_afwa)
then
502 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN NH."
504 if (lats_mdl(ij) >= 0.0)
then
505 if (snow_dep_mdl_tmp(ij,km) > 0.0)
then
506 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
507 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km)
511 elseif (use_nh_afwa)
then
512 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN NH."
514 if (lats_mdl(ij) >= 0.0)
then
515 if (snow_dep_mdl_tmp(ij,km) > 0.0)
then
516 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
517 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km)
521 deallocate (snow_dep_mdl_tmp)
522 elseif (use_nesdis)
then
523 print*,
"- SET DEPTH/COVER FROM NESDIS/IMS DATA IN NH."
525 if (lats_mdl(ij) >= 0.0)
then
526 if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold)
then
527 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth
529 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km)
532 deallocate (snow_cvr_mdl_1d)
539 autosnow :
if (use_autosnow)
then
543 if (autosnow_res < (0.5*resol_mdl))
then
544 print*,
"- INTERPOLATE AUTOSNOW DATA TO MODEL GRID USING BUDGET METHOD."
548 ipopt(20) = nint(100.0 / autosnow_res) + 1
549 kgds_mdl_tmp = kgds_mdl
550 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
554 print*,
"- INTERPOLATE AUTOSNOW DATA TO MODEL GRID USING NEIGHBOR METHOD."
555 ipopt(1) = nint(100.0 / autosnow_res) + 1
556 kgds_mdl_tmp = kgds_mdl
562 allocate (snow_cvr_mdl_1d(ijmdl,km))
563 snow_cvr_mdl_1d = 0.0
565 allocate (bitmap_mdl(ijmdl,km))
569 call ipolates(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, &
570 (iautosnow*jautosnow), ijmdl, &
571 1, ibi, bitmap_autosnow, snow_cvr_autosnow, &
572 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
573 snow_cvr_mdl_1d, iret)
575 deallocate (snow_cvr_autosnow, bitmap_autosnow)
578 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
579 call w3tage(
'SNOW2MDL')
589 if (lats_mdl(ij) < 0.0)
then
590 if (.not. bitmap_mdl(ij,km))
then
591 if (abs(lats_mdl(ij)) <= lat_threshold)
then
592 snow_cvr_mdl_1d(ij,km) = 0.0
594 snow_cvr_mdl_1d(ij,km) = 100.0
600 deallocate (bitmap_mdl)
608 sh_afwa :
if (use_sh_afwa)
then
617 if (afwa_res < (0.5*resol_mdl))
then
618 print*,
"- INTERPOLATE SH AFWA DATA TO MODEL GRID USING BUDGET METHOD."
621 ipopt(20) = nint(100.0 / afwa_res) + 1
622 kgds_mdl_tmp = kgds_mdl
623 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
627 print*,
"- INTERPOLATE SH AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
628 ipopt(1) = nint(100.0 / afwa_res) + 1
629 kgds_mdl_tmp = kgds_mdl
635 allocate (snow_dep_mdl_tmp(ijmdl,km))
636 snow_dep_mdl_tmp = 0.0
638 allocate (bitmap_mdl(ijmdl,km))
641 call ipolates(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, &
642 (iafwa*jafwa), ijmdl, &
643 1, ibi, bitmap_afwa_sh, snow_dep_afwa_sh, &
644 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
645 snow_dep_mdl_tmp, iret)
648 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
649 call w3tage(
'SNOW2MDL')
653 deallocate (bitmap_afwa_sh, snow_dep_afwa_sh)
661 if (lats_mdl(ij) < 0.)
then
662 if (.not. bitmap_mdl(ij,km))
then
663 if (abs(lats_mdl(ij)) >= lat_threshold)
then
664 snow_dep_mdl_tmp(ij,km) = min_snow_depth
666 snow_dep_mdl_tmp(ij,km) = 0.0
672 deallocate(bitmap_mdl)
681 if ((use_sh_afwa .or. use_global_afwa) .and. use_autosnow)
then
682 print*,
"- BLEND AUTOSNOW AND AFWA DATA IN SH."
684 if (lats_mdl(ij) < 0.0)
then
685 if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold)
then
686 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
687 max(snow_dep_mdl_tmp(ij,km), min_snow_depth)
689 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km)
692 deallocate (snow_cvr_mdl_1d)
693 deallocate (snow_dep_mdl_tmp)
694 elseif (use_sh_afwa .or. use_global_afwa)
then
695 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN SH."
697 if (lats_mdl(ij) < 0.0)
then
698 if (snow_dep_mdl_tmp(ij,km) > 0.0)
then
699 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
700 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij,km)
704 deallocate (snow_dep_mdl_tmp)
705 elseif (use_autosnow)
then
706 print*,
"- SET DEPTH/COVER FROM AUTOSNOW IN SH."
708 if (lats_mdl(ij) < 0.0)
then
709 if (snow_cvr_mdl_1d(ij,km) >= snow_cvr_threshold)
then
710 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth
712 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij,km)
715 deallocate (snow_cvr_mdl_1d)
724 if (kgds_mdl(1) == 4 .and. thinned)
then
726 ijmdl2 = sum(lonsperlat_mdl) * 2
727 allocate (snow_cvr_mdl_1d(ijmdl2,km))
728 allocate (lsmask_1d(ijmdl2))
729 allocate (snow_dep_mdl_tmp(ijmdl2,km))
732 snow_cvr_mdl_1d = 0.0
733 snow_dep_mdl_tmp = 0.0
738 if (jj > jmdl/2) jj = jmdl - j + 1
739 r = float(imdl) / float(lonsperlat_mdl(jj))
740 do i = 1, lonsperlat_mdl(jj)
744 lsmask_1d(ij) = lsmask_mdl_sav(imid,j)
745 if (lsmask_mdl_sav(imid,j) == 0.0) cycle
753 if (ii == istart)
then
754 fraction = 0.5 - (gridis - float(istart))
755 elseif (ii == iend)
then
756 fraction = 0.5 + (gridie - float(iend))
760 if (fraction < 0.0001) cycle
762 if (iii < 1) iii = imdl + iii
763 sumc = sumc + fraction * snow_cvr_mdl(iii,j)
764 sumd = sumd + fraction * snow_dep_mdl(iii,j)
766 snow_cvr_mdl_1d(ij,km) = sumc / r
767 snow_dep_mdl_tmp(ij,km) = 0.0
768 if (snow_cvr_mdl_1d(ij,km) > snow_cvr_threshold)
then
769 snow_dep_mdl_tmp(ij,km) = max(sumd / r,min_snow_depth)
774 deallocate (lsmask_mdl_sav)
780 allocate (idum(imdl,jmdl))
782 call
uninterpred(1, idum, lsmask_1d, lsmask_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
783 call
uninterpred(1, idum, snow_cvr_mdl_1d(:,km), snow_cvr_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
784 deallocate(snow_cvr_mdl_1d)
785 call
uninterpred(1, idum, snow_dep_mdl_tmp(:,km), snow_dep_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
786 deallocate(snow_dep_mdl_tmp)
795 if (output_grib2)
then
796 print*,
"- OUTPUT SNOW ANALYSIS DATA IN GRIB2 FORMAT"
799 print*,
"- OUTPUT SNOW ANALYSIS DATA IN GRIB1 FORMAT"
803 deallocate (snow_cvr_mdl)
804 deallocate (snow_dep_mdl)
829 character(len=1),
allocatable :: cgrib(:)
831 integer,
parameter :: numcoord = 0
833 integer :: coordlist(numcoord)
834 integer :: lugb, lcgrib, iret
836 integer :: listsec0(2)
837 integer :: listsec1(13)
838 integer :: ideflist, idefnum, ipdsnum, idrsnum
839 integer :: igdstmplen, ipdstmplen, idrstmplen
840 integer :: ipdstmpl(15)
841 integer,
allocatable :: igdstmpl(:), idrstmpl(:)
842 integer :: ngrdpts, ibmap, lengrib
844 logical*1,
allocatable :: bmap(:), bmap2d(:,:)
846 real,
allocatable :: fld(:)
854 allocate(igdstmpl(igdstmplen))
856 call
init_grib2(grib_century,grib_year, grib_month, grib_day, grib_hour, &
857 kgds_mdl, lat11, latlast, lon11, lonlast, &
858 listsec0, listsec1, igds, ipdstmpl, ipdsnum, igdstmpl, &
859 igdstmplen, idefnum, ideflist, ngrdpts)
862 allocate(cgrib(lcgrib))
870 print*,
"- CREATE SECTIONS 0 AND 1"
871 call gribcreate(cgrib,lcgrib,listsec0,listsec1,iret)
872 if (iret /= 0) goto 900
878 print*,
"- CREATE SECTION 3"
879 call addgrid(cgrib,lcgrib,igds,igdstmpl,igdstmplen, &
880 ideflist,idefnum,iret)
881 if (iret /= 0) goto 900
889 allocate (idrstmpl(idrstmplen))
893 allocate(fld(ngrdpts))
894 fld = reshape(snow_cvr_mdl, (/imdl*jmdl/) )
897 allocate(bmap2d(imdl,jmdl))
899 where (lsmask_mdl < 0.5) bmap2d=.false.
900 allocate(bmap(ngrdpts))
901 bmap = reshape(bmap2d, (/imdl*jmdl/) )
914 print*,
"- CREATE SECTIONS 4 AND 5 FOR SNOW COVER"
915 call addfield(cgrib,lcgrib,ipdsnum,ipdstmpl,ipdstmplen, &
916 coordlist,numcoord,idrsnum,idrstmpl, &
917 idrstmplen,fld,ngrdpts,ibmap,bmap,iret)
918 if (iret /= 0) goto 900
926 if (kgds_mdl(1) /= 4)
then
927 if (.not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_sh_afwa) goto 88
935 fld= reshape(snow_dep_mdl, (/imdl*jmdl/) )
943 print*,
"- CREATE SECTIONS 4 AND 5 FOR SNOW DEPTH"
944 call addfield(cgrib,lcgrib,ipdsnum,ipdstmpl,ipdstmplen, &
945 coordlist,numcoord,idrsnum,idrstmpl, &
946 idrstmplen,fld,ngrdpts,ibmap,bmap,iret)
947 if (iret /= 0) goto 900
955 call gribend(cgrib,lcgrib,lengrib,iret)
956 if (iret /= 0) goto 900
963 print*,
"- OPEN OUTPUT GRIB FILE ", trim(model_snow_file)
964 call baopenw(lugb, model_snow_file, iret)
967 print*,
'- FATAL ERROR: BAD OPEN OF OUTPUT GRIB FILE. IRET IS ', iret
968 call w3tage(
'SNOW2MDL')
972 print*,
'- WRITE OUTPUT GRIB FILE.'
973 call wryte(lugb, lengrib, cgrib)
975 call baclose(lugb, iret)
977 deallocate(fld, bmap, idrstmpl, igdstmpl, cgrib)
982 print*,
'- FATAL ERROR CREATING GRIB2 MESSAGE. IRET IS ', iret
983 call w3tage(
'SNOW2MDL')
1008 integer,
parameter :: lugb = 64
1009 integer :: kpds(200)
1011 logical*1 :: lbms(imdl,jmdl)
1026 kpds(3) = grid_id_mdl
1032 kpds(9) = grib_month
1034 kpds(11) = grib_hour
1044 kpds(21) = grib_century
1052 where(lsmask_mdl > 0.0) lbms = .true.
1054 print*,
"- OPEN OUTPUT GRIB FILE ", trim(model_snow_file)
1055 call baopenw(lugb, model_snow_file, iret)
1058 print*,
'- FATAL ERROR OPENING OUTPUT GRIB FILE. IRET IS ', iret
1059 call w3tage(
'SNOW2MDL')
1063 print*,
"- WRITE OUTPUT GRIB FILE ", trim(model_snow_file)
1064 call putgb(lugb, (imdl*jmdl), kpds, kgds_mdl, lbms, &
1068 print*,
'- FATAL ERROR WRITING OUTPUT GRIB FILE. IRET IS ', iret
1069 call w3tage(
'SNOW2MDL')
1077 if (kgds_mdl(1) /= 4)
then
1078 if (.not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_sh_afwa) goto 88
1084 call putgb(lugb, (imdl*jmdl), kpds, kgds_mdl, lbms, &
1088 print*,
'- FATAL ERROR WRITING OUTPUT GRIB FILE. IRET IS ', iret
1089 call w3tage(
'SNOW2MDL')
1093 88 call baclose(lugb, iret)
1119 integer,
intent(in) :: len
1120 integer,
intent(in) :: iord
1121 integer,
intent(in) :: lonl
1122 integer,
intent(in) :: latd
1123 integer,
intent(in) :: lonsperlat(latd/2)
1124 integer,
intent(in) :: kmsk(lonl*latd)
1125 integer :: j,lons,jj,latd2,ii,i
1127 real,
intent(in) :: fi(len)
1128 real,
intent(out) :: f(lonl,latd)
1136 if (j .gt. latd2) jj = latd - j + 1
1139 if(lons.ne.lonl)
then
1140 call
intlon(iord,1,1,lons,lonl,kmsk(ii),fi(ii),f(1,j))
1166 subroutine intlon(iord,imon,imsk,m1,m2,k1,f1,f2)
1170 integer,
intent(in) :: iord,imon,imsk,m1,m2
1171 integer,
intent(in) :: k1(m1)
1172 integer :: i2,in,il,ir
1174 real,
intent(in) :: f1(m1)
1175 real,
intent(out) :: f2(m2)
1183 if(iord.eq.2.and.(imsk.eq.0.or.k1(il).eq.k1(ir)))
then
1184 f2(i2)=f1(il)*(il-x1)+f1(ir)*(x1-il+1)
1186 in=mod(nint(x1),m1)+1
subroutine init_grib2(century, year, month, day, hour, kgds, lat11, latlast, lon11, lonlast, listsec0, listsec1, igds, ipdstmpl, ipdsnum, igdstmpl, igdstmplen, idefnum, ideflist, ngrdpts)
Initialize grib2 arrays required by the ncep g2 library according to grib1 gds information.
subroutine grib2_check(kgds, igdstmplen)
Determine length of grib2 gds template array, which is a function of the map projection.
Read in data defining the model grid.
subroutine, public interp
Interpolate snow data to model grid.
subroutine uninterpred(iord, kmsk, fi, f, lonl, latd, len, lonsperlat)
Fills out full grid using thinned grid data.
subroutine write_grib1
Write grib1 snow cover and depth on the model grid.
This module reads in data from the program's configuration namelist.
Read and qc afwa, nesdis/ims and autosnow snow data.
subroutine intlon(iord, imon, imsk, m1, m2, k1, f1, f2)
Convert data from the thinned (or reduced) to the full grid along a single row.
Interpolate snow data to model grid and grib the result.
subroutine write_grib2
Write grib2 snow cover and depth on the model grid.