73 use vrbls4d,
only: dust, salt, suso, soot, waso, smoke, fv3dust, coarsepm, ebb, &
75 use vrbls3d,
only: t, q, uh, vh, pmid, pint, alpint, dpres, zint, zmid, o3, &
76 qqr, qqnr, qqs, qqi, qqni, qqw, qqnw, qqg, qqh, cwm, &
77 omga, rhomid, q2, cfr, rlwtt, rswtt, tcucn, &
78 tcucns, train, el_pbl, exch_h, vdifftt, vdiffmois, dconvmois, nradtt, &
79 o3vdiff, o3prod, o3tndy, mwpv, unknown, vdiffzacce, zgdrag,cnvctummixing, &
80 vdiffmacce, mgdrag, cnvctvmmixing, ncnvctcfrac, cnvctumflx, cnvctdmflx, &
81 cnvctzgdrag, sconvmois, cnvctmgdrag, cnvctdetmflx, duwt, duem, dusd, dudp, &
82 dusv,ssem,sssd,ssdp,sswt,sssv,bcem,bcsd,bcdp,bcwt,bcsv,ocem,ocsd,ocdp,ocwt,ocsv, &
83 wh, ref_10cm, qqnifa, qqnwfa, avgpmtf, avgozcon, aextc55, taod5503d, &
86 use vrbls2d,
only: f, pd, fis, pblh, ustar, z0, ths, qs, twbs, qwbs, avgcprate, &
87 cprate, avgprec, prec, lspa, sno, sndepac, si, cldefi, th10, q10, tshltr, pshltr, &
88 tshltr, albase, albedo, avgalbedo, avgtcdc, czen, czmean, mxsnal, landfrac, radot,&
89 sigt4,cfrach, cfracl, cfracm, avgcfrach, qshltr, avgcfracl, avgcfracm, cnvcfr, &
90 islope, cmc, grnflx, vegfrc, acfrcv, ncfrcv, acfrst, ncfrst, ssroff, &
91 bgroff, rlwin, rlwtoa, cldwork, alwin, alwout, alwtoa, rswin, rswinc, &
92 rswout, aswin, auvbin, auvbinc, aswout, aswtoa, sfcshx, sfclhx, subshx, &
93 snopcx, sfcux, sfcvx, sfcuxi, sfcvxi, sfcuvx, gtaux, gtauy, potevp, u10, v10, smstav,&
94 smstot, ivgtyp, isltyp, sfcevp, sfcexc, acsnow, acsnom, sst, thz0, qz0, &
95 uz0, vz0, ptop, htop, pbot, hbot, ptopl, pbotl, ttopl, ptopm, pbotm, ttopm, &
96 ptoph, pboth, pblcfr, ttoph, runoff, tecan, tetran, tedir, twa, maxtshltr, &
97 mintshltr, maxrhshltr, fdnsst, acgraup, graup_bucket, acfrain, frzrn_bucket, &
98 snow_acm, snow_bkt, snownc, graupelnc, qrmax, swddif, swddni, xlaixy, &
99 minrhshltr, dzice, smcwlt, suntime, fieldcapa, htopd, hbotd, htops, hbots, &
100 cuppt, dusmass, ducmass, dusmass25, ducmass25, aswintoa,rel_vort_maxhy1, &
101 maxqshltr, minqshltr, acond, sr, u10h, v10h,refd_max, w_up_max, w_dn_max, &
102 up_heli_max,up_heli_min,up_heli_max03,up_heli_min03,rel_vort_max01,u10max, v10max, &
103 avgedir,avgecan,paha,pahi,avgetrans,avgesnow,avgprec_cont,avgcprate_cont,rel_vort_max, &
104 avisbeamswin,avisdiffswin,airbeamswin,airdiffswin,refdm10c_max,wspd10max, &
105 alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
106 ti,aod550,du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550,prate_max,maod,dustpm10, &
107 dustcb,bccb,occb,sulfcb,sscb,dustallcb,ssallcb,dustpm,sspm,pp25cb,pp10cb,no3cb,nh4cb,&
108 pwat, hwp, aqm_aod550, ltg1_max,ltg2_max,ltg3_max, hail_maxhailcast, pblhgust, &
109 smoke_ave, dust_ave, coarsepm_ave, wspd10umax, wspd10vmax
110 use soil,
only: sldpth, sllevel, sh2o, smc, stc
111 use masks,
only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
112 use physcons_post,
only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
113 eps => con_eps, epsm1 => con_epsm1
114 use params_mod,
only: erad, dtr, tfrz, h1, d608, rd, p1000, capa,pi
115 use lookup_mod,
only: thl, plq, ptbl, ttbl, rdq, rdth, rdp, rdthe, pl, qs0, sqs, sthe, &
116 ttblq, rdpq, rdtheq, stheq, the0q, the0
117 use ctlblk_mod,
only: me, mpi_comm_comp, icnt, idsp, jsta, jend, ihrst, idat, sdat, ifhr, &
118 ifmin, filename, tprec, tclod, trdlw, trdsw, tsrfc, tmaxmin, td3d, restrt, sdat, &
119 jend_m, imin, imp_physics, dt, spval, pdtop, pt, qmin, nbin_du, nphs, dtq2, ardlw,&
120 ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
121 jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
122 nbin_oc, nbin_su, nbin_no3, nbin_nh4, gocart_on,gccpp_on, nasa_on,pt_tbl,hyb_sigp,&
123 filenameflux, filenameaer, prec_acc_dt1, &
124 isf_surface_physics,rdaod, d2d_chem, modelname, aqf_on, &
125 ista, iend, ista_2l, iend_2u,iend_m
126 use gridspec_mod,
only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
127 dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, &
128 latstartv, latlastv,cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r, standlon, &
129 latse,lonse,latnw,lonnw
130 use upp_physics,
only: fpvsnew
135 integer,
parameter :: nvar2d=48
137 integer :: nvar3d, numDims
158 real,
parameter :: gravi = 1.0/grav
159 character(len=20) :: VarName, VcoordName
160 integer :: Status, fldsize, fldst, recn, recn_vvel
161 character startdate*19,SysDepInfo*80,cgar*1
162 character startdate2(19)*4, flatlon*40
163 logical :: read_lonlat=.true.
170 LOGICAL RUNB,SINGLRST,SUBPOST,NEST,HYDRO,IOOMG,IOALL
171 logical,
parameter :: debugprint = .false., zerout = .false.
173 logical :: convert_rad_to_deg=.false.
174 CHARACTER*32 varcharval
177 CHARACTER FNAME*255,ENVAR*50
178 INTEGER IDATE(8),JDATE(8),JPDS(200),JGDS(200),KPDS(200),KGDS(200)
195 integer ii,jj,js,je,iyear,imn,iday,itmp,ioutcount,istatus, &
196 i,j,l,ll,k,k1,kf,irtn,igdout,n,index,nframe, &
197 nframed2,iunitd3d,ierr,idum,iret,nrec,idrt
198 integer ncid3d,ncid2d,varid,nhcas,varid_bl,iret_bl
199 real TSTART,TLMH,TSPH,ES,FACT,soilayert,soilayerb,zhour,dum, &
200 tvll,pmll,tv, tx1, tx2, zpbltop
202 character*20,
allocatable :: recname(:)
203 integer,
allocatable :: reclev(:), kmsk(:,:)
204 real,
allocatable :: glat1d(:), glon1d(:), qstl(:)
205 real,
allocatable :: wrk1(:,:), wrk2(:,:)
206 real,
allocatable :: p2d(:,:), t2d(:,:), q2d(:,:), &
207 qs2d(:,:), cw2d(:,:), cfr2d(:,:)
208 real,
dimension(lm+1) :: ak5, bk5
209 real*8,
allocatable :: pm2d(:,:), pi2d(:,:)
210 real,
allocatable :: tmp(:)
211 real :: buf(ista_2l:iend_2u,jsta_2l:jend_2u)
212 real :: buf2(ista_2l:iend_2u,jsta_2l:jend_2u)
213 real :: buf3d(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
214 real :: chem_2d(ista_2l:iend_2u,jsta_2l:jend_2u)
215 real :: chemT(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
216 real :: dt1(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
217 real :: dt2(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
218 real :: dt3(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
219 real :: dt4(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
220 real :: dt5(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
226 integer isa, jsa, latghf, jtem, idvc, idsl, nvcoord, ip1, nn, npass
228 integer,
parameter :: npass2=5, npass3=30
229 real,
parameter :: third=1.0/3.0
230 real,
parameter :: delta_theta4gust=0.5
231 INTEGER,
DIMENSION(2) :: ij4min, ij4max
232 REAL :: omgmin, omgmax
233 real,
allocatable :: d2d(:,:), u2d(:,:), v2d(:,:), omga2d(:,:)
234 REAL,
ALLOCATABLE :: ps2d(:,:),psx2d(:,:),psy2d(:,:)
235 real,
allocatable :: div3d(:,:,:)
236 real(kind=4),allocatable :: vcrd(:,:)
238 real,
allocatable :: ext550(:,:,:),thv(:,:,:)
240 if (modelname ==
'FV3R')
then
241 allocate(ext550(ista_2l:iend_2u,jsta_2l:jend_2u,lm))
242 allocate(thv(ista_2l:iend_2u,jsta_2l:jend_2u,lm))
249 WRITE(6,*)
'INITPOST: ENTER INITPOST_NETCDF'
250 WRITE(6,*)
'me=',me, &
251 'jsta_2l=',jsta_2l,
'jend_2u=', &
253 'ista_2l=',ista_2l,
'iend_2u=',iend_2u, &
254 'ista=',ista,
'iend=',iend, &
258 isa = (ista+iend) / 2
259 jsa = (jsta+jend) / 2
262 do j = jsta_2l, jend_2u
263 do i= ista_2l, iend_2u
268 status=nf90_get_att(ncid3d,nf90_global,
'ak',ak5)
270 print*,
'ak not found; assigning missing value'
273 if(me==0)print*,
'ak5= ',ak5
275 status=nf90_get_att(ncid3d,nf90_global,
'idrt',idrt)
277 if(me==0)print*,
'idrt not in netcdf file,reading grid'
278 status=nf90_get_att(ncid3d,nf90_global,
'grid',varcharval)
280 if(me==0)print*,
'idrt and grid not in netcdf file, set default to latlon'
284 if(trim(varcharval)==
'rotated_latlon')
then
287 status=nf90_get_att(ncid3d,nf90_global,
'cen_lon',dum_const)
289 print*,
'cen_lon not found; assigning missing value'
293 cenlon=nint((dum_const+360.)*gdsdegr)
295 cenlon=dum_const*gdsdegr
298 status=nf90_get_att(ncid3d,nf90_global,
'cen_lat',dum_const)
300 print*,
'cen_lat not found; assigning missing value'
303 cenlat=dum_const*gdsdegr
306 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
308 print*,
'lonstart_r not found; assigning missing value'
312 lonstart_r=nint((dum_const+360.)*gdsdegr)
314 lonstart_r=dum_const*gdsdegr
317 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
319 print*,
'latstart_r not found; assigning missing value'
322 latstart_r=dum_const*gdsdegr
325 status=nf90_get_att(ncid3d,nf90_global,
'lon2',dum_const)
327 print*,
'lonlast_r not found; assigning missing value'
331 lonlast_r=nint((dum_const+360.)*gdsdegr)
333 lonlast_r=dum_const*gdsdegr
336 status=nf90_get_att(ncid3d,nf90_global,
'lat2',dum_const)
338 print*,
'latlast_r not found; assigning missing value'
341 latlast_r=dum_const*gdsdegr
344 status=nf90_get_att(ncid3d,nf90_global,
'dlon',dum_const)
346 print*,
'dlmd not found; assigning missing value'
349 dxval=dum_const*gdsdegr
351 status=nf90_get_att(ncid3d,nf90_global,
'dlat',dum_const)
353 print*,
'dphd not found; assigning missing value'
356 dyval=dum_const*gdsdegr
363 else if(trim(varcharval)==
'latlon')
then
367 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
369 print*,
'lonstart not found; assigning missing value'
373 lonstart=nint((dum_const+360.)*gdsdegr)
375 lonstart=dum_const*gdsdegr
378 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
380 print*,
'latstart not found; assigning missing value'
383 latstart=dum_const*gdsdegr
386 status=nf90_get_att(ncid3d,nf90_global,
'lon2',dum_const)
388 print*,
'lonlast not found; assigning missing value'
392 lonlast=nint((dum_const+360.)*gdsdegr)
394 lonlast=dum_const*gdsdegr
397 status=nf90_get_att(ncid3d,nf90_global,
'lat2',dum_const)
399 print*,
'latlast not found; assigning missing value'
402 latlast=dum_const*gdsdegr
405 status=nf90_get_att(ncid3d,nf90_global,
'dlon',dum_const)
407 print*,
'dlmd not found; assigning missing value'
410 dxval=dum_const*gdsdegr
412 status=nf90_get_att(ncid3d,nf90_global,
'dlat',dum_const)
414 print*,
'dphd not found; assigning missing value'
417 dyval=dum_const*gdsdegr
425 ELSE IF (trim(varcharval)==
'lambert_conformal')
then
429 status=nf90_get_att(ncid3d,nf90_global,
'cen_lon',dum_const)
431 print*,
'cen_lon not found; assigning missing value'
435 cenlon=nint((dum_const+360.)*gdsdegr)
437 cenlon=dum_const*gdsdegr
440 status=nf90_get_att(ncid3d,nf90_global,
'cen_lat',dum_const)
442 print*,
'cen_lat not found; assigning missing value'
445 cenlat=dum_const*gdsdegr
448 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
450 print*,
'lonstart not found; assigning missing value'
454 lonstart=nint((dum_const+360.)*gdsdegr)
456 lonstart=dum_const*gdsdegr
459 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
461 print*,
'latstart not found; assigning missing value'
464 latstart=dum_const*gdsdegr
467 status=nf90_get_att(ncid3d,nf90_global,
'stdlat1',dum_const)
469 print*,
'stdlat1 not found; assigning missing value'
472 truelat1=dum_const*gdsdegr
474 status=nf90_get_att(ncid3d,nf90_global,
'stdlat2',dum_const)
476 print*,
'stdlat2 not found; assigning missing value'
479 truelat2=dum_const*gdsdegr
482 status=nf90_get_att(ncid3d,nf90_global,
'dx',dum_const)
484 print*,
'dx not found; assigning missing value'
489 status=nf90_get_att(ncid3d,nf90_global,
'dy',dum_const)
491 print*,
'dphd not found; assigning missing value'
502 else if(trim(varcharval)==
'gaussian')
then
511 if(me==0)print*,
'idrt MAPTYPE= ',idrt,maptype
520 do j = jsta_2l, jend_2u
521 do i = ista_2l, iend_2u
531 do j = jsta_2l, jend_2u
532 do i = ista_2l, iend_2u
539 status=nf90_get_att(ncid3d,nf90_global,
'nhcas',nhcas)
541 if(me==0) print*,
'nhcas not in netcdf file, set default to nonhydro'
544 if(me==0)print*,
'nhcas= ',nhcas
545 if (nhcas == 0 )
then
547 allocate (recname(nrec))
548 recname=[
character(len=20) ::
'ugrd',
'vgrd',
'spfh',
'tmp',
'o3mr', &
549 'presnh',
'dzdt',
'clwmr',
'dpres', &
550 'delz',
'icmr',
'rwmr', &
551 'snmr',
'grle',
'hail',
'smoke', &
552 'dust',
'coarsepm',
'ext550', &
553 'ebu_smoke',
'nicp',
'water_nc',
'rain_nc']
556 allocate (recname(nrec))
557 recname=[
character(len=20) ::
'ugrd',
'vgrd',
'tmp',
'spfh',
'o3mr', &
558 'hypres',
'clwmr',
'dpres']
563 allocate(glat1d(jm),glon1d(im))
568 status=nf90_inq_varid(ncid3d,
'time',varid)
570 print*,
'time not in netcdf file, stopping'
573 status=nf90_get_att(ncid3d,varid,
'units',varcharval)
575 if(me==0)print*,
'time unit not available'
577 if(me==0)print*,
'time unit read from netcdf file= ',varcharval
580 read(varcharval,101)idate(1),idate(2),idate(3),idate(4),idate(5)
592 101
format(t13,i4,1x,i2,1x,i2,1x,i2,1x,i2)
596 status=nf90_inq_varid(ncid3d,
'grid_xt',varid)
597 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
598 if(numdims==1.and.modelname==
"FV3R")
then
607 if (read_lonlat)
then
608 status=nf90_inq_varid(ncid3d,
'lon',varid)
609 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
610 if(debugprint)print*,
'number of dim for gdlon ',numdims
612 status=nf90_inq_varid(ncid3d,
'grid_xt',varid)
613 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
614 if(debugprint)print*,
'number of dim for gdlon ',numdims
617 status=nf90_get_var(ncid3d,varid,glon1d)
620 gdlon(i,j) = real(glon1d(i),kind=4)
623 lonstart = nint(glon1d(1)*gdsdegr)
624 lonlast = nint(glon1d(im)*gdsdegr)
627 if (maptype == 0)
then
629 lonstart=lonstart+360.*gdsdegr
632 lonlast=lonlast+360.*gdsdegr
637 else if(numdims==2)
then
638 status=nf90_get_var(ncid3d,varid,dummy)
639 if(maxval(abs(dummy))<2.0*pi)convert_rad_to_deg=.true.
640 if(convert_rad_to_deg)
then
643 gdlon(i,j) = real(dummy(i,j),kind=4)*180./pi
649 gdlon(i,j) = real(dummy(i,j),kind=4)
653 if(convert_rad_to_deg)
then
654 lonstart = nint(dummy(1,1)*gdsdegr)*180./pi
655 lonlast = nint(dummy(im,jm)*gdsdegr)*180./pi
656 lonse = nint(dummy(im,1)*gdsdegr)*180./pi
657 lonnw = nint(dummy(1,jm)*gdsdegr)*180./pi
659 lonstart = nint(dummy(1,1)*gdsdegr)
660 lonlast = nint(dummy(im,jm)*gdsdegr)
661 lonse = nint(dummy(im,1)*gdsdegr)
662 lonnw = nint(dummy(1,jm)*gdsdegr)
666 if (maptype == 0)
then
668 lonstart=lonstart+360.*gdsdegr
671 lonlast=lonlast+360.*gdsdegr
680 if (read_lonlat)
then
681 status=nf90_inq_varid(ncid3d,
'lat',varid)
682 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
683 if(debugprint)print*,
'number of dim for gdlat ',numdims
685 status=nf90_inq_varid(ncid3d,
'grid_yt',varid)
686 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
687 if(debugprint)print*,
'number of dim for gdlat ',numdims
690 status=nf90_get_var(ncid3d,varid,glat1d)
693 gdlat(i,j) = real(glat1d(j),kind=4)
696 latstart = nint(glat1d(1)*gdsdegr)
697 latlast = nint(glat1d(jm)*gdsdegr)
698 else if(numdims==2)
then
699 status=nf90_get_var(ncid3d,varid,dummy)
700 if(maxval(abs(dummy))<pi)convert_rad_to_deg=.true.
701 if(convert_rad_to_deg)
then
704 gdlat(i,j) = real(dummy(i,j),kind=4)*180./pi
710 gdlat(i,j) = real(dummy(i,j),kind=4)
714 if(convert_rad_to_deg)
then
715 latstart = nint(dummy(1,1)*gdsdegr)*180./pi
716 latlast = nint(dummy(im,jm)*gdsdegr)*180./pi
717 latse = nint(dummy(im,1)*gdsdegr)*180./pi
718 latnw = nint(dummy(1,jm)*gdsdegr)*180./pi
720 latstart = nint(dummy(1,1)*gdsdegr)
721 latlast = nint(dummy(im,jm)*gdsdegr)
722 latse = nint(dummy(im,1)*gdsdegr)
723 latnw = nint(dummy(1,jm)*gdsdegr)
727 if(debugprint)print*,
'me sample gdlon gdlat= ' &
728 ,me,gdlon(isa,jsa),gdlat(isa,jsa)
733 if (me == 0) print *,
'maptype and gridtype is ', &
736 if(gridtype ==
'A')
then
748 print *,
'recname=',trim(recname(i))
754 deallocate(glat1d,glon1d)
765 CALL exch(gdlat(ista_2l,jsta_2l))
766 CALL exch(gdlon(ista_2l,jsta_2l))
775 dx(i,j) = erad*dxval*dtr/gdsdegr
777 dx(i,j) = erad*cos(gdlat(i,j)*dtr) *(gdlon(ip1,j)-gdlon(i,j))*dtr
780 dy(i,j)= erad*dyval*dtr/gdsdegr
782 dy(i,j) = erad*(gdlat(i,j+1)-gdlat(i,j))*dtr
789 if(debugprint)print*,
'me sample dx dy= ' &
790 ,me,dx(isa,jsa),dy(isa,jsa)
794 f(i,j) = 1.454441e-4*sin(gdlat(i,j)*dtr)
807 print*,
'start yr mo day hr min =',iyear,imn,iday,ihrst,imin
808 print*,
'processing yr mo day hr min=' &
809 ,idat(3),idat(1),idat(2),idat(4),idat(5)
829 CALL w3difdat(jdate,idate,0,rinc)
832 ifhr = nint(rinc(2)+rinc(1)*24.)
834 ifmin = nint(rinc(3))
846 IF(tstart > 1.0e-2)
THEN
847 ifhr = ifhr+nint(tstart)
851 call w3movdat(rinc,jdate,idate)
868 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
869 spval,recname(1),uh(ista_2l,jsta_2l,1),lm)
870 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
871 spval,recname(2),vh(ista_2l,jsta_2l,1),lm)
872 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
873 spval,recname(3),q(ista_2l,jsta_2l,1),lm)
874 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
875 spval,recname(4),t(ista_2l,jsta_2l,1),lm)
876 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
877 spval,recname(5),o3(ista_2l,jsta_2l,1),lm)
878 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
879 spval,recname(7),wh(ista_2l,jsta_2l,1),lm)
880 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
881 spval,recname(8),qqw(ista_2l,jsta_2l,1),lm)
882 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
883 spval,recname(9),dpres(ista_2l,jsta_2l,1),lm)
884 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
885 spval,recname(10),buf3d(ista_2l,jsta_2l,1),lm)
887 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
888 spval,
'omga',omga(ista_2l,jsta_2l,1),lm)
894 if(wh(i,j,l) /= spval)
then
895 if (omga(i,j,l) == spval .and. dpres(i,j,l) /= spval .and. buf3d(i,j,l) /=spval) &
896 omga(i,j,l) = (-1.) * wh(i,j,l) * dpres(i,j,l)/abs(buf3d(i,j,l))
901 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
902 spval,recname(11),qqi(ista_2l,jsta_2l,1),lm)
903 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
904 spval,recname(12),qqr(ista_2l,jsta_2l,1),lm)
905 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
906 spval,recname(13),qqs(ista_2l,jsta_2l,1),lm)
907 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
908 spval,recname(14),qqg(ista_2l,jsta_2l,1),lm)
909 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
910 spval,recname(15),qqh(ista_2l,jsta_2l,1),lm)
912 if (modelname ==
'FV3R')
then
913 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
914 spval,recname(16),smoke(ista_2l,jsta_2l,1,1),lm)
915 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
916 spval,recname(17),fv3dust(ista_2l,jsta_2l,1,1),lm)
917 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
918 spval,recname(18),coarsepm(ista_2l,jsta_2l,1,1),lm)
919 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
920 spval,recname(19),ext550(ista_2l,jsta_2l,1),lm)
921 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
922 spval,recname(20),ebb(ista_2l,jsta_2l,1,1),lm)
923 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
924 spval,recname(21),qqni(ista_2l,jsta_2l,1),lm)
925 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
926 spval,recname(22),qqnw(ista_2l,jsta_2l,1),lm)
927 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
928 spval,recname(23),qqnr(ista_2l,jsta_2l,1),lm)
932 do j = jsta_2l, jend_2u
933 do i = ista_2l, iend_2u
942 if(qqr(i,j,l) /= spval)
then
943 qrmax(i,j)=max(qrmax(i,j),qqr(i,j,l))
944 cwm(i,j,l)=qqg(i,j,l)+qqs(i,j,l)+qqr(i,j,l)+qqi(i,j,l)+qqw(i,j,l)
945 if(qqh(i,j,l) /= spval)
then
946 cwm(i,j,l)=cwm(i,j,l)+qqh(i,j,l)
951 if(debugprint)print*,
'sample l,t,q,u,v,w= ',isa,jsa,l &
952 ,t(isa,jsa,l),q(isa,jsa,l),uh(isa,jsa,l),vh(isa,jsa,l) &
954 if(debugprint)print*,
'sample l cwm for FV3',l, &
959 if ( imp_physics==11)
then
961 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
962 spval,varname,cfr(ista_2l,jsta_2l,1),lm)
965 iret_bl = nf90_inq_varid(ncid2d,
'cldfra_bl',varid_bl)
966 iret = nf90_inq_varid(ncid2d,
'cldfra',varid)
968 if(iret_bl==nf90_noerr .and. iret==nf90_noerr)
then
969 write(*,*)
'WARNING: BOTH cldfra_bl AND cldfra ARE AVAILABLE. USING cldfra.'
971 else if(iret_bl==nf90_noerr)
then
973 else if(iret==nf90_noerr)
then
979 if(varname /=
'nope')
then
980 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
981 spval,varname,cfr(ista_2l,jsta_2l,1),lm)
991 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
992 spval,varname,effri(ista_2l,jsta_2l,1),lm)
996 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
997 spval,varname,effrl(ista_2l,jsta_2l,1),lm)
1001 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1002 spval,varname,effrs(ista_2l,jsta_2l,1),lm)
1017 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1018 spval,varname,avgozcon(ista_2l,jsta_2l,1),lm)
1021 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1022 spval,varname,avgpmtf(ista_2l,jsta_2l,1),lm)
1026 spval,varname,aqm_aod550(ista_2l,jsta_2l))
1032 if (modelname ==
'FV3R')
then
1036 spval,varname,w_up_max(ista_2l,jsta_2l))
1037 if(debugprint)print*,
'sample ',varname,
' = ',w_up_max(isa,jsa)
1041 spval,varname,w_dn_max(ista_2l,jsta_2l))
1042 if(debugprint)print*,
'sample ',varname,
' = ',w_dn_max(isa,jsa)
1046 spval,varname,up_heli_max(ista_2l,jsta_2l))
1047 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_max(isa,jsa)
1051 spval,varname,up_heli_min(ista_2l,jsta_2l))
1052 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_min(isa,jsa)
1056 spval,varname,up_heli_max03(ista_2l,jsta_2l))
1057 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_max03(isa,jsa)
1061 spval,varname,up_heli_min03(ista_2l,jsta_2l))
1062 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_min03(isa,jsa)
1067 spval,varname,rel_vort_max01(ista_2l,jsta_2l))
1068 if(debugprint)print*,
'sample ',varname,
' = ',rel_vort_max01(isa,jsa)
1072 spval,varname,rel_vort_max(ista_2l,jsta_2l))
1073 if(debugprint)print*,
'sample ',varname,
' =',rel_vort_max(isa,jsa)
1075 varname=
'maxvorthy1'
1077 spval,varname,rel_vort_maxhy1(ista_2l,jsta_2l))
1078 if(debugprint)print*,
'sample ',varname,
' =',rel_vort_maxhy1(isa,jsa)
1080 varname=
'hailcast_dhail'
1082 spval,varname,hail_maxhailcast(ista_2l,jsta_2l))
1083 if(debugprint)print*,
'sample ',varname,
' =',hail_maxhailcast(isa,jsa)
1087 spval,varname,hwp(ista_2l,jsta_2l))
1088 if(debugprint)print*,
'sample ',varname,
' =',hwp(isa,jsa)
1092 spval,varname,smoke_ave(ista_2l,jsta_2l))
1093 if(debugprint)print*,
'sample ',varname,
' =',smoke_ave(isa,jsa)
1097 spval,varname,dust_ave(ista_2l,jsta_2l))
1098 if(debugprint)print*,
'sample ',varname,
' =',dust_ave(isa,jsa)
1100 varname=
'coarsepm_ave'
1102 spval,varname,coarsepm_ave(ista_2l,jsta_2l))
1103 if(debugprint)print*,
'sample ',varname,
' =',coarsepm_ave(isa,jsa)
1109 spval,varname,ltg1_max(ista_2l,jsta_2l))
1110 if(debugprint)print*,
'sample ',varname,
' =',ltg1_max(isa,jsa)
1115 spval,varname,ltg2_max(ista_2l,jsta_2l))
1116 if(debugprint)print*,
'sample ',varname,
' =',ltg2_max(isa,jsa)
1121 spval,varname,ltg3_max(ista_2l,jsta_2l))
1122 if(debugprint)print*,
'sample ',varname,
' =',ltg3_max(isa,jsa)
1127 spval,varname,pint(ista_2l,jsta_2l,lp1))
1134 if(debugprint)print*,
'sample ',varname,
' =',pint(isa,jsa,lp1)
1147 if (dpres(i,j,l-1)<spval .and. pint(i,j,l-1)<spval)
then
1148 pint(i,j,l)= pint(i,j,l-1) + dpres(i,j,l-1)
1162 if (pint(i,j,l)<spval .and. pint(i,j,l+1)<spval)
then
1163 pmid(i,j,l)=0.5*(pint(i,j,l)+pint(i,j,l+1))
1176 spval,varname,zint(ista_2l,jsta_2l,lp1))
1177 if(debugprint)print*,
'sample ',varname,
' =',zint(isa,jsa,lp1)
1180 if (zint(i,j,lp1) /= spval)
then
1181 fis(i,j) = zint(i,j,lp1) * grav
1191 alpint(i,j,l)=log(pint(i,j,l))
1200 if(wh(i,j,l) /= spval)
then
1202 zint(i,j,l) = abs(buf3d(i,j,l)) + zint(i,j,l+1)
1204 if(zint(i,j,l+1) /=spval .and. t(i,j,l) /= spval .and. alpint(i,j,l+1) /= spval &
1205 .and. alpint(i,j,l) /=spval .and. q(i,j,l) /= spval)
then
1206 zint(i,j,l) = zint(i,j,l+1)+(rgas/grav)*t(i,j,l)*(1.+fv*q(i,j,l))*(alpint(i,j,l+1)-alpint(i,j,l))
1218 if(zint(i,j,l+1)/=spval .and. zint(i,j,l)/=spval &
1219 .and. pmid(i,j,l)/=spval)
then
1220 zmid(i,j,l)=zint(i,j,l+1)+(zint(i,j,l)-zint(i,j,l+1))* &
1221 (log(pmid(i,j,l))-alpint(i,j,l+1))/ &
1222 (alpint(i,j,l)-alpint(i,j,l+1))
1223 if(zmid(i,j,l)>1.0e6)print*,
'bad Hmid ',i,j,l,zmid(i,j,l)
1232 if (gocart_on .or.gccpp_on .or. nasa_on)
then
1240 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1241 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1243 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1244 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1246 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1247 spval,varname,dt3(ista_2l,jsta_2l,1),lm)
1249 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1250 spval,varname,dt4(ista_2l,jsta_2l,1),lm)
1252 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1253 spval,varname,dt5(ista_2l,jsta_2l,1),lm)
1261 dust(i,j,l,1)=dt1(i,j,l)
1262 dust(i,j,l,2)=dt2(i,j,l)
1263 dust(i,j,l,3)=dt3(i,j,l)
1264 dust(i,j,l,4)=dt4(i,j,l)
1265 dust(i,j,l,5)=dt5(i,j,l)
1268 dustcb(i,j)=dustcb(i,j)+&
1269 (dust(i,j,l,1)+0.38*dust(i,j,l,2))* &
1273 dustallcb(i,j)=dustallcb(i,j)+ &
1274 (dust(i,j,l,1)+dust(i,j,l,2)+ &
1275 dust(i,j,l,3)+0.74*dust(i,j,l,4))* &
1287 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1288 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1291 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1292 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1295 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1296 spval,varname,dt3(ista_2l,jsta_2l,1),lm)
1299 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1300 spval,varname,dt4(ista_2l,jsta_2l,1),lm)
1303 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1304 spval,varname,dt5(ista_2l,jsta_2l,1),lm)
1312 salt(i,j,l,1)=dt1(i,j,l)
1313 salt(i,j,l,2)=dt2(i,j,l)
1314 salt(i,j,l,3)=dt3(i,j,l)
1315 salt(i,j,l,4)=dt4(i,j,l)
1316 salt(i,j,l,5)=dt5(i,j,l)
1318 sscb(i,j)=sscb(i,j)+ &
1319 (salt(i,j,l,1)+salt(i,j,l,2)+0.83*salt(i,j,l,3))* &
1323 ssallcb(i,j)=ssallcb(i,j)+ &
1324 (salt(i,j,l,1)+salt(i,j,l,2)+salt(i,j,l,3)+salt(i,j,l,4))* &
1334 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1335 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1338 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1339 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1346 soot(i,j,l,1)=dt1(i,j,l)
1347 soot(i,j,l,2)=dt2(i,j,l)
1349 bccb(i,j)=bccb(i,j)+ &
1350 (soot(i,j,l,1)+soot(i,j,l,2))* &
1360 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1361 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1364 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1365 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1370 waso(i,j,l,1)=dt1(i,j,l)
1371 waso(i,j,l,2)=dt2(i,j,l)
1373 occb(i,j)=occb(i,j)+ &
1374 (waso(i,j,l,1)+waso(i,j,l,2))* &
1384 if (gocart_on .or. gccpp_on)
then
1391 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1392 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1398 suso(i,j,l,1)=dt1(i,j,l)
1400 sulfcb(i,j)=sulfcb(i,j)+ &
1411 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1412 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1415 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1416 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1419 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1420 spval,varname,dt3(ista_2l,jsta_2l,1),lm)
1426 if ((dt1(i,j,l) /= spval ) .and. (dt2(i,j,l) /= spval) .and. (dt3(i,j,l) /= spval))
then
1427 no3(i,j,l,1)=dt1(i,j,l)
1428 no3(i,j,l,2)=dt2(i,j,l)
1429 no3(i,j,l,3)=dt3(i,j,l)
1431 no3cb(i,j)=no3cb(i,j)+ &
1432 (no3(i,j,l,1)+no3(i,j,l,2)+no3(i,j,l,3))* &
1447 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1448 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1454 nh4(i,j,l,1)=dt1(i,j,l)
1456 nh4cb(i,j)=nh4cb(i,j)+ &
1469 if (gocart_on .or. gccpp_on)
then
1476 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1477 spval,varname,dt1(ista_2l,jsta_2l,1),lm)
1482 if (gocart_on .or. gccpp_on)
then
1490 call read_netcdf_3d_para(ncid3d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u,&
1491 spval,varname,dt2(ista_2l,jsta_2l,1),lm)
1497 pp25(i,j,l,1)=dt1(i,j,l)
1498 pp10(i,j,l,1)=dt2(i,j,l)
1501 pp25cb(i,j)=pp25cb(i,j)+ &
1502 pp25(i,j,l,1)* dpres(i,j,l)/grav
1504 pp10cb(i,j)=pp10cb(i,j)+ &
1505 pp10(i,j,l,1)* dpres(i,j,l)/grav
1515 tv = t(i,j,l) * (h1+d608*max(q(i,j,l),qmin))
1516 rhomid(i,j,l) = pmid(i,j,l) / (rd*tv)
1518 IF ( dust(i,j,l,n) < spval)
THEN
1519 dust(i,j,l,n) = max(dust(i,j,l,n), 0.0)
1523 IF ( salt(i,j,l,n) < spval)
THEN
1524 salt(i,j,l,n) = max(salt(i,j,l,n), 0.0)
1528 IF ( waso(i,j,l,n) < spval)
THEN
1529 waso(i,j,l,n) = max(waso(i,j,l,n), 0.0)
1533 IF ( soot(i,j,l,n) < spval)
THEN
1534 soot(i,j,l,n) = max(soot(i,j,l,n), 0.0)
1538 IF ( suso(i,j,l,n) < spval)
THEN
1539 suso(i,j,l,n) = max(suso(i,j,l,n), 0.0)
1544 IF ( no3(i,j,l,n) < spval)
THEN
1545 no3(i,j,l,n) = max(no3(i,j,l,n), 0.0)
1549 IF ( nh4(i,j,l,n) < spval)
THEN
1550 nh4(i,j,l,n) = max(nh4(i,j,l,n), 0.0)
1561 dustcb(i,j) = max(dustcb(i,j), 0.0)
1562 dustallcb(i,j) = max(dustallcb(i,j), 0.0)
1563 sscb(i,j) = max(sscb(i,j), 0.0)
1564 ssallcb(i,j) = max(ssallcb(i,j), 0.0)
1565 bccb(i,j) = max(bccb(i,j), 0.0)
1566 occb(i,j) = max(occb(i,j), 0.0)
1567 sulfcb(i,j) = max(sulfcb(i,j), 0.0)
1569 no3cb(i,j) = max(no3cb(i,j), 0.0)
1570 nh4cb(i,j) = max(nh4cb(i,j), 0.0)
1572 pp25cb(i,j) = max(pp25cb(i,j), 0.0)
1573 pp10cb(i,j) = max(pp10cb(i,j), 0.0)
1576 dustpm(i,j)=(dust(i,j,l,1)+0.38*dust(i,j,l,2))*rhomid(i,j,l)
1577 dustpm10(i,j)=(dust(i,j,l,1)+dust(i,j,l,2)+dust(i,j,l,3)+ &
1578 0.74*dust(i,j,l,4))*rhomid(i,j,l)
1579 sspm(i,j)=(salt(i,j,l,1)+salt(i,j,l,2)+ &
1580 0.83*salt(i,j,l,3))*rhomid(i,j,l)
1582 if (gocart_on .or. gccpp_on)
then
1584 dusmass(i,j)=(dust(i,j,l,1)+dust(i,j,l,2)+dust(i,j,l,3)+ &
1585 0.74*dust(i,j,l,4)+salt(i,j,l,1)+salt(i,j,l,2)+salt(i,j,l,3)+ &
1586 salt(i,j,l,4) + soot(i,j,l,1)+soot(i,j,l,2)+waso(i,j,l,1)+ &
1587 waso(i,j,l,2) +suso(i,j,l,1)+pp25(i,j,l,1)+pp10(i,j,l,1)) &
1590 dusmass25(i,j)=(dust(i,j,l,1)+0.38*dust(i,j,l,2)+ &
1591 salt(i,j,l,1)+salt(i,j,l,2)+0.83*salt(i,j,l,3) + &
1592 soot(i,j,l,1)+soot(i,j,l,2)+waso(i,j,l,1)+ &
1593 waso(i,j,l,2) +suso(i,j,l,1)+pp25(i,j,l,1))*rhomid(i,j,l)
1596 ducmass(i,j)=dustallcb(i,j)+ssallcb(i,j)+bccb(i,j)+ &
1597 occb(i,j)+sulfcb(i,j)+pp25cb(i,j)+pp10cb(i,j)
1599 ducmass25(i,j)=dustcb(i,j)+sscb(i,j)+bccb(i,j)+occb(i,j) &
1600 +sulfcb(i,j)+pp25cb(i,j)
1605 dusmass(i,j)=pp10(i,j,l,1)*rhomid(i,j,l)
1607 dusmass25(i,j)=pp25(i,j,l,1)*rhomid(i,j,l)
1610 ducmass(i,j)=pp10cb(i,j)
1612 ducmass25(i,j)=pp25cb(i,j)
1631 status=nf90_close(ncid3d)
1636 status=nf90_get_att(ncid2d,nf90_global,
'IVEGSRC',ivegsrc)
1637 if (status /= 0)
then
1638 if(me==0)print*,varname,
' not found-Assigned 1 for IGBP as default'
1641 if (me == 0) print*,
'IVEGSRC= ',ivegsrc
1646 else if(ivegsrc==1)
then
1648 else if(ivegsrc==0)
then
1651 if (me == 0) print*,
'novegtype= ',novegtype
1654 status=nf90_get_att(ncid2d,nf90_global,
'fhzero',fhzero)
1655 if (status /= 0)
then
1657 status=nf90_get_att(ncid2d,nf90_global,
'fhzero',fhzeror)
1658 if (status /= 0)
then
1659 print*,
'fhzero not found-Assigned 3 hours as default'
1663 fhzeror=float(fhzero)
1667 status=nf90_get_att(ncid2d,nf90_global,
'dtp',dtp)
1668 if (status /= 0)
then
1669 print*,
'dtp not found-Assigned 90s as default'
1672 if (me == 0) print*,
'dtp= ',dtp
1674 if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
1675 CALL microinit(imp_physics)
1691 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1692 spval,varname,ref_10cm(ista_2l,jsta_2l,1),lm)
1700 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1701 spval,varname,q2(ista_2l,jsta_2l,1),lm)
1705 if(q2(i,j,l)/=spval) q2(i,j,l)=q2(i,j,l)/2.0
1712 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1713 spval,varname,qqnifa(ista_2l,jsta_2l,1),lm)
1717 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
1718 spval,varname,qqnwfa(ista_2l,jsta_2l,1),lm)
1723 if(debugprint)print*,
'sample ',varname,
' =',sm((ista+iend)/2,(jsta+jend)/2)
1728 if (sm(i,j) /= spval) sm(i,j) = 1.0 - sm(i,j)
1737 if(debugprint)print*,
'sample ',varname,
' = ',sice(isa,jsa)
1750 if (sm(i,j) /= spval .and. sm(i,j) == 0.0) sice(i,j) = 0.0
1759 if(debugprint)print*,
'sample ',varname,
' = ',pblh(isa,jsa)
1764 spval,varname,ustar)
1776 spval,varname,sfcexc)
1781 spval,varname,snow_acm)
1785 spval,varname,snow_bkt)
1790 spval,varname,acgraup)
1795 spval,varname,graup_bucket)
1800 spval,varname,acfrain)
1805 spval,varname,frzrn_bucket)
1810 spval,varname,snownc)
1815 spval,varname,graupelnc)
1820 spval,varname,acond)
1821 if(debugprint)print*,
'sample ',varname,
' = ',acond(isa,jsa)
1825 spval,varname,avgalbedo)
1829 if (avgalbedo(i,j) /= spval) avgalbedo(i,j) = avgalbedo(i,j) * 0.01
1832 if(debugprint)print*,
'sample ',varname,
' = ',avgalbedo(isa,jsa)
1836 spval,varname,albedo)
1837 if(debugprint)print*,
'sample ',varname,
' = ',albedo(isa,jsa)
1849 if (ths(i,j) /= spval)
then
1851 ths(i,j) = ths(i,j) * (p1000/pint(i,j,lp1))**capa
1857 if (sm(i,j) /= 0.0 .and. ths(i,j) < spval )
then
1858 if (sice(i,j) >= 0.15)
then
1861 sst(i,j) = ths(i,j) * (pint(i,j,lp1)/p1000)**capa
1868 if(debugprint)print*,
'sample ',varname,
' = ',ths(isa,jsa)
1873 spval,varname,fdnsst)
1874 if(debugprint)print*,
'sample ',varname,
' = ',fdnsst(isa,jsa)
1889 varname=
'cpratb_ave'
1891 spval,varname,avgcprate)
1896 if (avgcprate(i,j) /= spval) avgcprate(i,j) = avgcprate(i,j) * (dtq2*0.001)
1906 spval,varname,avgcprate_cont)
1910 if (avgcprate_cont(i,j) /= spval) avgcprate_cont(i,j) = &
1911 avgcprate_cont(i,j) * (dtq2*0.001)
1919 varname=
'prateb_ave'
1921 spval,varname,avgprec)
1925 if(avgprec(i,j) /= spval)avgprec(i,j)=avgprec(i,j)*(dtq2*0.001)
1929 if(debugprint)print*,
'sample ',varname,
' = ',avgprec(isa,jsa)
1935 spval,varname,avgprec_cont)
1940 if (avgprec_cont(i,j) /=spval)avgprec_cont(i,j)=avgprec_cont(i,j) &
1945 if(debugprint)print*,
'sample ',varname,
' = ',avgprec_cont(isa,jsa)
1953 if (prec(i,j) /= spval) prec(i,j)=prec(i,j)* (dtq2*0.001) &
1961 spval,varname,cprate)
1965 if (cprate(i,j) /= spval)
then
1966 cprate(i,j) = max(0.,cprate(i,j)) * (dtq2*0.001) &
1979 spval,varname,prate_max)
1980 if(debugprint)print*,
'sample ',varname,
' = ',prate_max(isa,jsa)
1984 spval,varname,refd_max)
1985 if(debugprint)print*,
'sample ',varname,
' = ',refd_max(isa,jsa)
1987 varname=
'refdmax263k'
1989 spval,varname,refdm10c_max)
1990 if(debugprint)print*,
'sample ',varname,
' = ',refdm10c_max(isa,jsa)
1995 spval,varname,u10max)
1996 if(debugprint)print*,
'sample ',varname,
' = ',u10max(isa,jsa)
2000 spval,varname,v10max)
2001 if(debugprint)print*,
'sample ',varname,
' = ',v10max(isa,jsa)
2003 if (modelname==
'FV3R')
then
2005 else if (modelname==
'GFS')
then
2006 varname=
'wind10m_max'
2009 spval,varname,wspd10max)
2010 if(debugprint)print*,
'sample ',varname,
' = ',wspd10max(isa,jsa)
2015 spval,varname,wspd10umax)
2016 if(debugprint)print*,
'sample ',varname,
' = ',u10max(isa,jsa)
2020 spval,varname,wspd10vmax)
2021 if(debugprint)print*,
'sample ',varname,
' = ',v10max(isa,jsa)
2031 if (sm(i,j) == 1.0 .and. sice(i,j)==0.) sno(i,j) = spval
2034 if(debugprint)print*,
'sample ',varname,
' = ',sno(isa,jsa)
2039 spval,varname,snoavg)
2043 if (sm(i,j)==1.0 .and. sice(i,j)==0.) snoavg(i,j)=spval
2044 if(snoavg(i,j)/=spval)snoavg(i,j)=snoavg(i,j)/100.
2055 if (sm(i,j)==1.0 .and. sice(i,j)==0.) si(i,j)=spval
2056 if (si(i,j) /= spval) si(i,j) = si(i,j) * 1000.0
2065 if(debugprint)print*,
'sample ',varname,
' = ',si(isa,jsa)
2070 spval,varname,tshltr)
2071 if(debugprint)print*,
'sample ',varname,
' = ',tshltr(isa,jsa)
2076 pshltr(i,j)=pint(i,j,lm+1)*exp(-0.068283/tshltr(i,j))
2077 tshltr(i,j)= tshltr(i,j)*(p1000/pshltr(i,j))**capa
2087 spval,varname,qshltr)
2088 if(debugprint)print*,
'sample ',varname,
' = ',qshltr(isa,jsa)
2091 varname=
'tcdc_aveclm'
2093 spval,varname,avgtcdc)
2098 if (avgtcdc(i,j) /= spval) avgtcdc(i,j) = avgtcdc(i,j) * 0.01
2101 if(debugprint)print*,
'sample ',varname,
' = ',avgtcdc(isa,jsa)
2105 do j=jsta_2l,jend_2u
2106 do i=ista_2l,iend_2u
2115 spval,varname,mxsnal)
2120 spval,varname,landfrac)
2126 tlmh = t(i,j,lm) * t(i,j,lm)
2127 sigt4(i,j) = 5.67e-8 * tlmh * tlmh
2135 do j=jsta_2l,jend_2u
2136 do i=ista_2l,iend_2u
2144 varname=
'tcdc_avehcl'
2146 spval,varname,avgcfrach)
2151 if (avgcfrach(i,j) /= spval) avgcfrach(i,j) = avgcfrach(i,j) * 0.01
2154 if(debugprint)print*,
'sample ',varname,
' = ',avgcfrach(isa,jsa)
2157 varname=
'tcdc_avelcl'
2159 spval,varname,avgcfracl)
2164 if (avgcfracl(i,j) /= spval) avgcfracl(i,j) = avgcfracl(i,j) * 0.01
2167 if(debugprint)print*,
'sample ',varname,
' = ',avgcfracl(isa,jsa)
2170 varname=
'tcdc_avemcl'
2172 spval,varname,avgcfracm)
2177 if (avgcfracm(i,j) /= spval) avgcfracm(i,j) = avgcfracm(i,j) * 0.01
2180 if(debugprint)print*,
'sample ',varname,
' = ',avgcfracm(isa,jsa)
2185 spval,varname,cnvcfr)
2190 if (cnvcfr(i,j) /= spval) cnvcfr(i,j)= cnvcfr(i,j) * 0.01
2200 do j = jsta_2l, jend_2u
2202 if (buf(i,j) < spval)
then
2203 islope(i,j) = nint(buf(i,j))
2218 if (cmc(i,j) /= spval) cmc(i,j) = cmc(i,j) * 0.001
2219 if (sm(i,j) /= 0.0) cmc(i,j) = spval
2225 do j=jsta_2l,jend_2u
2226 do i=ista_2l,iend_2u
2238 if(sr(i,j) /= spval)
then
2240 sr(i,j)=min(1.,max(0.,sr(i,j)))
2252 if (sice(i,j) == spval .or. sice(i,j) == 0.) ti(i,j)=spval
2259 spval,varname,vegfrc)
2263 if (vegfrc(i,j) /= spval)
then
2264 vegfrc(i,j) = vegfrc(i,j) * 0.01
2274 if (sm(i,j) /= 0.0) vegfrc(i,j) = spval
2302 status=nf90_inq_varid(ncid2d,
'zsoil',varid)
2308 spval,varname,sh2o(ista_2l,jsta_2l,1))
2313 if (sm(i,j) /= 0.0) sh2o(i,j,1) = spval
2316 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,1)
2320 spval,varname,sh2o(ista_2l,jsta_2l,2))
2325 if (sm(i,j) /= 0.0) sh2o(i,j,2) = spval
2328 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,2)
2332 spval,varname,sh2o(ista_2l,jsta_2l,3))
2337 if (sm(i,j) /= 0.0) sh2o(i,j,3) = spval
2340 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,3)
2344 spval,varname,sh2o(ista_2l,jsta_2l,4))
2349 if (sm(i,j) /= 0.0) sh2o(i,j,4) = spval
2352 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,4)
2358 spval,varname,sh2o(ista_2l,jsta_2l,5))
2363 if (sm(i,j) /= 0.0) sh2o(i,j,5) = spval
2366 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,5)
2370 spval,varname,sh2o(ista_2l,jsta_2l,6))
2375 if (sm(i,j) /= 0.0) sh2o(i,j,6) = spval
2378 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,6)
2382 spval,varname,sh2o(ista_2l,jsta_2l,7))
2387 if (sm(i,j) /= 0.0) sh2o(i,j,7) = spval
2390 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,7)
2394 spval,varname,sh2o(ista_2l,jsta_2l,8))
2399 if (sm(i,j) /= 0.0) sh2o(i,j,8) = spval
2402 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,8)
2406 spval,varname,sh2o(ista_2l,jsta_2l,9))
2411 if (sm(i,j) /= 0.0) sh2o(i,j,9) = spval
2414 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,9)
2421 spval,varname,smc(ista_2l,jsta_2l,1))
2426 if (sm(i,j) /= 0.0) smc(i,j,1) = spval
2429 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,1)
2433 spval,varname,smc(ista_2l,jsta_2l,2))
2438 if (sm(i,j) /= 0.0) smc(i,j,2) = spval
2441 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,2)
2445 spval,varname,smc(ista_2l,jsta_2l,3))
2450 if (sm(i,j) /= 0.0) smc(i,j,3) = spval
2453 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,3)
2457 spval,varname,smc(ista_2l,jsta_2l,4))
2462 if (sm(i,j) /= 0.0) smc(i,j,4) = spval
2465 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,4)
2471 spval,varname,smc(ista_2l,jsta_2l,5))
2476 if (sm(i,j) /= 0.0) smc(i,j,5) = spval
2479 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,5)
2483 spval,varname,smc(ista_2l,jsta_2l,6))
2488 if (sm(i,j) /= 0.0) smc(i,j,6) = spval
2491 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,6)
2495 spval,varname,smc(ista_2l,jsta_2l,7))
2500 if (sm(i,j) /= 0.0) smc(i,j,7) = spval
2503 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,7)
2507 spval,varname,smc(ista_2l,jsta_2l,8))
2512 if (sm(i,j) /= 0.0) smc(i,j,8) = spval
2515 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,8)
2519 spval,varname,smc(ista_2l,jsta_2l,9))
2524 if (sm(i,j) /= 0.0) smc(i,j,9) = spval
2527 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,9)
2534 spval,varname,stc(ista_2l,jsta_2l,1))
2539 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,1) = spval
2543 if(debugprint)print*,
'sample l',
'stc',
' = ',1,stc(isa,jsa,1)
2547 spval,varname,stc(ista_2l,jsta_2l,2))
2552 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,2) = spval
2556 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,2)
2560 spval,varname,stc(ista_2l,jsta_2l,3))
2565 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,3) = spval
2569 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,3)
2573 spval,varname,stc(ista_2l,jsta_2l,4))
2578 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,4) = spval
2582 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,4)
2588 spval,varname,stc(ista_2l,jsta_2l,5))
2593 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,5) = spval
2597 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,5)
2601 spval,varname,stc(ista_2l,jsta_2l,6))
2606 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,6) = spval
2610 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,6)
2614 spval,varname,stc(ista_2l,jsta_2l,7))
2619 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,7) = spval
2623 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,7)
2627 spval,varname,stc(ista_2l,jsta_2l,8))
2632 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,8) = spval
2636 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,8)
2640 spval,varname,stc(ista_2l,jsta_2l,9))
2645 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,9) = spval
2649 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,9)
2655 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
2656 spval,varname,stc(ista_2l,jsta_2l,1),nsoil)
2658 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
2659 spval,varname,smc(ista_2l,jsta_2l,1),nsoil)
2661 call read_netcdf_3d_para(ncid2d,im,jm,ista,ista_2l,iend,iend_2u,jsta,jsta_2l,jend,jend_2u, &
2662 spval,varname,sh2o(ista_2l,jsta_2l,1),nsoil)
2665 if (modelname ==
'FV3R')
then
2667 do j = jsta_2l, jend_2u
2668 do i = ista_2l, iend_2u
2673 if(ext550(i,j,l)<spval)
then
2674 taod5503d( i, j, l) = ext550( i, j, l )
2675 dz = zint( i, j, l ) - zint( i, j, l+1 )
2676 aextc55( i, j, l ) = taod5503d( i, j, l ) / dz
2678 if(debugprint.and.i==im/2.and.j==(jsta+jend)/2)print*,
'sample taod5503d= ', &
2679 i,j,l,taod5503d( i, j, l )
2680 if(debugprint.and.i==im/2.and.j==(jsta+jend)/2)print*,
'sample dz= ', &
2682 if(debugprint.and.i==im/2.and.j==(jsta+jend)/2)print*,
'sample AEXTC55= ', &
2683 i,j,l,aextc55( i, j, l )
2687 thv(i,j,l) = ( t(i,j,l) * (p1000/pint(i,j,l))**capa ) &
2688 * ( 1. + 0.61*q(i,j,l)/(1.-q(i,j,l)) )
2696 do j = jsta_2l, jend_2u
2697 do i = ista_2l, iend_2u
2705 if (thv(i,j,lm-1) < (thv(i,j,lm) + delta_theta4gust))
then
2712 if (thv(i,j,lm-k+1) > (thv(i,j,lm) + delta_theta4gust)) &
2720 zpbltop = zmid(i,j,lm-k1+1) + &
2721 ((thv(i,j,lm)+delta_theta4gust)-thv(i,j,lm-k1+1)) &
2722 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
2723 / (thv(i,j,lm-k1+2) - thv(i,j,lm-k1+1))
2725 pblhgust( i, j ) = max(zpbltop - zint(i,j,lp1), 0.)
2729 pblhgust( i, j ) = 0.
2757 spval,varname,alwin)
2762 spval,varname,rlwin)
2767 spval,varname,alwout)
2772 spval,varname,radot)
2778 if (alwout(i,j) /= spval) alwout(i,j) = -alwout(i,j)
2784 varname=
'ulwrf_avetoa'
2786 spval,varname,alwtoa)
2792 spval,varname,rlwtoa)
2802 spval,varname,aswin)
2808 spval,varname,rswin)
2813 spval,varname,rswinc)
2818 spval,varname,swddni)
2823 spval,varname,swddif)
2828 spval,varname,xlaixy)
2833 spval,varname,auvbin)
2839 spval,varname,auvbinc)
2845 spval,varname,aswout)
2850 if (aswout(i,j) /= spval) aswout(i,j) = -aswout(i,j)
2858 spval,varname,rswout)
2861 varname=
'dswrf_avetoa'
2863 spval,varname,aswintoa)
2867 varname=
'uswrf_avetoa'
2869 spval,varname,aswtoa)
2876 spval,varname,sfcshx)
2881 if (sfcshx(i,j) /= spval) sfcshx(i,j) = -sfcshx(i,j)
2893 if (twbs(i,j) /= spval) twbs(i,j) = -twbs(i,j)
2905 spval,varname,sfclhx)
2910 if (sfclhx(i,j) /= spval) sfclhx(i,j) = -sfclhx(i,j)
2922 if (qwbs(i,j) /= spval) qwbs(i,j) = -qwbs(i,j)
2926 if(me==0)print*,
'rdaod= ',rdaod
2931 spval,varname,aod550)
2935 spval,varname,du_aod550)
2939 spval,varname,ss_aod550)
2943 spval,varname,su_aod550)
2947 spval,varname,oc_aod550)
2951 spval,varname,bc_aod550)
2957 spval,varname,subshx)
2962 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) subshx(i,j) = spval
2970 spval,varname,grnflx)
2975 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) grnflx(i,j) = spval
2982 spval,varname,sfcux)
2988 spval,varname,sfcvx)
2995 spval,varname,sfcuxi)
2996 if(debugprint)print*,
'sample l',varname,
' = ',1,sfcuxi(isa,jsa)
3001 spval,varname,sfcvxi)
3002 if(debugprint)print*,
'sample l',varname,
' = ',1,sfcvxi(isa,jsa)
3006 do j=jsta_2l,jend_2u
3007 do i=ista_2l,iend_2u
3015 spval,varname,gtaux)
3021 spval,varname,gtauy)
3027 spval,varname,avgpotevp)
3032 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) avgpotevp(i,j) = spval
3040 spval,varname,potevp)
3045 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) potevp(i,j) = spval
3051 do j=jsta_2l,jend_2u
3052 do i=ista_2l,iend_2u
3054 rlwtt(i,j,l) = spval
3056 rswtt(i,j,l) = spval
3058 tcucn(i,j,l) = spval
3059 tcucns(i,j,l) = spval
3061 train(i,j,l) = spval
3105 do j = jsta_2l, jend_2u
3107 if (buf(i,j) < spval)
then
3108 ivgtyp(i,j) = nint(buf(i,j))
3122 do j = jsta_2l, jend_2u
3124 if (buf(i,j) < spval)
then
3125 isltyp(i,j) = nint(buf(i,j))
3139 smstav(i,j) = buf(i,j)
3142 varname=
'snacc_land'
3149 do j = jsta_2l, jend_2u
3151 if(buf(i,j)<spval)
then
3152 sndepac(i,j) = buf(i,j)
3153 elseif(buf2(i,j)<spval)
then
3154 sndepac(i,j) = buf2(i,j)
3156 sndepac(i,j) = spval
3167 do j = jsta_2l, jend_2u
3169 if(buf(i,j)<spval)
then
3170 acsnom(i,j) = buf(i,j)
3171 elseif(buf2(i,j)<spval)
then
3172 acsnom(i,j) = buf2(i,j)
3179 do j=jsta_2l,jend_2u
3180 do i=ista_2l,iend_2u
3186 thz0(i,j) = ths(i,j)
3194 do j=jsta_2l,jend_2u
3195 do i=ista_2l,iend_2u
3196 el_pbl(i,j,l) = spval
3197 exch_h(i,j,l) = spval
3209 varname=
'prescnvclt'
3218 if(ptop(i,j) <= 0.0) ptop(i,j) = spval
3223 if(ptop(i,j) < spval)
then
3225 if(ptop(i,j) <= pmid(i,j,l))
then
3238 varname=
'prescnvclb'
3246 if(pbot(i,j) <= 0.0) pbot(i,j) = spval
3253 if(pbot(i,j) < spval)
then
3255 if(pbot(i,j) >= pmid(i,j,l))
then
3265 if(debugprint)print*,
'sample hbot = ',hbot(isa,jsa)
3267 varname=
'pres_avelct'
3269 spval,varname,ptopl)
3273 varname=
'pres_avelcb'
3275 spval,varname,pbotl)
3279 varname=
'tmp_avelct'
3281 spval,varname,ttopl)
3285 varname=
'pres_avemct'
3287 spval,varname,ptopm)
3291 varname=
'pres_avemcb'
3293 spval,varname,pbotm)
3297 varname=
'tmp_avemct'
3299 spval,varname,ttopm)
3303 varname=
'pres_avehct'
3305 spval,varname,ptoph)
3309 varname=
'pres_avehcb'
3311 spval,varname,pboth)
3315 varname=
'tmp_avehct'
3317 spval,varname,ttoph)
3321 varname=
'tcdc_avebndcl'
3323 spval,varname,pblcfr)
3327 do j = jsta_2l, jend_2u
3329 if (pblcfr(i,j) < spval) pblcfr(i,j) = pblcfr(i,j) * 0.01
3334 varname=
'cwork_aveclm'
3336 spval,varname,cldwork)
3342 spval,varname,runoff)
3347 if (sm(i,j) /= 0.0) runoff(i,j) = spval
3359 if (sm(i,j) /= 0.0) twa(i,j) = spval
3367 spval,varname,tecan)
3372 if (sm(i,j) /= 0.0) tecan(i,j) = spval
3379 spval,varname,tetran)
3384 if (sm(i,j) /= 0.0) tetran(i,j) = spval
3391 spval,varname,tedir)
3396 if (sm(i,j) /= 0.0) tedir(i,j) = spval
3402 if(modelname==
'GFS') varname=
'tmax_max2m'
3404 spval,varname,maxtshltr)
3408 if(modelname==
'GFS') varname=
'tmin_min2m'
3410 spval,varname,mintshltr)
3417 spval,varname,maxrhshltr)
3422 spval,varname,minrhshltr)
3427 varname=
'spfhmax_max2m'
3429 spval,varname,maxqshltr)
3434 varname=
'spfhmin_min2m'
3436 spval,varname,minqshltr)
3441 spval,varname,dzice)
3447 spval,varname,smcwlt)
3452 if (sm(i,j) /= 0.0) smcwlt(i,j) = spval
3460 spval,varname,suntime)
3465 spval,varname,fieldcapa)
3470 if (sm(i,j) /= 0.0) fieldcapa(i,j) = spval
3478 spval,varname,avisbeamswin)
3485 spval,varname,avisdiffswin)
3490 spval,varname,airbeamswin)
3495 spval,varname,airdiffswin)
3500 spval,varname,alwoutc)
3505 spval,varname,alwtoac)
3510 spval,varname,aswoutc)
3515 spval,varname,aswtoac)
3520 spval,varname,alwinc)
3525 spval,varname,aswinc)
3530 spval,varname,ssroff)
3535 if (sm(i,j) /= 0.0) ssroff(i,j) = spval
3542 spval,varname,avgedir)
3547 if (sm(i,j) /= 0.0) avgedir(i,j) = spval
3554 spval,varname,avgecan)
3559 if (sm(i,j) /= 0.0) avgecan(i,j) = spval
3571 if (sm(i,j) /= 0.0) paha(i,j) = spval
3583 if (sm(i,j) /= 0.0) pahi(i,j) = spval
3590 spval,varname,avgetrans)
3595 if (sm(i,j) /= 0.0) avgetrans(i,j) = spval
3602 spval,varname,avgesnow)
3607 if (sm(i,j)==1.0 .and. sice(i,j)==0.) avgesnow(i,j)=spval
3614 spval,varname,smstot)
3619 if (sm(i,j) /= 0.0) smstot(i,j) = spval
3626 spval,varname,snopcx)
3631 if (sm(i,j) /= 0.0) snopcx(i,j) = spval
3654 if ((gocart_on .or. gccpp_on) .and. d2d_chem)
then
3659 if ( k == 1) varname=
'duem001'
3660 if ( k == 2) varname=
'duem002'
3661 if ( k == 3) varname=
'duem003'
3662 if ( k == 4) varname=
'duem004'
3663 if ( k == 5) varname=
'duem005'
3666 spval,varname,chem_2d)
3668 duem(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3673 if ( k == 1) varname=
'dust1sd'
3674 if ( k == 2) varname=
'dust2sd'
3675 if ( k == 3) varname=
'dust3sd'
3676 if ( k == 4) varname=
'dust4sd'
3677 if ( k == 5) varname=
'dust5sd'
3679 spval,varname,chem_2d)
3680 dusd(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3685 if ( k == 1) varname=
'dust1dp'
3686 if ( k == 2) varname=
'dust2dp'
3687 if ( k == 3) varname=
'dust3dp'
3688 if ( k == 4) varname=
'dust4dp'
3689 if ( k == 5) varname=
'dust5dp'
3691 spval,varname,chem_2d)
3692 dudp(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3697 if ( k == 1) varname=
'dust1wtl'
3698 if ( k == 2) varname=
'dust2wtl'
3699 if ( k == 3) varname=
'dust3wtl'
3700 if ( k == 4) varname=
'dust4wtl'
3701 if ( k == 5) varname=
'dust5wtl'
3703 spval,varname,chem_2d)
3704 duwt(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3709 if ( k == 1) varname=
'dust1wtc'
3710 if ( k == 2) varname=
'dust2wtc'
3711 if ( k == 3) varname=
'dust3wtc'
3712 if ( k == 4) varname=
'dust4wtc'
3713 if ( k == 5) varname=
'dust5wtc'
3715 spval,varname,chem_2d)
3716 dusv(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3721 if ( k == 1) varname=
'ssem001'
3722 if ( k == 2) varname=
'ssem002'
3723 if ( k == 3) varname=
'ssem003'
3724 if ( k == 4) varname=
'ssem004'
3725 if ( k == 5) varname=
'ssem005'
3727 spval,varname,chem_2d)
3728 ssem(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3733 if ( k == 1) varname=
'seas1sd'
3734 if ( k == 2) varname=
'seas2sd'
3735 if ( k == 3) varname=
'seas3sd'
3736 if ( k == 4) varname=
'seas4sd'
3737 if ( k == 5) varname=
'seas5sd'
3739 spval,varname,chem_2d)
3740 sssd(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3745 if ( k == 1) varname=
'seas1dp'
3746 if ( k == 2) varname=
'seas2dp'
3747 if ( k == 3) varname=
'seas3dp'
3748 if ( k == 4) varname=
'seas4dp'
3749 if ( k == 5) varname=
'seas5dp'
3751 spval,varname,chem_2d)
3752 ssdp(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3757 if ( k == 1) varname=
'seas1wtl'
3758 if ( k == 2) varname=
'seas2wtl'
3759 if ( k == 3) varname=
'seas3wtl'
3760 if ( k == 4) varname=
'seas4wtl'
3761 if ( k == 5) varname=
'seas5wtl'
3763 spval,varname,chem_2d)
3764 sswt(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3769 if ( k == 1) varname=
'seas1wtc'
3770 if ( k == 2) varname=
'seas2wtc'
3771 if ( k == 3) varname=
'seas3wtc'
3772 if ( k == 4) varname=
'seas4wtc'
3773 if ( k == 5) varname=
'seas5wtc'
3775 spval,varname,chem_2d)
3776 sssv(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3781 if ( k == 1) varname=
'bceman'
3782 if ( k == 2) varname=
'bcembb'
3784 spval,varname,chem_2d)
3785 bcem(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3790 if ( k == 1) varname=
'bc1sd'
3791 if ( k == 2) varname=
'bc2sd'
3793 spval,varname,chem_2d)
3794 bcsd(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3799 if ( k == 1) varname=
'bc1dp'
3800 if ( k == 2) varname=
'bc2dp'
3802 spval,varname,chem_2d)
3803 bcdp(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3808 if ( k == 1) varname=
'bc1wtl'
3809 if ( k == 2) varname=
'bc2wtl'
3811 spval,varname,chem_2d)
3812 bcwt(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3817 if ( k == 1) varname=
'bc1wtc'
3818 if ( k == 2) varname=
'bc2wtc'
3820 spval,varname,chem_2d)
3821 bcsv(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3826 if ( k == 1) varname=
'oceman'
3827 if ( k == 2) varname=
'ocembb'
3829 spval,varname,chem_2d)
3830 ocem(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3835 if ( k == 1) varname=
'oc1sd'
3836 if ( k == 2) varname=
'oc2sd'
3838 spval,varname,chem_2d)
3839 ocsd(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3844 if ( k == 1) varname=
'oc1dp'
3845 if ( k == 2) varname=
'oc2dp'
3847 spval,varname,chem_2d)
3848 ocdp(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3853 if ( k == 1) varname=
'oc1wtl'
3854 if ( k == 2) varname=
'oc2wtl'
3856 spval,varname,chem_2d)
3857 ocwt(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3862 if ( k == 1) varname=
'oc1wtc'
3863 if ( k == 2) varname=
'oc2wtc'
3865 spval,varname,chem_2d)
3866 ocsv(1:im,jsta_2l:jend_2u,k)=chem_2d(1:im,jsta_2l:jend_2u)
3872 spval,varname,chem_2d)
3873 maod(1:im,jsta_2l:jend_2u)=chem_2d(1:im,jsta_2l:jend_2u)
3877 status=nf90_close(ncid2d)
3908 CALL table(ptbl,ttbl,pt_tbl, &
3909 rdq,rdth,rdp,rdthe,pl,thl,qs0,sqs,sthe,the0)
3911 CALL tableq(ttblq,rdpq,rdtheq,plq,thl,stheq,the0q)
3916 WRITE(6,*)
' SPL (POSTED PRESSURE LEVELS) BELOW: '
3917 WRITE(6,51) (spl(l),l=1,lsm)
3918 50
FORMAT(14(f4.1,1x))
3919 51
FORMAT(8(f8.1,1x))
3924 alsl(l) = log(spl(l))
3929 print*,
'writing out igds'
3933 if(maptype == 1)
THEN
3935 WRITE(6,*)
'igd(1)=',3
3938 WRITE(igdout)latstart
3939 WRITE(igdout)lonstart
3946 WRITE(igdout)truelat2
3947 WRITE(igdout)truelat1
3949 ELSE IF(maptype == 2)
THEN
3953 WRITE(igdout)latstart
3954 WRITE(igdout)lonstart
3961 WRITE(igdout)truelat2
3962 WRITE(igdout)truelat1
3968 if (truelat1 < 0.)
THEN
3974 CALL msfps (lat,truelat1*0.001,psmapf)
3976 ELSE IF(maptype == 3)
THEN
3980 WRITE(igdout)latstart
3981 WRITE(igdout)lonstart
3983 WRITE(igdout)latlast
3984 WRITE(igdout)lonlast
3985 WRITE(igdout)truelat1
3991 ELSE IF(maptype == 0 .OR. maptype == 203)
THEN
3995 WRITE(igdout)latstart
3996 WRITE(igdout)lonstart
4006 ELSE IF(maptype == 207)
THEN
4007 write(flatlon,1001)ifhr
4008 open(112,file=trim(flatlon),form=
'formatted', &
4010 write(112,1002)latstart/1000,lonstart/1000,&
4011 latse/1000,lonse/1000,latnw/1000,lonnw/1000,&
4012 latlast/1000,lonlast/1000
4013 1001
format(
'latlons_corners.txt.f',i3.3)
4014 1002
format(4(i6,i7,x))