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(:,:)
164 integer :: i, j, ii, jj, ij
165 integer :: ijmdl2, istart, iend, imid, iii
166 integer,
allocatable :: idum(:,:)
167 integer :: int_opt, ipopt(20)
168 integer :: kgds_mdl_tmp(200)
169 integer :: no, ibo, iret, nret
171 logical*1,
allocatable :: bitmap_mdl(:)
175 real,
allocatable :: lsmask_1d(:)
176 real,
allocatable :: snow_cvr_mdl_1d(:)
177 real,
allocatable :: snow_dep_mdl_tmp(:)
178 real :: sumc, sumd, x1, r, fraction, gridis, gridie
179 real,
parameter :: undefined_value = -999.
188 if (minval(lats_mdl) < -10.0 .and. .not. use_global_afwa .and. .not. use_sh_afwa .and. .not. use_autosnow)
then
189 print*,
"- FATAL ERROR: MUST SELECT EITHER AFWA OR AUTOSNOW DATA FOR MODEL GRID WITH SH POINTS."
190 call w3tage(
'SNOW2MDL')
200 if (maxval(lats_mdl) < 0.0)
then
210 if (maxval(lats_mdl) > 0.0 .and. .not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_nesdis)
then
211 print*,
"- FATAL ERROR: MUST SELECT EITHER NESDIS/IMS OR AFWA DATA FOR MODEL GRID WITH NH POINTS."
212 call w3tage(
'SNOW2MDL')
222 if (minval(lats_mdl) > 0.0)
then
231 nesdis_ims :
if (use_nesdis)
then
234 if (nesdis_res < (0.5*resol_mdl))
then
235 print*,
"- INTERPOLATE NH NESDIS/IMS DATA TO MODEL GRID USING BUDGET METHOD."
239 ipopt(20) = nint(100.0 / nesdis_res) + 1
240 kgds_mdl_tmp = kgds_mdl
241 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
245 print*,
"- INTERPOLATE NH NESDIS/IMS DATA TO MODEL GRID USING NEIGHBOR METHOD."
246 ipopt(1) = nint(100.0 / nesdis_res) + 1
247 kgds_mdl_tmp = kgds_mdl
253 allocate (snow_cvr_mdl_1d(ijmdl))
254 snow_cvr_mdl_1d = 0.0
256 allocate (bitmap_mdl(ijmdl))
260 call ipolates(int_opt, ipopt, kgds_nesdis, kgds_mdl_tmp, &
261 (inesdis*jnesdis), ijmdl, &
262 1, 1, bitmap_nesdis, snow_cvr_nesdis, &
263 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
264 snow_cvr_mdl_1d, iret)
266 deallocate (bitmap_nesdis, snow_cvr_nesdis)
269 print*,
"- FATAL ERROR: IN INTERPOLATION ROUTINE. IRET IS: ", iret
270 call w3tage(
'SNOW2MDL')
283 if (lats_mdl(ij) < 0.0) cycle
284 if (.not. bitmap_mdl(ij))
then
285 if (lats_mdl(ij) <= lat_threshold)
then
286 snow_cvr_mdl_1d(ij) = 0.0
288 call gdswzd(kgds_nesdis,-1,1,undefined_value,gridi,gridj, &
289 lons_mdl(ij),lats_mdl(ij),nret)
291 print*,
"- WARNING: MODEL POINT OUTSIDE NESDIS/IMS GRID: ", ipts_mdl(ij), jpts_mdl(ij)
292 snow_cvr_mdl_1d(ij) = 0.0
296 if (sea_ice_nesdis(ii,jj) == 1)
then
297 snow_cvr_mdl_1d(ij) = 100.0
299 snow_cvr_mdl_1d(ij) = 0.0
306 deallocate (sea_ice_nesdis)
307 deallocate (bitmap_mdl)
315 global_afwa :
if (use_global_afwa)
then
323 if (afwa_res < (0.5*resol_mdl))
then
324 print*,
"- INTERPOLATE GLOBAL AFWA DATA TO MODEL GRID USING BUDGET METHOD."
327 ipopt(20) = nint(100.0 / afwa_res) + 1
328 kgds_mdl_tmp = kgds_mdl
329 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
333 print*,
"- INTERPOLATE GLOBAL AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
334 ipopt(1) = nint(100.0 / afwa_res) + 1
335 kgds_mdl_tmp = kgds_mdl
341 allocate (snow_dep_mdl_tmp(ijmdl))
342 snow_dep_mdl_tmp = 0.0
344 allocate (bitmap_mdl(ijmdl))
347 call ipolates(int_opt, ipopt, kgds_afwa_global, kgds_mdl_tmp, &
348 (iafwa*jafwa), ijmdl, &
349 1, 1, bitmap_afwa_global, snow_dep_afwa_global, &
350 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
351 snow_dep_mdl_tmp, iret)
353 deallocate(bitmap_afwa_global, snow_dep_afwa_global)
356 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
357 call w3tage(
'SNOW2MDL')
369 if (.not. bitmap_mdl(ij))
then
370 if (abs(lats_mdl(ij)) >= lat_threshold)
then
371 snow_dep_mdl_tmp(ij) = min_snow_depth
373 snow_dep_mdl_tmp(ij) = 0.0
378 deallocate(bitmap_mdl)
386 nh_afwa :
if (use_nh_afwa)
then
394 if (afwa_res < (0.5*resol_mdl))
then
395 print*,
"- INTERPOLATE NH AFWA DATA TO MODEL GRID USING BUDGET METHOD."
398 ipopt(20) = nint(100.0 / afwa_res) + 1
399 kgds_mdl_tmp = kgds_mdl
400 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
404 print*,
"- INTERPOLATE NH AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
405 ipopt(1) = nint(100.0 / afwa_res) + 1
406 kgds_mdl_tmp = kgds_mdl
412 allocate (snow_dep_mdl_tmp(ijmdl))
413 snow_dep_mdl_tmp = 0.0
415 allocate (bitmap_mdl(ijmdl))
418 call ipolates(int_opt, ipopt, kgds_afwa_nh, kgds_mdl_tmp, &
419 (iafwa*jafwa), ijmdl, &
420 1, 1, bitmap_afwa_nh, snow_dep_afwa_nh, &
421 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
422 snow_dep_mdl_tmp, iret)
424 deallocate(bitmap_afwa_nh, snow_dep_afwa_nh)
427 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
428 call w3tage(
'SNOW2MDL')
440 if (lats_mdl(ij) >= 0.)
then
441 if (.not. bitmap_mdl(ij))
then
442 if (abs(lats_mdl(ij)) >= lat_threshold)
then
443 snow_dep_mdl_tmp(ij) = min_snow_depth
445 snow_dep_mdl_tmp(ij) = 0.0
451 deallocate(bitmap_mdl)
460 allocate (snow_dep_mdl(imdl,jmdl))
461 allocate (snow_cvr_mdl(imdl,jmdl))
465 if (use_global_afwa .and. use_nesdis)
then
466 print*,
"- BLEND NESDIS/IMS AND AFWA DATA IN NH."
468 if (lats_mdl(ij) >= 0.0)
then
469 if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold)
then
470 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
471 max(snow_dep_mdl_tmp(ij), min_snow_depth)
473 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij)
476 deallocate (snow_cvr_mdl_1d)
477 elseif (use_nh_afwa .and. use_nesdis)
then
478 print*,
"- BLEND NESDIS/IMS AND AFWA DATA IN NH."
480 if (lats_mdl(ij) >= 0.0)
then
481 if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold)
then
482 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
483 max(snow_dep_mdl_tmp(ij), min_snow_depth)
485 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij)
488 deallocate (snow_cvr_mdl_1d)
489 deallocate (snow_dep_mdl_tmp)
490 elseif (use_global_afwa)
then
491 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN NH."
493 if (lats_mdl(ij) >= 0.0)
then
494 if (snow_dep_mdl_tmp(ij) > 0.0)
then
495 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
496 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij)
500 elseif (use_nh_afwa)
then
501 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN NH."
503 if (lats_mdl(ij) >= 0.0)
then
504 if (snow_dep_mdl_tmp(ij) > 0.0)
then
505 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
506 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij)
510 deallocate (snow_dep_mdl_tmp)
511 elseif (use_nesdis)
then
512 print*,
"- SET DEPTH/COVER FROM NESDIS/IMS DATA IN NH."
514 if (lats_mdl(ij) >= 0.0)
then
515 if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold)
then
516 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth
518 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij)
521 deallocate (snow_cvr_mdl_1d)
528 autosnow :
if (use_autosnow)
then
531 if (autosnow_res < (0.5*resol_mdl))
then
532 print*,
"- INTERPOLATE AUTOSNOW DATA TO MODEL GRID USING BUDGET METHOD."
536 ipopt(20) = nint(100.0 / autosnow_res) + 1
537 kgds_mdl_tmp = kgds_mdl
538 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
542 print*,
"- INTERPOLATE AUTOSNOW DATA TO MODEL GRID USING NEIGHBOR METHOD."
543 ipopt(1) = nint(100.0 / autosnow_res) + 1
544 kgds_mdl_tmp = kgds_mdl
550 allocate (snow_cvr_mdl_1d(ijmdl))
551 snow_cvr_mdl_1d = 0.0
553 allocate (bitmap_mdl(ijmdl))
557 call ipolates(int_opt, ipopt, kgds_autosnow, kgds_mdl_tmp, &
558 (iautosnow*jautosnow), ijmdl, &
559 1, 1, bitmap_autosnow, snow_cvr_autosnow, &
560 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
561 snow_cvr_mdl_1d, iret)
563 deallocate (snow_cvr_autosnow, bitmap_autosnow)
566 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
567 call w3tage(
'SNOW2MDL')
577 if (lats_mdl(ij) < 0.0)
then
578 if (.not. bitmap_mdl(ij))
then
579 if (abs(lats_mdl(ij)) <= lat_threshold)
then
580 snow_cvr_mdl_1d(ij) = 0.0
582 snow_cvr_mdl_1d(ij) = 100.0
588 deallocate (bitmap_mdl)
596 sh_afwa :
if (use_sh_afwa)
then
604 if (afwa_res < (0.5*resol_mdl))
then
605 print*,
"- INTERPOLATE SH AFWA DATA TO MODEL GRID USING BUDGET METHOD."
608 ipopt(20) = nint(100.0 / afwa_res) + 1
609 kgds_mdl_tmp = kgds_mdl
610 kgds_mdl_tmp(1) = kgds_mdl_tmp(1) - 255
614 print*,
"- INTERPOLATE SH AFWA DATA TO MODEL GRID USING NEIGHBOR METHOD."
615 ipopt(1) = nint(100.0 / afwa_res) + 1
616 kgds_mdl_tmp = kgds_mdl
622 allocate (snow_dep_mdl_tmp(ijmdl))
623 snow_dep_mdl_tmp = 0.0
625 allocate (bitmap_mdl(ijmdl))
628 call ipolates(int_opt, ipopt, kgds_afwa_sh, kgds_mdl_tmp, &
629 (iafwa*jafwa), ijmdl, &
630 1, 1, bitmap_afwa_sh, snow_dep_afwa_sh, &
631 no, lats_mdl, lons_mdl, ibo, bitmap_mdl, &
632 snow_dep_mdl_tmp, iret)
635 print*,
"- FATAL ERROR IN INTERPOLATION ROUTINE. IRET IS: ", iret
636 call w3tage(
'SNOW2MDL')
640 deallocate (bitmap_afwa_sh, snow_dep_afwa_sh)
648 if (lats_mdl(ij) < 0.)
then
649 if (.not. bitmap_mdl(ij))
then
650 if (abs(lats_mdl(ij)) >= lat_threshold)
then
651 snow_dep_mdl_tmp(ij) = min_snow_depth
653 snow_dep_mdl_tmp(ij) = 0.0
659 deallocate(bitmap_mdl)
668 if ((use_sh_afwa .or. use_global_afwa) .and. use_autosnow)
then
669 print*,
"- BLEND AUTOSNOW AND AFWA DATA IN SH."
671 if (lats_mdl(ij) < 0.0)
then
672 if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold)
then
673 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = &
674 max(snow_dep_mdl_tmp(ij), min_snow_depth)
676 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij)
679 deallocate (snow_cvr_mdl_1d)
680 deallocate (snow_dep_mdl_tmp)
681 elseif (use_sh_afwa .or. use_global_afwa)
then
682 print*,
"- SET DEPTH/COVER FROM AFWA DATA IN SH."
684 if (lats_mdl(ij) < 0.0)
then
685 if (snow_dep_mdl_tmp(ij) > 0.0)
then
686 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = 100.0
687 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_dep_mdl_tmp(ij)
691 deallocate (snow_dep_mdl_tmp)
692 elseif (use_autosnow)
then
693 print*,
"- SET DEPTH/COVER FROM AUTOSNOW IN SH."
695 if (lats_mdl(ij) < 0.0)
then
696 if (snow_cvr_mdl_1d(ij) >= snow_cvr_threshold)
then
697 snow_dep_mdl(ipts_mdl(ij),jpts_mdl(ij)) = min_snow_depth
699 snow_cvr_mdl(ipts_mdl(ij),jpts_mdl(ij)) = snow_cvr_mdl_1d(ij)
702 deallocate (snow_cvr_mdl_1d)
711 if (kgds_mdl(1) == 4 .and. thinned)
then
713 ijmdl2 = sum(lonsperlat_mdl) * 2
714 allocate (snow_cvr_mdl_1d(ijmdl2))
715 allocate (lsmask_1d(ijmdl2))
716 allocate (snow_dep_mdl_tmp(ijmdl2))
719 snow_cvr_mdl_1d = 0.0
720 snow_dep_mdl_tmp = 0.0
725 if (jj > jmdl/2) jj = jmdl - j + 1
726 r = float(imdl) / float(lonsperlat_mdl(jj))
727 do i = 1, lonsperlat_mdl(jj)
731 lsmask_1d(ij) = lsmask_mdl_sav(imid,j)
732 if (lsmask_mdl_sav(imid,j) == 0.0) cycle
740 if (ii == istart)
then
741 fraction = 0.5 - (gridis - float(istart))
742 elseif (ii == iend)
then
743 fraction = 0.5 + (gridie - float(iend))
747 if (fraction < 0.0001) cycle
749 if (iii < 1) iii = imdl + iii
750 sumc = sumc + fraction * snow_cvr_mdl(iii,j)
751 sumd = sumd + fraction * snow_dep_mdl(iii,j)
753 snow_cvr_mdl_1d(ij) = sumc / r
754 snow_dep_mdl_tmp(ij) = 0.0
755 if (snow_cvr_mdl_1d(ij) > snow_cvr_threshold)
then
756 snow_dep_mdl_tmp(ij) = max(sumd / r,min_snow_depth)
761 deallocate (lsmask_mdl_sav)
767 allocate (idum(imdl,jmdl))
769 call
uninterpred(1, idum, lsmask_1d, lsmask_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
770 call
uninterpred(1, idum, snow_cvr_mdl_1d, snow_cvr_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
771 deallocate(snow_cvr_mdl_1d)
772 call
uninterpred(1, idum, snow_dep_mdl_tmp, snow_dep_mdl, imdl, jmdl, ijmdl2, lonsperlat_mdl)
773 deallocate(snow_dep_mdl_tmp)
782 if (output_grib2)
then
783 print*,
"- OUTPUT SNOW ANALYSIS DATA IN GRIB2 FORMAT"
786 print*,
"- OUTPUT SNOW ANALYSIS DATA IN GRIB1 FORMAT"
790 deallocate (snow_cvr_mdl)
791 deallocate (snow_dep_mdl)
816 character(len=1),
allocatable :: cgrib(:)
818 integer,
parameter :: numcoord = 0
820 integer :: coordlist(numcoord)
821 integer :: lugb, lcgrib, iret
823 integer :: listsec0(2)
824 integer :: listsec1(13)
825 integer :: ideflist, idefnum, ipdsnum, idrsnum
826 integer :: igdstmplen, ipdstmplen, idrstmplen
827 integer :: ipdstmpl(15)
828 integer,
allocatable :: igdstmpl(:), idrstmpl(:)
829 integer :: ngrdpts, ibmap, lengrib
831 logical*1,
allocatable :: bmap(:), bmap2d(:,:)
833 real,
allocatable :: fld(:)
841 allocate(igdstmpl(igdstmplen))
843 call
init_grib2(grib_century,grib_year, grib_month, grib_day, grib_hour, &
844 kgds_mdl, lat11, latlast, lon11, lonlast, &
845 listsec0, listsec1, igds, ipdstmpl, ipdsnum, igdstmpl, &
846 igdstmplen, idefnum, ideflist, ngrdpts)
849 allocate(cgrib(lcgrib))
857 print*,
"- CREATE SECTIONS 0 AND 1"
858 call gribcreate(cgrib,lcgrib,listsec0,listsec1,iret)
859 if (iret /= 0) goto 900
865 print*,
"- CREATE SECTION 3"
866 call addgrid(cgrib,lcgrib,igds,igdstmpl,igdstmplen, &
867 ideflist,idefnum,iret)
868 if (iret /= 0) goto 900
876 allocate (idrstmpl(idrstmplen))
880 allocate(fld(ngrdpts))
881 fld = reshape(snow_cvr_mdl, (/imdl*jmdl/) )
884 allocate(bmap2d(imdl,jmdl))
886 where (lsmask_mdl < 0.5) bmap2d=.false.
887 allocate(bmap(ngrdpts))
888 bmap = reshape(bmap2d, (/imdl*jmdl/) )
901 print*,
"- CREATE SECTIONS 4 AND 5 FOR SNOW COVER"
902 call addfield(cgrib,lcgrib,ipdsnum,ipdstmpl,ipdstmplen, &
903 coordlist,numcoord,idrsnum,idrstmpl, &
904 idrstmplen,fld,ngrdpts,ibmap,bmap,iret)
905 if (iret /= 0) goto 900
913 if (kgds_mdl(1) /= 4)
then
914 if (.not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_sh_afwa) goto 88
922 fld= reshape(snow_dep_mdl, (/imdl*jmdl/) )
930 print*,
"- CREATE SECTIONS 4 AND 5 FOR SNOW DEPTH"
931 call addfield(cgrib,lcgrib,ipdsnum,ipdstmpl,ipdstmplen, &
932 coordlist,numcoord,idrsnum,idrstmpl, &
933 idrstmplen,fld,ngrdpts,ibmap,bmap,iret)
934 if (iret /= 0) goto 900
942 call gribend(cgrib,lcgrib,lengrib,iret)
943 if (iret /= 0) goto 900
950 print*,
"- OPEN OUTPUT GRIB FILE ", trim(model_snow_file)
951 call baopenw(lugb, model_snow_file, iret)
954 print*,
'- FATAL ERROR: BAD OPEN OF OUTPUT GRIB FILE. IRET IS ', iret
955 call w3tage(
'SNOW2MDL')
959 print*,
'- WRITE OUTPUT GRIB FILE.'
960 call wryte(lugb, lengrib, cgrib)
962 call baclose(lugb, iret)
964 deallocate(fld, bmap, idrstmpl, igdstmpl, cgrib)
969 print*,
'- FATAL ERROR CREATING GRIB2 MESSAGE. IRET IS ', iret
970 call w3tage(
'SNOW2MDL')
995 integer,
parameter :: lugb = 64
998 logical*1 :: lbms(imdl,jmdl)
1013 kpds(3) = grid_id_mdl
1019 kpds(9) = grib_month
1021 kpds(11) = grib_hour
1031 kpds(21) = grib_century
1039 where(lsmask_mdl > 0.0) lbms = .true.
1041 print*,
"- OPEN OUTPUT GRIB FILE ", trim(model_snow_file)
1042 call baopenw(lugb, model_snow_file, iret)
1045 print*,
'- FATAL ERROR OPENING OUTPUT GRIB FILE. IRET IS ', iret
1046 call w3tage(
'SNOW2MDL')
1050 print*,
"- WRITE OUTPUT GRIB FILE ", trim(model_snow_file)
1051 call putgb(lugb, (imdl*jmdl), kpds, kgds_mdl, lbms, &
1055 print*,
'- FATAL ERROR WRITING OUTPUT GRIB FILE. IRET IS ', iret
1056 call w3tage(
'SNOW2MDL')
1064 if (kgds_mdl(1) /= 4)
then
1065 if (.not. use_global_afwa .and. .not. use_nh_afwa .and. .not. use_sh_afwa) goto 88
1071 call putgb(lugb, (imdl*jmdl), kpds, kgds_mdl, lbms, &
1075 print*,
'- FATAL ERROR WRITING OUTPUT GRIB FILE. IRET IS ', iret
1076 call w3tage(
'SNOW2MDL')
1080 88 call baclose(lugb, iret)
1106 integer,
intent(in) :: len
1107 integer,
intent(in) :: iord
1108 integer,
intent(in) :: lonl
1109 integer,
intent(in) :: latd
1110 integer,
intent(in) :: lonsperlat(latd/2)
1111 integer,
intent(in) :: kmsk(lonl*latd)
1112 integer :: j,lons,jj,latd2,ii,i
1114 real,
intent(in) :: fi(len)
1115 real,
intent(out) :: f(lonl,latd)
1123 if (j .gt. latd2) jj = latd - j + 1
1126 if(lons.ne.lonl)
then
1127 call
intlon(iord,1,1,lons,lonl,kmsk(ii),fi(ii),f(1,j))
1153 subroutine intlon(iord,imon,imsk,m1,m2,k1,f1,f2)
1157 integer,
intent(in) :: iord,imon,imsk,m1,m2
1158 integer,
intent(in) :: k1(m1)
1159 integer :: i2,in,il,ir
1161 real,
intent(in) :: f1(m1)
1162 real,
intent(out) :: f2(m2)
1170 if(iord.eq.2.and.(imsk.eq.0.or.k1(il).eq.k1(ir)))
then
1171 f2(i2)=f1(il)*(il-x1)+f1(ir)*(x1-il+1)
1173 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.