29 SUBROUTINE initpost_gfs_nems_mpiio(iostatusAER)
32 use vrbls4d, only: dust, salt, suso, soot, waso, pp25, pp10
33 use vrbls3d, only: t, q, uh, vh,wh,pmid,pint,alpint, dpres,zint,zmid,o3, &
34 qqr, qqs, cwm, qqi, qqw, omga, rhomid, q2, cfr, rlwtt, rswtt, tcucn, &
35 tcucns, train, el_pbl, exch_h, vdifftt, vdiffmois, dconvmois, nradtt, &
36 o3vdiff, o3prod, o3tndy, mwpv, qqg, vdiffzacce, zgdrag,cnvctummixing, &
37 vdiffmacce, mgdrag, cnvctvmmixing, ncnvctcfrac, cnvctumflx, cnvctdmflx, &
38 cnvctzgdrag, sconvmois, cnvctmgdrag, cnvctdetmflx, duwt, duem, dusd, dudp, &
39 dusv,ssem,sssd,ssdp,sswt,sssv,bcem,bcsd,bcdp,bcwt,bcsv,ocem,ocsd,ocdp, &
41 use vrbls2d, only: f, pd, fis, pblh, ustar, z0, ths, qs, twbs, qwbs, avgcprate, &
42 cprate, avgprec, prec, lspa, sno, si, cldefi, th10, q10, tshltr, pshltr, &
43 tshltr, albase, avgalbedo, avgtcdc, czen, czmean, mxsnal, radot, sigt4, &
44 cfrach, cfracl, cfracm, avgcfrach, qshltr, avgcfracl, avgcfracm, cnvcfr, &
45 islope, cmc, grnflx, vegfrc, acfrcv, ncfrcv, acfrst, ncfrst, ssroff, &
46 bgroff, rlwin, rlwtoa, cldwork, alwin, alwout, alwtoa, rswin, rswinc, &
47 rswout, aswin, auvbin, auvbinc, aswout, aswtoa, sfcshx, sfclhx, subshx, &
48 snopcx, sfcux, sfcvx, sfcuvx, gtaux, gtauy, potevp, u10, v10, smstav, &
49 smstot, ivgtyp, isltyp, sfcevp, sfcexc, acsnow, acsnom, sst, thz0, qz0, &
50 uz0, vz0, ptop, htop, pbot, hbot, ptopl, pbotl, ttopl, ptopm, pbotm, ttopm, &
51 ptoph, pboth, pblcfr, ttoph, runoff, maxtshltr, mintshltr, maxrhshltr, &
52 minrhshltr, dzice, smcwlt, suntime, fieldcapa, htopd, hbotd, htops, hbots, &
53 cuppt, dusmass, ducmass, dusmass25, ducmass25, aswintoa, &
54 maxqshltr, minqshltr, acond, sr, u10h, v10h, &
55 avgedir,avgecan,avgetrans,avgesnow,avgprec_cont,avgcprate_cont, &
56 avisbeamswin,avisdiffswin,airbeamswin,airdiffswin, &
57 alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
58 dustcb,bccb,occb,sulfcb,sscb,dustallcb,ssallcb,dustpm,dustpm10,sspm,pp25cb, &
60 use soil, only: sldpth, sh2o, smc, stc
61 use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
64 use physcons_post, only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
65 eps => con_eps, epsm1 => con_epsm1
66 use params_mod, only: erad, dtr, tfrz, h1, d608, rd, p1000, capa
67 use lookup_mod, only: thl, plq, ptbl, ttbl, rdq, rdth, rdp, rdthe, pl, qs0, sqs, sthe, &
68 ttblq, rdpq, rdtheq, stheq, the0q, the0
69 use ctlblk_mod
, only: me, mpi_comm_comp, icnt, idsp, jsta, jend, ihrst, idat, sdat, ifhr, &
70 ifmin, filename, tprec, tclod, trdlw, trdsw, tsrfc, tmaxmin, td3d, restrt, sdat, &
71 jend_m, imin, imp_physics, dt, spval, pdtop, pt, qmin, nbin_du, nphs, dtq2, ardlw,&
72 ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
73 jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
74 nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameflux, filenameaer, &
76 use gridspec_mod
, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
77 dxval, dyval, truelat2, truelat1, psmapf, cenlat
83 type(nemsio_gfile
) :: nfile,ffile,rfile
102 real,
parameter :: gravi = 1.0/grav
103 integer,
intent(in) :: iostatusaer
104 character(len=20) :: varname, vcoordname
105 integer :: status, fldsize, fldst, recn
106 integer :: recn_vvel,recn_delz,recn_dpres
107 character startdate*19,sysdepinfo*80,cgar*1
108 character startdate2(19)*4,lprecip_accu*3
115 LOGICAL runb,singlrst,subpost,nest,hydro,ioomg,ioall
116 logical,
parameter :: debugprint = .false., zerout = .false.
118 logical :: reduce_grid = .true.
120 CHARACTER*40 contrl,filall,filmst,filtmp,filtke,filunv,filcld,filrad,filsfc
122 CHARACTER fname*255,envar*50
123 INTEGER idate(8),jdate(8),jpds(200),jgds(200),kpds(200),kgds(200)
137 real,
allocatable :: fi(:,:,:)
139 integer ii,jj,js,je,iyear,imn,iday,itmp,ioutcount,istatus, &
140 i,j,l,ll,k,kf,irtn,igdout,n,index,nframe, &
141 impf,jmpf,nframed2,iunitd3d,ierr,idum,iret,nrec,idrt
142 real tstart,tlmh,tsph,es,fact,soilayert,soilayerb,zhour,dum, &
143 tvll,pmll,tv, tx1, tx2
145 character*16,
allocatable :: recname(:)
146 character*16,
allocatable :: reclevtyp(:)
147 character*6 :: modelname_nemsio
148 integer,
allocatable :: reclev(:), kmsk(:,:)
149 real,
allocatable :: glat1d(:), glon1d(:), qstl(:)
150 real,
allocatable :: wrk1(:,:), wrk2(:,:)
151 real,
allocatable :: p2d(:,:), t2d(:,:), q2d(:,:), &
152 qs2d(:,:), cw2d(:,:), cfr2d(:,:)
153 real(kind=4),
allocatable :: vcoord4(:,:,:)
154 real,
dimension(lm+1) :: ak5, bk5
155 real*8,
allocatable :: pm2d(:,:), pi2d(:,:)
156 real,
allocatable :: tmp(:)
157 real :: buf(im,jsta_2l:jend_2u)
158 integer :: lonsperlat(jm/2), numi(jm)
164 integer isa, jsa, latghf, jtem, idvc, idsl, nvcoord, ip1, nn, npass
171 integer,
parameter :: npass2=5, npass3=30
172 real,
parameter :: third=1.0/3.0
173 INTEGER,
DIMENSION(2) :: ij4min, ij4max
174 REAL :: omgmin, omgmax
175 real,
allocatable :: d2d(:,:), u2d(:,:), v2d(:,:), omga2d(:,:)
176 REAL,
ALLOCATABLE :: ps2d(:,:),psx2d(:,:),psy2d(:,:)
177 real,
allocatable :: div3d(:,:,:)
178 real(kind=4),
allocatable :: vcrd(:,:)
179 real :: omg1(im), omg2(im+2)
184 WRITE(6,*)
'INITPOST: ENTER INITPOST_GFS_NEMS_MPIIO'
185 WRITE(6,*)
'me=',me,
'LMV=',
size(lmv,1),
size(lmv,2),
'LMH=', &
186 size(lmh,1),
size(lmh,2),
'jsta_2l=',jsta_2l,
'jend_2u=', &
190 jsa = (jsta+jend) / 2
193 do j = jsta_2l, jend_2u
201 call nemsio_open(nfile,trim(filename),
'read',mpi_comm_comp,iret=status)
202 if ( status /= 0 )
then
203 print*,
'error opening ',filename,
' Status = ', status ; stop
205 call nemsio_getfilehead(nfile,iret=status,nrec=nrec,idrt=idrt)
208 call nemsio_open(ffile,trim(filenameflux),
'read',mpi_comm_comp &
210 if ( status /= 0 )
then
211 print*,
'error opening ',filenameflux,
' Status = ', status
220 do j = jsta_2l, jend_2u
231 do j = jsta_2l, jend_2u
240 allocate(recname(nrec),reclevtyp(nrec),reclev(nrec))
241 allocate(glat1d(im*jm),glon1d(im*jm))
242 allocate(vcoord4(lm+1,3,2))
244 call nemsio_getfilehead(nfile,iret=iret &
245 ,idate=idate(1:7),nfhour=nfhour,recname=recname &
246 ,reclevtyp=reclevtyp,reclev=reclev,lat=glat1d &
247 ,lon=glon1d,nframe=nframe,vcoord=vcoord4,idrt=maptype &
248 ,modelname=modelname_nemsio)
249 if(iret/=0)print*,
'error getting idate,nfhour'
250 print *,
'latstar1=',glat1d(1),glat1d(im*jm)
253 print*,
'modelname = ',modelname_nemsio
254 if(trim(modelname_nemsio)==
'FV3GFS')reduce_grid=.false.
260 open (201,file=
'lonsperlat.dat',status=
'old',form=
'formatted', &
261 action=
'read',iostat=iret)
263 read (201,*,iostat=iret) latghf,(lonsperlat(i),i=1,latghf)
265 print*,
'finished reading lonsperlat'
267 if (jm /= latghf+latghf)
then
268 write(0,*)
' wrong reduced grid - execution skipped'
272 numi(j) = lonsperlat(j)
275 numi(j) = lonsperlat(jm+1-j)
290 if (me == 0) print *,
'maptype and gridtype is ', &
296 print *,
'recname,reclevtyp,reclev=',trim(recname(i)),
' ', &
297 trim(reclevtyp(i)),reclev(i)
306 gdlat(i,j) = glat1d(js+i)
307 gdlon(i,j) = glon1d(js+i)
313 ak5(l) = vcoord4(l,1,1)
314 bk5(l) = vcoord4(l,2,1)
319 if ( minval(ak5) <0 .or. minval(bk5) <0 )
then
320 open (202,file=
'global_hyblev.txt',status=
'old',form=
'formatted', &
321 action=
'read',iostat=iret)
325 read (202,*,iostat=iret) ak5(l),bk5(l)
331 vcoord4(l,1,1)=ak5(l)
332 vcoord4(l,2,1)=bk5(l)
335 print *,
'ak5 and bk5 not found, stop !'
346 deallocate(glat1d,glon1d)
348 print*,
'idate = ',(idate(i),i=1,7)
349 print*,
'idate after broadcast = ',(idate(i),i=1,4)
350 print*,
'nfhour = ',nfhour
356 print *,me,
'max(gdlat)=', maxval(gdlat), &
357 'max(gdlon)=', maxval(gdlon)
358 CALL exch(gdlat(1,jsta_2l))
359 print *,
'after call EXCH,me=',me
365 if (ip1 > im) ip1 = ip1 - im
366 dx(i,j) = erad*cos(gdlat(i,j)*dtr) *(gdlon(ip1,j)-gdlon(i,j))*dtr
367 dy(i,j) = erad*(gdlat(i,j)-gdlat(i,j+1))*dtr
377 f(i,j) = 1.454441e-4*sin(gdlat(i,j)*dtr)
383 print*,
'impf,jmpf,nframe= ',impf,jmpf,nframe
393 print*,
'start yr mo day hr min =',iyear,imn,iday,ihrst,imin
394 print*,
'processing yr mo day hr min=' &
395 ,idat(3),idat(1),idat(2),idat(4),idat(5)
411 print *,
' idate=',idate
412 print *,
' jdate=',jdate
414 CALL w3difdat(jdate,idate,0,rinc)
416 print *,
' rinc=',rinc
417 ifhr = nint(rinc(2)+rinc(1)*24.)
418 print *,
' ifhr=',ifhr
419 ifmin = nint(rinc(3))
421 print*,
' in INITPOST ifhr ifmin fileName=',ifhr,ifmin,filename
425 print*,
'tstart= ',tstart
431 IF(tstart > 1.0e-2)
THEN
432 ifhr = ifhr+nint(tstart)
436 call w3movdat(rinc,jdate,idate)
441 print*,
'new forecast hours for restrt run= ',ifhr
442 print*,
'new start yr mo day hr min =',sdat(3),sdat(1) &
446 varname=
'imp_physics'
447 call nemsio_getheadvar(ffile,trim(varname),imp_physics,iret)
449 if(me==0)print*,varname, &
450 " not found in file-Assigned 99 for Zhao"
454 if(me==0)print*,
'MP_PHYSICS= ',imp_physics
456 varname=
'sf_surface_physi'
457 call nemsio_getheadvar(ffile,trim(varname),imp_physics,iret)
459 if(me==0)print*,varname, &
460 " not found in file-Assigned 2 for NOAH"
461 isf_surface_physics=2
464 if(me==0)print*,
'SF_SURFACE_PHYSICS= ',isf_surface_physics
468 call nemsio_getheadvar(ffile,trim(varname),fhzero,iret)
470 if(me==0)print*,varname, &
471 " not found in file-Assign 6 or 12 hours precip bucket"
473 if(ifhr>240)tprec=12.
500 print*,
'tprec, tclod, trdlw = ',tprec,tclod,trdlw
504 if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
505 CALL microinit(imp_physics)
516 fldsize = (jend-jsta+1)*im
517 allocate(tmp(fldsize*nrec))
518 print*,
'allocate tmp successfully'
520 call nemsio_denseread(nfile,1,im,jsta,jend,tmp,iret=iret)
522 print*,
"fail to read sigma file using mpi io read, stopping"
529 print*,
'performing reduced grid'
531 allocate (kmsk(im,jtem))
534 fldst = (recn-1)*fldsize
536 js = fldst + (j-jsta)*im
541 call gg2rg(im,jtem,numi(jsta),buf(1,jsta))
542 call uninterpred(2,kmsk,numi(jsta),im,jtem,buf(1,jsta),tmp(fldst+1))
551 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
553 fldst = (recn-1)*fldsize
556 js = fldst + (j-jsta)*im
562 if(me == 0) print*,
'fail to read ', varname,vcoordname,l
573 if (fis(i,j) /= spval)
then
574 zint(i,j,lp1) = fis(i,j)
575 fis(i,j) = fis(i,j) * grav
579 if(debugprint) print*,
'sample ',varname,
' = ',fis(isa,jsa)
586 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
587 ,l,nrec,fldsize,spval,tmp &
588 ,recname,reclevtyp,reclev,varname,vcoordname &
589 ,pint(1,jsta_2l,lp1))
591 if(debugprint)print*,
'sample surface pressure = ',pint(isa,jsa,lp1)
596 vcoordname =
'mid layer'
603 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
605 fldst = (recn-1)*fldsize
608 js = fldst + (j-jsta)*im
610 t(i,j,ll) = tmp(i+js)
614 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
618 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,t(isa,jsa,ll)
622 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
624 fldst = (recn-1)*fldsize
627 js = fldst + (j-jsta)*im
629 q(i,j,ll) = tmp(i+js)
633 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
637 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,q(isa,jsa,ll)
641 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
643 fldst = (recn-1)*fldsize
646 js = fldst + (j-jsta)*im
648 uh(i,j,ll) = tmp(i+js)
652 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
656 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,uh(isa,jsa,ll)
660 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
662 fldst = (recn-1)*fldsize
665 js = fldst + (j-jsta)*im
667 vh(i,j,ll) = tmp(i+js)
671 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
675 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,vh(isa,jsa,ll)
703 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
705 fldst = (recn-1)*fldsize
708 js = fldst + (j-jsta)*im
710 dpres(i,j,ll) = tmp(i+js)
715 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll, &
716 'will derive pressure using ak bk later'
720 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
722 fldst = (recn-1)*fldsize
725 js = fldst + (j-jsta)*im
727 o3(i,j,ll) = tmp(i+js)
731 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
736 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,o3(isa,jsa,ll)
752 if(imp_physics==99 .or. imp_physics==98)
then
754 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
756 fldst = (recn-1)*fldsize
759 js = fldst + (j-jsta)*im
761 cwm(i,j,ll) = tmp(i+js)
765 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
769 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,cwm(isa,jsa,ll)
774 if(t(i,j,ll) < (tfrz-15.) )
then
775 qqi(i,j,ll) = cwm(i,j,ll)
777 qqw(i,j,ll) = cwm(i,j,ll)
781 else if(imp_physics==11 .or. imp_physics==8)
then
783 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
785 fldst = (recn-1)*fldsize
788 js = fldst + (j-jsta)*im
790 qqw(i,j,ll) = tmp(i+js)
794 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
797 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,qqw(isa,jsa,ll)
800 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
802 fldst = (recn-1)*fldsize
805 js = fldst + (j-jsta)*im
807 qqi(i,j,ll) = tmp(i+js)
811 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
814 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,qqi(isa,jsa,ll)
817 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
819 fldst = (recn-1)*fldsize
822 js = fldst + (j-jsta)*im
824 qqr(i,j,ll) = tmp(i+js)
828 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
831 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,qqr(isa,jsa,ll)
834 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
836 fldst = (recn-1)*fldsize
839 js = fldst + (j-jsta)*im
841 qqs(i,j,ll) = tmp(i+js)
845 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
848 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,qqs(isa,jsa,ll)
851 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
853 fldst = (recn-1)*fldsize
856 js = fldst + (j-jsta)*im
858 qqg(i,j,ll) = tmp(i+js)
862 print*,
'fail to read ', varname,
' at lev ',ll,
'stopping'
865 if(debugprint)print*,
'sample ',ll,varname,
' = ',ll,qqg(isa,jsa,ll)
869 cwm(i,j,ll)=qqg(i,j,ll)+qqs(i,j,ll)+qqr(i,j,ll)+qqi(i,j,ll)+qqw(i,j,ll)
878 if(trim(modelname_nemsio)==
'FV3GFS')
then
881 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
883 fldst = (recn-1)*fldsize
886 js = fldst + (j-jsta)*im
888 wh(i,j,ll) = tmp(i+js)
891 if(debugprint)print*,
'sample l ',varname,
' = ',ll,wh(isa,jsa,ll)
893 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll
897 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
899 fldst = (recn-1)*fldsize
902 js = fldst + (j-jsta)*im
904 omga(i,j,ll) = tmp(i+js)
907 if(debugprint)print*,
'sample l ',varname,
' = ',ll,omga(isa,jsa,ll)
910 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll, &
911 'will derive omega later'
917 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
919 fldst = (recn-1)*fldsize
923 js = fldst + (j-jsta)*im
925 zint(i,j,ll)=zint(i,j,ll+1)+abs(tmp(i+js))
926 if(recn_dpres /= -9999)pmid(i,j,ll)=rgas*dpres(i,j,ll)* &
927 t(i,j,ll)*(q(i,j,ll)*fv+1.0)/grav/abs(tmp(i+js))
930 if(debugprint)print*,
'sample l ',varname,
' = ',ll, &
932 if(trim(modelname_nemsio)==
'FV3GFS' .and. &
933 recn_dpres /= -9999)
then
935 js = fldst + (j-jsta)*im
937 omga(i,j,ll)=(-1.)*wh(i,j,ll)*dpres(i,j,ll)/abs(tmp(i+js))
940 if(debugprint)print*,
'sample l omga for FV3',ll, &
945 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll, &
946 'will derive height later'
951 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
953 fldst = (recn-1)*fldsize
956 js = fldst + (j-jsta)*im
958 cfr(i,j,ll)=tmp(i+js)
965 if(imp_physics == 99)
then
966 allocate(p2d(im,lm),t2d(im,lm),q2d(im,lm),cw2d(im,lm), &
967 qs2d(im,lm),cfr2d(im,lm))
971 p2d(i,k) = pmid(i,j,ll)*0.01
974 cw2d(i,k) = cwm(i,j,ll)
975 es = min(
fpvsnew(t(i,j,ll)),pmid(i,j,ll))
976 qs2d(i,k) = eps*es/(pmid(i,j,ll)+epsm1*es)
982 ( p2d,t2d,q2d,qs2d,cw2d,im,lm,0, &
989 cfr(i,j,k) = cfr2d(i,k)
993 deallocate(p2d,t2d,q2d,qs2d,cw2d,cfr2d)
999 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
1001 fldst = (recn-1)*fldsize
1004 js = fldst + (j-jsta)*im
1006 q2(i,j,ll) = tmp(i+js)
1010 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll
1018 if(debugprint)print*,
'sample l ',varname,
' = ',ll,q2(isa,jsa,ll)
1023 call getrecn(recname,reclevtyp,reclev,nrec,varname,vcoordname,l,recn)
1027 js = fldst + (j-jsta)*im
1029 ref_10cm(i,j,ll) = tmp(i+js)
1036 ref_10cm(i,j,ll) = spval
1039 if(me==0)print*,
'fail to read ', varname,
' at lev ',ll
1041 if(debugprint)print*,
'sample l ',varname,
' = ',ll,ref_10cm(isa,jsa,ll)
1058 if (recn_dpres == -9999)
then
1063 pint(i,j,l) = ak5(lm+2-l) + bk5(lm+2-l)*pint(i,j,lp1)
1064 if(recn_delz == -9999)pmid(i,j,l) = 0.5*(pint(i,j,l)+ &
1068 if (me == 0) print*,
'sample pint,pmid' ,ii,jj,l,pint(ii,jj,l),pmid(ii,jj,l)
1085 pint(i,j,1)=ak5(lp1)
1092 pint(i,j,l) = pint(i,j,l-1) + dpres(i,j,l-1)
1095 if (me == 0) print*,
'sample model pint,pmid' ,ii,jj,l &
1105 if (recn_vvel == -9999)
then
1106 allocate(ps2d(im,jsta_2l:jend_2u), psx2d(im,jsta_2l:jend_2u), &
1107 psy2d(im,jsta_2l:jend_2u))
1108 allocate(div3d(im,jsta:jend,lm))
1113 ps2d(i,j) = log(pint(i,j,lm+1))
1116 call calgradps(ps2d,psx2d,psy2d)
1118 call caldiv(uh, vh, div3d)
1121 allocate (vcrd(lm+1,2), d2d(im,lm), u2d(im,lm), v2d(im,lm), &
1122 pi2d(im,lm+1), pm2d(im,lm), omga2d(im,lm))
1128 vcrd(l,1) = vcoord4(l,1,1)
1129 vcrd(l,2) = vcoord4(l,2,1)
1137 if (j > jm-jtem+1)
then
1138 npass = npass + nint(0.5*(j-jm+jtem-1))
1139 elseif (j < jtem)
then
1140 npass = npass + nint(0.5*(jtem-j))
1147 u2d(i,l) = uh(i,j,ll)
1148 v2d(i,l) = vh(i,j,ll)
1149 d2d(i,l) = div3d(i,j,ll)
1153 call
modstuff2(im, im, lm, idvc, idsl, nvcoord, &
1154 vcrd, pint(1,j,lp1), psx2d(1,j), psy2d(1,j), &
1155 d2d, u2d, v2d, pi2d, pm2d, omga2d, me)
1159 if (npass <= 0 )
then
1164 omga(i,j,l) = omga2d(i,ll)
1174 omg1(i) = omga2d(i,ll)
1180 omg2(1) = omg2(im+1)
1181 omg2(im+2) = omg2(2)
1183 omg1(i-1) = third * (omg2(i-1) + omg2(i) + omg2(i+1))
1188 omga(i,j,l) = omg1(i)
1197 if (j ==1 .or. j == jm)
then
1204 tx2 = tx2 + omga(i,j,l)
1215 deallocate (vcrd,d2d,u2d,v2d,pi2d,pm2d,omga2d)
1216 deallocate (ps2d,psx2d,psy2d,div3d)
1218 deallocate (vcoord4)
1223 allocate(wrk1(im,jsta:jend),wrk2(im,jsta:jend))
1224 allocate(fi(im,jsta:jend,2))
1236 alpint(i,j,l)=log(pint(i,j,l))
1241 if (recn_delz == -9999)
then
1244 wrk1(i,j) = log(pmid(i,j,lm))
1245 wrk2(i,j) = t(i,j,lm)*(q(i,j,lm)*fv+1.0)
1246 fi(i,j,1) = fis(i,j) &
1247 + wrk2(i,j)*rgas*(alpint(i,j,lp1)-wrk1(i,j))
1248 zmid(i,j,lm) = fi(i,j,1) * gravi
1256 tvll = t(i,j,ll)*(q(i,j,ll)*fv+1.0)
1257 pmll = log(pmid(i,j,ll))
1259 fi(i,j,2) = fi(i,j,1) + (0.5*rgas)*(wrk2(i,j)+tvll) &
1261 zmid(i,j,ll) = fi(i,j,2) * gravi
1263 fact = (alpint(i,j,l)-wrk1(i,j)) / (pmll-wrk1(i,j))
1264 zint(i,j,l) = zmid(i,j,l) +(zmid(i,j,ll)-zmid(i,j,l))*fact
1265 fi(i,j,1) = fi(i,j,2)
1271 if (me == 0) print*,
'L ZINT= ',l,zint(ii,jj,l), &
1272 'alpint=',alpint(ii,jj,l),
'pmid=',log(pmid(ii,jj,l)), &
1273 'pmid(l-1)=',log(pmid(ii,jj,l-1)),
'zmd=',zmid(ii,jj,l), &
1274 'zmid(l-1)=',zmid(ii,jj,l-1)
1276 deallocate(wrk1,wrk2,fi)
1281 zmid(i,j,l)=zint(i,j,l+1)+(zint(i,j,l)-zint(i,j,l+1))* &
1282 (log(pmid(i,j,l))-alpint(i,j,l+1))/ &
1283 (alpint(i,j,l)-alpint(i,j,l+1))
1332 print *,
'gocart_on2=',gocart_on
1341 do j=jsta_2l,jend_2u
1343 dust(i,j,l,n) = spval
1351 vcoordname=
'mid layer'
1354 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1355 ,l,nrec,fldsize,spval,tmp &
1356 ,recname,reclevtyp,reclev,varname,vcoordname &
1357 ,dust(1:im,jsta_2l:jend_2u,ll,1))
1364 vcoordname=
'mid layer'
1367 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1368 ,l,nrec,fldsize,spval,tmp &
1369 ,recname,reclevtyp,reclev,varname,vcoordname &
1370 ,dust(1:im,jsta_2l:jend_2u,ll,2))
1372 dustcb(1:im,jsta_2l:jend_2u)=dustcb(1:im,jsta_2l:jend_2u)+ &
1373 (dust(1:im,jsta_2l:jend_2u,ll,1)+0.38*dust(1:im,jsta_2l:jend_2u,ll,2))* &
1374 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1381 vcoordname=
'mid layer'
1384 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1385 ,l,nrec,fldsize,spval,tmp &
1386 ,recname,reclevtyp,reclev,varname,vcoordname &
1387 ,dust(1:im,jsta_2l:jend_2u,ll,3))
1393 vcoordname=
'mid layer'
1396 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1397 ,l,nrec,fldsize,spval,tmp &
1398 ,recname,reclevtyp,reclev,varname,vcoordname &
1399 ,dust(1:im,jsta_2l:jend_2u,ll,4))
1406 vcoordname=
'mid layer'
1409 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1410 ,l,nrec,fldsize,spval,tmp &
1411 ,recname,reclevtyp,reclev,varname,vcoordname &
1412 ,dust(1:im,jsta_2l:jend_2u,ll,5))
1414 dustallcb(1:im,jsta_2l:jend_2u)=dustallcb(1:im,jsta_2l:jend_2u)+ &
1415 (dust(1:im,jsta_2l:jend_2u,ll,1)+dust(1:im,jsta_2l:jend_2u,ll,2)+ &
1416 dust(1:im,jsta_2l:jend_2u,ll,3)+0.74*dust(1:im,jsta_2l:jend_2u,ll,4))* &
1417 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1428 do j=jsta_2l,jend_2u
1430 salt(i,j,l,n) = spval
1438 vcoordname=
'mid layer'
1441 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1442 ,l,nrec,fldsize,spval,tmp &
1443 ,recname,reclevtyp,reclev,varname,vcoordname &
1444 ,salt(1:im,jsta_2l:jend_2u,ll,1))
1451 vcoordname=
'mid layer'
1454 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1455 ,l,nrec,fldsize,spval,tmp &
1456 ,recname,reclevtyp,reclev,varname,vcoordname &
1457 ,salt(1:im,jsta_2l:jend_2u,ll,2))
1464 vcoordname=
'mid layer'
1467 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1468 ,l,nrec,fldsize,spval,tmp &
1469 ,recname,reclevtyp,reclev,varname,vcoordname &
1470 ,salt(1:im,jsta_2l:jend_2u,ll,3))
1472 sscb(1:im,jsta_2l:jend_2u)=sscb(1:im,jsta_2l:jend_2u)+ &
1473 (salt(1:im,jsta_2l:jend_2u,ll,1)+ &
1474 salt(1:im,jsta_2l:jend_2u,ll,2)+0.83*salt(1:im,jsta_2l:jend_2u,ll,3))* &
1475 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1482 vcoordname=
'mid layer'
1485 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1486 ,l,nrec,fldsize,spval,tmp &
1487 ,recname,reclevtyp,reclev,varname,vcoordname &
1488 ,salt(1:im,jsta_2l:jend_2u,ll,4))
1494 vcoordname=
'mid layer'
1497 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1498 ,l,nrec,fldsize,spval,tmp &
1499 ,recname,reclevtyp,reclev,varname,vcoordname &
1500 ,salt(1:im,jsta_2l:jend_2u,ll,5))
1502 ssallcb(1:im,jsta_2l:jend_2u)=ssallcb(1:im,jsta_2l:jend_2u)+ &
1503 (salt(1:im,jsta_2l:jend_2u,ll,1)+salt(1:im,jsta_2l:jend_2u,ll,2)+ &
1504 salt(1:im,jsta_2l:jend_2u,ll,3)+ &
1505 salt(1:im,jsta_2l:jend_2u,ll,4))* &
1506 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1516 do j=jsta_2l,jend_2u
1518 soot(i,j,l,n) = spval
1526 vcoordname=
'mid layer'
1529 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1530 ,l,nrec,fldsize,spval,tmp &
1531 ,recname,reclevtyp,reclev,varname,vcoordname &
1532 ,soot(1:im,jsta_2l:jend_2u,ll,1))
1539 vcoordname=
'mid layer'
1542 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1543 ,l,nrec,fldsize,spval,tmp &
1544 ,recname,reclevtyp,reclev,varname,vcoordname &
1545 ,soot(1:im,jsta_2l:jend_2u,ll,2))
1547 bccb(1:im,jsta_2l:jend_2u)=bccb(1:im,jsta_2l:jend_2u)+ &
1548 (soot(1:im,jsta_2l:jend_2u,ll,1)+soot(1:im,jsta_2l:jend_2u,ll,2))* &
1549 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1559 do j=jsta_2l,jend_2u
1561 waso(i,j,l,n) = spval
1569 vcoordname=
'mid layer'
1572 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1573 ,l,nrec,fldsize,spval,tmp &
1574 ,recname,reclevtyp,reclev,varname,vcoordname &
1575 ,waso(1:im,jsta_2l:jend_2u,ll,1))
1582 vcoordname=
'mid layer'
1585 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1586 ,l,nrec,fldsize,spval,tmp &
1587 ,recname,reclevtyp,reclev,varname,vcoordname &
1588 ,waso(1:im,jsta_2l:jend_2u,ll,2))
1590 occb(1:im,jsta_2l:jend_2u)=occb(1:im,jsta_2l:jend_2u)+ &
1591 (waso(1:im,jsta_2l:jend_2u,ll,1)+waso(1:im,jsta_2l:jend_2u,ll,2)) * &
1592 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1602 do j=jsta_2l,jend_2u
1604 suso(i,j,l,n) = spval
1612 vcoordname=
'mid layer'
1615 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1616 ,l,nrec,fldsize,spval,tmp &
1617 ,recname,reclevtyp,reclev,varname,vcoordname &
1618 ,suso(1:im,jsta_2l:jend_2u,ll,1))
1620 sulfcb(1:im,jsta_2l:jend_2u)=sulfcb(1:im,jsta_2l:jend_2u)+ &
1621 suso(1:im,jsta_2l:jend_2u,ll,1)* &
1622 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1632 do j=jsta_2l,jend_2u
1634 pp25(i,j,l,n) = spval
1642 vcoordname=
'mid layer'
1645 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1646 ,l,nrec,fldsize,spval,tmp &
1647 ,recname,reclevtyp,reclev,varname,vcoordname &
1648 ,pp25(1:im,jsta_2l:jend_2u,ll,1))
1649 pp25cb(1:im,jsta_2l:jend_2u)=pp25cb(1:im,jsta_2l:jend_2u)+ &
1650 pp25(1:im,jsta_2l:jend_2u,ll,1)* &
1651 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1660 do j=jsta_2l,jend_2u
1662 pp10(i,j,l,n) = spval
1670 vcoordname=
'mid layer'
1673 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1674 ,l,nrec,fldsize,spval,tmp &
1675 ,recname,reclevtyp,reclev,varname,vcoordname &
1676 ,pp10(1:im,jsta_2l:jend_2u,ll,1))
1677 pp10cb(1:im,jsta_2l:jend_2u)=pp10cb(1:im,jsta_2l:jend_2u)+ &
1678 pp10(1:im,jsta_2l:jend_2u,ll,1)* &
1679 dpres(1:im,jsta_2l:jend_2u,ll)/grav
1690 tv = t(i,j,l) * (h1+d608*max(q(i,j,l),qmin))
1691 rhomid(i,j,l) = pmid(i,j,l) / (rd*tv)
1693 IF ( dust(i,j,l,n) < spval)
THEN
1694 dust(i,j,l,n) = max(dust(i,j,l,n), 0.0)
1698 IF ( salt(i,j,l,n) < spval)
THEN
1699 salt(i,j,l,n) = max(salt(i,j,l,n), 0.0)
1703 IF ( waso(i,j,l,n) < spval)
THEN
1704 waso(i,j,l,n) = max(waso(i,j,l,n), 0.0)
1708 IF ( soot(i,j,l,n) < spval)
THEN
1709 soot(i,j,l,n) = max(soot(i,j,l,n), 0.0)
1713 IF ( suso(i,j,l,n) < spval)
THEN
1714 suso(i,j,l,n) = max(suso(i,j,l,n), 0.0)
1725 dustcb(i,j) = max(dustcb(i,j), 0.0)
1726 dustallcb(i,j) = max(dustallcb(i,j), 0.0)
1727 sscb(i,j) = max(sscb(i,j), 0.0)
1728 ssallcb(i,j) = max(ssallcb(i,j), 0.0)
1729 bccb(i,j) = max(bccb(i,j), 0.0)
1730 occb(i,j) = max(occb(i,j), 0.0)
1731 sulfcb(i,j) = max(sulfcb(i,j), 0.0)
1732 pp25cb(i,j) = max(pp25cb(i,j), 0.0)
1733 pp10cb(i,j) = max(pp10cb(i,j), 0.0)
1735 dusmass(i,j)=(dust(i,j,l,1)+dust(i,j,l,2)+dust(i,j,l,3)+ &
1736 0.74*dust(i,j,l,4)+salt(i,j,l,1)+salt(i,j,l,2)+salt(i,j,l,3)+ &
1737 salt(i,j,l,4) + soot(i,j,l,1)+soot(i,j,l,2)+waso(i,j,l,1)+ &
1738 waso(i,j,l,2) +suso(i,j,l,1)+pp25(i,j,l,1)+pp10(i,j,l,1)) &
1741 dustpm(i,j)=(dust(i,j,l,1)+0.38*dust(i,j,l,2))*rhomid(i,j,l)
1742 dustpm10(i,j)=(dust(i,j,l,1)+dust(i,j,l,2)+dust(i,j,l,3)+ &
1743 0.74*dust(i,j,l,4))*rhomid(i,j,l)
1744 sspm(i,j)=(salt(i,j,l,1)+salt(i,j,l,2)+ &
1745 0.83*salt(i,j,l,3))*rhomid(i,j,l)
1747 dusmass25(i,j)=(dust(i,j,l,1)+0.38*dust(i,j,l,2)+ &
1748 salt(i,j,l,1)+salt(i,j,l,2)+0.83*salt(i,j,l,3) + &
1749 soot(i,j,l,1)+soot(i,j,l,2)+waso(i,j,l,1)+ &
1750 waso(i,j,l,2) +suso(i,j,l,1)+pp25(i,j,l,1))*rhomid(i,j,l)
1752 ducmass(i,j)=dustallcb(i,j)+ssallcb(i,j)+bccb(i,j)+ &
1753 occb(i,j)+sulfcb(i,j)+pp25cb(i,j)+pp10cb(i,j)
1755 ducmass25(i,j)=dustcb(i,j)+sscb(i,j)+bccb(i,j)+occb(i,j) &
1756 +sulfcb(i,j)+pp25cb(i,j)
1762 call nemsio_close(nfile,iret=status)
1763 deallocate(tmp,recname,reclevtyp,reclev)
1773 call nemsio_getfilehead(ffile,iret=status,nrec=nrec)
1774 print*,
'nrec for flux file=',nrec
1775 allocate(recname(nrec),reclevtyp(nrec),reclev(nrec))
1776 call nemsio_getfilehead(ffile,iret=iret &
1777 ,recname=recname ,reclevtyp=reclevtyp,reclev=reclev)
1781 print *,
'recname,reclevtyp,reclev=',trim(recname(i)),
' ', &
1782 trim(reclevtyp(i)),reclev(i)
1789 call nemsio_getheadvar(ffile,trim(varname),ivegsrc,iret)
1791 print*,varname,
' not found in file-use 1 for IGBP as default'
1794 if (me == 0) print*,
'IVEGSRC= ',ivegsrc
1799 else if(ivegsrc==1)
then
1801 else if(ivegsrc==0)
then
1804 if (me == 0) print*,
'novegtype= ',novegtype
1806 varname=
'CU_PHYSICS'
1807 call nemsio_getheadvar(ffile,trim(varname),icu_physics,iret)
1809 print*,varname,
" not found in file-Assigned 4 for SAS as default"
1812 if (me == 0) print*,
'CU_PHYSICS= ',icu_physics
1815 call nemsio_getheadvar(ffile,trim(varname),dtp,iret)
1817 print*,varname,
" not found in file-Assigned 225. for dtp as default"
1820 if (me == 0) print*,
'dtp= ',dtp
1853 fldsize = (jend-jsta+1)*im
1854 allocate(tmp(fldsize*nrec))
1855 print*,
'allocate tmp successfully'
1857 call nemsio_denseread(ffile,1,im,jsta,jend,tmp,iret=iret)
1867 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1868 ,l,nrec,fldsize,spval,tmp &
1869 ,recname,reclevtyp,reclev,varname,vcoordname,sm)
1870 if(debugprint)print*,
'sample ',varname,
' =',sm(im/2,(jsta+jend)/2)
1875 if (sm(i,j) /= spval) sm(i,j) = 1.0 - sm(i,j)
1884 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1885 ,l,nrec,fldsize,spval,tmp &
1886 ,recname,reclevtyp,reclev,varname,vcoordname,sice)
1888 if(debugprint)print*,
'sample ',varname,
' = ',sice(isa,jsa)
1901 if (sm(i,j) /= spval .and. sm(i,j) == 0.0) sice(i,j) = 0.0
1910 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1911 ,l,nrec,fldsize,spval,tmp &
1912 ,recname,reclevtyp,reclev,varname,vcoordname &
1914 if(debugprint)print*,
'sample ',varname,
' = ',pblh(isa,jsa)
1920 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1921 ,l,nrec,fldsize,spval,tmp &
1922 ,recname,reclevtyp,reclev,varname,vcoordname &
1930 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1931 ,l,nrec,fldsize,spval,tmp &
1932 ,recname,reclevtyp,reclev,varname,vcoordname &
1940 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1941 ,l,nrec,fldsize,spval,tmp &
1942 ,recname,reclevtyp,reclev,varname,vcoordname &
1949 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1950 ,l,nrec,fldsize,spval,tmp &
1951 ,recname,reclevtyp,reclev,varname,vcoordname &
1958 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
1959 ,l,nrec,fldsize,spval,tmp &
1960 ,recname,reclevtyp,reclev,varname,vcoordname &
1968 if (ths(i,j) /= spval)
then
1970 ths(i,j) = ths(i,j) * (p1000/pint(i,j,lp1))**capa
1976 if (sm(i,j) /= 0.0)
then
1977 if (sice(i,j) >= 0.15)
then
1980 sst(i,j) = ths(i,j) * (pint(i,j,lp1)/p1000)**capa
2001 varname=
'cpratb_ave'
2004 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2005 ,l,nrec,fldsize,spval,tmp &
2006 ,recname,reclevtyp,reclev,varname,vcoordname &
2012 if (avgcprate(i,j) /= spval) avgcprate(i,j) = avgcprate(i,j) * (dtq2*0.001)
2020 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2021 ,l,nrec,fldsize,spval,tmp &
2022 ,recname,reclevtyp,reclev,varname,vcoordname &
2027 if (avgcprate_cont(i,j) /= spval) avgcprate_cont(i,j) = &
2028 avgcprate_cont(i,j) * (dtq2*0.001)
2037 varname=
'prateb_ave'
2040 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2041 ,l,nrec,fldsize,spval,tmp &
2042 ,recname,reclevtyp,reclev,varname,vcoordname &
2048 if (avgprec(i,j) /= spval) avgprec(i,j) = avgprec(i,j) * (dtq2*0.001)
2058 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2059 ,l,nrec,fldsize,spval,tmp &
2060 ,recname,reclevtyp,reclev,varname,vcoordname &
2066 if (avgprec_cont(i,j) /= spval) avgprec_cont(i,j) = avgprec_cont(i,j) &
2077 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2078 ,l,nrec,fldsize,spval,tmp &
2079 ,recname,reclevtyp,reclev,varname,vcoordname &
2086 if (prec(i,j) /= spval) prec(i,j) = prec(i,j) * (dtq2*0.001) &
2095 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2096 ,l,nrec,fldsize,spval,tmp &
2097 ,recname,reclevtyp,reclev,varname,vcoordname &
2102 if (cprate(i,j) /= spval)
then
2103 cprate(i,j) = max(0.,cprate(i,j)) * (dtq2*0.001) * 1000. / dtp
2109 if(debugprint)print*,
'sample ',varname,
' = ',cprate(isa,jsa)
2118 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2119 ,l,nrec,fldsize,spval,tmp &
2120 ,recname,reclevtyp,reclev,varname,vcoordname &
2126 if (sm(i,j) == 1.0 .and. sice(i,j)==0.) sno(i,j) = spval
2135 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2136 ,l,nrec,fldsize,spval,tmp &
2137 ,recname,reclevtyp,reclev,varname,vcoordname &
2142 if (sm(i,j)==1.0 .and. sice(i,j)==0.) snoavg(i,j)=spval
2143 if(snoavg(i,j)/=spval)snoavg(i,j)=snoavg(i,j)/100.
2151 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2152 ,l,nrec,fldsize,spval,tmp &
2153 ,recname,reclevtyp,reclev,varname,vcoordname &
2159 if (sm(i,j)==1.0 .and. sice(i,j)==0.) si(i,j)=spval
2160 if (si(i,j) /= spval) si(i,j) = si(i,j) * 1000.0
2174 vcoordname=
'2 m above gnd'
2176 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2177 ,l,nrec,fldsize,spval,tmp &
2178 ,recname,reclevtyp,reclev,varname,vcoordname &
2185 pshltr(i,j)=pint(i,j,lm+1)*exp(-0.068283/tshltr(i,j))
2186 tshltr(i,j)= tshltr(i,j)*(p1000/pshltr(i,j))**capa
2195 vcoordname=
'2 m above gnd'
2197 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2198 ,l,nrec,fldsize,spval,tmp &
2199 ,recname,reclevtyp,reclev,varname,vcoordname &
2207 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2208 ,l,nrec,fldsize,spval,tmp &
2209 ,recname,reclevtyp,reclev,varname,vcoordname &
2215 if (avgalbedo(i,j) /= spval) avgalbedo(i,j) = avgalbedo(i,j) * 0.01
2222 vcoordname=
'atmos col'
2224 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2225 ,l,nrec,fldsize,spval,tmp &
2226 ,recname,reclevtyp,reclev,varname,vcoordname &
2232 if (avgtcdc(i,j) /= spval) avgtcdc(i,j) = avgtcdc(i,j) * 0.01
2239 do j=jsta_2l,jend_2u
2250 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2251 ,l,nrec,fldsize,spval,tmp &
2252 ,recname,reclevtyp,reclev,varname,vcoordname &
2258 if (mxsnal(i,j) /= spval) mxsnal(i,j) = mxsnal(i,j) * 0.01
2264 do j=jsta_2l,jend_2u
2274 tlmh = t(i,j,lm) * t(i,j,lm)
2275 sigt4(i,j) = 5.67e-8 * tlmh * tlmh
2283 do j=jsta_2l,jend_2u
2293 vcoordname=
'high cld lay'
2295 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2296 ,l,nrec,fldsize,spval,tmp &
2297 ,recname,reclevtyp,reclev,varname,vcoordname &
2303 if (avgcfrach(i,j) /= spval) avgcfrach(i,j) = avgcfrach(i,j) * 0.01
2310 vcoordname=
'low cld lay'
2312 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2313 ,l,nrec,fldsize,spval,tmp &
2314 ,recname,reclevtyp,reclev,varname,vcoordname &
2320 if (avgcfracl(i,j) /= spval) avgcfracl(i,j) = avgcfracl(i,j) * 0.01
2327 vcoordname=
'mid cld lay'
2329 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2330 ,l,nrec,fldsize,spval,tmp &
2331 ,recname,reclevtyp,reclev,varname,vcoordname &
2337 if (avgcfracm(i,j) /= spval) avgcfracm(i,j) = avgcfracm(i,j) * 0.01
2344 vcoordname=
'convect-cld laye'
2346 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2347 ,l,nrec,fldsize,spval,tmp &
2348 ,recname,reclevtyp,reclev,varname,vcoordname &
2354 if (cnvcfr(i,j) /= spval) cnvcfr(i,j)= cnvcfr(i,j) * 0.01
2363 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2364 ,l,nrec,fldsize,spval,tmp &
2365 ,recname,reclevtyp,reclev,varname,vcoordname &
2369 do j = jsta_2l, jend_2u
2371 if (buf(i,j) < spval)
then
2372 islope(i,j) = nint(buf(i,j))
2384 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2385 ,l,nrec,fldsize,spval,tmp &
2386 ,recname,reclevtyp,reclev,varname,vcoordname &
2392 if (cmc(i,j) /= spval) cmc(i,j) = cmc(i,j) * 0.001
2393 if (sm(i,j) /= 0.0) cmc(i,j) = spval
2399 do j=jsta_2l,jend_2u
2409 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2410 ,l,nrec,fldsize,spval,tmp &
2411 ,recname,reclevtyp,reclev,varname,vcoordname &
2416 if(sr(i,j) /= spval)
then
2418 sr(i,j)=min(1.,max(0.,sr(i,j)))
2427 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2428 ,l,nrec,fldsize,spval,tmp &
2429 ,recname,reclevtyp,reclev,varname,vcoordname &
2434 if (sice(i,j) == spval .or. sice(i,j) == 0.) ti(i,j)=spval
2442 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2443 ,l,nrec,fldsize,spval,tmp &
2444 ,recname,reclevtyp,reclev,varname,vcoordname &
2449 if (vegfrc(i,j) /= spval)
then
2450 vegfrc(i,j) = vegfrc(i,j) * 0.01
2460 if (sm(i,j) /= 0.0) vegfrc(i,j) = spval
2474 vcoordname=
'0-10 cm down'
2476 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2477 ,l,nrec,fldsize,spval,tmp &
2478 ,recname,reclevtyp,reclev,varname,vcoordname &
2484 if (sm(i,j) /= 0.0) sh2o(i,j,1) = spval
2490 vcoordname=
'10-40 cm down'
2492 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2493 ,l,nrec,fldsize,spval,tmp &
2494 ,recname,reclevtyp,reclev,varname,vcoordname &
2500 if (sm(i,j) /= 0.0) sh2o(i,j,2) = spval
2506 vcoordname=
'40-100 cm down'
2508 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2509 ,l,nrec,fldsize,spval,tmp &
2510 ,recname,reclevtyp,reclev,varname,vcoordname &
2516 if (sm(i,j) /= 0.0) sh2o(i,j,3) = spval
2522 vcoordname=
'100-200 cm down'
2524 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2525 ,l,nrec,fldsize,spval,tmp &
2526 ,recname,reclevtyp,reclev,varname,vcoordname &
2532 if (sm(i,j) /= 0.0) sh2o(i,j,4) = spval
2539 vcoordname=
'0-10 cm down'
2542 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2543 ,l,nrec,fldsize,spval,tmp &
2544 ,recname,reclevtyp,reclev,varname,vcoordname &
2550 if (sm(i,j) /= 0.0) smc(i,j,1) = spval
2556 vcoordname=
'10-40 cm down'
2558 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2559 ,l,nrec,fldsize,spval,tmp &
2560 ,recname,reclevtyp,reclev,varname,vcoordname &
2566 if (sm(i,j) /= 0.0) smc(i,j,2) = spval
2572 vcoordname=
'40-100 cm down'
2574 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2575 ,l,nrec,fldsize,spval,tmp &
2576 ,recname,reclevtyp,reclev,varname,vcoordname &
2582 if (sm(i,j) /= 0.0) smc(i,j,3) = spval
2588 vcoordname=
'100-200 cm down'
2590 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2591 ,l,nrec,fldsize,spval,tmp &
2592 ,recname,reclevtyp,reclev,varname,vcoordname &
2598 if (sm(i,j) /= 0.0) smc(i,j,4) = spval
2605 vcoordname=
'0-10 cm down'
2607 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2608 ,l,nrec,fldsize,spval,tmp &
2609 ,recname,reclevtyp,reclev,varname,vcoordname &
2615 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,1) = spval
2622 vcoordname=
'10-40 cm down'
2624 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2625 ,l,nrec,fldsize,spval,tmp &
2626 ,recname,reclevtyp,reclev,varname,vcoordname &
2632 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,2) = spval
2639 vcoordname=
'40-100 cm down'
2641 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2642 ,l,nrec,fldsize,spval,tmp &
2643 ,recname,reclevtyp,reclev,varname,vcoordname &
2649 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,3) = spval
2656 vcoordname=
'100-200 cm down'
2658 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2659 ,l,nrec,fldsize,spval,tmp &
2660 ,recname,reclevtyp,reclev,varname,vcoordname &
2666 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,4) = spval
2692 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2693 ,l,nrec,fldsize,spval,tmp &
2694 ,recname,reclevtyp,reclev,varname,vcoordname &
2701 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2702 ,l,nrec,fldsize,spval,tmp &
2703 ,recname,reclevtyp,reclev,varname,vcoordname &
2710 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2711 ,l,nrec,fldsize,spval,tmp &
2712 ,recname,reclevtyp,reclev,varname,vcoordname &
2718 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2719 ,l,nrec,fldsize,spval,tmp &
2720 ,recname,reclevtyp,reclev,varname,vcoordname &
2727 if (alwout(i,j) /= spval) alwout(i,j) = -alwout(i,j)
2734 vcoordname=
'nom. top'
2736 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2737 ,l,nrec,fldsize,spval,tmp &
2738 ,recname,reclevtyp,reclev,varname,vcoordname &
2743 do j=jsta_2l,jend_2u
2759 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2760 ,l,nrec,fldsize,spval,tmp &
2761 ,recname,reclevtyp,reclev,varname,vcoordname &
2769 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2770 ,l,nrec,fldsize,spval,tmp &
2771 ,recname,reclevtyp,reclev,varname,vcoordname &
2778 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2779 ,l,nrec,fldsize,spval,tmp &
2780 ,recname,reclevtyp,reclev,varname,vcoordname &
2788 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2789 ,l,nrec,fldsize,spval,tmp &
2790 ,recname,reclevtyp,reclev,varname,vcoordname &
2798 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2799 ,l,nrec,fldsize,spval,tmp &
2800 ,recname,reclevtyp,reclev,varname,vcoordname &
2806 if (aswout(i,j) /= spval) aswout(i,j) = -aswout(i,j)
2815 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2816 ,l,nrec,fldsize,spval,tmp &
2817 ,recname,reclevtyp,reclev,varname,vcoordname &
2822 vcoordname=
'nom. top'
2824 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2825 ,l,nrec,fldsize,spval,tmp &
2826 ,recname,reclevtyp,reclev,varname,vcoordname &
2833 vcoordname=
'nom. top'
2835 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2836 ,l,nrec,fldsize,spval,tmp &
2837 ,recname,reclevtyp,reclev,varname,vcoordname &
2846 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2847 ,l,nrec,fldsize,spval,tmp &
2848 ,recname,reclevtyp,reclev,varname,vcoordname &
2854 if (sfcshx(i,j) /= spval) sfcshx(i,j) = -sfcshx(i,j)
2863 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2864 ,l,nrec,fldsize,spval,tmp &
2865 ,recname,reclevtyp,reclev,varname,vcoordname &
2870 if (twbs(i,j) /= spval) twbs(i,j) = -twbs(i,j)
2883 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2884 ,l,nrec,fldsize,spval,tmp &
2885 ,recname,reclevtyp,reclev,varname,vcoordname &
2891 if (sfclhx(i,j) /= spval) sfclhx(i,j) = -sfclhx(i,j)
2900 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2901 ,l,nrec,fldsize,spval,tmp &
2902 ,recname,reclevtyp,reclev,varname,vcoordname &
2908 if (qwbs(i,j) /= spval) qwbs(i,j) = -qwbs(i,j)
2916 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2917 ,l,nrec,fldsize,spval,tmp &
2918 ,recname,reclevtyp,reclev,varname,vcoordname &
2924 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) subshx(i,j) = spval
2933 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2934 ,l,nrec,fldsize,spval,tmp &
2935 ,recname,reclevtyp,reclev,varname,vcoordname &
2941 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) grnflx(i,j) = spval
2948 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2949 ,l,nrec,fldsize,spval,tmp &
2950 ,recname,reclevtyp,reclev,varname,vcoordname &
2958 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2959 ,l,nrec,fldsize,spval,tmp &
2960 ,recname,reclevtyp,reclev,varname,vcoordname &
2965 do j=jsta_2l,jend_2u
2976 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2977 ,l,nrec,fldsize,spval,tmp &
2978 ,recname,reclevtyp,reclev,varname,vcoordname &
2987 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2988 ,l,nrec,fldsize,spval,tmp &
2989 ,recname,reclevtyp,reclev,varname,vcoordname &
2997 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
2998 ,l,nrec,fldsize,spval,tmp &
2999 ,recname,reclevtyp,reclev,varname,vcoordname &
3005 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) avgpotevp(i,j) = spval
3014 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3015 ,l,nrec,fldsize,spval,tmp &
3016 ,recname,reclevtyp,reclev,varname,vcoordname &
3022 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) potevp(i,j) = spval
3028 do j=jsta_2l,jend_2u
3031 rlwtt(i,j,l) = spval
3033 rswtt(i,j,l) = spval
3035 tcucn(i,j,l) = spval
3036 tcucns(i,j,l) = spval
3038 train(i,j,l) = spval
3050 vcoordname=
'10 m above gnd'
3052 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3053 ,l,nrec,fldsize,spval,tmp &
3054 ,recname,reclevtyp,reclev,varname,vcoordname &
3066 vcoordname=
'10 m above gnd'
3068 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3069 ,l,nrec,fldsize,spval,tmp &
3070 ,recname,reclevtyp,reclev,varname,vcoordname &
3086 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3087 ,l,nrec,fldsize,spval,tmp &
3088 ,recname,reclevtyp,reclev,varname,vcoordname &
3096 do j = jsta_2l, jend_2u
3098 if (buf(i,j) < spval)
then
3099 ivgtyp(i,j) = nint(buf(i,j))
3111 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3112 ,l,nrec,fldsize,spval,tmp &
3113 ,recname,reclevtyp,reclev,varname,vcoordname &
3121 do j = jsta_2l, jend_2u
3123 if (buf(i,j) < spval)
then
3124 isltyp(i,j) = nint(buf(i,j))
3133 do j=jsta_2l,jend_2u
3141 thz0(i,j) = ths(i,j)
3149 do j=jsta_2l,jend_2u
3151 el_pbl(i,j,l) = spval
3152 exch_h(i,j,l) = spval
3161 vcoordname=
'convect-cld top'
3163 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3164 ,l,nrec,fldsize,spval,tmp &
3165 ,recname,reclevtyp,reclev,varname,vcoordname &
3173 if(ptop(i,j) <= 0.0) ptop(i,j) = spval
3178 if(ptop(i,j) < spval)
then
3180 if(ptop(i,j) <= pmid(i,j,l))
then
3194 vcoordname=
'convect-cld bot'
3196 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3197 ,l,nrec,fldsize,spval,tmp &
3198 ,recname,reclevtyp,reclev,varname,vcoordname &
3206 if(pbot(i,j) <= 0.0) pbot(i,j) = spval
3213 if(pbot(i,j) < spval)
then
3215 if(pbot(i,j) >= pmid(i,j,l))
then
3228 vcoordname=
'low cld top'
3230 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3231 ,l,nrec,fldsize,spval,tmp &
3232 ,recname,reclevtyp,reclev,varname,vcoordname &
3238 vcoordname=
'low cld bot'
3240 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3241 ,l,nrec,fldsize,spval,tmp &
3242 ,recname,reclevtyp,reclev,varname,vcoordname &
3248 vcoordname=
'low cld top'
3250 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3251 ,l,nrec,fldsize,spval,tmp &
3252 ,recname,reclevtyp,reclev,varname,vcoordname &
3258 vcoordname=
'mid cld top'
3260 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3261 ,l,nrec,fldsize,spval,tmp &
3262 ,recname,reclevtyp,reclev,varname,vcoordname &
3268 vcoordname=
'mid cld bot'
3270 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3271 ,l,nrec,fldsize,spval,tmp &
3272 ,recname,reclevtyp,reclev,varname,vcoordname &
3278 vcoordname=
'mid cld top'
3280 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3281 ,l,nrec,fldsize,spval,tmp &
3282 ,recname,reclevtyp,reclev,varname,vcoordname &
3288 vcoordname=
'high cld top'
3290 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3291 ,l,nrec,fldsize,spval,tmp &
3292 ,recname,reclevtyp,reclev,varname,vcoordname &
3298 vcoordname=
'high cld bot'
3300 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3301 ,l,nrec,fldsize,spval,tmp &
3302 ,recname,reclevtyp,reclev,varname,vcoordname &
3308 vcoordname=
'high cld top'
3310 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3311 ,l,nrec,fldsize,spval,tmp &
3312 ,recname,reclevtyp,reclev,varname,vcoordname &
3318 vcoordname=
'bndary-layer cld'
3320 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3321 ,l,nrec,fldsize,spval,tmp &
3322 ,recname,reclevtyp,reclev,varname,vcoordname &
3327 do j = jsta_2l, jend_2u
3329 if (pblcfr(i,j) < spval) pblcfr(i,j) = pblcfr(i,j) * 0.01
3335 vcoordname=
'atmos col'
3337 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3338 ,l,nrec,fldsize,spval,tmp &
3339 ,recname,reclevtyp,reclev,varname,vcoordname &
3347 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3348 ,l,nrec,fldsize,spval,tmp &
3349 ,recname,reclevtyp,reclev,varname,vcoordname &
3355 if (sm(i,j) /= 0.0) runoff(i,j) = spval
3362 vcoordname=
'2 m above gnd'
3364 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3365 ,l,nrec,fldsize,spval,tmp &
3366 ,recname,reclevtyp,reclev,varname,vcoordname &
3372 vcoordname=
'2 m above gnd'
3374 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3375 ,l,nrec,fldsize,spval,tmp &
3376 ,recname,reclevtyp,reclev,varname,vcoordname &
3382 do j=jsta_2l,jend_2u
3384 maxrhshltr(i,j) = spval
3385 minrhshltr(i,j) = spval
3393 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3394 ,l,nrec,fldsize,spval,tmp &
3395 ,recname,reclevtyp,reclev,varname,vcoordname &
3403 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3404 ,l,nrec,fldsize,spval,tmp &
3405 ,recname,reclevtyp,reclev,varname,vcoordname &
3411 if (sm(i,j) /= 0.0) smcwlt(i,j) = spval
3420 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3421 ,l,nrec,fldsize,spval,tmp &
3422 ,recname,reclevtyp,reclev,varname,vcoordname &
3430 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3431 ,l,nrec,fldsize,spval,tmp &
3432 ,recname,reclevtyp,reclev,varname,vcoordname &
3438 if (sm(i,j) /= 0.0) fieldcapa(i,j) = spval
3447 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3448 ,l,nrec,fldsize,spval,tmp &
3449 ,recname,reclevtyp,reclev,varname,vcoordname &
3456 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3457 ,l,nrec,fldsize,spval,tmp &
3458 ,recname,reclevtyp,reclev,varname,vcoordname &
3465 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3466 ,l,nrec,fldsize,spval,tmp &
3467 ,recname,reclevtyp,reclev,varname,vcoordname &
3474 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3475 ,l,nrec,fldsize,spval,tmp &
3476 ,recname,reclevtyp,reclev,varname,vcoordname &
3483 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3484 ,l,nrec,fldsize,spval,tmp &
3485 ,recname,reclevtyp,reclev,varname,vcoordname &
3490 vcoordname=
'nom. top'
3492 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3493 ,l,nrec,fldsize,spval,tmp &
3494 ,recname,reclevtyp,reclev,varname,vcoordname &
3501 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3502 ,l,nrec,fldsize,spval,tmp &
3503 ,recname,reclevtyp,reclev,varname,vcoordname &
3508 vcoordname=
'nom. top'
3510 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3511 ,l,nrec,fldsize,spval,tmp &
3512 ,recname,reclevtyp,reclev,varname,vcoordname &
3519 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3520 ,l,nrec,fldsize,spval,tmp &
3521 ,recname,reclevtyp,reclev,varname,vcoordname &
3528 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3529 ,l,nrec,fldsize,spval,tmp &
3530 ,recname,reclevtyp,reclev,varname,vcoordname &
3534 varname=
'spfhmax_max'
3535 vcoordname=
'2 m above gnd'
3537 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3538 ,l,nrec,fldsize,spval,tmp &
3539 ,recname,reclevtyp,reclev,varname,vcoordname &
3545 varname=
'spfhmin_min'
3546 vcoordname=
'2 m above gnd'
3548 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3549 ,l,nrec,fldsize,spval,tmp &
3550 ,recname,reclevtyp,reclev,varname,vcoordname &
3557 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3558 ,l,nrec,fldsize,spval,tmp &
3559 ,recname,reclevtyp,reclev,varname,vcoordname &
3565 if (sm(i,j) /= 0.0) ssroff(i,j) = spval
3573 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3574 ,l,nrec,fldsize,spval,tmp &
3575 ,recname,reclevtyp,reclev,varname,vcoordname &
3581 if (sm(i,j) /= 0.0) avgedir(i,j) = spval
3589 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3590 ,l,nrec,fldsize,spval,tmp &
3591 ,recname,reclevtyp,reclev,varname,vcoordname &
3597 if (sm(i,j) /= 0.0) avgecan(i,j) = spval
3605 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3606 ,l,nrec,fldsize,spval,tmp &
3607 ,recname,reclevtyp,reclev,varname,vcoordname &
3613 if (sm(i,j) /= 0.0) avgetrans(i,j) = spval
3621 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3622 ,l,nrec,fldsize,spval,tmp &
3623 ,recname,reclevtyp,reclev,varname,vcoordname &
3629 if (sm(i,j)==1.0 .and. sice(i,j)==0.) avgesnow(i,j)=spval
3635 vcoordname=
'0-200 cm down'
3637 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3638 ,l,nrec,fldsize,spval,tmp &
3639 ,recname,reclevtyp,reclev,varname,vcoordname &
3645 if (sm(i,j) /= 0.0) smstot(i,j) = spval
3653 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3654 ,l,nrec,fldsize,spval,tmp &
3655 ,recname,reclevtyp,reclev,varname,vcoordname &
3661 if (sm(i,j) /= 0.0) snopcx(i,j) = spval
3680 if ( k == 1) varname=
'duem001'
3681 if ( k == 2) varname=
'duem002'
3682 if ( k == 3) varname=
'duem003'
3683 if ( k == 4) varname=
'duem004'
3684 if ( k == 5) varname=
'duem005'
3685 vcoordname=
'atmos sfc'
3687 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3688 ,l,nrec,fldsize,spval,tmp &
3689 ,recname,reclevtyp,reclev,varname,vcoordname&
3696 if ( k == 1) varname=
'dust1sd'
3697 if ( k == 2) varname=
'dust2sd'
3698 if ( k == 3) varname=
'dust3sd'
3699 if ( k == 4) varname=
'dust4sd'
3700 if ( k == 5) varname=
'dsut5sd'
3701 vcoordname=
'atmos sfc'
3703 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3704 ,l,nrec,fldsize,spval,tmp &
3705 ,recname,reclevtyp,reclev,varname,vcoordname&
3712 if ( k == 1) varname=
'dust1dp'
3713 if ( k == 2) varname=
'dust2dp'
3714 if ( k == 3) varname=
'dust3dp'
3715 if ( k == 4) varname=
'dust4dp'
3716 if ( k == 5) varname=
'dust5dp'
3717 vcoordname=
'atmos sfc'
3719 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3720 ,l,nrec,fldsize,spval,tmp &
3721 ,recname,reclevtyp,reclev,varname,vcoordname&
3723 print *,
'dudp,ck=',maxval(dudp(1:im,jsta:jend,k)), &
3724 minval(dudp(1:im,jsta:jend,k))
3730 if ( k == 1) varname=
'dust1wtl'
3731 if ( k == 2) varname=
'dust2wtl'
3732 if ( k == 3) varname=
'dust3wtl'
3733 if ( k == 4) varname=
'dust4wtl'
3734 if ( k == 5) varname=
'dust5wtl'
3735 vcoordname=
'atmos sfc'
3737 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3738 ,l,nrec,fldsize,spval,tmp &
3739 ,recname,reclevtyp,reclev,varname,vcoordname&
3744 if ( k == 1) varname=
'dust1wtc'
3745 if ( k == 2) varname=
'dust2wtc'
3746 if ( k == 3) varname=
'dust3wtc'
3747 if ( k == 4) varname=
'dust4wtc'
3748 if ( k == 5) varname=
'dust5wtc'
3749 vcoordname=
'atmos sfc'
3751 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3752 ,l,nrec,fldsize,spval,tmp &
3753 ,recname,reclevtyp,reclev,varname,vcoordname&
3759 if ( k == 1) varname=
'ssem001'
3760 if ( k == 2) varname=
'ssem002'
3761 if ( k == 3) varname=
'ssem003'
3762 if ( k == 4) varname=
'ssem004'
3763 if ( k == 5) varname=
'ssem005'
3764 vcoordname=
'atmos sfc'
3766 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3767 ,l,nrec,fldsize,spval,tmp &
3768 ,recname,reclevtyp,reclev,varname,vcoordname&
3774 if ( k == 1) varname=
'seas1sd'
3775 if ( k == 2) varname=
'seas2sd'
3776 if ( k == 3) varname=
'seas3sd'
3777 if ( k == 4) varname=
'seas4sd'
3778 if ( k == 5) varname=
'seas5sd'
3781 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3782 ,l,nrec,fldsize,spval,tmp &
3783 ,recname,reclevtyp,reclev,varname,vcoordname&
3790 if ( k == 1) varname=
'seas1dp'
3791 if ( k == 2) varname=
'seas2dp'
3792 if ( k == 3) varname=
'seas3dp'
3793 if ( k == 4) varname=
'seas4dp'
3794 if ( k == 5) varname=
'seas5dp'
3795 vcoordname=
'atmos sfc'
3797 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3798 ,l,nrec,fldsize,spval,tmp &
3799 ,recname,reclevtyp,reclev,varname,vcoordname&
3805 if ( k == 1) varname=
'seas1wtl'
3806 if ( k == 2) varname=
'seas2wtl'
3807 if ( k == 3) varname=
'seas3wtl'
3808 if ( k == 4) varname=
'seas4wtl'
3809 if ( k == 5) varname=
'seas5wtl'
3810 vcoordname=
'atmos sfc'
3812 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3813 ,l,nrec,fldsize,spval,tmp &
3814 ,recname,reclevtyp,reclev,varname,vcoordname&
3820 if ( k == 1) varname=
'seas1wtc'
3821 if ( k == 2) varname=
'seas1wtc'
3822 if ( k == 3) varname=
'seas1wtc'
3823 if ( k == 4) varname=
'seas1wtc'
3824 if ( k == 5) varname=
'seas1wtc'
3825 vcoordname=
'atmos sfc'
3827 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3828 ,l,nrec,fldsize,spval,tmp &
3829 ,recname,reclevtyp,reclev,varname,vcoordname&
3835 if ( k == 1) varname=
'bceman'
3836 if ( k == 2) varname=
'bcembb'
3837 vcoordname=
'atmos sfc'
3839 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3840 ,l,nrec,fldsize,spval,tmp &
3841 ,recname,reclevtyp,reclev,varname,vcoordname&
3847 if ( k == 1) varname=
'bc1sd'
3848 if ( k == 2) varname=
'bc2sd'
3849 vcoordname=
'atmos sfc'
3851 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3852 ,l,nrec,fldsize,spval,tmp &
3853 ,recname,reclevtyp,reclev,varname,vcoordname&
3859 if ( k == 1) varname=
'bc1dp'
3860 if ( k == 2) varname=
'bc2dp'
3861 vcoordname=
'atmos sfc'
3863 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3864 ,l,nrec,fldsize,spval,tmp &
3865 ,recname,reclevtyp,reclev,varname,vcoordname&
3871 if ( k == 1) varname=
'bc1wtl'
3872 if ( k == 2) varname=
'bc2wtl'
3873 vcoordname=
'atmos sfc'
3875 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3876 ,l,nrec,fldsize,spval,tmp &
3877 ,recname,reclevtyp,reclev,varname,vcoordname&
3883 if ( k == 1) varname=
'bc1wtc'
3884 if ( k == 2) varname=
'bc2wtc'
3885 vcoordname=
'atmos sfc'
3887 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3888 ,l,nrec,fldsize,spval,tmp &
3889 ,recname,reclevtyp,reclev,varname,vcoordname&
3895 if ( k == 1) varname=
'oceman'
3896 if ( k == 2) varname=
'ocembb'
3897 vcoordname=
'atmos sfc'
3899 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3900 ,l,nrec,fldsize,spval,tmp &
3901 ,recname,reclevtyp,reclev,varname,vcoordname&
3907 if ( k == 1) varname=
'oc1sd'
3908 if ( k == 2) varname=
'oc2sd'
3909 vcoordname=
'atmos sfc'
3911 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3912 ,l,nrec,fldsize,spval,tmp &
3913 ,recname,reclevtyp,reclev,varname,vcoordname&
3919 if ( k == 1) varname=
'oc1dp'
3920 if ( k == 2) varname=
'oc2dp'
3921 vcoordname=
'atmos sfc'
3923 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3924 ,l,nrec,fldsize,spval,tmp &
3925 ,recname,reclevtyp,reclev,varname,vcoordname&
3931 if ( k == 1) varname=
'oc1wtl'
3932 if ( k == 2) varname=
'oc2wtl'
3933 vcoordname=
'atmos sfc'
3935 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3936 ,l,nrec,fldsize,spval,tmp &
3937 ,recname,reclevtyp,reclev,varname,vcoordname&
3943 if ( k == 1) varname=
'oc1wtc'
3944 if ( k == 2) varname=
'oc2wtc'
3945 vcoordname=
'atmos sfc'
3947 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3948 ,l,nrec,fldsize,spval,tmp &
3949 ,recname,reclevtyp,reclev,varname,vcoordname&
3957 call assignnemsiovar(im,jsta,jend,jsta_2l,jend_2u &
3958 ,l,nrec,fldsize,spval,tmp &
3959 ,recname,reclevtyp,reclev,varname,vcoordname&
3964 call nemsio_close(ffile,iret=status)
3965 deallocate(tmp,recname,reclevtyp,reclev)
4012 call collect_loc(gdlat,dummy)
4014 latstart = nint(dummy(1,1)*gdsdegr)
4015 latlast = nint(dummy(im,jm)*gdsdegr)
4016 print*,
'laststart,latlast B bcast= ',latstart,latlast,
'gdsdegr=',gdsdegr,&
4017 'dummy(1,1)=',dummy(1,1),dummy(im,jm),
'gdlat=',gdlat(1,1)
4019 call mpi_bcast(latstart,1,mpi_integer,0,mpi_comm_comp,irtn)
4020 call mpi_bcast(latlast,1,mpi_integer,0,mpi_comm_comp,irtn)
4021 write(6,*)
'laststart,latlast,me A calling bcast=',latstart,latlast,me
4022 call collect_loc(gdlon,dummy)
4024 lonstart = nint(dummy(1,1)*gdsdegr)
4025 lonlast = nint(dummy(im,jm)*gdsdegr)
4027 call mpi_bcast(lonstart,1,mpi_integer,0,mpi_comm_comp,irtn)
4028 call mpi_bcast(lonlast, 1,mpi_integer,0,mpi_comm_comp,irtn)
4030 write(6,*)
'lonstart,lonlast A calling bcast=',lonstart,lonlast
4039 CALL table(ptbl,ttbl,pt_tbl, &
4040 rdq,rdth,rdp,rdthe,pl,thl,qs0,sqs,sthe,the0)
4042 CALL tableq(ttblq,rdpq,rdtheq,plq,thl,stheq,the0q)
4047 WRITE(6,*)
' SPL (POSTED PRESSURE LEVELS) BELOW: '
4048 WRITE(6,51) (spl(l),l=1,lsm)
4049 50
FORMAT(14(f4.1,1x))
4050 51
FORMAT(8(f8.1,1x))
4055 alsl(l) = log(spl(l))
4060 print*,
'writing out igds'
4064 if(maptype == 1)
THEN
4066 WRITE(6,*)
'igd(1)=',3
4069 WRITE(igdout)latstart
4070 WRITE(igdout)lonstart
4077 WRITE(igdout)truelat2
4078 WRITE(igdout)truelat1
4080 ELSE IF(maptype == 2)
THEN
4084 WRITE(igdout)latstart
4085 WRITE(igdout)lonstart
4092 WRITE(igdout)truelat2
4093 WRITE(igdout)truelat1
4099 if (truelat1 < 0.)
THEN
4105 CALL msfps(lat,truelat1*0.001,psmapf)
4107 ELSE IF(maptype == 3)
THEN
4111 WRITE(igdout)latstart
4112 WRITE(igdout)lonstart
4114 WRITE(igdout)latlast
4115 WRITE(igdout)lonlast
4116 WRITE(igdout)truelat1
4122 ELSE IF(maptype == 0 .OR. maptype == 203)
THEN
4126 WRITE(igdout)latstart
4127 WRITE(igdout)lonstart
4144 subroutine rg2gg(im,jm,numi,a)
4148 integer,
intent(in):: im,jm,numi(jm)
4149 real,
intent(inout):: a(im,jm)
4153 r =
real(numi(j))/
real(im)
4155 ir = mod(nint((ig-1)*r),numi(j)) + 1
4162 end subroutine rg2gg
4163 subroutine gg2rg(im,jm,numi,a)
4167 integer,
intent(in):: im,jm,numi(jm)
4168 real,
intent(inout):: a(im,jm)
4172 r =
real(numi(j))/
real(im)
4174 ig = nint((ir-1)/r) + 1
4181 end subroutine gg2rg
4183 subroutine uninterpred(iord,kmsk,lonsperlat,lonr,latr,fi,f)
4187 integer,
intent(in) :: iord, lonr, latr
4188 integer,
intent(in) :: kmsk(lonr,latr), lonsperlat(latr)
4189 real,
intent(in) :: fi(lonr,latr)
4190 real,
intent(out) :: f(lonr,latr)
4195 lons = lonsperlat(j)
4196 if(lons /= lonr)
then
4197 call intlon(iord,1,lons,lonr,kmsk(1,j),fi(1,j),f(1,j))
4203 subroutine intlon(iord,imsk,m1,m2,k1,f1,f2)
4205 integer,
intent(in) :: iord,imsk,m1,m2
4206 integer,
intent(in) :: k1(m1)
4207 real,
intent(in) :: f1(m1)
4208 real,
intent(out):: f2(m2)
4211 r =
real(m1)/
real(m2)
4216 if(iord == 2 .and. (imsk == 0 .or. k1(il) == k1(ir)))
then
4217 f2(i2) = f1(il)*(il-x1) + f1(ir)*(x1-il+1)
4219 in = mod(nint(x1),m1) + 1
4223 end subroutine intlon
subroutine modstuff2(im, ix, km, idvc, idsl, nvcoord, vcoord, ps, psx, psy, d, u, v, pi, pm, om, me)
modstuff2() computes model coordinate dependent functions.
elemental real function, public fpvsnew(t)
calcape() computes CAPE/CINS and other storm related variables.