20 SUBROUTINE initpost_netcdf(ncid2d,ncid3d)
24 use vrbls4d, only: dust, salt, suso, soot, waso
25 use vrbls3d, only: t, q, uh, vh, pmid, pint, alpint, dpres, zint, zmid, o3, &
26 qqr, qqs, cwm, qqi, qqw, omga, rhomid, q2, cfr, rlwtt, rswtt, tcucn, &
27 tcucns, train, el_pbl, exch_h, vdifftt, vdiffmois, dconvmois, nradtt, &
28 o3vdiff, o3prod, o3tndy, mwpv, unknown, vdiffzacce, zgdrag,cnvctummixing, &
29 vdiffmacce, mgdrag, cnvctvmmixing, ncnvctcfrac, cnvctumflx, cnvctdmflx, &
30 cnvctzgdrag, sconvmois, cnvctmgdrag, cnvctdetmflx, duwt, duem, dusd, dudp, &
31 wh, qqg, ref_10cm, qqnifa, qqnwfa, pmtf, ozcon
33 use vrbls2d, only: f, pd, fis, pblh, ustar, z0, ths, qs, twbs, qwbs, avgcprate, &
34 cprate, avgprec, prec, lspa, sno, si, cldefi, th10, q10, tshltr, pshltr, &
35 tshltr, albase, avgalbedo, avgtcdc, czen, czmean, mxsnal, landfrac, radot, sigt4, &
36 cfrach, cfracl, cfracm, avgcfrach, qshltr, avgcfracl, avgcfracm, cnvcfr, &
37 islope, cmc, grnflx, vegfrc, acfrcv, ncfrcv, acfrst, ncfrst, ssroff, &
38 bgroff, rlwin, rlwtoa, cldwork, alwin, alwout, alwtoa, rswin, rswinc, &
39 rswout, aswin, auvbin, auvbinc, aswout, aswtoa, sfcshx, sfclhx, subshx, &
40 snopcx, sfcux, sfcvx, sfcuxi, sfcvxi, sfcuvx, gtaux, gtauy, potevp, u10, v10, smstav, &
41 smstot, ivgtyp, isltyp, sfcevp, sfcexc, acsnow, acsnom, sst, thz0, qz0, &
42 uz0, vz0, ptop, htop, pbot, hbot, ptopl, pbotl, ttopl, ptopm, pbotm, ttopm, &
43 ptoph, pboth, pblcfr, ttoph, runoff, tecan, tetran, tedir, twa, maxtshltr, &
44 mintshltr, maxrhshltr, fdnsst, &
45 minrhshltr, dzice, smcwlt, suntime, fieldcapa, htopd, hbotd, htops, hbots, &
46 cuppt, dusmass, ducmass, dusmass25, ducmass25, aswintoa,rel_vort_maxhy1, &
47 maxqshltr, minqshltr, acond, sr, u10h, v10h,refd_max, w_up_max, w_dn_max, &
48 up_heli_max,up_heli_min,up_heli_max03,up_heli_min03,rel_vort_max01,u10max, v10max, &
49 avgedir,avgecan,paha,pahi,avgetrans,avgesnow,avgprec_cont,avgcprate_cont,rel_vort_max, &
50 avisbeamswin,avisdiffswin,airbeamswin,airdiffswin,refdm10c_max,wspd10max, &
51 alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
52 ti,aod550,du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550,prate_max, &
54 use soil, only: sldpth, sllevel, sh2o, smc, stc
55 use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
56 use physcons_post, only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
57 eps => con_eps, epsm1 => con_epsm1
58 use params_mod, only: erad, dtr, tfrz, h1, d608, rd, p1000, capa,pi
59 use lookup_mod, only: thl, plq, ptbl, ttbl, rdq, rdth, rdp, rdthe, pl, qs0, sqs, sthe, &
60 ttblq, rdpq, rdtheq, stheq, the0q, the0
61 use ctlblk_mod
, only: me, mpi_comm_comp, icnt, idsp, jsta, jend, ihrst, idat, sdat, ifhr, &
62 ifmin, filename, tprec, tclod, trdlw, trdsw, tsrfc, tmaxmin, td3d, restrt, sdat, &
63 jend_m, imin, imp_physics, dt, spval, pdtop, pt, qmin, nbin_du, nphs, dtq2, ardlw,&
64 ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
65 jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
66 nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameflux, filenameaer, &
67 isf_surface_physics,rdaod, aqfcmaq_on, modelname
68 use gridspec_mod
, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
69 dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, &
70 latstartv, latlastv, cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r, standlon
76 integer,
parameter :: nvar2d=48
78 integer :: nvar3d, numdims
99 real,
parameter :: gravi = 1.0/grav
100 character(len=20) :: varname, vcoordname
101 integer :: status, fldsize, fldst, recn, recn_vvel
102 character startdate*19,sysdepinfo*80,cgar*1
103 character startdate2(19)*4
104 logical :: read_lonlat=.true.
111 LOGICAL runb,singlrst,subpost,nest,hydro,ioomg,ioall
112 logical,
parameter :: debugprint = .false., zerout = .false.
114 logical :: convert_rad_to_deg=.false.
115 CHARACTER*32 varcharval
118 CHARACTER fname*255,envar*50
119 INTEGER idate(8),jdate(8),jpds(200),jgds(200),kpds(200),kgds(200)
134 integer ii,jj,js,je,iyear,imn,iday,itmp,ioutcount,istatus, &
135 i,j,l,ll,k,kf,irtn,igdout,n,index,nframe, &
136 nframed2,iunitd3d,ierr,idum,iret,nrec,idrt
137 integer ncid3d,ncid2d,varid,nhcas
138 real tstart,tlmh,tsph,es,fact,soilayert,soilayerb,zhour,dum, &
139 tvll,pmll,tv, tx1, tx2
141 character*20,
allocatable :: recname(:)
142 integer,
allocatable :: reclev(:), kmsk(:,:)
143 real,
allocatable :: glat1d(:), glon1d(:), qstl(:)
144 real,
allocatable :: wrk1(:,:), wrk2(:,:)
145 real,
allocatable :: p2d(:,:), t2d(:,:), q2d(:,:), &
146 qs2d(:,:), cw2d(:,:), cfr2d(:,:)
147 real,
dimension(lm+1) :: ak5, bk5
148 real*8,
allocatable :: pm2d(:,:), pi2d(:,:)
149 real,
allocatable :: tmp(:)
150 real :: buf(im,jsta_2l:jend_2u)
151 real :: buf3d(im,jsta_2l:jend_2u,lm)
157 integer isa, jsa, latghf, jtem, idvc, idsl, nvcoord, ip1, nn, npass
159 integer,
parameter :: npass2=5, npass3=30
160 real,
parameter :: third=1.0/3.0
161 INTEGER,
DIMENSION(2) :: ij4min, ij4max
162 REAL :: omgmin, omgmax
163 real,
allocatable :: d2d(:,:), u2d(:,:), v2d(:,:), omga2d(:,:)
164 REAL,
ALLOCATABLE :: ps2d(:,:),psx2d(:,:),psy2d(:,:)
165 real,
allocatable :: div3d(:,:,:)
166 real(kind=4),
allocatable :: vcrd(:,:)
171 real,
allocatable :: aacd(:,:,:), aalj(:,:,:) &
172 ,aalk1j(:,:,:), aalk2j(:,:,:) &
173 ,abnz1j(:,:,:), abnz2j(:,:,:), abnz3j(:,:,:) &
174 ,acaj(:,:,:), acet(:,:,:) &
175 ,acli(:,:,:), aclj(:,:,:), aclk(:,:,:) &
176 ,acors(:,:,:), acro_primary(:,:,:) &
177 ,acrolein(:,:,:), aeci(:,:,:) &
178 ,aecj(:,:,:), afej(:,:,:) &
180 ,ah2oi(:,:,:), ah2oj(:,:,:), ah2ok(:,:,:) &
181 ,ah3opi(:,:,:), ah3opj(:,:,:), ah3opk(:,:,:) &
182 ,aiso1j(:,:,:), aiso2j(:,:,:), aiso3j(:,:,:) &
183 ,aivpo1j(:,:,:), akj(:,:,:) &
184 ,ald2(:,:,:), ald2_primary(:,:,:) &
186 ,alvoo1i(:,:,:), alvoo1j(:,:,:) &
187 ,alvoo2i(:,:,:), alvoo2j(:,:,:) &
188 ,alvpo1i(:,:,:), alvpo1j(:,:,:) &
189 ,amgj(:,:,:), amnj(:,:,:) &
190 ,amgk(:,:,:), akk(:,:,:), acak(:,:,:) &
191 ,anai(:,:,:), anaj(:,:,:), anak(:,:,:) &
192 ,anh4i(:,:,:), anh4j(:,:,:), anh4k(:,:,:) &
193 ,ano3i(:,:,:), ano3j(:,:,:), ano3k(:,:,:) &
194 ,aolgaj(:,:,:), aolgbj(:,:,:), aorgcj(:,:,:) &
195 ,aomi(:,:,:), aomj(:,:,:) &
196 ,aothri(:,:,:), aothrj(:,:,:) &
197 ,apah1j(:,:,:), apah2j(:,:,:), apah3j(:,:,:) &
198 ,apomi(:,:,:), apomj(:,:,:) &
199 ,apcsoj(:,:,:), aseacat(:,:,:), asij(:,:,:) &
200 ,aso4i(:,:,:), aso4j(:,:,:), aso4k(:,:,:) &
201 ,asoil(:,:,:), asqtj(:,:,:) &
202 ,asomi(:,:,:), asomj(:,:,:) &
203 ,asvoo1i(:,:,:), asvoo1j(:,:,:) &
204 ,asvoo2i(:,:,:), asvoo2j(:,:,:) &
206 ,asvpo1i(:,:,:), asvpo1j(:,:,:) &
207 ,asvpo2i(:,:,:), asvpo2j(:,:,:) &
210 ,atol1j(:,:,:), atol2j(:,:,:), atol3j(:,:,:) &
211 ,atoti(:,:,:), atotj(:,:,:), atotk(:,:,:) &
212 ,atrp1j(:,:,:), atrp2j(:,:,:) &
213 ,axyl1j(:,:,:), axyl2j(:,:,:), axyl3j(:,:,:) &
214 ,pm25ac(:,:,:), pm25at(:,:,:), pm25co(:,:,:)
217 if (me == 0) print *,
' aqfcmaq_on=', aqfcmaq_on
221 allocate(aacd(im,jsta_2l:jend_2u,lm))
222 allocate(aalj(im,jsta_2l:jend_2u,lm))
223 allocate(aalk1j(im,jsta_2l:jend_2u,lm))
224 allocate(aalk2j(im,jsta_2l:jend_2u,lm))
226 allocate(abnz1j(im,jsta_2l:jend_2u,lm))
227 allocate(abnz2j(im,jsta_2l:jend_2u,lm))
228 allocate(abnz3j(im,jsta_2l:jend_2u,lm))
230 allocate(acaj(im,jsta_2l:jend_2u,lm))
231 allocate(acet(im,jsta_2l:jend_2u,lm))
233 allocate(acli(im,jsta_2l:jend_2u,lm))
234 allocate(aclj(im,jsta_2l:jend_2u,lm))
235 allocate(aclk(im,jsta_2l:jend_2u,lm))
237 allocate(acors(im,jsta_2l:jend_2u,lm))
238 allocate(acro_primary(im,jsta_2l:jend_2u,lm))
239 allocate(acrolein(im,jsta_2l:jend_2u,lm))
240 allocate(aeci(im,jsta_2l:jend_2u,lm))
241 allocate(aecj(im,jsta_2l:jend_2u,lm))
242 allocate(afej(im,jsta_2l:jend_2u,lm))
243 allocate(aglyj(im,jsta_2l:jend_2u,lm))
245 allocate(ah2oi(im,jsta_2l:jend_2u,lm))
246 allocate(ah2oj(im,jsta_2l:jend_2u,lm))
247 allocate(ah2ok(im,jsta_2l:jend_2u,lm))
249 allocate(ah3opi(im,jsta_2l:jend_2u,lm))
250 allocate(ah3opj(im,jsta_2l:jend_2u,lm))
251 allocate(ah3opk(im,jsta_2l:jend_2u,lm))
253 allocate(aiso1j(im,jsta_2l:jend_2u,lm))
254 allocate(aiso2j(im,jsta_2l:jend_2u,lm))
255 allocate(aiso3j(im,jsta_2l:jend_2u,lm))
257 allocate(aivpo1j(im,jsta_2l:jend_2u,lm))
258 allocate(akj(im,jsta_2l:jend_2u,lm))
260 allocate(ald2(im,jsta_2l:jend_2u,lm))
261 allocate(ald2_primary(im,jsta_2l:jend_2u,lm))
263 allocate(aldx(im,jsta_2l:jend_2u,lm))
265 allocate(alvoo1i(im,jsta_2l:jend_2u,lm))
266 allocate(alvoo1j(im,jsta_2l:jend_2u,lm))
267 allocate(alvoo2i(im,jsta_2l:jend_2u,lm))
268 allocate(alvoo2j(im,jsta_2l:jend_2u,lm))
269 allocate(alvpo1i(im,jsta_2l:jend_2u,lm))
270 allocate(alvpo1j(im,jsta_2l:jend_2u,lm))
272 allocate(amgj(im,jsta_2l:jend_2u,lm))
273 allocate(amnj(im,jsta_2l:jend_2u,lm))
275 allocate(anai(im,jsta_2l:jend_2u,lm))
276 allocate(anaj(im,jsta_2l:jend_2u,lm))
277 allocate(anak(im,jsta_2l:jend_2u,lm))
279 allocate(anh4i(im,jsta_2l:jend_2u,lm))
280 allocate(anh4j(im,jsta_2l:jend_2u,lm))
281 allocate(anh4k(im,jsta_2l:jend_2u,lm))
283 allocate(ano3i(im,jsta_2l:jend_2u,lm))
284 allocate(ano3j(im,jsta_2l:jend_2u,lm))
285 allocate(ano3k(im,jsta_2l:jend_2u,lm))
287 allocate(aolgaj(im,jsta_2l:jend_2u,lm))
288 allocate(aolgbj(im,jsta_2l:jend_2u,lm))
290 allocate(aomi(im,jsta_2l:jend_2u,lm))
291 allocate(aomj(im,jsta_2l:jend_2u,lm))
293 allocate(aorgcj(im,jsta_2l:jend_2u,lm))
295 allocate(aothri(im,jsta_2l:jend_2u,lm))
296 allocate(aothrj(im,jsta_2l:jend_2u,lm))
298 allocate(apah1j(im,jsta_2l:jend_2u,lm))
299 allocate(apah2j(im,jsta_2l:jend_2u,lm))
300 allocate(apah3j(im,jsta_2l:jend_2u,lm))
302 allocate(apcsoj(im,jsta_2l:jend_2u,lm))
304 allocate(apomi(im,jsta_2l:jend_2u,lm))
305 allocate(apomj(im,jsta_2l:jend_2u,lm))
307 allocate(aseacat(im,jsta_2l:jend_2u,lm))
308 allocate(asij(im,jsta_2l:jend_2u,lm))
310 allocate(aso4i(im,jsta_2l:jend_2u,lm))
311 allocate(aso4j(im,jsta_2l:jend_2u,lm))
312 allocate(aso4k(im,jsta_2l:jend_2u,lm))
313 allocate(asoil(im,jsta_2l:jend_2u,lm))
315 allocate(asomi(im,jsta_2l:jend_2u,lm))
316 allocate(asomj(im,jsta_2l:jend_2u,lm))
318 allocate(asqtj(im,jsta_2l:jend_2u,lm))
320 allocate(asvoo1i(im,jsta_2l:jend_2u,lm))
321 allocate(asvoo1j(im,jsta_2l:jend_2u,lm))
322 allocate(asvoo2i(im,jsta_2l:jend_2u,lm))
323 allocate(asvoo2j(im,jsta_2l:jend_2u,lm))
324 allocate(asvoo3j(im,jsta_2l:jend_2u,lm))
326 allocate(asvpo1i(im,jsta_2l:jend_2u,lm))
327 allocate(asvpo1j(im,jsta_2l:jend_2u,lm))
328 allocate(asvpo2i(im,jsta_2l:jend_2u,lm))
329 allocate(asvpo2j(im,jsta_2l:jend_2u,lm))
330 allocate(asvpo3j(im,jsta_2l:jend_2u,lm))
332 allocate(atij(im,jsta_2l:jend_2u,lm))
334 allocate(atol1j(im,jsta_2l:jend_2u,lm))
335 allocate(atol2j(im,jsta_2l:jend_2u,lm))
336 allocate(atol3j(im,jsta_2l:jend_2u,lm))
338 allocate(atoti(im,jsta_2l:jend_2u,lm))
339 allocate(atotj(im,jsta_2l:jend_2u,lm))
340 allocate(atotk(im,jsta_2l:jend_2u,lm))
342 allocate(atrp1j(im,jsta_2l:jend_2u,lm))
343 allocate(atrp2j(im,jsta_2l:jend_2u,lm))
345 allocate(axyl1j(im,jsta_2l:jend_2u,lm))
346 allocate(axyl2j(im,jsta_2l:jend_2u,lm))
347 allocate(axyl3j(im,jsta_2l:jend_2u,lm))
349 allocate(pm25ac(im,jsta_2l:jend_2u,lm))
350 allocate(pm25at(im,jsta_2l:jend_2u,lm))
351 allocate(pm25co(im,jsta_2l:jend_2u,lm))
358 WRITE(6,*)
'INITPOST: ENTER INITPOST_NETCDF'
359 WRITE(6,*)
'me=',me, &
360 'jsta_2l=',jsta_2l,
'jend_2u=', &
364 jsa = (jsta+jend) / 2
367 do j = jsta_2l, jend_2u
373 status=nf90_get_att(ncid3d,nf90_global,
'ak',ak5)
375 print*,
'ak not found; assigning missing value'
378 if(me==0)print*,
'ak5= ',ak5
380 status=nf90_get_att(ncid3d,nf90_global,
'idrt',idrt)
382 print*,
'idrt not in netcdf file,reading grid'
383 status=nf90_get_att(ncid3d,nf90_global,
'grid',varcharval)
385 print*,
'idrt and grid not in netcdf file, set default to latlon'
389 if(trim(varcharval)==
'rotated_latlon')
then
392 status=nf90_get_att(ncid3d,nf90_global,
'cen_lon',dum_const)
394 print*,
'cen_lon not found; assigning missing value'
398 cenlon=nint((dum_const+360.)*gdsdegr)
400 cenlon=dum_const*gdsdegr
403 status=nf90_get_att(ncid3d,nf90_global,
'cen_lat',dum_const)
405 print*,
'cen_lat not found; assigning missing value'
408 cenlat=dum_const*gdsdegr
411 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
413 print*,
'lonstart_r not found; assigning missing value'
417 lonstart_r=nint((dum_const+360.)*gdsdegr)
419 lonstart_r=dum_const*gdsdegr
422 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
424 print*,
'latstart_r not found; assigning missing value'
427 latstart_r=dum_const*gdsdegr
430 status=nf90_get_att(ncid3d,nf90_global,
'lon2',dum_const)
432 print*,
'lonlast_r not found; assigning missing value'
436 lonlast_r=nint((dum_const+360.)*gdsdegr)
438 lonlast_r=dum_const*gdsdegr
441 status=nf90_get_att(ncid3d,nf90_global,
'lat2',dum_const)
443 print*,
'latlast_r not found; assigning missing value'
446 latlast_r=dum_const*gdsdegr
449 status=nf90_get_att(ncid3d,nf90_global,
'dlon',dum_const)
451 print*,
'dlmd not found; assigning missing value'
454 dxval=dum_const*gdsdegr
456 status=nf90_get_att(ncid3d,nf90_global,
'dlat',dum_const)
458 print*,
'dphd not found; assigning missing value'
461 dyval=dum_const*gdsdegr
464 print*,
'lonstart,latstart,cenlon,cenlat,dyval,dxval', &
465 lonstart,latstart,cenlon,cenlat,dyval,dxval
468 else if(trim(varcharval)==
'latlon')
then
472 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
474 print*,
'lonstart not found; assigning missing value'
478 lonstart=nint((dum_const+360.)*gdsdegr)
480 lonstart=dum_const*gdsdegr
483 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
485 print*,
'latstart not found; assigning missing value'
488 latstart=dum_const*gdsdegr
491 status=nf90_get_att(ncid3d,nf90_global,
'lon2',dum_const)
493 print*,
'lonlast not found; assigning missing value'
497 lonlast=nint((dum_const+360.)*gdsdegr)
499 lonlast=dum_const*gdsdegr
502 status=nf90_get_att(ncid3d,nf90_global,
'lat2',dum_const)
504 print*,
'latlast not found; assigning missing value'
507 latlast=dum_const*gdsdegr
510 status=nf90_get_att(ncid3d,nf90_global,
'dlon',dum_const)
512 print*,
'dlmd not found; assigning missing value'
515 dxval=dum_const*gdsdegr
517 status=nf90_get_att(ncid3d,nf90_global,
'dlat',dum_const)
519 print*,
'dphd not found; assigning missing value'
522 dyval=dum_const*gdsdegr
525 print*,
'lonstart,latstart,dyval,dxval', &
526 lonstart,lonlast,latstart,latlast,dyval,dxval
530 ELSE IF (trim(varcharval)==
'lambert_conformal')
then
534 status=nf90_get_att(ncid3d,nf90_global,
'cen_lon',dum_const)
536 print*,
'cen_lon not found; assigning missing value'
540 cenlon=nint((dum_const+360.)*gdsdegr)
542 cenlon=dum_const*gdsdegr
545 status=nf90_get_att(ncid3d,nf90_global,
'cen_lat',dum_const)
547 print*,
'cen_lat not found; assigning missing value'
550 cenlat=dum_const*gdsdegr
553 status=nf90_get_att(ncid3d,nf90_global,
'lon1',dum_const)
555 print*,
'lonstart not found; assigning missing value'
559 lonstart=nint((dum_const+360.)*gdsdegr)
561 lonstart=dum_const*gdsdegr
564 status=nf90_get_att(ncid3d,nf90_global,
'lat1',dum_const)
566 print*,
'latstart not found; assigning missing value'
569 latstart=dum_const*gdsdegr
572 status=nf90_get_att(ncid3d,nf90_global,
'stdlat1',dum_const)
574 print*,
'stdlat1 not found; assigning missing value'
577 truelat1=dum_const*gdsdegr
579 status=nf90_get_att(ncid3d,nf90_global,
'stdlat2',dum_const)
581 print*,
'stdlat2 not found; assigning missing value'
584 truelat2=dum_const*gdsdegr
587 status=nf90_get_att(ncid3d,nf90_global,
'dx',dum_const)
589 print*,
'dx not found; assigning missing value'
594 status=nf90_get_att(ncid3d,nf90_global,
'dy',dum_const)
596 print*,
'dphd not found; assigning missing value'
603 print*,
'lonstart,latstart,cenlon,cenlat,truelat1,truelat2, &
604 stadlon,dyval,dxval', &
605 lonstart,latstart,cenlon,cenlat,truelat1,truelat2,standlon,dyval,dxval
607 else if(trim(varcharval)==
'gaussian')
then
616 if(me==0)print*,
'idrt MAPTYPE= ',idrt,maptype
625 do j = jsta_2l, jend_2u
636 do j = jsta_2l, jend_2u
644 status=nf90_get_att(ncid3d,nf90_global,
'nhcas',nhcas)
646 print*,
'nhcas not in netcdf file, set default to nonhydro'
649 if(me==0)print*,
'nhcas= ',nhcas
650 if (nhcas == 0 )
then
652 allocate (recname(nrec))
653 recname=[
character(len=20) ::
'ugrd',
'vgrd',
'spfh',
'tmp',
'o3mr', &
654 'presnh',
'dzdt',
'clwmr',
'dpres', &
655 'delz',
'icmr',
'rwmr', &
659 allocate (recname(nrec))
660 recname=[
character(len=20) ::
'ugrd',
'vgrd',
'tmp',
'spfh',
'o3mr', &
661 'hypres',
'clwmr',
'dpres']
666 allocate(glat1d(jm),glon1d(im))
671 status=nf90_inq_varid(ncid3d,
'time',varid)
673 print*,
'time not in netcdf file, stopping'
676 status=nf90_get_att(ncid3d,varid,
'units',varcharval)
678 print*,
'time unit not available'
680 print*,
'time unit read from netcdf file= ',varcharval
683 read(varcharval,101)idate(1),idate(2),idate(3),idate(4),idate(5)
695 101
format(t13,i4,1x,i2,1x,i2,1x,i2,1x,i2)
696 print*,
'idate= ',idate(1:5)
699 status=nf90_inq_varid(ncid3d,
'grid_xt',varid)
700 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
701 if(numdims==1.and.modelname==
"FV3R")
then
710 if (read_lonlat)
then
711 status=nf90_inq_varid(ncid3d,
'lon',varid)
712 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
713 if(debugprint)print*,
'number of dim for gdlon ',numdims
715 status=nf90_inq_varid(ncid3d,
'grid_xt',varid)
716 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
717 if(debugprint)print*,
'number of dim for gdlon ',numdims
720 status=nf90_get_var(ncid3d,varid,glon1d)
723 gdlon(i,j) =
real(glon1d(i),kind=4)
726 lonstart = nint(glon1d(1)*gdsdegr)
727 lonlast = nint(glon1d(im)*gdsdegr)
730 if (maptype == 0)
then
732 lonstart=lonstart+360.*gdsdegr
735 lonlast=lonlast+360.*gdsdegr
740 else if(numdims==2)
then
741 status=nf90_get_var(ncid3d,varid,dummy)
742 if(maxval(abs(dummy))<2.0*pi)convert_rad_to_deg=.true.
743 if(convert_rad_to_deg)
then
746 gdlon(i,j) =
real(dummy(i,j),kind=4)*180./pi
752 gdlon(i,j) =
real(dummy(i,j),kind=4)
756 if(convert_rad_to_deg)
then
757 lonstart = nint(dummy(1,1)*gdsdegr)*180./pi
758 lonlast = nint(dummy(im,jm)*gdsdegr)*180./pi
760 lonstart = nint(dummy(1,1)*gdsdegr)
761 lonlast = nint(dummy(im,jm)*gdsdegr)
765 if (maptype == 0)
then
767 lonstart=lonstart+360.*gdsdegr
770 lonlast=lonlast+360.*gdsdegr
776 print*,
'lonstart,lonlast ',lonstart,lonlast
779 if (read_lonlat)
then
780 status=nf90_inq_varid(ncid3d,
'lat',varid)
781 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
782 if(debugprint)print*,
'number of dim for gdlat ',numdims
784 status=nf90_inq_varid(ncid3d,
'grid_yt',varid)
785 status=nf90_inquire_variable(ncid3d,varid,ndims = numdims)
786 if(debugprint)print*,
'number of dim for gdlat ',numdims
789 status=nf90_get_var(ncid3d,varid,glat1d)
792 gdlat(i,j) =
real(glat1d(j),kind=4)
795 latstart = nint(glat1d(1)*gdsdegr)
796 latlast = nint(glat1d(jm)*gdsdegr)
797 else if(numdims==2)
then
798 status=nf90_get_var(ncid3d,varid,dummy)
799 if(maxval(abs(dummy))<pi)convert_rad_to_deg=.true.
800 if(convert_rad_to_deg)
then
803 gdlat(i,j) =
real(dummy(i,j),kind=4)*180./pi
809 gdlat(i,j) =
real(dummy(i,j),kind=4)
813 if(convert_rad_to_deg)
then
814 latstart = nint(dummy(1,1)*gdsdegr)*180./pi
815 latlast = nint(dummy(im,jm)*gdsdegr)*180./pi
817 latstart = nint(dummy(1,1)*gdsdegr)
818 latlast = nint(dummy(im,jm)*gdsdegr)
821 print*,
'laststart,latlast = ',latstart,latlast
822 if(debugprint)print*,
'me sample gdlon gdlat= ' &
823 ,me,gdlon(isa,jsa),gdlat(isa,jsa)
828 if (me == 0) print *,
'maptype and gridtype is ', &
831 if(gridtype ==
'A')
then
843 print *,
'recname=',trim(recname(i))
849 deallocate(glat1d,glon1d)
851 print*,
'idate = ',(idate(i),i=1,7)
858 print *,me,
'max(gdlat)=', maxval(gdlat), &
859 'max(gdlon)=', maxval(gdlon)
860 CALL exch(gdlat(1,jsta_2l))
861 print *,
'after call EXCH,me=',me
868 dx(i,j) = erad*cos(gdlat(i,j)*dtr) *(gdlon(ip1,j)-gdlon(i,j))*dtr
869 dy(i,j) = erad*(gdlat(i,j+1)-gdlat(i,j))*dtr
875 if(debugprint)print*,
'me sample dx dy= ' &
876 ,me,dx(isa,jsa),dy(isa,jsa)
880 f(i,j) = 1.454441e-4*sin(gdlat(i,j)*dtr)
892 print*,
'start yr mo day hr min =',iyear,imn,iday,ihrst,imin
893 print*,
'processing yr mo day hr min=' &
894 ,idat(3),idat(1),idat(2),idat(4),idat(5)
910 print *,
' idate=',idate
911 print *,
' jdate=',jdate
913 CALL w3difdat(jdate,idate,0,rinc)
915 print *,
' rinc=',rinc
916 ifhr = nint(rinc(2)+rinc(1)*24.)
917 print *,
' ifhr=',ifhr
918 ifmin = nint(rinc(3))
920 print*,
' in INITPOST ifhr ifmin fileName=',ifhr,ifmin,filename
924 print*,
'tstart= ',tstart
930 IF(tstart > 1.0e-2)
THEN
931 ifhr = ifhr+nint(tstart)
935 call w3movdat(rinc,jdate,idate)
940 print*,
'new forecast hours for restrt run= ',ifhr
941 print*,
'new start yr mo day hr min =',sdat(3),sdat(1) &
952 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
953 spval,recname(1),uh(1,jsta_2l,1),lm)
954 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
955 spval,recname(2),vh(1,jsta_2l,1),lm)
956 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
957 spval,recname(3),q(1,jsta_2l,1),lm)
958 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
959 spval,recname(4),t(1,jsta_2l,1),lm)
960 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
961 spval,recname(5),o3(1,jsta_2l,1),lm)
962 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
963 spval,recname(7),wh(1,jsta_2l,1),lm)
964 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
965 spval,recname(8),qqw(1,jsta_2l,1),lm)
966 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
967 spval,recname(9),dpres(1,jsta_2l,1),lm)
968 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
969 spval,recname(10),buf3d(1,jsta_2l,1),lm)
975 if (wh(i,j,l) < spval)
then
976 omga(i,j,l)=(-1.)*wh(i,j,l)*dpres(i,j,l)/abs(buf3d(i,j,l))
984 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
985 spval,recname(11),qqi(1,jsta_2l,1),lm)
986 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
987 spval,recname(12),qqr(1,jsta_2l,1),lm)
988 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
989 spval,recname(13),qqs(1,jsta_2l,1),lm)
990 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
991 spval,recname(14),qqg(1,jsta_2l,1),lm)
997 cwm(i,j,l)=qqg(i,j,l)+qqs(i,j,l)+qqr(i,j,l)+qqi(i,j,l)+qqw(i,j,l)
1000 if(debugprint)print*,
'sample l,t,q,u,v,w= ',isa,jsa,l &
1001 ,t(isa,jsa,l),q(isa,jsa,l),uh(isa,jsa,l),vh(isa,jsa,l) &
1003 if(debugprint)print*,
'sample l cwm for FV3',l, &
1008 if ( imp_physics==11)
then
1010 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1011 spval,varname,cfr(1,jsta_2l,1),lm)
1014 call read_netcdf_3d_para(ncid2d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1015 spval,varname,cfr(1,jsta_2l,1),lm)
1026 if (aqfcmaq_on)
then
1036 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1037 spval,varname,ozcon(1,jsta_2l,1),lm)
1042 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1043 spval,varname,aacd(1,jsta_2l,1),lm)
1046 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1047 spval,varname,aalj(1,jsta_2l,1),lm)
1050 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1051 spval,varname,aalk1j(1,jsta_2l,1),lm)
1054 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1055 spval,varname,aalk2j(1,jsta_2l,1),lm)
1058 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1059 spval,varname,abnz1j(1,jsta_2l,1),lm)
1062 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1063 spval,varname,abnz2j(1,jsta_2l,1),lm)
1066 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1067 spval,varname,abnz3j(1,jsta_2l,1),lm)
1070 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1071 spval,varname,acaj(1,jsta_2l,1),lm)
1074 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1075 spval,varname,acet(1,jsta_2l,1),lm)
1078 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1079 spval,varname,acli(1,jsta_2l,1),lm)
1082 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1083 spval,varname,aclj(1,jsta_2l,1),lm)
1086 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1087 spval,varname,aclk(1,jsta_2l,1),lm)
1090 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1091 spval,varname,acors(1,jsta_2l,1),lm)
1093 varname=
'acro_primary'
1094 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1095 spval,varname,acro_primary(1,jsta_2l,1),lm)
1098 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1099 spval,varname,acrolein(1,jsta_2l,1),lm)
1102 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1103 spval,varname,aeci(1,jsta_2l,1),lm)
1106 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1107 spval,varname,aecj(1,jsta_2l,1),lm)
1110 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1111 spval,varname,afej(1,jsta_2l,1),lm)
1114 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1115 spval,varname,aglyj(1,jsta_2l,1),lm)
1118 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1119 spval,varname,ah2oi(1,jsta_2l,1),lm)
1122 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1123 spval,varname,ah2oj(1,jsta_2l,1),lm)
1126 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1127 spval,varname,ah2ok(1,jsta_2l,1),lm)
1130 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1131 spval,varname,ah3opi(1,jsta_2l,1),lm)
1134 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1135 spval,varname,ah3opj(1,jsta_2l,1),lm)
1138 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1139 spval,varname,ah3opk(1,jsta_2l,1),lm)
1142 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1143 spval,varname,aiso1j(1,jsta_2l,1),lm)
1146 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1147 spval,varname,aiso2j(1,jsta_2l,1),lm)
1150 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1151 spval,varname,aiso3j(1,jsta_2l,1),lm)
1154 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1155 spval,varname,aivpo1j(1,jsta_2l,1),lm)
1158 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1159 spval,varname,akj(1,jsta_2l,1),lm)
1162 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1163 spval,varname,ald2(1,jsta_2l,1),lm)
1165 varname=
'ald2_primary'
1166 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1167 spval,varname,ald2_primary(1,jsta_2l,1),lm)
1170 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1171 spval,varname,aldx(1,jsta_2l,1),lm)
1174 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1175 spval,varname,alvoo1i(1,jsta_2l,1),lm)
1178 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1179 spval,varname,alvoo1j(1,jsta_2l,1),lm)
1182 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1183 spval,varname,alvoo2i(1,jsta_2l,1),lm)
1186 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1187 spval,varname,alvoo2j(1,jsta_2l,1),lm)
1190 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1191 spval,varname,alvpo1i(1,jsta_2l,1),lm)
1194 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1195 spval,varname,alvpo1j(1,jsta_2l,1),lm)
1198 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1199 spval,varname,amgj(1,jsta_2l,1),lm)
1202 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1203 spval,varname,amnj(1,jsta_2l,1),lm)
1206 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1207 spval,varname,anai(1,jsta_2l,1),lm)
1210 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1211 spval,varname,anaj(1,jsta_2l,1),lm)
1214 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1215 spval,varname,anh4i(1,jsta_2l,1),lm)
1218 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1219 spval,varname,anh4j(1,jsta_2l,1),lm)
1222 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1223 spval,varname,anh4k(1,jsta_2l,1),lm)
1226 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1227 spval,varname,ano3i(1,jsta_2l,1),lm)
1230 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1231 spval,varname,ano3j(1,jsta_2l,1),lm)
1234 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1235 spval,varname,ano3k(1,jsta_2l,1),lm)
1238 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1239 spval,varname,aolgaj(1,jsta_2l,1),lm)
1242 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1243 spval,varname,aolgbj(1,jsta_2l,1),lm)
1246 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1247 spval,varname,aorgcj(1,jsta_2l,1),lm)
1250 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1251 spval,varname,aothri(1,jsta_2l,1),lm)
1254 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1255 spval,varname,aothrj(1,jsta_2l,1),lm)
1258 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1259 spval,varname,apah1j(1,jsta_2l,1),lm)
1262 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1263 spval,varname,apah2j(1,jsta_2l,1),lm)
1266 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1267 spval,varname,apah3j(1,jsta_2l,1),lm)
1270 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1271 spval,varname,apcsoj(1,jsta_2l,1),lm)
1274 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1275 spval,varname,aseacat(1,jsta_2l,1),lm)
1278 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1279 spval,varname,asij(1,jsta_2l,1),lm)
1282 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1283 spval,varname,aso4i(1,jsta_2l,1),lm)
1286 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1287 spval,varname,aso4j(1,jsta_2l,1),lm)
1290 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1291 spval,varname,aso4k(1,jsta_2l,1),lm)
1294 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1295 spval,varname,asoil(1,jsta_2l,1),lm)
1298 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1299 spval,varname,asqtj(1,jsta_2l,1),lm)
1302 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1303 spval,varname,asvoo1i(1,jsta_2l,1),lm)
1306 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1307 spval,varname,asvoo1j(1,jsta_2l,1),lm)
1310 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1311 spval,varname,asvoo2i(1,jsta_2l,1),lm)
1314 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1315 spval,varname,asvoo2j(1,jsta_2l,1),lm)
1318 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1319 spval,varname,asvoo3j(1,jsta_2l,1),lm)
1322 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1323 spval,varname,asvpo1i(1,jsta_2l,1),lm)
1326 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1327 spval,varname,asvpo1j(1,jsta_2l,1),lm)
1330 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1331 spval,varname,asvpo2i(1,jsta_2l,1),lm)
1334 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1335 spval,varname,asvpo2j(1,jsta_2l,1),lm)
1338 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1339 spval,varname,asvpo3j(1,jsta_2l,1),lm)
1342 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1343 spval,varname,atij(1,jsta_2l,1),lm)
1346 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1347 spval,varname,atol1j(1,jsta_2l,1),lm)
1350 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1351 spval,varname,atol2j(1,jsta_2l,1),lm)
1354 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1355 spval,varname,atol3j(1,jsta_2l,1),lm)
1358 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1359 spval,varname,atrp1j(1,jsta_2l,1),lm)
1362 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1363 spval,varname,atrp2j(1,jsta_2l,1),lm)
1366 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1367 spval,varname,axyl1j(1,jsta_2l,1),lm)
1370 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1371 spval,varname,axyl2j(1,jsta_2l,1),lm)
1374 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1375 spval,varname,axyl3j(1,jsta_2l,1),lm)
1378 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1379 spval,varname,pm25ac(1,jsta_2l,1),lm)
1382 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1383 spval,varname,pm25at(1,jsta_2l,1),lm)
1386 call read_netcdf_3d_para(ncid3d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1387 spval,varname,pm25co(1,jsta_2l,1),lm)
1430 apomi(i,j,l) = alvpo1i(i,j,l) &
1431 +asvpo1i(i,j,l) + asvpo2i(i,j,l)
1433 apomj(i,j,l) = alvpo1j(i,j,l) &
1434 +asvpo1j(i,j,l) + asvpo2j(i,j,l) + asvpo3j(i,j,l) &
1437 asomi(i,j,l) = alvoo1i(i,j,l) + alvoo2i(i,j,l) &
1438 +asvoo1i(i,j,l) + asvoo2i(i,j,l)
1440 asomj(i,j,l) = axyl1j(i,j,l) + axyl2j(i,j,l) + axyl3j(i,j,l) &
1441 +atol1j(i,j,l) + atol2j(i,j,l) + atol3j(i,j,l) &
1442 +abnz1j(i,j,l) + abnz2j(i,j,l) + abnz3j(i,j,l) &
1443 +aiso1j(i,j,l) + aiso2j(i,j,l) + aiso3j(i,j,l) &
1444 +atrp1j(i,j,l) + atrp2j(i,j,l) + asqtj(i,j,l) &
1445 +aalk1j(i,j,l) + aalk2j(i,j,l) &
1446 +apah1j(i,j,l) + apah2j(i,j,l) + apah3j(i,j,l) &
1447 +aorgcj(i,j,l) + aolgbj(i,j,l) + aolgaj(i,j,l) &
1448 +alvoo1j(i,j,l) + alvoo2j(i,j,l) &
1449 +asvoo1j(i,j,l) + asvoo2j(i,j,l) + asvoo3j(i,j,l) &
1452 aomi(i,j,l) = apomi(i,j,l) + asomi(i,j,l)
1453 aomj(i,j,l) = apomj(i,j,l) + asomj(i,j,l)
1455 atoti(i,j,l) = aso4i(i,j,l) + ano3i(i,j,l) + anh4i(i,j,l) &
1456 + anai(i,j,l) + acli(i,j,l) + aeci(i,j,l) &
1457 + aomi(i,j,l) +aothri(i,j,l)
1459 atotj(i,j,l) = aso4j(i,j,l) + ano3j(i,j,l) + anh4j(i,j,l) &
1460 + anaj(i,j,l) + aclj(i,j,l) + aecj(i,j,l) &
1461 + aomj(i,j,l) +aothrj(i,j,l) &
1462 + afej(i,j,l) + asij(i,j,l) + atij(i,j,l) &
1463 + acaj(i,j,l) + amgj(i,j,l) + amnj(i,j,l) &
1464 + aalj(i,j,l) + akj(i,j,l)
1466 atotk(i,j,l) = asoil(i,j,l) + acors(i,j,l) + aseacat(i,j,l)&
1468 +aso4k(i,j,l) + ano3k(i,j,l) + anh4k(i,j,l)
1470 pmtf(i,j,l) = atoti(i,j,l)*pm25at(i,j,l) &
1471 + atotj(i,j,l)*pm25ac(i,j,l) &
1472 + atotk(i,j,l)*pm25co(i,j,l)
1477 deallocate (aacd, aalj, aalk1j, aalk2j, abnz1j, abnz2j, abnz3j)
1478 deallocate (acaj, acet, acli, aclj, aclk)
1479 deallocate (acors, acro_primary, acrolein)
1481 deallocate (aeci, aecj, afej, aglyj, ah2oi, ah2oj, ah2ok)
1482 deallocate (ah3opi, ah3opj, ah3opk, aiso1j, aiso2j, aiso3j)
1484 deallocate (aivpo1j, akj, ald2, ald2_primary, aldx)
1485 deallocate (alvoo1i, alvoo1j, alvoo2i, alvoo2j, alvpo1i, alvpo1j)
1487 deallocate (amgj, amnj, anai, anaj, anak)
1488 deallocate (anh4i, anh4j, anh4k, ano3i, ano3j, ano3k)
1490 deallocate (aolgaj, aolgbj, aomi, aomj)
1491 deallocate (aorgcj, aothri, aothrj, apah1j, apah2j, apah3j)
1493 deallocate (apcsoj, apomi, apomj, aseacat, asij)
1494 deallocate (aso4i, aso4j, aso4k, asoil, asomi, asomj, asqtj)
1496 deallocate (asvoo1i, asvoo1j, asvoo2i, asvoo2j, asvoo3j)
1497 deallocate (asvpo1i, asvpo1j, asvpo2i, asvpo2j, asvpo3j)
1499 deallocate (atij, atol1j, atol2j, atol3j, atrp1j, atrp2j)
1500 deallocate (atoti, atotj, atotk, axyl1j, axyl2j, axyl3j)
1502 deallocate (pm25ac, pm25at, pm25co)
1508 if (modelname ==
'FV3R')
then
1511 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1512 spval,varname,w_up_max)
1513 if(debugprint)print*,
'sample ',varname,
' = ',w_up_max(isa,jsa)
1516 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1517 spval,varname,w_dn_max)
1518 if(debugprint)print*,
'sample ',varname,
' = ',w_dn_max(isa,jsa)
1521 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1522 spval,varname,up_heli_max)
1523 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_max(isa,jsa)
1526 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1527 spval,varname,up_heli_min)
1528 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_min(isa,jsa)
1531 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1532 spval,varname,up_heli_max03)
1533 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_max03(isa,jsa)
1536 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1537 spval,varname,up_heli_min03)
1538 if(debugprint)print*,
'sample ',varname,
' = ',up_heli_min03(isa,jsa)
1542 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1543 spval,varname,rel_vort_max01)
1544 if(debugprint)print*,
'sample ',varname,
' = ',rel_vort_max01(isa,jsa)
1547 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1548 spval,varname,rel_vort_max)
1549 if(debugprint)print*,
'sample ',varname,
' =',rel_vort_max(isa,jsa)
1551 varname=
'maxvorthy1'
1552 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1553 spval,varname,rel_vort_maxhy1)
1554 if(debugprint)print*,
'sample ',varname,
' =',rel_vort_maxhy1(isa,jsa)
1559 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1560 spval,varname,pint(1,jsta_2l,lp1))
1567 if(debugprint)print*,
'sample ',varname,
' =',pint(isa,jsa,lp1)
1580 if (dpres(i,j,l-1)<spval .and. pint(i,j,l-1)<spval)
then
1581 pint(i,j,l)= pint(i,j,l-1) + dpres(i,j,l-1)
1595 if (pint(i,j,l)<spval .and. pint(i,j,l+1)<spval)
then
1596 pmid(i,j,l)=0.5*(pint(i,j,l)+pint(i,j,l+1))
1608 call read_netcdf_2d_para(ncid3d,im,jsta,jsta_2l,jend,jend_2u, &
1609 spval,varname,zint(1,jsta_2l,lp1))
1610 if(debugprint)print*,
'sample ',varname,
' =',zint(isa,jsa,lp1)
1613 if (zint(i,j,lp1) /= spval)
then
1614 fis(i,j) = zint(i,j,lp1) * grav
1624 if(zint(i,j,l+1)/=spval .and. buf3d(i,j,l)/=spval)
then
1626 zint(i,j,l)=zint(i,j,l+1)+abs(buf3d(i,j,l))
1633 if(debugprint)print*,
'sample zint= ',isa,jsa,l,zint(isa,jsa,l)
1639 alpint(i,j,l)=log(pint(i,j,l))
1647 if(zint(i,j,l+1)/=spval .and. zint(i,j,l)/=spval &
1648 .and. pmid(i,j,l)/=spval)
then
1649 zmid(i,j,l)=zint(i,j,l+1)+(zint(i,j,l)-zint(i,j,l+1))* &
1650 (log(pmid(i,j,l))-alpint(i,j,l+1))/ &
1651 (alpint(i,j,l)-alpint(i,j,l+1))
1652 if(zmid(i,j,l)>1.0e6)print*,
'bad Hmid ',i,j,l,zmid(i,j,l)
1666 status=nf90_close(ncid3d)
1671 status=nf90_get_att(ncid2d,nf90_global,
'IVEGSRC',ivegsrc)
1672 if (status /= 0)
then
1673 print*,varname,
' not found-Assigned 1 for IGBP as default'
1676 if (me == 0) print*,
'IVEGSRC= ',ivegsrc
1681 else if(ivegsrc==1)
then
1683 else if(ivegsrc==0)
then
1686 if (me == 0) print*,
'novegtype= ',novegtype
1688 status=nf90_get_att(ncid2d,nf90_global,
'fhzero',fhzero)
1689 if (status /= 0)
then
1690 print*,
'fhzero not found-Assigned 3 hours as default'
1693 if (me == 0) print*,
'fhzero= ',fhzero
1695 status=nf90_get_att(ncid2d,nf90_global,
'dtp',dtp)
1696 if (status /= 0)
then
1697 print*,
'dtp not found-Assigned 90s as default'
1700 if (me == 0) print*,
'dtp= ',dtp
1702 if(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
then
1703 CALL microinit(imp_physics)
1706 tprec = float(fhzero)
1707 if(ifhr>240)tprec=12.
1714 print*,
'tprec = ',tprec
1718 call read_netcdf_3d_para(ncid2d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1719 spval,varname,ref_10cm(1,jsta_2l,1),lm)
1727 call read_netcdf_3d_para(ncid2d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1728 spval,varname,q2(1,jsta_2l,1),lm)
1732 q2(i,j,l)=q2(i,j,l)/2.0
1739 call read_netcdf_3d_para(ncid2d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1740 spval,varname,qqnifa(1,jsta_2l,1),lm)
1744 call read_netcdf_3d_para(ncid2d,im,jm,jsta,jsta_2l,jend,jend_2u, &
1745 spval,varname,qqnwfa(1,jsta_2l,1),lm)
1748 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1750 if(debugprint)print*,
'sample ',varname,
' =',sm(im/2,(jsta+jend)/2)
1755 if (sm(i,j) /= spval) sm(i,j) = 1.0 - sm(i,j)
1762 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1764 if(debugprint)print*,
'sample ',varname,
' = ',sice(isa,jsa)
1777 if (sm(i,j) /= spval .and. sm(i,j) == 0.0) sice(i,j) = 0.0
1784 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1786 if(debugprint)print*,
'sample ',varname,
' = ',pblh(isa,jsa)
1790 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1791 spval,varname,ustar)
1796 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1802 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1803 spval,varname,sfcexc)
1807 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1808 spval,varname,acond)
1809 if(debugprint)print*,
'sample ',varname,
' = ',acond(isa,jsa)
1812 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1813 spval,varname,avgalbedo)
1817 if (avgalbedo(i,j) /= spval) avgalbedo(i,j) = avgalbedo(i,j) * 0.01
1820 if(debugprint)print*,
'sample ',varname,
' = ',avgalbedo(isa,jsa)
1824 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1832 if (ths(i,j) /= spval)
then
1834 ths(i,j) = ths(i,j) * (p1000/pint(i,j,lp1))**capa
1840 if (sm(i,j) /= 0.0 .and. ths(i,j) < spval )
then
1841 if (sice(i,j) >= 0.15)
then
1844 sst(i,j) = ths(i,j) * (pint(i,j,lp1)/p1000)**capa
1851 if(debugprint)print*,
'sample ',varname,
' = ',ths(isa,jsa)
1855 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1856 spval,varname,fdnsst)
1857 if(debugprint)print*,
'sample ',varname,
' = ',fdnsst(isa,jsa)
1872 varname=
'cpratb_ave'
1873 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1874 spval,varname,avgcprate)
1879 if (avgcprate(i,j) /= spval) avgcprate(i,j) = avgcprate(i,j) * (dtq2*0.001)
1888 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1889 spval,varname,avgcprate_cont)
1893 if (avgcprate_cont(i,j) /= spval) avgcprate_cont(i,j) = &
1894 avgcprate_cont(i,j) * (dtq2*0.001)
1902 varname=
'prateb_ave'
1903 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1904 spval,varname,avgprec)
1908 if(avgprec(i,j) /= spval)avgprec(i,j)=avgprec(i,j)*(dtq2*0.001)
1912 if(debugprint)print*,
'sample ',varname,
' = ',avgprec(isa,jsa)
1917 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1918 spval,varname,avgprec_cont)
1923 if (avgprec_cont(i,j) /=spval)avgprec_cont(i,j)=avgprec_cont(i,j) &
1928 if(debugprint)print*,
'sample ',varname,
' = ',avgprec_cont(isa,jsa)
1931 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1936 if (prec(i,j) /= spval) prec(i,j)=prec(i,j)* (dtq2*0.001) &
1943 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1944 spval,varname,cprate)
1948 if (cprate(i,j) /= spval)
then
1949 cprate(i,j) = max(0.,cprate(i,j)) * (dtq2*0.001) &
1961 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1962 spval,varname,prate_max)
1963 if(debugprint)print*,
'sample ',varname,
' = ',prate_max(isa,jsa)
1966 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1967 spval,varname,refd_max)
1968 if(debugprint)print*,
'sample ',varname,
' = ',refd_max(isa,jsa)
1970 varname=
'refdmax263k'
1971 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1972 spval,varname,refdm10c_max)
1973 if(debugprint)print*,
'sample ',varname,
' = ',refdm10c_max(isa,jsa)
1977 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1978 spval,varname,u10max)
1979 if(debugprint)print*,
'sample ',varname,
' = ',u10max(isa,jsa)
1982 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1983 spval,varname,v10max)
1984 if(debugprint)print*,
'sample ',varname,
' = ',v10max(isa,jsa)
1987 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1988 spval,varname,wspd10max)
1989 if(debugprint)print*,
'sample ',varname,
' = ',wspd10max(isa,jsa)
1993 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
1999 if (sm(i,j) == 1.0 .and. sice(i,j)==0.) sno(i,j) = spval
2002 if(debugprint)print*,
'sample ',varname,
' = ',sno(isa,jsa)
2006 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2007 spval,varname,snoavg)
2011 if (sm(i,j)==1.0 .and. sice(i,j)==0.) snoavg(i,j)=spval
2012 if(snoavg(i,j)/=spval)snoavg(i,j)=snoavg(i,j)/100.
2018 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2023 if (sm(i,j)==1.0 .and. sice(i,j)==0.) si(i,j)=spval
2024 if (si(i,j) /= spval) si(i,j) = si(i,j) * 1000.0
2033 if(debugprint)print*,
'sample ',varname,
' = ',si(isa,jsa)
2037 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2038 spval,varname,tshltr)
2039 if(debugprint)print*,
'sample ',varname,
' = ',tshltr(isa,jsa)
2044 pshltr(i,j)=pint(i,j,lm+1)*exp(-0.068283/tshltr(i,j))
2045 tshltr(i,j)= tshltr(i,j)*(p1000/pshltr(i,j))**capa
2054 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2055 spval,varname,qshltr)
2056 if(debugprint)print*,
'sample ',varname,
' = ',qshltr(isa,jsa)
2059 varname=
'tcdc_aveclm'
2060 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2061 spval,varname,avgtcdc)
2066 if (avgtcdc(i,j) /= spval) avgtcdc(i,j) = avgtcdc(i,j) * 0.01
2069 if(debugprint)print*,
'sample ',varname,
' = ',avgtcdc(isa,jsa)
2073 do j=jsta_2l,jend_2u
2082 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2083 spval,varname,mxsnal)
2087 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2088 spval,varname,landfrac)
2094 tlmh = t(i,j,lm) * t(i,j,lm)
2095 sigt4(i,j) = 5.67e-8 * tlmh * tlmh
2103 do j=jsta_2l,jend_2u
2112 varname=
'tcdc_avehcl'
2113 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2114 spval,varname,avgcfrach)
2119 if (avgcfrach(i,j) /= spval) avgcfrach(i,j) = avgcfrach(i,j) * 0.01
2122 if(debugprint)print*,
'sample ',varname,
' = ',avgcfrach(isa,jsa)
2125 varname=
'tcdc_avelcl'
2126 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2127 spval,varname,avgcfracl)
2132 if (avgcfracl(i,j) /= spval) avgcfracl(i,j) = avgcfracl(i,j) * 0.01
2135 if(debugprint)print*,
'sample ',varname,
' = ',avgcfracl(isa,jsa)
2138 varname=
'tcdc_avemcl'
2139 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2140 spval,varname,avgcfracm)
2145 if (avgcfracm(i,j) /= spval) avgcfracm(i,j) = avgcfracm(i,j) * 0.01
2148 if(debugprint)print*,
'sample ',varname,
' = ',avgcfracm(isa,jsa)
2152 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2153 spval,varname,cnvcfr)
2158 if (cnvcfr(i,j) /= spval) cnvcfr(i,j)= cnvcfr(i,j) * 0.01
2165 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2168 do j = jsta_2l, jend_2u
2170 if (buf(i,j) < spval)
then
2171 islope(i,j) = nint(buf(i,j))
2181 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2186 if (cmc(i,j) /= spval) cmc(i,j) = cmc(i,j) * 0.001
2187 if (sm(i,j) /= 0.0) cmc(i,j) = spval
2193 do j=jsta_2l,jend_2u
2201 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2206 if(sr(i,j) /= spval)
then
2208 sr(i,j)=min(1.,max(0.,sr(i,j)))
2215 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2220 if (sice(i,j) == spval .or. sice(i,j) == 0.) ti(i,j)=spval
2226 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2227 spval,varname,vegfrc)
2231 if (vegfrc(i,j) /= spval)
then
2232 vegfrc(i,j) = vegfrc(i,j) * 0.01
2242 if (sm(i,j) /= 0.0) vegfrc(i,j) = spval
2272 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2273 spval,varname,sh2o(1,jsta_2l,1))
2278 if (sm(i,j) /= 0.0) sh2o(i,j,1) = spval
2281 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,1)
2284 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2285 spval,varname,sh2o(1,jsta_2l,2))
2290 if (sm(i,j) /= 0.0) sh2o(i,j,2) = spval
2293 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,2)
2296 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2297 spval,varname,sh2o(1,jsta_2l,3))
2302 if (sm(i,j) /= 0.0) sh2o(i,j,3) = spval
2305 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,3)
2308 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2309 spval,varname,sh2o(1,jsta_2l,4))
2314 if (sm(i,j) /= 0.0) sh2o(i,j,4) = spval
2317 if(debugprint)print*,
'sample l',varname,
' = ',1,sh2o(isa,jsa,4)
2321 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2322 spval,varname,smc(1,jsta_2l,1))
2327 if (sm(i,j) /= 0.0) smc(i,j,1) = spval
2330 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,1)
2333 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2334 spval,varname,smc(1,jsta_2l,2))
2339 if (sm(i,j) /= 0.0) smc(i,j,2) = spval
2342 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,2)
2345 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2346 spval,varname,smc(1,jsta_2l,3))
2351 if (sm(i,j) /= 0.0) smc(i,j,3) = spval
2354 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,3)
2357 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2358 spval,varname,smc(1,jsta_2l,4))
2363 if (sm(i,j) /= 0.0) smc(i,j,4) = spval
2366 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,4)
2371 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2372 spval,varname,smc(1,jsta_2l,5))
2377 if (sm(i,j) /= 0.0) smc(i,j,5) = spval
2380 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,5)
2383 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2384 spval,varname,smc(1,jsta_2l,6))
2389 if (sm(i,j) /= 0.0) smc(i,j,6) = spval
2392 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,6)
2395 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2396 spval,varname,smc(1,jsta_2l,7))
2401 if (sm(i,j) /= 0.0) smc(i,j,7) = spval
2404 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,7)
2407 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2408 spval,varname,smc(1,jsta_2l,8))
2413 if (sm(i,j) /= 0.0) smc(i,j,8) = spval
2416 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,8)
2419 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2420 spval,varname,smc(1,jsta_2l,9))
2425 if (sm(i,j) /= 0.0) smc(i,j,9) = spval
2428 if(debugprint)print*,
'sample l',varname,
' = ',1,smc(isa,jsa,9)
2434 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2435 spval,varname,stc(1,jsta_2l,1))
2440 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,1) = spval
2444 if(debugprint)print*,
'sample l',
'stc',
' = ',1,stc(isa,jsa,1)
2447 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2448 spval,varname,stc(1,jsta_2l,2))
2453 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,2) = spval
2457 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,2)
2460 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2461 spval,varname,stc(1,jsta_2l,3))
2466 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,3) = spval
2470 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,3)
2473 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2474 spval,varname,stc(1,jsta_2l,4))
2479 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,4) = spval
2483 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,4)
2488 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2489 spval,varname,stc(1,jsta_2l,5))
2494 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,5) = spval
2498 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,5)
2501 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2502 spval,varname,stc(1,jsta_2l,6))
2507 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,6) = spval
2511 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,6)
2514 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2515 spval,varname,stc(1,jsta_2l,7))
2520 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,7) = spval
2524 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,7)
2527 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2528 spval,varname,stc(1,jsta_2l,8))
2533 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,8) = spval
2537 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,8)
2540 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2541 spval,varname,stc(1,jsta_2l,9))
2546 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) stc(i,j,9) = spval
2550 if(debugprint)print*,
'sample stc = ',1,stc(isa,jsa,9)
2570 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2571 spval,varname,alwin)
2575 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2576 spval,varname,rlwin)
2580 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2581 spval,varname,alwout)
2585 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2586 spval,varname,radot)
2592 if (alwout(i,j) /= spval) alwout(i,j) = -alwout(i,j)
2598 varname=
'ulwrf_avetoa'
2599 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2600 spval,varname,alwtoa)
2609 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2610 spval,varname,aswin)
2615 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2616 spval,varname,rswin)
2621 do j=jsta_2l,jend_2u
2629 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2630 spval,varname,auvbin)
2635 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2636 spval,varname,auvbinc)
2641 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2642 spval,varname,aswout)
2647 if (aswout(i,j) /= spval) aswout(i,j) = -aswout(i,j)
2654 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2655 spval,varname,rswout)
2658 varname=
'dswrf_avetoa'
2659 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2660 spval,varname,aswintoa)
2664 varname=
'uswrf_avetoa'
2665 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2666 spval,varname,aswtoa)
2672 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2673 spval,varname,sfcshx)
2678 if (sfcshx(i,j) /= spval) sfcshx(i,j) = -sfcshx(i,j)
2685 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2690 if (twbs(i,j) /= spval) twbs(i,j) = -twbs(i,j)
2701 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2702 spval,varname,sfclhx)
2707 if (sfclhx(i,j) /= spval) sfclhx(i,j) = -sfclhx(i,j)
2714 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2719 if (qwbs(i,j) /= spval) qwbs(i,j) = -qwbs(i,j)
2723 if(me==0)print*,
'rdaod= ',rdaod
2727 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2728 spval,varname,aod550)
2731 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2732 spval,varname,du_aod550)
2735 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2736 spval,varname,ss_aod550)
2739 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2740 spval,varname,su_aod550)
2743 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2744 spval,varname,oc_aod550)
2747 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2748 spval,varname,bc_aod550)
2753 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2754 spval,varname,subshx)
2759 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) subshx(i,j) = spval
2766 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2767 spval,varname,grnflx)
2772 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) grnflx(i,j) = spval
2778 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2779 spval,varname,sfcux)
2784 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2785 spval,varname,sfcvx)
2791 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2792 spval,varname,sfcuxi)
2793 if(debugprint)print*,
'sample l',varname,
' = ',1,sfcuxi(isa,jsa)
2797 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2798 spval,varname,sfcvxi)
2799 if(debugprint)print*,
'sample l',varname,
' = ',1,sfcvxi(isa,jsa)
2803 do j=jsta_2l,jend_2u
2811 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2812 spval,varname,gtaux)
2817 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2818 spval,varname,gtauy)
2823 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2824 spval,varname,avgpotevp)
2829 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) avgpotevp(i,j) = spval
2836 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2837 spval,varname,potevp)
2842 if (sm(i,j) == 1.0 .and. sice(i,j) ==0.) potevp(i,j) = spval
2848 do j=jsta_2l,jend_2u
2851 rlwtt(i,j,l) = spval
2853 rswtt(i,j,l) = spval
2855 tcucn(i,j,l) = spval
2856 tcucns(i,j,l) = spval
2858 train(i,j,l) = spval
2870 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2882 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2894 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2902 do j = jsta_2l, jend_2u
2904 if (buf(i,j) < spval)
then
2905 ivgtyp(i,j) = nint(buf(i,j))
2915 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2919 do j = jsta_2l, jend_2u
2921 if (buf(i,j) < spval)
then
2922 isltyp(i,j) = nint(buf(i,j))
2931 do j=jsta_2l,jend_2u
2939 thz0(i,j) = ths(i,j)
2947 do j=jsta_2l,jend_2u
2949 el_pbl(i,j,l) = spval
2950 exch_h(i,j,l) = spval
2962 varname=
'prescnvclt'
2963 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2971 if(ptop(i,j) <= 0.0) ptop(i,j) = spval
2976 if(ptop(i,j) < spval)
then
2978 if(ptop(i,j) <= pmid(i,j,l))
then
2991 varname=
'prescnvclb'
2992 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
2999 if(pbot(i,j) <= 0.0) pbot(i,j) = spval
3006 if(pbot(i,j) < spval)
then
3008 if(pbot(i,j) >= pmid(i,j,l))
then
3018 if(debugprint)print*,
'sample hbot = ',hbot(isa,jsa)
3020 varname=
'pres_avelct'
3021 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3022 spval,varname,ptopl)
3026 varname=
'pres_avelcb'
3027 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3028 spval,varname,pbotl)
3032 varname=
'tmp_avelct'
3033 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3034 spval,varname,ttopl)
3038 varname=
'pres_avemct'
3039 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3040 spval,varname,ptopm)
3044 varname=
'pres_avemcb'
3045 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3046 spval,varname,pbotm)
3050 varname=
'tmp_avemct'
3051 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3052 spval,varname,ttopm)
3056 varname=
'pres_avehct'
3057 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3058 spval,varname,ptoph)
3062 varname=
'pres_avehcb'
3063 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3064 spval,varname,pboth)
3068 varname=
'tmp_avehct'
3069 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3070 spval,varname,ttoph)
3074 varname=
'tcdc_avebndcl'
3075 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3076 spval,varname,pblcfr)
3080 do j = jsta_2l, jend_2u
3082 if (pblcfr(i,j) < spval) pblcfr(i,j) = pblcfr(i,j) * 0.01
3087 varname=
'cwork_aveclm'
3088 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3089 spval,varname,cldwork)
3094 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3095 spval,varname,runoff)
3100 if (sm(i,j) /= 0.0) runoff(i,j) = spval
3106 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3112 if (sm(i,j) /= 0.0) twa(i,j) = spval
3119 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3120 spval,varname,tecan)
3125 if (sm(i,j) /= 0.0) tecan(i,j) = spval
3131 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3132 spval,varname,tetran)
3137 if (sm(i,j) /= 0.0) tetran(i,j) = spval
3143 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3144 spval,varname,tedir)
3149 if (sm(i,j) /= 0.0) tedir(i,j) = spval
3155 if(modelname==
'GFS') varname=
'tmax_max2m'
3156 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3157 spval,varname,maxtshltr)
3161 if(modelname==
'GFS') varname=
'tmin_min2m'
3162 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3163 spval,varname,mintshltr)
3169 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3170 spval,varname,maxrhshltr)
3174 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3175 spval,varname,minrhshltr)
3180 varname=
'spfhmax_max2m'
3181 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3182 spval,varname,maxqshltr)
3187 varname=
'spfhmin_min2m'
3188 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3189 spval,varname,minqshltr)
3193 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3194 spval,varname,dzice)
3199 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3200 spval,varname,smcwlt)
3205 if (sm(i,j) /= 0.0) smcwlt(i,j) = spval
3212 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3213 spval,varname,suntime)
3217 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3218 spval,varname,fieldcapa)
3223 if (sm(i,j) /= 0.0) fieldcapa(i,j) = spval
3230 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3231 spval,varname,avisbeamswin)
3237 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3238 spval,varname,avisdiffswin)
3242 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3243 spval,varname,airbeamswin)
3247 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3248 spval,varname,airdiffswin)
3252 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3253 spval,varname,alwoutc)
3257 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3258 spval,varname,alwtoac)
3262 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3263 spval,varname,aswoutc)
3267 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3268 spval,varname,aswtoac)
3272 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3273 spval,varname,alwinc)
3277 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3278 spval,varname,aswinc)
3282 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3283 spval,varname,ssroff)
3288 if (sm(i,j) /= 0.0) ssroff(i,j) = spval
3294 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3295 spval,varname,avgedir)
3300 if (sm(i,j) /= 0.0) avgedir(i,j) = spval
3306 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3307 spval,varname,avgecan)
3312 if (sm(i,j) /= 0.0) avgecan(i,j) = spval
3318 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3324 if (sm(i,j) /= 0.0) paha(i,j) = spval
3330 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3336 if (sm(i,j) /= 0.0) pahi(i,j) = spval
3342 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3343 spval,varname,avgetrans)
3348 if (sm(i,j) /= 0.0) avgetrans(i,j) = spval
3354 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3355 spval,varname,avgesnow)
3360 if (sm(i,j)==1.0 .and. sice(i,j)==0.) avgesnow(i,j)=spval
3366 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3367 spval,varname,smstot)
3372 if (sm(i,j) /= 0.0) smstot(i,j) = spval
3378 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3379 spval,varname,snopcx)
3384 if (sm(i,j) /= 0.0) snopcx(i,j) = spval
3390 call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
3407 status=nf90_close(ncid2d)
3438 CALL table(ptbl,ttbl,pt_tbl, &
3439 rdq,rdth,rdp,rdthe,pl,thl,qs0,sqs,sthe,the0)
3441 CALL tableq(ttblq,rdpq,rdtheq,plq,thl,stheq,the0q)
3446 WRITE(6,*)
' SPL (POSTED PRESSURE LEVELS) BELOW: '
3447 WRITE(6,51) (spl(l),l=1,lsm)
3448 50
FORMAT(14(f4.1,1x))
3449 51
FORMAT(8(f8.1,1x))
3454 alsl(l) = log(spl(l))
3459 print*,
'writing out igds'
3463 if(maptype == 1)
THEN
3465 WRITE(6,*)
'igd(1)=',3
3468 WRITE(igdout)latstart
3469 WRITE(igdout)lonstart
3476 WRITE(igdout)truelat2
3477 WRITE(igdout)truelat1
3479 ELSE IF(maptype == 2)
THEN
3483 WRITE(igdout)latstart
3484 WRITE(igdout)lonstart
3491 WRITE(igdout)truelat2
3492 WRITE(igdout)truelat1
3498 if (truelat1 < 0.)
THEN
3504 CALL msfps(lat,truelat1*0.001,psmapf)
3506 ELSE IF(maptype == 3)
THEN
3510 WRITE(igdout)latstart
3511 WRITE(igdout)lonstart
3513 WRITE(igdout)latlast
3514 WRITE(igdout)lonlast
3515 WRITE(igdout)truelat1
3521 ELSE IF(maptype == 0 .OR. maptype == 203)
THEN
3525 WRITE(igdout)latstart
3526 WRITE(igdout)lonstart
3544 subroutine read_netcdf_3d_scatter(me,ncid,ifhr,im,jm,jsta,jsta_2l &
3545 ,jend_2u,mpi_comm_comp,icnt,idsp,spval,varname &
3551 character(len=20),
intent(in) :: varname
3552 real,
intent(in) :: spval
3553 integer,
intent(in) :: me,ncid,ifhr,im,jm,jsta_2l,jend_2u,jsta, &
3555 integer,
intent(in) :: icnt(0:1023), idsp(0:1023)
3556 real,
intent(out) :: buf(im,jsta_2l:jend_2u,lm)
3557 integer :: iret,i,j,jj,varid,l
3558 real dummy(im,jm,lm),dummy2(im,jm,lm)
3559 real,
parameter :: spval_netcdf=-1.e+10
3561 real,
parameter :: small=1.e-6
3564 iret = nf90_inq_varid(ncid,trim(varname),varid)
3566 print*,varname,
" not found -Assigned missing values"
3571 dummy(i,j,l) = spval
3576 iret = nf90_get_att(ncid,varid,
"_FillValue",fill_value)
3577 if (iret /= 0) fill_value = spval_netcdf
3578 iret = nf90_get_var(ncid,varid,dummy2)
3585 dummy(i,j,l)=dummy2(i,jj,l)
3586 if(abs(dummy(i,j,l)-fill_value)<small)dummy(i,j,l)=spval
3594 call mpi_scatterv(dummy(1,1,l),icnt,idsp,mpi_real &
3595 ,buf(1,jsta,l),icnt(me),mpi_real,0,mpi_comm_comp,iret)
3598 end subroutine read_netcdf_3d_scatter
3600 subroutine read_netcdf_2d_scatter(me,ncid,ifhr,im,jm,jsta,jsta_2l &
3601 ,jend_2u,mpi_comm_comp,icnt,idsp,spval,varname,buf)
3606 character(len=20),
intent(in) :: varname
3607 real,
intent(in) :: spval
3608 integer,
intent(in) :: me,ncid,ifhr,im,jm,jsta_2l,jend_2u,jsta, &
3610 integer,
intent(in) :: icnt(0:1023), idsp(0:1023)
3611 real,
intent(out) :: buf(im,jsta_2l:jend_2u)
3612 integer :: iret,i,j,jj,varid
3613 real,
parameter :: spval_netcdf=9.99e+20
3615 real,
parameter :: spval_netcdf_3d=-1.e+10
3616 real,
parameter :: small=1.e-6
3618 real dummy(im,jm),dummy2(im,jm)
3621 iret = nf90_inq_varid(ncid,trim(varname),varid)
3623 print*,varname,
" not found -Assigned missing values"
3631 iret = nf90_get_att(ncid,varid,
"_FillValue",fill_value)
3632 if (iret /= 0) fill_value = spval_netcdf
3633 iret = nf90_get_var(ncid,varid,dummy2)
3639 dummy(i,j)=dummy2(i,jj)
3640 if(abs(dummy2(i,jj)-fill_value)<small)dummy(i,j)=spval
3646 call mpi_scatterv(dummy(1,1),icnt,idsp,mpi_real &
3647 ,buf(1,jsta),icnt(me),mpi_real,0,mpi_comm_comp,iret)
3649 end subroutine read_netcdf_2d_scatter
3651 subroutine read_netcdf_3d_para(ncid,im,jm,jsta,jsta_2l,jend,jend_2u, &
3652 spval,varname,buf,lm)
3655 use ctlblk_mod
, only : me
3660 character(len=20),
intent(in) :: varname
3661 real,
intent(in) :: spval
3662 integer,
intent(in) :: ncid,im,jm,lm,jsta_2l,jend_2u,jsta,jend
3663 real,
intent(out) :: buf(im,jsta_2l:jend_2u,lm)
3664 integer :: varid,iret,jj,i,j,l,kk
3665 integer :: start(3), count(3), stride(3)
3666 real,
parameter :: spval_netcdf=9.99e+20
3669 iret = nf90_inq_varid(ncid,trim(varname),varid)
3671 if (me == 0) print*,varname,
" not found -Assigned missing values"
3681 iret = nf90_get_att(ncid,varid,
"_FillValue",fill_value)
3682 if (iret /= 0) fill_value = spval_netcdf
3683 start = (/1,jsta,1/)
3685 count = (/im,jj,lm/)
3686 iret = nf90_get_var(ncid,varid,buf(1:im,jsta:jend,1:lm),start=start,count=count)
3690 if(abs(buf(i,j,l)-fill_value)<small)buf(i,j,l)=spval
3696 end subroutine read_netcdf_3d_para
3698 subroutine read_netcdf_2d_para(ncid,im,jsta,jsta_2l,jend,jend_2u, &
3702 use ctlblk_mod
, only : me
3707 character(len=20),
intent(in) :: varname
3708 real,
intent(in) :: spval
3709 integer,
intent(in) :: ncid,im,jsta_2l,jend_2u,jsta,jend
3710 real,
intent(out) :: buf(im,jsta_2l:jend_2u)
3711 integer :: varid,iret,jj,i,j
3712 integer :: start(2), count(2)
3713 real,
parameter :: spval_netcdf=9.99e+20
3716 iret = nf90_inq_varid(ncid,trim(varname),varid)
3718 if (me==0) print*,varname,
" not found -Assigned missing values"
3726 iret = nf90_get_att(ncid,varid,
"_FillValue",fill_value)
3727 if (iret /= 0) fill_value = spval_netcdf
3731 iret = nf90_get_var(ncid,varid,buf(:,jsta),start=start,count=count)
3734 if(abs(buf(i,j)-fill_value)<small)buf(i,j)=spval
3739 end subroutine read_netcdf_2d_para
elemental real function, public fpvsnew(t)
calcape() computes CAPE/CINS and other storm related variables.