27 use vrbls4d,
only: dust, smoke
28 use vrbls3d,
only: t, u, uh, v, vh, wh, q, pmid, t, omga, pint, alpint, &
29 qqr, qqs, qqi, qqg, qqnw, qqni,qqnr, cwm, qqw, qqi, qqr, qqs, extcof55,&
30 f_ice, f_rain, f_rimef, q2, zint, zmid, ttnd, cfr, cfr_raw, qc_bl, ref_10cm, &
31 qqnwfa,qqnifa,taod5503d,aextc55
32 use vrbls2d,
only: tmax, qrmax, htop, hbot, cuppt, fis, cfrach, cfracl, &
33 sr, cfrach, cfracm, wspd10max, w_up_max, w_dn_max, w_mean, refd_max, &
34 up_heli_max, up_heli_max16, grpl_max, up_heli, up_heli16, &
35 up_heli_min,up_heli_min16,up_heli_max02,up_heli_min02, &
36 up_heli_max03,up_heli_min03,rel_vort_max,rel_vort_max01, &
37 wspd10umax,wspd10vmax,refdm10c_max, &
38 hail_max2d,hail_maxk1,hail_maxhailcast,ltg1_max, &
39 ltg2_max, ltg3_max, nci_ltg, nca_ltg, nci_wq, nca_wq, nci_refd, &
40 u10, v10, th10, q10, tshltr, mrshltr, &
41 nca_refd, qv2m, qshltr, smstav, smstot, ssroff, bgroff, sfcevp, &
42 sfcexc, vegfrc, acsnow, cmc, sst, thz0, qz0, uz0, vz0, qs, qvg, &
43 z0, ustar, akhs, akms, radot, ths, acsnom, cuprec, ancprc, acprec, &
44 rainc_bucket, pcp_bucket, cprate, prec, snownc, snow_bucket, &
45 graup_bucket, swddni, swddif, mean_frp, acgraup, acfrain, &
46 graupelnc, albedo, rswin, rswout, swdnbc, swddnic, &
47 swddifc, swupbc, swupt, czen, czmean, rlwin, lwdnbc, lwupbc, &
48 rainnc_bucket, taod5502d, aerasy2d, aerssa2d, lwp, iwp, &
49 sigt4, rlwtoa, rswinc, aswin, aswout, alwin, alwout, alwtoa, aswtoa, &
50 tg, soiltb, twbs, qwbs,grnflx, sfcshx, sfclhx, subshx, snopcx, &
51 sfcuvx, potevp, ncfrcv, ncfrst, sno, si, pctsno, snonc, tsnow, &
52 ivgtyp, isltyp, islope, pblh, pblhgust, f, &
53 qvl1,refc_10cm,ref1km_10cm,ref4km_10cm, &
54 swradmean,u10mean,v10mean,spduv10mean,swnormmean,snfden,sndepac, &
55 hbotd,hbots,rainc_bucket1,rainnc_bucket1,pcp_bucket1,snow_bucket1, &
56 graup_bucket1, shdmin, shdmax, lai, htopd,htops
57 use soil,
only: smc, sh2o, stc, sldpth, sllevel
58 use masks,
only: lmv, lmh, vtm, sice, gdlat, gdlon, sm, dx, dy, htm
59 use ctlblk_mod,
only: jsta_2l, jend_2u, filename, datahandle, datestr, &
60 ihrst, imin, idat, sdat, ifhr, ifmin, imp_physics, jsta, jend, &
61 spval,gdsdegr, modelname, pt, icu_physics, jsta_m, jend_m, nsoil, &
62 isf_surface_physics, nsoil, ardlw, ardsw, asrfc, me, mpi_comm_comp, &
63 nphs, smflag, spl, lsm, dt, prec_acc_dt, dtq2, tsrfc, trdlw, &
64 trdsw, theat, tclod, tprec, nprec, alsl, im, jm, lm, grib, &
65 prec_acc_dt1, submodelname
66 use params_mod,
only: capa, g, rd, d608, tfrz, ad05, cft0, stbol, &
67 p1000, pi, rtd, lheat, dtr, erad
68 use lookup_mod,
only: thl, plq, ptbl, ttbl, rdq, rdth, rdp, rdthe, pl, &
69 qs0, sqs, sthe, the0, ttblq, rdpq, rdtheq, stheq, the0q
70 use gridspec_mod,
only: gridtype, dxval, latstart, latlast, lonstart, &
71 lonlast, dyval, cenlat, cenlon, maptype, truelat1, truelat2, &
73 use wrf_io_flags_mod,
only:
85 character(len=31) :: VarName
87 character startdate*19,SysDepInfo*80
95 INTEGER IDATE(8),JDATE(8)
100 REAL DUMMY ( IM, JM )
101 REAL DUMMY2 ( IM, JM )
102 real,
allocatable:: msft(:,:)
103 INTEGER IDUMMY ( IM, JM )
104 REAL,
allocatable :: DUM3D ( :, :, : )
106 real,
allocatable:: pvapor(:,:)
107 real,
allocatable:: pvapor_orig(:,:)
108 REAL,
ALLOCATABLE :: THV(:,:,:)
110 integer js,je,jev,iyear,imn,iday,itmp,ioutcount,istatus, &
111 ii,jj,ll,i,j,l,nrdlw,nrdsw,n,igdout,irtn,idyvald, &
112 idxvald,nsrfc , lflip, k, k1
113 real DZ,TSPH,TMP,QMEAN,PVAPORNEW,DUMCST,TLMH,RHO,ZSF,ZPBLTOP
114 real t2,th2,x2m,p2m,tsk, fact, temp
117 integer jdn, numr, ic, jc, ierr
118 integer,
external :: iw3jdn
119 real sun_zenith,sun_azimuth, ptop_low, ptop_mid, ptop_high
120 real delta_theta4gust
126 ALLOCATE ( thv(im,jsta_2l:jend_2u,lm) )
127 ALLOCATE ( dum3d( im+1, jm+1, lm+1 ) )
128 WRITE(6,*)
'INITPOST: ENTER INITPOST'
145 do j = jsta_2l, jend_2u
156 do j = jsta_2l, jend_2u
168 call ext_ncd_ioinit(sysdepinfo,status)
169 print*,
'called ioinit', status
170 call ext_ncd_open_for_read( trim(filename), 0, 0,
" ", &
172 print*,
'called open for read', status
173 if ( status /= 0 )
then
174 print*,
'error opening ',filename,
' Status = ', status ; stop
178 print *,
'DateStr before calling ext_ncd_get_next_time=',datestr
180 print *,
'DateStri,Status,DataHandle = ',datestr,status,datahandle
185 IF (jend_2u==jm)
THEN
193 call ext_ncd_get_dom_ti_char(datahandle,
'SIMULATION_START_DATE', &
196 call ext_ncd_get_dom_ti_char(datahandle,
'START_DATE',startdate, &
199 print*,
'startdate= ',startdate
202 read(startdate,15)iyear,imn,iday,ihrst,imin
203 15
format(i4,1x,i2,1x,i2,1x,i2,1x,i2)
204 print*,
'start yr mo day hr min=',iyear,imn,iday,ihrst,imin
205 print*,
'processing yr mo day hr min=' &
206 ,idat(3),idat(1),idat(2),idat(4),idat(5)
222 CALL w3difdat(jdate,idate,0,rinc)
223 ifhr=nint(rinc(2)+rinc(1)*24.)
225 print*,
' in INITPOST ifhr ifmin fileName=',ifhr,ifmin,filename
232 call ext_ncd_get_dom_ti_integer(datahandle,
'MP_PHYSICS' &
233 ,itmp,1,ioutcount,istatus)
235 print*,
'MP_PHYSICS= ',itmp
238 if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
239 CALL microinit(imp_physics)
242 call ext_ncd_get_dom_ti_integer(datahandle,
'CU_PHYSICS' &
243 ,itmp,1,ioutcount,istatus)
245 print*,
'CU_PHYSICS= ',icu_physics
248 print*,
'im,jm,lm= ',im,jm,lm
254 call getvariable(filename,datestr,datahandle,varname,dum3d, &
255 im+1,1,jm+1,lm+1,im,js,je,lm)
257 do j = jsta_2l, jend_2u
259 t( i, j, l ) = dum3d( i, j, l ) + 300.
268 call getvariable(filename,datestr,datahandle,varname,dum3d, &
269 im+1,1,jm+1,lm+1,im+1,js,je,lm)
271 do j = jsta_2l, jend_2u
273 u( i, j, l ) = dum3d( i, j, l )
277 do j = jsta_2l, jend_2u
279 uh(i,j,l) = (dum3d(i,j,l)+dum3d(i+1,j,l))*0.5
285 call getvariable(filename,datestr,datahandle,varname,dum3d, &
286 im+1,1,jm+1,lm+1,im, js,jev,lm)
290 v( i, j, l ) = dum3d( i, j, l )
294 do j = jsta_2l, jend_2u
296 vh(i,j,l) = (dum3d(i,j,l)+dum3d(i,j+1,l))*0.5
303 call getvariable(filename,datestr,datahandle,varname,dum3d, &
304 im+1,1,jm+1,lm+1,im, js,je,lm+1)
316 wh(i,j,l) = (dum3d(i,j,l)+dum3d(i,j,l+1))*0.5
320 print*,
'finish reading W'
323 call getvariable(filename,datestr,datahandle,varname,dum3d, &
324 im+1,1,jm+1,lm+1,im,js,je,lm)
326 do j = jsta_2l, jend_2u
331 q( i, j, l ) = dum3d( i, j, l )/(1.0+dum3d( i, j, l ))
335 print*,
'finish reading mixing ratio'
344 call getvariable(filename,datestr,datahandle,varname,dum3d, &
345 im+1,1,jm+1,lm+1,im, js,je,lm)
350 do j = jsta_2l, jend_2u
353 pmid(i,j,l)=dum3d(i,j,l)
354 thv( i, j, l ) = t(i,j,l)*(q(i,j,l)*0.608+1.)
356 t( i, j, l ) = t(i,j,l)*(pmid(i,j,l)*1.e-5)**capa
358 if(abs(t( i, j, l ))>1.0e-3) &
359 omga(i,j,l) = -wh(i,j,l)*pmid(i,j,l)*g/ &
360 (rd*t(i,j,l)*(1.+d608*q(i,j,l)))
374 do j = jsta_2l, jend_2u
376 if((pmid(i,j,ll-1) - pmid(i,j,ll))>=0.)
then
381 pmid(i,j,ll)=0.5*(pmid(i,j,ll+1)+pmid(i,j,ll-1))
401 do j = jsta_2l, jend_2u
403 if((pmid(i,j,ll-1) - pmid(i,j,ll))>=0.)
then
408 pmid(i,j,ll)=pmid(i,j,ll-1) + &
409 fact*(pmid(i,j,ll-1)-pmid(i,j,ll-2))
423 pint(i,j,l)=(pmid(i,j,l-1)+pmid(i,j,l))*0.5
424 alpint(i,j,l)=alog(pint(i,j,l))
430 do j = jsta_2l, jend_2u
438 do j = jsta_2l, jend_2u
440 tmax(i,j)=max(tmax(i,j),t(i,j,lflip))
462 if(imp_physics/=5 .and. imp_physics/=0)
then
464 call getvariable(filename,datestr,datahandle,varname,dum3d, &
465 im+1,1,jm+1,lm+1,im, js,je,lm)
467 do j = jsta_2l, jend_2u
470 if(imp_physics==3)
then
471 if(t(i,j,l) >= tfrz)
then
472 qqw( i, j, l ) = dum3d( i, j, l )
474 qqi( i, j, l ) = dum3d( i, j, l )
477 qqw( i, j, l ) = dum3d( i, j, l )
489 if(imp_physics/=1 .and. imp_physics/=3 &
490 .and. imp_physics/=5 .and. imp_physics/=0)
then
492 call getvariable(filename,datestr,datahandle,varname,dum3d, &
493 im+1,1,jm+1,lm+1,im, js,je,lm)
495 do j = jsta_2l, jend_2u
497 qqi( i, j, l ) = dum3d( i, j, l )
506 if(imp_physics/=5 .and. imp_physics/=0)
then
508 call getvariable(filename,datestr,datahandle,varname,dum3d, &
509 im+1,1,jm+1,lm+1,im, js,je,lm)
511 do j = jsta_2l, jend_2u
514 if(imp_physics == 3)
then
515 if(t(i,j,l) >= tfrz)
then
516 qqr( i, j, l ) = dum3d( i, j, l )
518 qqs( i, j, l ) = dum3d( i, j, l )
521 qqr( i, j, l ) = dum3d( i, j, l )
523 dummy(i,j)=dum3d(i,j,l)
532 do j = jsta_2l, jend_2u
539 do j = jsta_2l, jend_2u
541 qrmax(i,j)=max(qrmax(i,j),qqr(i,j,l))
549 if(imp_physics/=1 .and. imp_physics/=3 .and. &
550 imp_physics/=5 .and. imp_physics/=0)
then
552 call getvariable(filename,datestr,datahandle,varname,dum3d, &
553 im+1,1,jm+1,lm+1,im, js,je,lm)
555 do j = jsta_2l, jend_2u
557 qqs( i, j, l ) = dum3d( i, j, l )
558 dummy(i,j)=dum3d(i,j,l)
566 if(imp_physics==2 .or. imp_physics==6 .or. &
567 imp_physics==8 .or. imp_physics==9 .or. imp_physics==28)
then
569 call getvariable(filename,datestr,datahandle,varname,dum3d, &
570 im+1,1,jm+1,lm+1,im, js,je,lm)
572 do j = jsta_2l, jend_2u
574 qqg( i, j, l ) = dum3d( i, j, l )
582 if(imp_physics==8 .or. imp_physics==9 .or.imp_physics==28)
then
584 call getvariable(filename,datestr,datahandle,varname,dum3d, &
585 im+1,1,jm+1,lm+1,im, js,je,lm)
587 do j = jsta_2l, jend_2u
589 qqni( i, j, l ) = dum3d( i, j, l )
590 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample QQNI= ', &
591 i,j,l,qqni( i, j, l )
596 call getvariable(filename,datestr,datahandle,varname,dum3d, &
597 im+1,1,jm+1,lm+1,im, js,je,lm)
599 do j = jsta_2l, jend_2u
601 qqnr( i, j, l ) = dum3d( i, j, l )
602 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample QQNR= ', &
603 i,j,l,qqnr( i, j, l )
610 if(imp_physics==28)
then
612 call getvariable(filename,datestr,datahandle,varname,dum3d, &
613 im+1,1,jm+1,lm+1,im, js,je,lm)
615 do j = jsta_2l, jend_2u
617 qqnw( i, j, l ) = dum3d( i, j, l )
618 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample QQNW= ', &
619 i,j,l,qqnw( i, j, l )
624 call getvariable(filename,datestr,datahandle,varname,dum3d, &
625 im+1,1,jm+1,lm+1,im, js,je,lm)
627 do j = jsta_2l, jend_2u
629 qqnwfa( i, j, l ) = dum3d( i, j, l )
630 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample QQNWFA= ', &
631 i,j,l,qqnwfa( i, j, l )
636 call getvariable(filename,datestr,datahandle,varname,dum3d, &
637 im+1,1,jm+1,lm+1,im, js,je,lm)
639 do j = jsta_2l, jend_2u
641 qqnifa( i, j, l ) = dum3d( i, j, l )
642 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample QQNIFA= ', &
643 i,j,l,qqnifa( i, j, l )
662 if(imp_physics/=5)
then
665 do j = jsta_2l, jend_2u
667 IF(qqr(i,j,l)<spval)
THEN
668 cwm(i,j,l)=qqr(i,j,l)
670 IF(qqi(i,j,l)<spval)
THEN
671 cwm(i,j,l)=cwm(i,j,l)+qqi(i,j,l)
673 IF(qqw(i,j,l)<spval)
THEN
674 cwm(i,j,l)=cwm(i,j,l)+qqw(i,j,l)
676 IF(qqs(i,j,l)<spval)
THEN
677 cwm(i,j,l)=cwm(i,j,l)+qqs(i,j,l)
679 IF(qqg(i,j,l)<spval)
THEN
680 cwm(i,j,l)=cwm(i,j,l)+qqg(i,j,l)
688 call getvariable(filename,datestr,datahandle,varname,dum3d, &
689 im+1,1,jm+1,lm+1,im, js,je,lm)
691 do j = jsta_2l, jend_2u
693 cwm( i, j, l ) = dum3d( i, j, l )
699 call getvariable(filename,datestr,datahandle,varname,dum3d, &
700 im+1,1,jm+1,lm+1,im, js,je,lm)
702 do j = jsta_2l, jend_2u
704 f_ice( i, j, l ) = dum3d( i, j, l )
710 call getvariable(filename,datestr,datahandle,varname,dum3d, &
711 im+1,1,jm+1,lm+1,im, js,je,lm)
713 do j = jsta_2l, jend_2u
715 f_rain( i, j, l ) = dum3d( i, j, l )
720 varname=
'F_RIMEF_PHY'
721 call getvariable(filename,datestr,datahandle,varname,dum3d, &
722 im+1,1,jm+1,lm+1,im, js,je,lm)
724 do j = jsta_2l, jend_2u
726 f_rimef( i, j, l ) = dum3d( i, j, l )
734 IF(icu_physics == 3 .or. icu_physics == 5) varname=
'CUTOP'
735 call getvariable(filename,datestr,datahandle,varname,dummy, &
736 im,1,jm,1,im,js,je,1)
737 do j = jsta_2l, jend_2u
739 htop( i, j ) = float(lm)-dummy(i,j)+1.0
743 IF(icu_physics == 3 .or. icu_physics == 5) varname=
'CUBOT'
744 call getvariable(filename,datestr,datahandle,varname,dummy, &
745 im,1,jm,1,im,js,je,1)
746 do j = jsta_2l, jend_2u
748 hbot( i, j ) = float(lm)-dummy(i,j)+1.0
753 call getvariable(filename,datestr,datahandle,varname,dummy, &
754 im,1,jm,1,im,js,je,1)
755 do j = jsta_2l, jend_2u
757 cuppt( i, j ) = dummy( i, j )
762 IF(modelname ==
'RAPR')
THEN
763 call getvariable(filename,datestr,datahandle,
'QKE',dum3d, &
764 im+1,1,jm+1,lm+1,im,js,je,lm)
766 do j = jsta_2l, jend_2u
768 q2( i, j, l ) = dum3d( i, j, l ) / 2.0
773 call getvariable(filename,datestr,datahandle,
'TKE',dum3d, &
774 im+1,1,jm+1,lm+1,im,js,je,lm)
776 do j = jsta_2l, jend_2u
778 q2( i, j, l ) = dum3d( i, j, l )
789 call getvariable(filename,datestr,datahandle,varname,dummy, &
790 im,1,jm,1,im,js,je,1)
792 call getvariable(filename,datestr,datahandle,varname,dummy2, &
793 im,1,jm,1,im,js,je,1)
795 call getvariable(filename,datestr,datahandle,varname,pt, &
800 pint(i,j,lm+1) = dummy(i,j)+dummy2(i,j)+pt
802 alpint(i,j,lm+1)=alog(pint(i,j,lm+1))
803 alpint(i,j,1)=alog(pint(i,j,1))
809 call getvariable(filename,datestr,datahandle,varname,dummy, &
810 im,1,jm,1,im,js,je,1)
811 do j = jsta_2l, jend_2u
813 fis( i, j ) = dummy( i, j ) * g
818 call getvariable(filename,datestr,datahandle,varname,dum3d, &
819 im+1,1,jm+1,lm+1,im,js,je,lm+1)
823 zint(i,j,l)=dum3d(i,j,l)
828 call getvariable(filename,datestr,datahandle,varname,dum3d, &
829 im+1,1,jm+1,lm+1,im,js,je,lm+1)
831 print*,
'finish reading geopotential'
836 zint(i,j,l)=(zint(i,j,l)+dum3d(i,j,l))/g
841 IF(modelname ==
'RAPR')
THEN
844 call getvariable(filename,datestr,datahandle,varname,dummy, &
845 im,1,jm,1,im,js,je,1)
849 if((pint(i,j,lm) - dummy(i,j))>=0.)
then
852 dummy(i,j)=pmid(i,j,lm)*1.001
855 pint(i,j,lm+1)=dummy(i,j)
856 alpint(i,j,lm+1)=alog(pint(i,j,lm+1))
864 allocate(pvapor(im,jsta_2l:jend_2u))
865 allocate(pvapor_orig(im,jsta_2l:jend_2u))
872 dz=zint(i,j,l)-zint(i,j,l+1)
873 rho=pmid(i,j,l)/(rd*t(i,j,l))
877 qmean=0.5*(q(i,j,l)+q(i,j,l+1))
883 pvapor(i,j)=pvapor(i,j)+g*rho*dz*qmean
890 pvapor_orig(i,j)=pvapor(i,j)
897 call exch(pvapor(1,jsta_2l))
901 pvapornew=ad05*(4.*(pvapor(i-1,j)+pvapor(i+1,j) &
902 +pvapor(i,j-1)+pvapor(i,j+1)) &
903 +pvapor(i-1,j-1)+pvapor(i+1,j-1) &
904 +pvapor(i-1,j+1)+pvapor(i+1,j+1)) &
907 pvapor(i,j)=pvapornew
917 pvapor(i,j)=pvapor_orig(i,j)+(pvapor(i,j+1)-pvapor_orig(i,j+1))
926 pvapor(i,j)=pvapor_orig(i,j)+(pvapor(i,j-1)-pvapor_orig(i,j-1))
933 pvapor(i,j)=pvapor_orig(i,j)+(pvapor(i+1,j)-pvapor_orig(i+1,j))
939 pvapor(i,j)=pvapor_orig(i,j)+(pvapor(i-1,j)-pvapor_orig(i-1,j))
944 pint(i,j,lm+1)=pint(i,j,lm+1)+pvapor(i,j)
947 if((pint(i,j,lm) - pint(i,j,lm+1))>=0. )
then
950 pint(i,j,lm+1) = pint(i,j,lm)*1.001
953 alpint(i,j,lm+1)=alog(pint(i,j,lm+1))
958 deallocate(pvapor_orig)
963 IF(modelname ==
'RAPR')
THEN
967 zint(i,j,lm+1)=fis(i,j)/g
969 if(i==im/2.and.j==(jsta+jend)/2) &
970 print*,
'i,j,L,ZINT from unipost= ',i,j,lm+1,zint(i,j,lm+1) &
971 , alpint(i,j,lm+1),alpint(i,j,lm)
977 dummy2(i,j)=htm(i,j,l)*t(i,j,l)*(q(i,j,l)*d608+1.0)*rd* &
978 (alpint(i,j,l+1)-alpint(i,j,l))+dummy(i,j)
980 dum3d(i,j,l)=zint(i,j,l)-dummy2(i,j)/g
982 zint(i,j,l)=dummy2(i,j)/g
983 if(i==im/2.and.j==(jsta+jend)/2) &
984 print*,
'i,j,L,ZINT from unipost= ',i,j,l,zint(i,j,l)
985 dummy(i,j)=dummy2(i,j)
992 if(i==im/2.and.j==(jsta+jend)/2)
then
993 print*,
'DIFF heights model-unipost= ', &
1000 print*,
'finish deriving geopotential in ARW'
1005 IF(modelname ==
'RAPR')
THEN
1010 fact=(alog(pmid(i,j,l))-alpint(i,j,l))/ &
1011 max(1.e-6,(alpint(i,j,l+1)-alpint(i,j,l)))
1012 zmid(i,j,l)=zint(i,j,l)+(zint(i,j,l+1)-zint(i,j,l))*fact
1013 dummy(i,j)=zmid(i,j,l)
1014 if((alpint(i,j,l+1)-alpint(i,j,l)) < 1.e-6) print*, &
1015 'P(K+1) and P(K) are too close, i,j,L,', &
1016 'ALPINT(I,J,L+1),ALPINT(I,J,L),ZMID = ', &
1017 i,j,l,alpint(i,j,l+1),alpint(i,j,l),zmid(i,j,l)
1020 print*,
'max/min ZMID= ',l,maxval(dummy),minval(dummy)
1026 zint(i,j,l+1) =amin1(zint(i,j,l)-2.,zint(i,j,l+1))
1027 zmid(i,j,l)=(zint(i,j,l+1)+zint(i,j,l))*0.5
1029 dummy(i,j)=zmid(i,j,lm)
1032 print*,
'max/min ZMID= ',lm,maxval(zmid(1:im,js:je,lm)), &
1033 minval(zmid(1:im,js:je,lm))
1039 zmid(i,j,l)=(zint(i,j,l+1)+zint(i,j,l))*0.5
1052 if(imp_physics==28)
then
1053 varname=
'AOD3D_SMOKE'
1054 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1055 im+1,1,jm+1,lm+1,im, js,je,lm)
1057 do j = jsta_2l, jend_2u
1059 taod5503d( i, j, l ) = dum3d( i, j, l )
1060 dz = zint( i, j, l ) - zint( i, j, l+1 )
1061 aextc55( i, j, l ) = taod5503d( i, j, l ) / dz
1062 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample TAOD5503D= ', &
1063 i,j,l,taod5503d( i, j, l )
1064 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample dz= ', &
1066 if(i==im/2.and.j==(jsta+jend)/2)print*,
'sample AEXTC55= ', &
1067 i,j,l,aextc55( i, j, l )
1075 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1076 im+1,1,jm+1,lm+1,im,js,je,nsoil)
1078 do j = jsta_2l, jend_2u
1084 smc( i, j, l ) = dum3d( i, j, nsoil-l+1)
1090 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1091 im+1,1,jm+1,lm+1,im,js,je,nsoil)
1093 do j = jsta_2l, jend_2u
1095 sh2o( i, j, l ) = dum3d( i, j, nsoil-l+1)
1101 call getvariable(filename,datestr,datahandle,varname,dummy, &
1102 im,1,jm,1,im,js,je,1)
1104 do j = jsta_2l, jend_2u
1106 sice( i, j ) = dummy( i, j )
1111 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1112 im+1,1,jm+1,lm+1,im,js,je,nsoil)
1114 do j = jsta_2l, jend_2u
1117 stc( i, j, l ) = dum3d( i, j, nsoil-l+1)
1123 do j = jsta_2l, jend_2u
1125 cfrach( i, j ) = spval/100.
1126 cfracl ( i, j ) = spval/100.
1127 cfracm ( i, j ) = spval/100.
1132 do j = jsta_2l, jend_2u
1134 cfr( i, j, l ) = spval
1140 call getvariable(filename,datestr,datahandle,varname,dummy, &
1141 im,1,jm,1,im,js,je,1)
1142 do j = jsta_2l, jend_2u
1144 sr( i, j ) = dummy( i, j )
1149 IF(modelname ==
'RAPR')
THEN
1151 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1152 im+1,1,jm+1,lm+1,im,js,je,lm)
1154 do j = jsta_2l, jend_2u
1156 cfr( i, j, l ) = dum3d( i, j, l )
1162 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1163 im+1,1,jm+1,lm+1,im,js,je,lm)
1165 do j = jsta_2l, jend_2u
1167 cfr( i, j, l ) = dum3d( i, j, l )
1174 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1175 im+1,1,jm+1,lm+1,im,js,je,lm)
1179 do j = jsta_2l, jend_2u
1181 qc_bl( i, j, l ) = dum3d( i, j, l )
1186 call ext_ncd_get_dom_ti_real(datahandle,
'DX',tmp, &
1187 1,ioutcount,istatus)
1189 write(6,*)
'dxval= ', dxval
1191 IF(modelname ==
'NCAR' .OR. modelname ==
'RAPR')
THEN
1192 if(imp_physics/=5 .and. imp_physics/=0)
then
1194 IF(modelname ==
'RAPR')
THEN
1201 do j = jsta_2l, jend_2u
1208 if (pmid(i,j,k) >= ptop_low)
then
1209 cfracl(i,j)=max(cfracl(i,j),cfr(i,j,k))
1210 elseif (pmid(i,j,k) < ptop_low .and. pmid(i,j,k) >= ptop_mid)
then
1211 cfracm(i,j)=max(cfracm(i,j),cfr(i,j,k))
1212 elseif (pmid(i,j,k) < ptop_mid .and. pmid(i,j,k) >= ptop_high)
then
1213 cfrach(i,j)=max(cfrach(i,j),cfr(i,j,k))
1228 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1229 im+1,1,jm+1,lm+1,im,js,je,lm)
1231 do j = jsta_2l, jend_2u
1233 smoke( i, j, l, 1) = dum3d( i, j, l )
1254 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1255 im+1,1,jm+1,lm+1,im,js,je,lm)
1259 do j = jsta_2l, jend_2u
1262 dust( i, j, l, 1) = dum3d( i, j, l )
1268 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1269 im+1,1,jm+1,lm+1,im,js,je,lm)
1273 do j = jsta_2l, jend_2u
1276 dust( i, j, l, 2) = dum3d( i, j, l )
1282 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1283 im+1,1,jm+1,lm+1,im,js,je,lm)
1287 do j = jsta_2l, jend_2u
1290 dust( i, j, l, 3) = dum3d( i, j, l )
1296 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1297 im+1,1,jm+1,lm+1,im,js,je,lm)
1301 do j = jsta_2l, jend_2u
1304 dust( i, j, l, 4) = dum3d( i, j, l )
1310 call getvariable(filename,datestr,datahandle,varname,dum3d, &
1311 im+1,1,jm+1,lm+1,im,js,je,lm)
1315 do j = jsta_2l, jend_2u
1318 dust( i, j, l, 5) = dum3d( i, j, l )
1325 call getvariable(filename,datestr,datahandle,varname,dum3d,&
1326 im+1,1,jm+1,lm+1,im,js,je,lm)
1330 do j = jsta_2l, jend_2u
1332 dust( i, j, l, 6) = dum3d( i, j, l )
1337 call getvariable(filename,datestr,datahandle,varname,dum3d,&
1338 im+1,1,jm+1,lm+1,im,js,je,lm)
1342 do j = jsta_2l, jend_2u
1344 dust( i, j, l, 7) = dum3d( i, j, l )
1350 call getvariable(filename,datestr,datahandle,varname,dum3d,&
1351 im+1,1,jm+1,lm+1,im,js,je,lm)
1355 do j = jsta_2l, jend_2u
1357 dust( i, j, l, 8) = dum3d( i, j, l )
1370 IF(isf_surface_physics==3)
then
1371 call getvariable(filename,datestr,datahandle,
'ZS',sllevel, &
1372 nsoil,1,1,1,nsoil,1,1,1)
1373 print*,
'SLLEVEL= ',(sllevel(n),n=1,nsoil)
1375 call getvariable(filename,datestr,datahandle,
'DZS',sldpth, &
1376 nsoil,1,1,1,nsoil,1,1,1)
1377 print*,
'SLDPTH= ',(sldpth(n),n=1,nsoil)
1384 call getvariable(filename,datestr,datahandle,varname,dummy, &
1385 im,1,jm,1,im,js,je,1)
1386 do j = jsta_2l, jend_2u
1388 wspd10max( i, j ) = dummy( i, j )
1393 varname=
'WSPD10UMAX'
1394 call getvariable(filename,datestr,datahandle,varname,dummy, &
1395 im,1,jm,1,im,js,je,1)
1396 do j = jsta_2l, jend_2u
1398 wspd10umax( i, j ) = dummy( i, j )
1403 varname=
'WSPD10VMAX'
1404 call getvariable(filename,datestr,datahandle,varname,dummy, &
1405 im,1,jm,1,im,js,je,1)
1406 do j = jsta_2l, jend_2u
1408 wspd10vmax( i, j ) = dummy( i, j )
1414 call getvariable(filename,datestr,datahandle,varname,dummy, &
1415 im,1,jm,1,im,js,je,1)
1416 do j = jsta_2l, jend_2u
1418 w_up_max( i, j ) = dummy( i, j )
1425 call getvariable(filename,datestr,datahandle,varname,dummy, &
1426 im,1,jm,1,im,js,je,1)
1427 do j = jsta_2l, jend_2u
1429 w_dn_max( i, j ) = dummy( i, j )
1435 call getvariable(filename,datestr,datahandle,varname,dummy, &
1436 im,1,jm,1,im,js,je,1)
1437 do j = jsta_2l, jend_2u
1439 w_mean( i, j ) = dummy( i, j )
1445 call getvariable(filename,datestr,datahandle,varname,dummy, &
1446 im,1,jm,1,im,js,je,1)
1447 do j = jsta_2l, jend_2u
1449 refd_max( i, j ) = dummy( i, j )
1454 varname=
'REFDM10C_MAX'
1455 call getvariable(filename,datestr,datahandle,varname,dummy, &
1456 im,1,jm,1,im,js,je,1)
1457 do j = jsta_2l, jend_2u
1459 refdm10c_max( i, j ) = dummy( i, j )
1465 varname=
'UP_HELI_MAX'
1466 call getvariable(filename,datestr,datahandle,varname,dummy, &
1467 im,1,jm,1,im,js,je,1)
1468 do j = jsta_2l, jend_2u
1470 up_heli_max( i, j ) = dummy( i, j )
1475 varname=
'UP_HELI_MAX16'
1476 call getvariable(filename,datestr,datahandle,varname,dummy, &
1477 im,1,jm,1,im,js,je,1)
1478 do j = jsta_2l, jend_2u
1480 up_heli_max16( i, j ) = dummy( i, j )
1485 varname=
'UP_HELI_MIN'
1486 call getvariable(filename,datestr,datahandle,varname,dummy, &
1487 im,1,jm,1,im,js,je,1)
1488 do j = jsta_2l, jend_2u
1490 up_heli_min( i, j ) = dummy( i, j )
1495 varname=
'UP_HELI_MIN16'
1496 call getvariable(filename,datestr,datahandle,varname,dummy, &
1497 im,1,jm,1,im,js,je,1)
1498 do j = jsta_2l, jend_2u
1500 up_heli_min16( i, j ) = dummy( i, j )
1505 varname=
'UP_HELI_MAX02'
1506 call getvariable(filename,datestr,datahandle,varname,dummy, &
1507 im,1,jm,1,im,js,je,1)
1508 do j = jsta_2l, jend_2u
1510 up_heli_max02( i, j ) = dummy( i, j )
1515 varname=
'UP_HELI_MIN02'
1516 call getvariable(filename,datestr,datahandle,varname,dummy, &
1517 im,1,jm,1,im,js,je,1)
1518 do j = jsta_2l, jend_2u
1520 up_heli_min02( i, j ) = dummy( i, j )
1525 varname=
'UP_HELI_MAX03'
1526 call getvariable(filename,datestr,datahandle,varname,dummy, &
1527 im,1,jm,1,im,js,je,1)
1528 do j = jsta_2l, jend_2u
1530 up_heli_max03( i, j ) = dummy( i, j )
1535 varname=
'UP_HELI_MIN03'
1536 call getvariable(filename,datestr,datahandle,varname,dummy, &
1537 im,1,jm,1,im,js,je,1)
1538 do j = jsta_2l, jend_2u
1540 up_heli_min03( i, j ) = dummy( i, j )
1545 varname=
'REL_VORT_MAX'
1546 call getvariable(filename,datestr,datahandle,varname,dummy, &
1547 im,1,jm,1,im,js,je,1)
1548 do j = jsta_2l, jend_2u
1550 rel_vort_max( i, j ) = dummy( i, j )
1555 varname=
'REL_VORT_MAX01'
1556 call getvariable(filename,datestr,datahandle,varname,dummy, &
1557 im,1,jm,1,im,js,je,1)
1558 do j = jsta_2l, jend_2u
1560 rel_vort_max01( i, j ) = dummy( i, j )
1566 call getvariable(filename,datestr,datahandle,varname,dummy, &
1567 im,1,jm,1,im,js,je,1)
1568 do j = jsta_2l, jend_2u
1570 grpl_max( i, j ) = dummy( i, j )
1576 varname=
'HAIL_MAXK1'
1577 call getvariable(filename,datestr,datahandle,varname,dummy, &
1578 im,1,jm,1,im,js,je,1)
1579 do j = jsta_2l, jend_2u
1581 hail_maxk1( i, j ) = dummy( i, j )
1586 varname=
'HAIL_MAX2D'
1587 call getvariable(filename,datestr,datahandle,varname,dummy, &
1588 im,1,jm,1,im,js,je,1)
1589 do j = jsta_2l, jend_2u
1591 hail_max2d( i, j ) = dummy( i, j )
1596 varname=
'HAILCAST_DIAM_MAX'
1597 call getvariable(filename,datestr,datahandle,varname,dummy, &
1598 im,1,jm,1,im,js,je,1)
1599 do j = jsta_2l, jend_2u
1601 hail_maxhailcast( i, j ) = dummy( i, j )
1607 call getvariable(filename,datestr,datahandle,varname,dummy, &
1608 im,1,jm,1,im,js,je,1)
1609 do j = jsta_2l, jend_2u
1611 up_heli( i, j ) = dummy( i, j )
1617 call getvariable(filename,datestr,datahandle,varname,dummy, &
1618 im,1,jm,1,im,js,je,1)
1619 do j = jsta_2l, jend_2u
1621 up_heli16( i, j ) = dummy( i, j )
1627 call getvariable(filename,datestr,datahandle,varname,dummy, &
1628 im,1,jm,1,im,js,je,1)
1629 do j = jsta_2l, jend_2u
1631 ltg1_max( i, j ) = dummy( i, j )
1637 call getvariable(filename,datestr,datahandle,varname,dummy, &
1638 im,1,jm,1,im,js,je,1)
1639 do j = jsta_2l, jend_2u
1641 ltg2_max( i, j ) = dummy( i, j )
1647 call getvariable(filename,datestr,datahandle,varname,dummy, &
1648 im,1,jm,1,im,js,je,1)
1649 do j = jsta_2l, jend_2u
1651 ltg3_max( i, j ) = dummy( i, j )
1657 call getvariable(filename,datestr,datahandle,varname,dummy, &
1658 im,1,jm,1,im,js,je,1)
1659 do j = jsta_2l, jend_2u
1661 nci_ltg( i, j ) = dummy( i, j )
1667 call getvariable(filename,datestr,datahandle,varname,dummy, &
1668 im,1,jm,1,im,js,je,1)
1669 do j = jsta_2l, jend_2u
1671 nca_ltg( i, j ) = dummy( i, j )
1677 call getvariable(filename,datestr,datahandle,varname,dummy, &
1678 im,1,jm,1,im,js,je,1)
1679 do j = jsta_2l, jend_2u
1681 nci_wq( i, j ) = dummy( i, j )
1687 call getvariable(filename,datestr,datahandle,varname,dummy, &
1688 im,1,jm,1,im,js,je,1)
1689 do j = jsta_2l, jend_2u
1691 nca_wq( i, j ) = dummy( i, j )
1697 call getvariable(filename,datestr,datahandle,varname,dummy, &
1698 im,1,jm,1,im,js,je,1)
1699 do j = jsta_2l, jend_2u
1701 nci_refd( i, j ) = dummy( i, j )
1707 call getvariable(filename,datestr,datahandle,varname,dummy, &
1708 im,1,jm,1,im,js,je,1)
1709 do j = jsta_2l, jend_2u
1711 nca_refd( i, j ) = dummy( i, j )
1720 call getvariable(filename,datestr,datahandle,varname,dum3d,&
1721 im+1,1,jm+1,lm+1,im,js,je,lm)
1723 do j = jsta_2l, jend_2u
1725 ref_10cm( i, j, l) = dum3d( i, j, l )
1731 varname=
'COMPOSITE_REFL_10CM'
1732 call getvariable(filename,datestr,datahandle,varname,dummy, &
1733 im,1,jm,1,im,js,je,1)
1734 do j = jsta_2l, jend_2u
1736 refc_10cm( i, j ) = dummy( i, j )
1740 varname=
'REFL_10CM_1KM'
1741 call getvariable(filename,datestr,datahandle,varname,dummy, &
1742 im,1,jm,1,im,js,je,1)
1743 do j = jsta_2l, jend_2u
1745 ref1km_10cm( i, j ) = dummy( i, j )
1749 varname=
'REFL_10CM_4KM'
1750 call getvariable(filename,datestr,datahandle,varname,dummy, &
1751 im,1,jm,1,im,js,je,1)
1752 do j = jsta_2l, jend_2u
1754 ref4km_10cm( i, j ) = dummy( i, j )
1761 call getvariable(filename,datestr,datahandle,varname,dummy, &
1762 im,1,jm,1,im,js,je,1)
1763 do j = jsta_2l, jend_2u
1765 IF(submodelname ==
'RTMA' .and. modelname ==
'RAPR')
THEN
1766 u10( i, j ) = uh( i, j, lm )
1768 u10( i, j ) = dummy( i, j )
1773 call getvariable(filename,datestr,datahandle,varname,dummy, &
1774 im,1,jm,1,im,js,je,1)
1775 do j = jsta_2l, jend_2u
1777 IF( submodelname ==
'RTMA' .and. modelname ==
'RAPR')then
1778 v10( i, j ) = vh( i, j, lm )
1780 v10( i, j ) = dummy( i, j )
1788 call getvariable(filename,datestr,datahandle,varname,dummy, &
1789 im,1,jm,1,im,js,je,1)
1790 do j = jsta_2l, jend_2u
1792 u10mean( i, j ) = dummy( i, j )
1798 call getvariable(filename,datestr,datahandle,varname,dummy, &
1799 im,1,jm,1,im,js,je,1)
1800 do j = jsta_2l, jend_2u
1802 v10mean( i, j ) = dummy( i, j )
1807 varname=
'SPDUV10MEAN'
1808 call getvariable(filename,datestr,datahandle,varname,dummy, &
1809 im,1,jm,1,im,js,je,1)
1810 do j = jsta_2l, jend_2u
1812 spduv10mean( i, j ) = dummy( i, j )
1818 do j = jsta_2l, jend_2u
1820 th10( i, j ) = spval
1821 q10 ( i, j ) = spval
1827 call getvariable(filename,datestr,datahandle,varname,dummy, &
1828 im,1,jm,1,im,js,je,1)
1829 do j = jsta_2l, jend_2u
1831 tshltr( i, j ) = dummy( i, j )
1837 call getvariable(filename,datestr,datahandle,varname,dummy, &
1838 im,1,jm,1,im,js,je,1)
1839 do j = jsta_2l, jend_2u
1841 mrshltr( i, j ) = dummy(i, j )
1842 IF(modelname ==
'RAPR')
THEN
1847 qv2m( i, j ) = dummy( i, j )
1848 qshltr( i, j ) = dummy( i, j )/(1.0+dummy( i, j ))
1849 qvl1( i, j ) = q( i, j, lm )
1853 qv2m( i, j ) = dummy( i, j )
1854 qshltr( i, j ) = dummy( i, j )/(1.0+dummy( i, j ))
1860 IF(modelname ==
'RAPR')
THEN
1866 call getvariable(filename,datestr,datahandle,varname,dummy, &
1867 im,1,jm,1,im,js,je,1)
1868 do j = jsta_2l, jend_2u
1870 smstav( i, j ) = dummy( i, j )
1885 call getvariable(filename,datestr,datahandle,varname,dummy, &
1886 im,1,jm,1,im,js,je,1)
1887 do j = jsta_2l, jend_2u
1889 ssroff( i, j ) = dummy( i, j )
1893 call getvariable(filename,datestr,datahandle,varname,dummy, &
1894 im,1,jm,1,im,js,je,1)
1895 do j = jsta_2l, jend_2u
1897 bgroff( i, j ) = dummy( i, j )
1921 call getvariable(filename,datestr,datahandle,varname,dummy, &
1922 im,1,jm,1,im,js,je,1)
1923 do j = jsta_2l, jend_2u
1925 vegfrc( i, j ) = dummy( i, j )/100.
1928 print*,
'VEGFRC at ',ii,jj,
' = ',vegfrc(ii,jj)
1931 call getvariable(filename,datestr,datahandle,varname,dummy, &
1932 im,1,jm,1,im,js,je,1)
1933 do j = jsta_2l, jend_2u
1935 shdmin( i, j ) = dummy( i, j )/100.
1938 print*,
'SHDMIN at ',ii,jj,
' = ',shdmin(ii,jj)
1941 call getvariable(filename,datestr,datahandle,varname,dummy, &
1942 im,1,jm,1,im,js,je,1)
1943 do j = jsta_2l, jend_2u
1945 shdmax( i, j ) = dummy( i, j )/100.
1948 print*,
'SHDMAX at ',ii,jj,
' = ',shdmax(ii,jj)
1951 call getvariable(filename,datestr,datahandle,varname,dummy, &
1952 im,1,jm,1,im,js,je,1)
1953 do j = jsta_2l, jend_2u
1955 lai( i, j ) = dummy( i, j )
1958 print*,
'LAI at ',ii,jj,
' = ',lai(ii,jj)
1961 call getvariable(filename,datestr,datahandle,varname,dummy, &
1962 im,1,jm,1,im,js,je,1)
1963 do j = jsta_2l, jend_2u
1965 acsnow( i, j ) = dummy( i, j )
1968 print*,
'maxval ACSNOW: ', maxval(acsnow)
1970 call getvariable(filename,datestr,datahandle,varname,dummy, &
1971 im,1,jm,1,im,js,je,1)
1972 do j = jsta_2l, jend_2u
1974 acsnom( i, j ) = dummy( i, j )
1978 call getvariable(filename,datestr,datahandle,varname,dummy, &
1979 im,1,jm,1,im,js,je,1)
1980 do j = jsta_2l, jend_2u
1982 cmc( i, j ) = dummy( i, j )
1986 call getvariable(filename,datestr,datahandle,varname,dummy, &
1987 im,1,jm,1,im,js,je,1)
1988 do j = jsta_2l, jend_2u
1990 sst( i, j ) = dummy( i, j )
1995 call getvariable(filename,datestr,datahandle,varname,dummy, &
1996 im,1,jm,1,im,js,je,1)
1997 do j = jsta_2l, jend_2u
1999 thz0( i, j ) = dummy( i, j )
2041 IF(modelname ==
'RAPR')
THEN
2043 call getvariable(filename,datestr,datahandle,varname,dummy, &
2044 im,1,jm,1,im,js,je,1)
2045 do j = jsta_2l, jend_2u
2047 z0( i, j ) = dummy( i, j )
2052 call getvariable(filename,datestr,datahandle,varname,dummy, &
2053 im,1,jm,1,im,js,je,1)
2054 do j = jsta_2l, jend_2u
2056 z0( i, j ) = dummy( i, j )
2063 call getvariable(filename,datestr,datahandle,varname,dummy, &
2064 im,1,jm,1,im,js,je,1)
2065 do j = jsta_2l, jend_2u
2067 ustar( i, j ) = dummy( i, j )
2098 call getvariable(filename,datestr,datahandle,varname,dummy, &
2099 im,1,jm,1,im,js,je,1)
2100 do j = jsta_2l, jend_2u
2105 radot( i, j ) = dummy(i,j)**4.0/stbol
2106 ths( i, j ) = dummy( i, j ) &
2107 *(p1000/pint(i,j,nint(lmh(i,j))+1))**capa
2113 IF(modelname ==
'RAPR')
THEN
2115 call getvariable(filename,datestr,datahandle,varname,dummy, &
2116 im,1,jm,1,im,js,je,1)
2117 do j = jsta_2l, jend_2u
2119 radot( i, j ) = radot(i, j) * dummy( i, j )
2130 write(6,*)
'getting RAINC'
2132 call getvariable(filename,datestr,datahandle,varname,dummy, &
2133 im,1,jm,1,im,js,je,1)
2134 do j = jsta_2l, jend_2u
2136 cuprec( i, j ) = dummy( i, j ) * 0.001
2140 write(6,*)
'getting RAINNC'
2142 call getvariable(filename,datestr,datahandle,varname,dummy, &
2143 im,1,jm,1,im,js,je,1)
2144 do j = jsta_2l, jend_2u
2146 ancprc( i, j ) = dummy( i, j )* 0.001
2150 write(6,*)
'past getting RAINNC'
2152 do j = jsta_2l, jend_2u
2154 acprec(i,j)=ancprc(i,j)+cuprec(i,j)
2160 write(6,*)
'getting PREC_ACC_C, [mm] '
2162 varname=
'PREC_ACC_C'
2163 call getvariable(filename,datestr,datahandle,varname,dummy, &
2164 im,1,jm,1,im,js,je,1)
2165 do j = jsta_2l, jend_2u
2167 rainc_bucket( i, j ) = dummy( i, j )
2173 write(6,*)
'getting PREC_ACC_C1, [mm] '
2174 varname=
'PREC_ACC_C1'
2175 call getvariable(filename,datestr,datahandle,varname,dummy, &
2176 im,1,jm,1,im,js,je,1)
2177 do j = jsta_2l, jend_2u
2179 rainc_bucket1( i, j ) = dummy( i, j )
2185 write(6,*)
'getting PREC_ACC_NC, [mm]'
2187 varname=
'PREC_ACC_NC'
2188 call getvariable(filename,datestr,datahandle,varname,dummy, &
2189 im,1,jm,1,im,js,je,1)
2190 do j = jsta_2l, jend_2u
2192 rainnc_bucket( i, j ) = dummy( i, j )
2198 write(6,*)
'getting PREC_ACC_NC1, [mm]'
2199 varname=
'PREC_ACC_NC1'
2200 call getvariable(filename,datestr,datahandle,varname,dummy, &
2201 im,1,jm,1,im,js,je,1)
2202 do j = jsta_2l, jend_2u
2204 rainnc_bucket1( i, j ) = dummy( i, j )
2208 do j = jsta_2l, jend_2u
2210 pcp_bucket(i,j)=rainc_bucket(i,j)+rainnc_bucket(i,j)
2211 pcp_bucket1(i,j)=rainc_bucket1(i,j)+rainnc_bucket1(i,j)
2217 call getvariable(filename,datestr,datahandle,varname,dummy, &
2218 im,1,jm,1,im,js,je,1)
2219 do j = jsta_2l, jend_2u
2222 cprate( i, j ) = dummy( i, j )* 0.001
2229 call getvariable(filename,datestr,datahandle,varname,dummy2, &
2230 im,1,jm,1,im,js,je,1)
2231 do j = jsta_2l, jend_2u
2234 prec( i, j ) = (dummy( i, j )+dummy2(i,j))* 0.001
2239 call getvariable(filename,datestr,datahandle,varname,dummy, &
2240 im,1,jm,1,im,js,je,1)
2241 do j = jsta_2l, jend_2u
2244 snownc( i, j ) = dummy( i, j ) * 0.001
2250 write(6,*)
'getting SNOW_ACC_NC, [mm] '
2252 varname=
'SNOW_ACC_NC'
2253 call getvariable(filename,datestr,datahandle,varname,dummy, &
2254 im,1,jm,1,im,js,je,1)
2255 do j = jsta_2l, jend_2u
2257 snow_bucket( i, j ) = dummy( i, j )
2263 write(6,*)
'getting SNOW_ACC_NC1, [mm] '
2264 varname=
'SNOW_ACC_NC1'
2265 call getvariable(filename,datestr,datahandle,varname,dummy, &
2266 im,1,jm,1,im,js,je,1)
2267 do j = jsta_2l, jend_2u
2269 snow_bucket1( i, j ) = dummy( i, j )
2275 write(6,*)
'getting GRAUP_ACC_NC, [mm] '
2276 varname=
'GRAUP_ACC_NC'
2277 call getvariable(filename,datestr,datahandle,varname,dummy, &
2278 im,1,jm,1,im,js,je,1)
2279 do j = jsta_2l, jend_2u
2281 graup_bucket( i, j ) = dummy( i, j )
2287 write(6,*)
'getting GRAUP_ACC_NC1, [mm] '
2288 varname=
'GRAUP_ACC_NC1'
2289 call getvariable(filename,datestr,datahandle,varname,dummy, &
2290 im,1,jm,1,im,js,je,1)
2291 do j = jsta_2l, jend_2u
2293 graup_bucket1( i, j ) = dummy( i, j )
2298 call getvariable(filename,datestr,datahandle,varname,dummy, &
2299 im,1,jm,1,im,js,je,1)
2300 do j = jsta_2l, jend_2u
2302 acgraup( i, j ) = dummy( i, j )
2307 call getvariable(filename,datestr,datahandle,varname,dummy, &
2308 im,1,jm,1,im,js,je,1)
2309 do j = jsta_2l, jend_2u
2311 acfrain( i, j ) = dummy( i, j )
2315 varname=
'GRAUPELNCV'
2316 call getvariable(filename,datestr,datahandle,varname,dummy, &
2317 im,1,jm,1,im,js,je,1)
2318 do j = jsta_2l, jend_2u
2321 graupelnc( i, j ) = dummy( i, j ) * 0.001
2327 call getvariable(filename,datestr,datahandle,varname,dummy, &
2328 im,1,jm,1,im,js,je,1)
2329 do j = jsta_2l, jend_2u
2331 albedo( i, j ) = dummy( i, j )
2349 call getvariable(filename,datestr,datahandle,varname,dummy, &
2350 im,1,jm,1,im,js,je,1)
2351 do j = jsta_2l, jend_2u
2354 rswin( i, j ) = dummy( i, j )
2355 rswout( i, j ) = rswin( i, j ) * albedo( i, j )
2361 call getvariable(filename,datestr,datahandle,varname,dummy, &
2362 im,1,jm,1,im,js,je,1)
2363 do j = jsta_2l, jend_2u
2365 swddni( i, j ) = dummy( i, j )
2371 call getvariable(filename,datestr,datahandle,varname,dummy, &
2372 im,1,jm,1,im,js,je,1)
2373 do j = jsta_2l, jend_2u
2375 swddif( i, j ) = dummy( i, j )
2381 call getvariable(filename,datestr,datahandle,varname,dummy, &
2382 im,1,jm,1,im,js,je,1)
2383 do j = jsta_2l, jend_2u
2385 swdnbc( i, j ) = dummy( i, j )
2391 call getvariable(filename,datestr,datahandle,varname,dummy, &
2392 im,1,jm,1,im,js,je,1)
2393 do j = jsta_2l, jend_2u
2395 swddnic( i, j ) = dummy( i, j )
2401 call getvariable(filename,datestr,datahandle,varname,dummy, &
2402 im,1,jm,1,im,js,je,1)
2403 do j = jsta_2l, jend_2u
2405 swddifc( i, j ) = dummy( i, j )
2411 call getvariable(filename,datestr,datahandle,varname,dummy, &
2412 im,1,jm,1,im,js,je,1)
2413 do j = jsta_2l, jend_2u
2415 swupbc( i, j ) = dummy( i, j )
2421 call getvariable(filename,datestr,datahandle,varname,dummy, &
2422 im,1,jm,1,im,js,je,1)
2423 do j = jsta_2l, jend_2u
2425 swupt( i, j ) = dummy( i, j )
2434 call getvariable(filename,datestr,datahandle,varname,dummy, &
2435 im,1,jm,1,im,js,je,1)
2436 do j = jsta_2l, jend_2u
2438 mean_frp( i, j ) = dummy( i, j )
2444 call getvariable(filename,datestr,datahandle,varname,dummy, &
2445 im,1,jm,1,im,js,je,1)
2446 do j = jsta_2l, jend_2u
2448 taod5502d( i, j ) = dummy( i, j )
2454 call getvariable(filename,datestr,datahandle,varname,dummy, &
2455 im,1,jm,1,im,js,je,1)
2456 do j = jsta_2l, jend_2u
2458 aerasy2d( i, j ) = dummy( i, j )
2464 call getvariable(filename,datestr,datahandle,varname,dummy, &
2465 im,1,jm,1,im,js,je,1)
2466 do j = jsta_2l, jend_2u
2468 aerssa2d( i, j ) = dummy( i, j )
2474 call getvariable(filename,datestr,datahandle,varname,dummy, &
2475 im,1,jm,1,im,js,je,1)
2476 do j = jsta_2l, jend_2u
2478 lwp( i, j ) = dummy( i, j )
2484 call getvariable(filename,datestr,datahandle,varname,dummy, &
2485 im,1,jm,1,im,js,je,1)
2486 do j = jsta_2l, jend_2u
2488 iwp( i, j ) = dummy( i, j )
2494 call getvariable(filename,datestr,datahandle,varname,dummy, &
2495 im,1,jm,1,im,js,je,1)
2496 do j = jsta_2l, jend_2u
2499 swradmean( i, j ) = dummy( i, j )
2502 print*,
'SWRADmean at ',ii,jj,
' = ',swradmean(ii,jj)
2505 varname=
'SWNORMMEAN'
2506 call getvariable(filename,datestr,datahandle,varname,dummy, &
2507 im,1,jm,1,im,js,je,1)
2508 do j = jsta_2l, jend_2u
2511 swnormmean( i, j ) = dummy( i, j )
2514 print*,
'SWNORMmean at ',ii,jj,
' = ',swnormmean(ii,jj)
2518 call getvariable(filename,datestr,datahandle,varname,dummy, &
2519 im,1,jm,1,im,js,je,1)
2520 do j = jsta_2l, jend_2u
2522 rlwin( i, j ) = dummy( i, j )
2526 do j = jsta_2l, jend_2u
2528 tlmh=t(i,j,nint(lmh(i,j)))
2529 sigt4( i, j ) = 5.67e-8*tlmh*tlmh*tlmh*tlmh
2535 call getvariable(filename,datestr,datahandle,varname,dummy, &
2536 im,1,jm,1,im,js,je,1)
2537 do j = jsta_2l, jend_2u
2539 lwdnbc( i, j ) = dummy( i, j )
2545 call getvariable(filename,datestr,datahandle,varname,dummy, &
2546 im,1,jm,1,im,js,je,1)
2547 do j = jsta_2l, jend_2u
2549 lwupbc( i, j ) = dummy( i, j )
2555 call getvariable(filename,datestr,datahandle,varname,dummy, &
2556 im,1,jm,1,im,js,je,1)
2557 do j = jsta_2l, jend_2u
2559 rlwtoa( i, j ) = dummy( i, j )
2565 do j = jsta_2l, jend_2u
2583 call getvariable(filename,datestr,datahandle,varname,dummy, &
2584 im,1,jm,1,im,js,je,1)
2585 do j = jsta_2l, jend_2u
2587 tg( i, j ) = dummy( i, j )
2588 soiltb( i, j ) = dummy( i, j )
2593 call getvariable(filename,datestr,datahandle,varname,dummy, &
2594 im,1,jm,1,im,js,je,1)
2595 do j = jsta_2l, jend_2u
2597 twbs(i,j)= dummy( i, j )
2604 IF(isf_surface_physics/=3)
then
2606 call getvariable(filename,datestr,datahandle,varname,dummy, &
2607 im,1,jm,1,im,js,je,1)
2608 do j = jsta_2l, jend_2u
2610 qwbs(i,j) = dummy( i, j )
2616 call getvariable(filename,datestr,datahandle,varname,dummy, &
2617 im,1,jm,1,im,js,je,1)
2618 do j = jsta_2l, jend_2u
2620 qwbs(i,j) = dummy( i, j ) * lheat
2627 call getvariable(filename,datestr,datahandle,varname,dummy, &
2628 im,1,jm,1,im,js,je,1)
2629 do j = jsta_2l, jend_2u
2631 grnflx(i,j) = dummy( i, j )
2636 do j = jsta_2l, jend_2u
2654 call getvariable(filename,datestr,datahandle,varname,dummy, &
2655 im,1,jm,1,im,js,je,1)
2656 do j = jsta_2l, jend_2u
2658 if( dummy( i, j ) <= 5000.0 .and. dummy( i, j ) >=0.0)
then
2659 sno( i, j ) = dummy( i, j )
2660 elseif( dummy( i, j ) > 5000.0)
then
2661 sno( i, j ) = 5000.0
2662 write(*,*)
'too large SNOW=',i,j,dummy( i, j )
2663 elseif( dummy( i, j ) < 0.0 )
then
2665 write(*,*)
'negative SNOW=',i,j,dummy( i, j )
2668 write(*,*)
'strange SNOW=',i,j,dummy( i, j )
2674 call getvariable(filename,datestr,datahandle,varname,dummy, &
2675 im,1,jm,1,im,js,je,1)
2676 do j = jsta_2l, jend_2u
2678 if( dummy( i, j ) <= 50.0 .and. dummy( i, j ) >=0.0)
then
2679 si( i, j ) = dummy( i, j ) * 1000.
2680 elseif( dummy( i, j ) > 50.0)
then
2681 si( i, j ) = 50.0 * 1000.
2682 write(*,*)
'too large SNOWH=',i,j,dummy( i, j )
2683 elseif( dummy( i, j ) < 0.0 )
then
2685 write(*,*)
'negative SNOWH=',i,j,dummy( i, j )
2688 write(*,*)
'strange SNOWH=',i,j,dummy( i, j )
2695 call getvariable(filename,datestr,datahandle,varname,dummy, &
2696 im,1,jm,1,im,js,je,1)
2697 do j = jsta_2l, jend_2u
2699 pctsno( i, j ) = dummy( i, j )
2705 call getvariable(filename,datestr,datahandle,varname,dummy, &
2706 im,1,jm,1,im,js,je,1)
2707 do j = jsta_2l, jend_2u
2709 snonc( i, j ) = dummy( i, j )
2715 call getvariable(filename,datestr,datahandle,varname,dummy, &
2716 im,1,jm,1,im,js,je,1)
2717 do j = jsta_2l, jend_2u
2719 snfden( i, j ) = max(0.,dummy( i, j ))
2722 print *,
' MIN/MAX SNFDEN ',minval(snfden),maxval(snfden)
2725 varname=
'SNOWFALLAC'
2726 call getvariable(filename,datestr,datahandle,varname,dummy, &
2727 im,1,jm,1,im,js,je,1)
2728 do j = jsta_2l, jend_2u
2730 sndepac( i, j ) = dummy( i, j )
2733 print *,
' MIN/MAX SNDEPAC ',minval(sndepac),maxval(sndepac)
2737 call getvariable(filename,datestr,datahandle,varname,dummy, &
2738 im,1,jm,1,im,js,je,1)
2739 do j = jsta_2l, jend_2u
2741 tsnow( i, j ) = dummy( i, j )
2747 call getivariablen(filename,datestr,datahandle,
'IVGTYP',idummy, &
2748 im,1,jm,1,im,js,je,1)
2750 do j = jsta_2l, jend_2u
2752 ivgtyp( i, j ) = idummy( i, j )
2757 call getivariablen(filename,datestr,datahandle,varname,idummy, &
2758 im,1,jm,1,im,js,je,1)
2759 do j = jsta_2l, jend_2u
2761 isltyp( i, j ) = idummy( i, j )
2764 print*,
'MAX ISLTYP=', maxval(idummy)
2778 call getvariable(filename,datestr,datahandle,varname,dummy, &
2779 im,1,jm,1,im,js,je,1)
2780 do j = jsta_2l, jend_2u
2782 sm( i, j ) = dummy( i, j ) - 1.0
2788 call getvariable(filename,datestr,datahandle,varname,dummy, &
2789 im,1,jm,1,im,js,je,1)
2790 do j = jsta_2l, jend_2u
2792 pblh( i, j ) = dummy( i, j )
2795 IF(modelname ==
'RAPR')
THEN
2797 delta_theta4gust=0.5
2798 do j = jsta_2l, jend_2u
2801 if (thv(i,j,lm-1) < (thv(i,j,lm) + delta_theta4gust))
then
2802 zsf=zint(i,j,nint(lmh(i,j))+1)
2808 if (thv(i,j,lm-k+1)>(thv(i,j,lm) + delta_theta4gust)) &
2814 zpbltop = zmid(i,j,lm-k1+1) + &
2815 ((thv(i,j,lm)+delta_theta4gust)-thv(i,j,lm-k1+1)) &
2816 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
2817 / (thv(i,j,lm-k1+2) - thv(i,j,lm-k1+1))
2818 pblhgust( i, j ) = zpbltop - zsf
2820 pblhgust( i, j ) = 0.
2827 call getvariable(filename,datestr,datahandle,varname,dummy, &
2828 im,1,jm,1,im,js,je,1)
2829 do j = jsta_2l, jend_2u
2831 gdlat( i, j ) = dummy( i, j )
2833 f(i,j) = 1.454441e-4*sin(gdlat(i,j)*dtr)
2838 print*,
'read past GDLAT'
2840 call getvariable(filename,datestr,datahandle,varname,dummy, &
2841 im,1,jm,1,im,js,je,1)
2842 do j = jsta_2l, jend_2u
2844 gdlon( i, j ) = dummy( i, j )
2852 print*,
'read past GDLON'
2856 latstart=nint(dummy(1,1)*gdsdegr)
2857 latlast=nint(dummy(im,jm)*gdsdegr)
2863 write(6,*)
'laststart,latlast B calling bcast= ',latstart,latlast
2864 call mpi_bcast(latstart,1,mpi_integer,0,mpi_comm_comp,irtn)
2865 call mpi_bcast(latlast,1,mpi_integer,0,mpi_comm_comp,irtn)
2866 write(6,*)
'laststart,latlast A calling bcast= ',latstart,latlast
2869 if(dummy(1,1)<0.0) dummy(1,1)=360.0+dummy(1,1)
2870 if(dummy(im,jm)<0.0) dummy(im,jm)=360.0+dummy(im,jm)
2871 lonstart=nint(dummy(1,1)*gdsdegr)
2872 lonlast=nint(dummy(im,jm)*gdsdegr)
2878 write(6,*)
'lonstart,lonlast B calling bcast=',lonstart,lonlast
2879 call mpi_bcast(lonstart,1,mpi_integer,0,mpi_comm_comp,irtn)
2880 call mpi_bcast(lonlast,1,mpi_integer,0,mpi_comm_comp,irtn)
2881 write(6,*)
'lonstart,lonlast A calling bcast= ',lonstart,lonlast
2887 allocate(msft(im,jsta_2l:jend_2u))
2889 call getvariable(filename,datestr,datahandle,varname,dummy, &
2890 im,1,jm,1,im,js,je,1)
2891 do j = jsta_2l, jend_2u
2893 msft( i, j ) = dummy( i, j )
2899 call getivariablen(filename,datestr,datahandle,varname,nphs, &
2907 IF(modelname /=
'RAPR')
THEN
2908 do j = jsta_2l, jend_2u
2911 czmean( i, j ) = czen( i, j )
2916 jdn=iw3jdn(idat(3),idat(1),idat(2))
2919 call zensun(jdn,float(idat(4)),gdlat(i,j),gdlon(i,j) &
2920 ,pi,sun_zenith,sun_azimuth)
2923 czmean( i, j ) = czen( i, j )
2926 print*,
'sample RAPR zenith angle=',acos(czen(ii,jj))*rtd
2933 write(6,*)
'filename in INITPOST=', filename,
' is'
2968 call ext_ncd_get_dom_ti_real(datahandle,
'DY',tmp, &
2969 1,ioutcount,istatus)
2971 write(6,*)
'dyval= ', dyval
2972 call ext_ncd_get_dom_ti_real(datahandle,
'CEN_LAT',tmp, &
2973 1,ioutcount,istatus)
2974 cenlat=nint(gdsdegr*tmp)
2975 write(6,*)
'cenlat= ', cenlat
2976 call ext_ncd_get_dom_ti_real(datahandle,
'CEN_LON',tmp, &
2977 1,ioutcount,istatus)
2978 if(tmp < 0) tmp=360.0 + tmp
2979 cenlon=nint(gdsdegr*tmp)
2980 write(6,*)
'cenlon= ', cenlon
2981 call ext_ncd_get_dom_ti_integer(datahandle,
'MAP_PROJ',itmp, &
2982 1,ioutcount,istatus)
2984 write(6,*)
'maptype is ', maptype
2986 call ext_ncd_get_dom_ti_real(datahandle,
'TRUELAT1',tmp, &
2987 1,ioutcount,istatus)
2988 truelat1=nint(gdsdegr*tmp)
2989 write(6,*)
'truelat1= ', truelat1
2991 call ext_ncd_get_dom_ti_real(datahandle,
'TRUELAT2',tmp, &
2992 1,ioutcount,istatus)
2993 truelat2=nint(gdsdegr*tmp)
2994 write(6,*)
'truelat2= ', truelat2
2997 call ext_ncd_get_dom_ti_real(datahandle,
'STAND_LON',tmp, &
2998 1,ioutcount,istatus)
2999 if(tmp < 0) tmp=360.0 + tmp
3000 standlon=nint(gdsdegr*tmp)
3001 write(6,*)
'STANDLON= ', standlon
3004 do j = jsta_2l, jend_2u
3006 dx( i, j ) = dxval/msft(i,j)
3007 dy( i, j ) = dyval/msft(i,j)
3012 print*,
'sample dx,dy,msft=',ii,jj,dx(ii,jj),dy(ii,jj) &
3018 dxval=(dxval * 360.)/(erad*2.*pi)*gdsdegr
3019 dyval=(dyval * 360.)/(erad*2.*pi)*gdsdegr
3021 print*,
'dx and dy for arw rotated latlon= ', &
3026 IF(modelname ==
'RAPR')
THEN
3037 CALL table(ptbl,ttbl,pt, &
3038 rdq,rdth,rdp,rdthe,pl,thl,qs0,sqs,sthe,the0)
3040 CALL tableq(ttblq,rdpq,rdtheq,plq,thl,stheq,the0q)
3045 WRITE(6,*)
' SPL (POSTED PRESSURE LEVELS) BELOW: '
3046 WRITE(6,51) (spl(l),l=1,lsm)
3047 50
FORMAT(14(f4.1,1x))
3048 51
FORMAT(8(f8.1,1x))
3054 call ext_ncd_get_dom_ti_real(datahandle,
'DT',tmp,1,ioutcount,istatus)
3059 call ext_ncd_get_dom_ti_real(datahandle,
'PREC_ACC_DT',tmp,1,ioutcount,istatus)
3060 prec_acc_dt=abs(tmp)
3061 print*,
'PREC_ACC_DT= ',prec_acc_dt
3066 print*,
'PREC_ACC_DT1= ',prec_acc_dt1
3082 tprec=float(nprec)/tsph
3083 IF(nprec==0)tprec=float(ifhr)
3084 print*,
'NPREC,TPREC = ',nprec,tprec
3094 print*,
'TSRFC TRDLW TRDSW= ',tsrfc, trdlw, trdsw
3127 alsl(l) = alog(spl(l))
3130 call ext_ncd_ioclose ( datahandle, status )
3134 print*,
'writing out igds'
3138 if(maptype == 1)
THEN
3140 WRITE(6,*)
'igd(1)=',3
3143 WRITE(igdout)latstart
3144 WRITE(igdout)lonstart
3147 WRITE(igdout)standlon
3152 WRITE(igdout)truelat2
3153 WRITE(igdout)truelat1
3155 ELSE IF(maptype == 2)
THEN
3159 WRITE(igdout)latstart
3160 WRITE(igdout)lonstart
3167 WRITE(igdout)truelat2
3168 WRITE(igdout)truelat1
3174 if (truelat1 < 0.)
THEN
3180 CALL msfps (lat,truelat1*0.001,psmapf)
3182 ELSE IF(maptype == 3)
THEN
3186 WRITE(igdout)latstart
3187 WRITE(igdout)lonstart
3189 WRITE(igdout)latlast
3190 WRITE(igdout)lonlast
3191 WRITE(igdout)truelat1
3197 ELSE IF(maptype==6 )
THEN
3201 WRITE(igdout)latstart
3202 WRITE(igdout)lonstart
3209 WRITE(igdout)latlast
3210 WRITE(igdout)lonlast
3217 open(10,file=
'copygb_hwrf.txt',form=
'formatted',status=
'unknown')
3218 idxvald = abs(lonlast-lonstart)/(im-2)
3219 idyvald = abs(latlast-latstart)/(jm-2)
3220 print*,
'dxval,dyval in degree',dxval/107000.,dyval/107000.
3221 print*,
'idxvald,idyvald,LATSTART,LONSTART,LATLAST,LONLAST= ', &
3222 idxvald,idyvald,latstart,lonstart,latlast,lonlast
3223 write(10,1010) im-1,jm-1,latstart,lonstart,latlast,lonlast, &
32261010
format(
'255 0 ',2(i4,x),i8,x,i9,x,
'136 ',i8,x,i9,x, &
3237 if (grib==
"grib2" )
then