48 use vrbls2d, only: albedo, avgalbedo, albase, mxsnal, sst, ths, epsr, ti&
50 use masks, only: gdlat, gdlon, sm, sice, lmh, lmv
53 use ctlblk_mod
, only: jsta, jend, modelname, grib, cfld, fld_info, datapd, spval, tsrfc,&
54 ifhr, ifmin, lm, im, jm
55 use rqstfld_mod
, only: iget, lvls, iavblfld, id
59 integer,
PARAMETER :: snoalb=0.55
63 REAL,
dimension(im,jm) :: grid1
65 integer i,j,itsrfc,ifincr
76 grid1(i,j) = gdlat(i,j)
79 if(grib==
'grib2')
then
81 fld_info(cfld)%ifld=iavblfld(iget(048))
82 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
90 IF (gdlon(i,j) < 0.)
THEN
91 grid1(i,j) = 360. + gdlon(i,j)
93 grid1(i,j) = gdlon(i,j)
95 IF (grid1(i,j)>360.)print*,
'LARGE GDLON ', &
99 if(grib==
'grib2')
then
101 fld_info(cfld)%ifld=iavblfld(iget(049))
102 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
107 IF (iget(050)>0)
THEN
112 IF(sm(i,j) /= spval) grid1(i,j) = 1. - sm(i,j)
113 If(modelname ==
'GFS' .or. modelname ==
'FV3R')
then
114 IF(sice(i,j) /= spval .AND. sice(i,j) > 0.0)grid1(i,j)=0.
116 IF(sice(i,j) /= spval .AND. sice(i,j) > 0.1)grid1(i,j)=0.
121 if(grib==
'grib2')
then
123 fld_info(cfld)%ifld=iavblfld(iget(050))
124 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
129 IF (iget(051)>0)
THEN
133 grid1(i,j) = sice(i,j)
136 if(grib==
'grib2')
then
138 fld_info(cfld)%ifld=iavblfld(iget(051))
139 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
144 IF (iget(052)>0)
THEN
148 grid1(i,j) = lmh(i,j)
151 if(grib==
'grib2')
then
153 fld_info(cfld)%ifld=iavblfld(iget(052))
154 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
159 IF (iget(053)>0)
THEN
163 grid1(i,j) = lmv(i,j)
166 if(grib==
'grib2')
then
168 fld_info(cfld)%ifld=iavblfld(iget(053))
169 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
177 IF (iget(150)>0)
THEN
185 IF(abs(albedo(i,j)-spval)>small)
THEN
186 grid1(i,j)=albedo(i,j)
193 CALL sclfld(grid1,100.,im,jm)
194 if(grib==
'grib2')
then
196 fld_info(cfld)%ifld=iavblfld(iget(150))
197 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
202 IF (iget(266)>0)
THEN
206 ifincr = mod(ifhr,itsrfc)
207 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itsrfc*60)
212 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
218 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
220 IF (id(18)<0) id(18) = 0
224 IF(abs(avgalbedo(i,j)-spval)>small)
THEN
225 grid1(i,j) = avgalbedo(i,j)*100.
232 if(grib==
'grib2')
then
234 fld_info(cfld)%ifld=iavblfld(iget(266))
236 fld_info(cfld)%ntrange=1
238 fld_info(cfld)%ntrange=0
240 fld_info(cfld)%tinvstat=ifhr-id(18)
241 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
245 IF (iget(226)>0)
THEN
249 IF(abs(albase(i,j)-spval)>small)
THEN
250 grid1(i,j) = albase(i,j)*100.
256 if(grib==
'grib2')
then
258 fld_info(cfld)%ifld=iavblfld(iget(226))
259 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
263 IF (iget(227)>0)
THEN
267 IF (abs(mxsnal(i,j)-spval)>small)
THEN
269 IF( (abs(sm(i,j)-1.) < 1.0e-5) )
THEN
272 ELSEIF( (abs(sm(i,j)-0.) < 1.0e-5) .AND. &
273 & (abs(sice(i,j)-1.) < 1.0e-5) )
THEN
285 IF(abs(mxsnal(i,j)-spval)>small)
THEN
286 grid1(i,j) = mxsnal(i,j)*100.
292 if(grib==
'grib2')
then
294 fld_info(cfld)%ifld=iavblfld(iget(227))
295 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
300 IF (iget(151)>0)
THEN
305 IF (modelname ==
'NMM')
THEN
306 IF( (abs(sm(i,j)-1.) < 1.0e-5) )
THEN
307 grid1(i,j) = sst(i,j)
309 IF(ths(i,j)<spval.and.pint(i,j,lm+1)<spval)&
310 grid1(i,j) = ths(i,j)*(pint(i,j,lm+1)/p1000)**capa
313 grid1(i,j) = sst(i,j)
317 if(grib==
'grib2')
then
319 fld_info(cfld)%ifld=iavblfld(iget(151))
320 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
326 IF (iget(968)>0)
THEN
333 if(grib==
'grib2')
then
335 fld_info(cfld)%ifld=iavblfld(iget(968))
336 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
341 IF (iget(549)>0)
THEN
345 grid1(i,j) = fdnsst(i,j)
348 if(grib==
'grib2')
then
350 fld_info(cfld)%ifld=iavblfld(iget(549))
351 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
356 IF (iget(248)>0)
THEN
360 grid1(i,j) = epsr(i,j)
363 if(grib==
'grib2')
then
365 fld_info(cfld)%ifld=iavblfld(iget(248))
366 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)