48 use vrbls3d,
only: pint
49 use vrbls2d,
only: albedo, avgalbedo, albase, mxsnal, sst, ths, epsr, ti&
51 use masks,
only: gdlat, gdlon, sm, sice, lmh, lmv
52 use params_mod,
only: small, p1000, capa
53 use lookup_mod,
only: itb,jtb,itbq,jtbq
54 use ctlblk_mod,
only: jsta, jend, modelname, grib, cfld, fld_info, datapd, spval, tsrfc,&
55 ifhr, ifmin, lm, im, jm, ista, iend
56 use rqstfld_mod,
only: iget, lvls, iavblfld, id
60 integer,
PARAMETER :: SNOALB=0.55
64 REAL,
dimension(im,jm) :: GRID1
66 integer I,J,ITSRFC,IFINCR
77 grid1(i,j) = gdlat(i,j)
80 if(grib==
'grib2')
then
82 fld_info(cfld)%ifld=iavblfld(iget(048))
83 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
91 IF (gdlon(i,j) < 0.)
THEN
92 grid1(i,j) = 360. + gdlon(i,j)
94 grid1(i,j) = gdlon(i,j)
96 IF (grid1(i,j)>360.)print*,
'LARGE GDLON ', &
100 if(grib==
'grib2')
then
102 fld_info(cfld)%ifld=iavblfld(iget(049))
103 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
108 IF (iget(050)>0)
THEN
113 IF(sm(i,j) /= spval) grid1(i,j) = 1. - sm(i,j)
114 If(modelname ==
'GFS' .or. modelname ==
'FV3R')
then
115 IF(sice(i,j) /= spval .AND. sice(i,j) > 0.0)grid1(i,j)=0.
117 IF(sice(i,j) /= spval .AND. sice(i,j) > 0.1)grid1(i,j)=0.
122 if(grib==
'grib2')
then
124 fld_info(cfld)%ifld=iavblfld(iget(050))
125 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
130 IF (iget(051)>0)
THEN
134 grid1(i,j) = sice(i,j)
137 if(grib==
'grib2')
then
139 fld_info(cfld)%ifld=iavblfld(iget(051))
140 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
145 IF (iget(052)>0)
THEN
149 grid1(i,j) = lmh(i,j)
152 if(grib==
'grib2')
then
154 fld_info(cfld)%ifld=iavblfld(iget(052))
155 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
160 IF (iget(053)>0)
THEN
164 grid1(i,j) = lmv(i,j)
167 if(grib==
'grib2')
then
169 fld_info(cfld)%ifld=iavblfld(iget(053))
170 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
178 IF (iget(150)>0)
THEN
186 IF(abs(albedo(i,j)-spval)>small)
THEN
187 grid1(i,j)=albedo(i,j)
194 CALL sclfld(grid1(ista:iend,jsta:jend),100.,im,jm)
195 if(grib==
'grib2')
then
197 fld_info(cfld)%ifld=iavblfld(iget(150))
198 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
203 IF (iget(266)>0)
THEN
207 ifincr = mod(ifhr,itsrfc)
208 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itsrfc*60)
213 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
219 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
221 IF (id(18)<0) id(18) = 0
225 IF(abs(avgalbedo(i,j)-spval)>small)
THEN
226 grid1(i,j) = avgalbedo(i,j)*100.
233 if(grib==
'grib2')
then
235 fld_info(cfld)%ifld=iavblfld(iget(266))
237 fld_info(cfld)%ntrange=1
239 fld_info(cfld)%ntrange=0
241 fld_info(cfld)%tinvstat=ifhr-id(18)
242 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
246 IF (iget(226)>0)
THEN
250 IF(abs(albase(i,j)-spval)>small)
THEN
251 grid1(i,j) = albase(i,j)*100.
257 if(grib==
'grib2')
then
259 fld_info(cfld)%ifld=iavblfld(iget(226))
260 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
264 IF (iget(227)>0)
THEN
268 IF (abs(mxsnal(i,j)-spval)>small)
THEN
270 IF( (abs(sm(i,j)-1.) < 1.0e-5) )
THEN
273 ELSEIF( (abs(sm(i,j)-0.) < 1.0e-5) .AND. &
274 & (abs(sice(i,j)-1.) < 1.0e-5) )
THEN
286 IF(abs(mxsnal(i,j)-spval)>small)
THEN
287 grid1(i,j) = mxsnal(i,j)*100.
293 if(grib==
'grib2')
then
295 fld_info(cfld)%ifld=iavblfld(iget(227))
296 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
301 IF (iget(151)>0)
THEN
306 IF (modelname ==
'NMM')
THEN
307 IF( (abs(sm(i,j)-1.) < 1.0e-5) )
THEN
308 grid1(i,j) = sst(i,j)
310 IF(ths(i,j)<spval.and.pint(i,j,lm+1)<spval)&
311 grid1(i,j) = ths(i,j)*(pint(i,j,lm+1)/p1000)**capa
314 grid1(i,j) = sst(i,j)
318 if(grib==
'grib2')
then
320 fld_info(cfld)%ifld=iavblfld(iget(151))
321 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
327 IF (iget(968)>0)
THEN
334 if(grib==
'grib2')
then
336 fld_info(cfld)%ifld=iavblfld(iget(968))
337 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
342 IF (iget(549)>0)
THEN
346 grid1(i,j) = fdnsst(i,j)
349 if(grib==
'grib2')
then
351 fld_info(cfld)%ifld=iavblfld(iget(549))
352 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
357 IF (iget(248)>0)
THEN
361 grid1(i,j) = epsr(i,j)
364 if(grib==
'grib2')
then
366 fld_info(cfld)%ifld=iavblfld(iget(248))
367 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)