85 parameter(kpdtsf=11, kpdwet=86, kpdsno=65, kpdzor=83,
87 1 kpdais=91, kpdtg3=11, kpdplr=224,
88 2 kpdgla=238, kpdmxi=91, kpdscv=238, kpdsmc=144,
89 3 kpdoro=8, kpdmsk=81, kpdstc=11, kpdacn=91, kpdveg=87,
91 & kpdvmn=255, kpdvmx=255,kpdslp=236, kpdabs_0=255,
92 & kpdvet=225, kpdsot=224,kpdabs_1=159,
95 integer,
parameter :: kpdalb_0(4)=(/212,215,213,216/)
98 integer,
parameter :: kpdalb_1(4)=(/189,190,191,192/)
101 integer,
parameter :: kpdalf(2)=(/214,217/)
104 integer,
parameter :: xdata=5000
105 integer,
parameter :: ydata=2500
106 integer,
parameter :: mdata=xdata*ydata
107 integer :: veg_type_landice
109 integer :: soil_type_landice
111 end module sfccyc_module
177 &, rla, rlo, slmask,orog,orog_uf,use_ufo,nst_anl
178 &, sihfcs,sicfcs,sitfcs
180 &, vmnfcs,vmxfcs,slpfcs,absfcs
181 &, tsffcs,snofcs,zorfcs,albfcs,tg3fcs
182 &, cnpfcs,smcfcs,stcfcs,slifcs,aisfcs
183 &, vegfcs,vetfcs,sotfcs,alffcs
184 &, cvfcs,cvbfcs,cvtfcs,me,nlunit
185 &, sz_nml,input_nml_file
186 &, ialb,isot,ivegsrc,tile_num_ch,i_index,j_index)
188 use machine , only : kind_io8,kind_io4
191 character(len=*),
intent(in) :: tile_num_ch
192 integer,
intent(in) :: i_index(len), j_index(len)
193 logical use_ufo, nst_anl
194 real (kind=kind_io8) sllnd,slsea,aicice,aicsea,tgice,rlapse,
195 & orolmx,orolmn,oroomx,oroomn,orosmx,
196 & orosmn,oroimx,oroimn,orojmx,orojmn,
197 & alblmx,alblmn,albomx,albomn,albsmx,
198 & albsmn,albimx,albimn,albjmx,albjmn,
199 & wetlmx,wetlmn,wetomx,wetomn,wetsmx,
200 & wetsmn,wetimx,wetimn,wetjmx,wetjmn,
201 & snolmx,snolmn,snoomx,snoomn,snosmx,
202 & snosmn,snoimx,snoimn,snojmx,snojmn,
203 & zorlmx,zorlmn,zoromx,zoromn,zorsmx,
204 & zorsmn,zorimx,zorimn,zorjmx, zorjmn,
205 & plrlmx,plrlmn,plromx,plromn,plrsmx,
206 & plrsmn,plrimx,plrimn,plrjmx,plrjmn,
207 & tsflmx,tsflmn,tsfomx,tsfomn,tsfsmx,
208 & tsfsmn,tsfimx,tsfimn,tsfjmx,tsfjmn,
209 & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3smx,
210 & tg3smn,tg3imx,tg3imn,tg3jmx,tg3jmn,
211 & stclmx,stclmn,stcomx,stcomn,stcsmx,
212 & stcsmn,stcimx,stcimn,stcjmx,stcjmn,
213 & smclmx,smclmn,smcomx,smcomn,smcsmx,
214 & smcsmn,smcimx,smcimn,smcjmx,smcjmn,
215 & scvlmx,scvlmn,scvomx,scvomn,scvsmx,
216 & scvsmn,scvimx,scvimn,scvjmx,scvjmn,
217 & veglmx,veglmn,vegomx,vegomn,vegsmx,
218 & vegsmn,vegimx,vegimn,vegjmx,vegjmn,
219 & vetlmx,vetlmn,vetomx,vetomn,vetsmx,
220 & vetsmn,vetimx,vetimn,vetjmx,vetjmn,
221 & sotlmx,sotlmn,sotomx,sotomn,sotsmx,
222 & sotsmn,sotimx,sotimn,sotjmx,sotjmn,
223 & alslmx,alslmn,alsomx,alsomn,alssmx,
224 & alssmn,alsimx,alsimn,alsjmx,alsjmn,
225 & epstsf,epsalb,epssno,epswet,epszor,
226 & epsplr,epsoro,epssmc,epsscv,eptsfc,
227 & epstg3,epsais,epsacn,epsveg,epsvet,
228 & epssot,epsalf,qctsfs,qcsnos,qctsfi,
229 & aislim,snwmin,snwmax,cplrl,cplrs,
230 & cvegl,czors,csnol,csnos,czorl,csots,
231 & csotl,cvwgs,cvetl,cvets,calfs,
232 & fcalfl,fcalfs,ccvt,ccnp,ccv,ccvb,
233 & calbl,calfl,calbs,ctsfs,grboro,
234 & grbmsk,ctsfl,deltf,caisl,caiss,
235 & fsalfl,fsalfs,flalfs,falbl,ftsfl,
236 & ftsfs,fzorl,fzors,fplrl,fsnos,faisl,
237 & faiss,fsnol,bltmsk,falbs,cvegs,percrit,
238 & deltsfc,critp2,critp3,blnmsk,critp1,
239 & fcplrl,fcplrs,fczors,fvets,fsotl,fsots,
240 & fvetl,fplrs,fvegl,fvegs,fcsnol,fcsnos,
241 & fczorl,fcalbs,fctsfl,fctsfs,fcalbl,
242 & falfs,falfl,fh,crit,zsca,ztsfc,tem1,tem2
243 &, fsihl,fsihs,fsicl,fsics,
244 & csihl,csihs,csicl,csics,epssih,epssic
245 &, fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps,
246 & fabsl,fabss,cvmnl,cvmns,cvmxl,cvmxs,
247 & cslpl,cslps,cabsl,cabss,epsvmn,epsvmx,
249 &, sihlmx,sihlmn,sihomx,sihomn,sihsmx,
250 & sihsmn,sihimx,sihimn,sihjmx,sihjmn,
251 & siclmx,siclmn,sicomx,sicomn,sicsmx,
252 & sicsmn,sicimx,sicimn,sicjmx,sicjmn
254 &, vmnlmx,vmnlmn,vmnomx,vmnomn,vmnsmx,
255 & vmnsmn,vmnimx,vmnimn,vmnjmx,vmnjmn,
256 & vmxlmx,vmxlmn,vmxomx,vmxomn,vmxsmx,
257 & vmxsmn,vmximx,vmximn,vmxjmx,vmxjmn,
258 & slplmx,slplmn,slpomx,slpomn,slpsmx,
259 & slpsmn,slpimx,slpimn,slpjmx,slpjmn,
260 & abslmx,abslmn,absomx,absomn,abssmx,
261 & abssmn,absimx,absimn,absjmx,absjmn
264 integer imsk,jmsk,ifp,irtscv,irtacn,irtais,irtsno,irtzor,
265 & irtalb,irtsot,irtalf,j,irtvet,irtsmc,irtstc,irtveg,
266 & irtwet,k,iprnt,kk,irttsf,iret,i,igrdbg,iy,im,id,
267 & icalbl,icalbs,icalfl,ictsfs,lugb,len,lsoil,ih,
268 & ictsfl,iczors,icplrl,icplrs,iczorl,icalfs,icsnol,
269 & icsnos,irttg3,me,kqcm,nlunit,sz_nml,ialb
270 &, irtvmn, irtvmx, irtslp, irtabs, isot, ivegsrc
271 logical gausm, deads, qcmsk, znlst, monclm, monanl,
272 & monfcs, monmer, mondif, landice
273 character(len=*),
intent(in) :: input_nml_file(sz_nml)
320 parameter(sllnd =1.0,slsea =0.0)
321 parameter(aicice=1.0,aicsea=0.0)
322 parameter(tgice=271.2)
323 parameter(rlapse=0.65e-2)
338 parameter(orolmx=8000.,orolmn=-1000.,oroomx=3000.,oroomn=-1000.,
339 & orosmx=8000.,orosmn=-1000.,oroimx=3000.,oroimn=-1000.,
340 & orojmx=3000.,orojmn=-1000.)
351 parameter(albomx=0.06,albomn=0.06,
352 & albimx=0.80,albimn=0.06,
353 & albjmx=0.80,albjmn=0.06)
354 parameter(sihlmx=0.0,sihlmn=0.0,sihomx=5.0,sihomn=0.0,
355 & sihsmx=5.0,sihsmn=0.0,sihimx=5.0,sihimn=0.10,
356 & sihjmx=5.0,sihjmn=0.10,glacir_hice=3.0)
365 parameter(siclmx=0.0,siclmn=0.0,sicomx=1.0,sicomn=0.0,
366 & sicsmx=1.0,sicsmn=0.0,sicimx=1.0,sicimn=0.15,
367 & sicjmx=1.0,sicjmn=0.15)
369 parameter(wetlmx=0.15,wetlmn=0.00,wetomx=0.15,wetomn=0.15,
370 & wetsmx=0.15,wetsmn=0.15,wetimx=0.15,wetimn=0.15,
371 & wetjmx=0.15,wetjmn=0.15)
372 parameter(snolmx=0.0,snolmn=0.0,snoomx=0.0,snoomn=0.0,
373 & snosmx=55000.,snosmn=0.001,snoimx=0.,snoimn=0.0,
374 & snojmx=10000.,snojmn=0.01)
375 parameter(zorlmx=300.,zorlmn=1.0,zoromx=1.0,zoromn=1.e-05,
376 & zorsmx=300.,zorsmn=1.0,zorimx=1.0,zorimn=1.0,
377 & zorjmx=1.0,zorjmn=1.0)
378 parameter(plrlmx=1000.,plrlmn=0.0,plromx=1000.0,plromn=0.0,
379 & plrsmx=1000.,plrsmn=0.0,plrimx=1000.,plrimn=0.0,
380 & plrjmx=1000.,plrjmn=0.0)
382 parameter(tsflmx=353.,tsflmn=173.0,tsfomx=313.0,tsfomn=271.2,
383 & tsfsmx=305.0,tsfsmn=173.0,tsfimx=271.2,tsfimn=173.0,
384 & tsfjmx=273.16,tsfjmn=173.0)
388 parameter(tg3lmx=310.,tg3lmn=200.0,tg3omx=310.0,tg3omn=200.0,
389 & tg3smx=310.,tg3smn=200.0,tg3imx=310.0,tg3imn=200.0,
390 & tg3jmx=310.,tg3jmn=200.0)
391 parameter(stclmx=353.,stclmn=173.0,stcomx=313.0,stcomn=200.0,
392 & stcsmx=310.,stcsmn=200.0,stcimx=310.0,stcimn=200.0,
393 & stcjmx=310.,stcjmn=200.0)
396 parameter(smclmx=0.55,smclmn=0.0,smcomx=1.0,smcomn=1.0,
397 & smcsmx=0.55,smcsmn=0.0,smcimx=1.0,smcimn=1.0,
398 & smcjmx=1.0,smcjmn=1.0)
399 parameter(scvlmx=0.0,scvlmn=0.0,scvomx=0.0,scvomn=0.0,
400 & scvsmx=1.0,scvsmn=1.0,scvimx=0.0,scvimn=0.0,
401 & scvjmx=1.0,scvjmn=1.0)
402 parameter(veglmx=1.0,veglmn=0.0,vegomx=0.0,vegomn=0.0,
403 & vegsmx=1.0,vegsmn=0.0,vegimx=0.0,vegimn=0.0,
404 & vegjmx=0.0,vegjmn=0.0)
405 parameter(vmnlmx=1.0,vmnlmn=0.0,vmnomx=0.0,vmnomn=0.0,
406 & vmnsmx=1.0,vmnsmn=0.0,vmnimx=0.0,vmnimn=0.0,
407 & vmnjmx=0.0,vmnjmn=0.0)
408 parameter(vmxlmx=1.0,vmxlmn=0.0,vmxomx=0.0,vmxomn=0.0,
409 & vmxsmx=1.0,vmxsmn=0.0,vmximx=0.0,vmximn=0.0,
410 & vmxjmx=0.0,vmxjmn=0.0)
411 parameter(slplmx=9.0,slplmn=1.0,slpomx=0.0,slpomn=0.0,
412 & slpsmx=9.0,slpsmn=1.0,slpimx=0.,slpimn=0.,
413 & slpjmx=0.,slpjmn=0.)
417 parameter(absomx=0.0,absomn=0.0,
418 & absimx=0.0,absimn=0.0,
419 & absjmx=0.0,absjmn=0.0)
421 parameter(vetlmx=20.,vetlmn=1.0,vetomx=0.0,vetomn=0.0,
422 & vetsmx=20.,vetsmn=1.0,vetimx=0.,vetimn=0.,
423 & vetjmx=0.,vetjmn=0.)
425 parameter(sotlmx=16.,sotlmn=1.0,sotomx=0.0,sotomn=0.0,
426 & sotsmx=16.,sotsmn=1.0,sotimx=0.,sotimn=0.,
427 & sotjmx=0.,sotjmn=0.)
430 parameter(alslmx=1.0,alslmn=0.0,alsomx=0.0,alsomn=0.0,
431 & alssmx=1.0,alssmn=0.0,alsimx=0.0,alsimn=0.0,
432 & alsjmx=0.0,alsjmn=0.0)
436 parameter(epstsf=0.01,epsalb=0.001,epssno=0.01,
437 & epswet=0.01,epszor=0.0000001,epsplr=1.,epsoro=0.,
438 & epssmc=0.0001,epsscv=0.,eptsfc=0.01,epstg3=0.01,
439 & epsais=0.,epsacn=0.01,epsveg=0.01,
440 & epssih=0.001,epssic=0.001,
441 & epsvmn=0.01,epsvmx=0.01,epsabs=0.001,epsslp=0.01,
442 & epsvet=.01,epssot=.01,epsalf=.001)
453 parameter(qctsfs=293.16,qcsnos=100.,qctsfi=280.16)
463 parameter(snwmin=5.0,snwmax=100.)
464 real (kind=kind_io8),
parameter :: ten=10.0, one=1.0
508 data critp1,critp2,critp3/80.,80.,25./
516 real (kind=kind_io8) slmask(len),orog(len), orog_uf(len)
518 real (kind=kind_io8) rla(len), rlo(len)
522 character*500 fnglac,fnmxic
523 real (kind=kind_io8),
allocatable :: glacir(:),amxice(:),tsfcl0(:)
529 character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
530 & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,
531 & fnvegc,fnvetc,fnsotc
532 &, fnvmnc,fnvmxc,fnslpc,fnabsc, fnalbc2
533 real (kind=kind_io8) tsfclm(len), wetclm(len), snoclm(len),
534 & zorclm(len), albclm(len,4), aisclm(len),
535 & tg3clm(len), acnclm(len), cnpclm(len),
536 & cvclm(len), cvbclm(len), cvtclm(len),
537 & scvclm(len), tsfcl2(len), vegclm(len),
538 & vetclm(len), sotclm(len), alfclm(len,2), sliclm(len),
539 & smcclm(len,lsoil), stcclm(len,lsoil)
540 &, sihclm(len), sicclm(len)
541 &, vmnclm(len), vmxclm(len), slpclm(len), absclm(len)
545 character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
546 & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna,
547 & fnvega,fnveta,fnsota
548 &, fnvmna,fnvmxa,fnslpa,fnabsa
550 real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len),
551 & zoranl(len), albanl(len,4), aisanl(len),
552 & tg3anl(len), acnanl(len), cnpanl(len),
553 & cvanl(len), cvbanl(len), cvtanl(len),
554 & scvanl(len), tsfan2(len), veganl(len),
555 & vetanl(len), sotanl(len), alfanl(len,2), slianl(len),
556 & smcanl(len,lsoil), stcanl(len,lsoil)
557 &, sihanl(len), sicanl(len)
558 &, vmnanl(len), vmxanl(len), slpanl(len), absanl(len)
560 real (kind=kind_io8) tsfan0(len)
564 real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len),
565 & zorfcs(len), albfcs(len,4), aisfcs(len),
566 & tg3fcs(len), acnfcs(len), cnpfcs(len),
567 & cvfcs(len), cvbfcs(len), cvtfcs(len),
568 & slifcs(len), vegfcs(len),
569 & vetfcs(len), sotfcs(len), alffcs(len,2),
570 & smcfcs(len,lsoil), stcfcs(len,lsoil)
571 &, sihfcs(len), sicfcs(len), sitfcs(len)
572 &, vmnfcs(len), vmxfcs(len), slpfcs(len), absfcs(len)
573 &, swdfcs(len), slcfcs(len,lsoil)
578 real (kind=kind_io8) f10m (len)
579 real (kind=kind_io8) fsmcl(25),fsmcs(25),fstcl(25),fstcs(25)
580 real (kind=kind_io8) fcsmcl(25),fcsmcs(25),fcstcl(25),fcstcs(25)
583 real (kind=kind_io8) swratio(len,lsoil)
585 logical fixratio(lsoil)
587 integer icsmcl(25), icsmcs(25), icstcl(25), icstcs(25)
589 real (kind=kind_io8) csmcl(25), csmcs(25)
590 real (kind=kind_io8) cstcl(25), cstcs(25)
592 real (kind=kind_io8) slmskh(mdata)
596 logical icefl1(len), icefl2(len)
603 real (kind=kind_io8) sig1t(len)
654 logical ldebug,lqcbgs
659 character*500 fndclm,fndanl
664 namelist/namsfc/fnglac,fnmxic,
665 & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
666 & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,
667 & fnvegc,fnvetc,fnsotc,fnalbc2,
668 & fnvmnc,fnvmxc,fnslpc,fnabsc,
669 & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
670 & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna,
671 & fnvega,fnveta,fnsota,
672 & fnvmna,fnvmxa,fnslpa,fnabsa,
674 & ldebug,lgchek,lqcbgs,critp1,critp2,critp3,
677 & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos,
678 & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs,
679 & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots,
680 & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos,
681 & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs,
682 & fcstcl,fcstcs,fsalfl,fsalfs,fcalfl,flalfs,
683 & fsihl,fsicl,fsihs,fsics,aislim,sihnew,
684 & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps,
686 & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos,
687 & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs,
688 & icstcl,icstcs,icalfl,icalfs,
689 & gausm, deads, qcmsk, znlst,
690 & monclm, monanl, monfcs, monmer, mondif, igrdbg,
691 & blnmsk, bltmsk, landice
693 data gausm/.true./, deads/.false./, blnmsk/0.0/, bltmsk/90.0/
694 &, qcmsk/.false./, znlst/.false./, igrdbg/-1/
695 &, monclm/.false./, monanl/.false./, monfcs/.false./
696 &, monmer/.false./, mondif/.false./, landice/.true./
700 data fnmskh/
'global_slmask.t126.grb'/
701 data fnalbc/
'global_albedo4.1x1.grb'/
702 data fnalbc2/
'global_albedo4.1x1.grb'/
703 data fntsfc/
'global_sstclim.2x2.grb'/
704 data fnsotc/
'global_soiltype.1x1.grb'/
705 data fnvegc/
'global_vegfrac.1x1.grb'/
706 data fnvetc/
'global_vegtype.1x1.grb'/
707 data fnglac/
'global_glacier.2x2.grb'/
708 data fnmxic/
'global_maxice.2x2.grb'/
709 data fnsnoc/
'global_snoclim.1.875.grb'/
710 data fnzorc/
'global_zorclim.1x1.grb'/
711 data fnaisc/
'global_iceclim.2x2.grb'/
712 data fntg3c/
'global_tg3clim.2.6x1.5.grb'/
713 data fnsmcc/
'global_soilmcpc.1x1.grb'/
715 data fnvmnc/
'global_shdmin.0.144x0.144.grb'/
716 data fnvmxc/
'global_shdmax.0.144x0.144.grb'/
717 data fnslpc/
'global_slope.1x1.grb'/
718 data fnabsc/
'global_snoalb.1x1.grb'/
747 data ldebug/.false./, lqcbgs/.true./
753 data ftsfl/99999.0/, ftsfs/0.0/
754 data falbl/0.0/, falbs/0.0/
755 data falfl/0.0/, falfs/0.0/
756 data faisl/0.0/, faiss/0.0/
757 data fsnol/0.0/, fsnos/99999.0/
758 data fzorl/0.0/, fzors/99999.0/
759 data fplrl/0.0/, fplrs/0.0/
760 data fvetl/0.0/, fvets/99999.0/
761 data fsotl/0.0/, fsots/99999.0/
762 data fvegl/0.0/, fvegs/99999.0/
764 data fsihl/99999.0/, fsihs/99999.0/
766 data fsicl/0.0/, fsics/0.0/
770 data aislim/0.15/, sihnew/0.2/
772 data fvmnl/0.0/, fvmns/99999.0/
773 data fvmxl/0.0/, fvmxs/99999.0/
774 data fslpl/0.0/, fslps/99999.0/
775 data fabsl/0.0/, fabss/99999.0/
777 data fctsfl/99999.0/, fctsfs/99999.0/
778 data fcalbl/99999.0/, fcalbs/99999.0/
779 data fcsnol/99999.0/, fcsnos/99999.0/
780 data fczorl/99999.0/, fczors/99999.0/
781 data fcplrl/99999.0/, fcplrs/99999.0/
783 data ictsfl/0/, ictsfs/1/
784 data icalbl/1/, icalbs/1/
785 data icalfl/1/, icalfs/1/
786 data icsnol/0/, icsnos/0/
787 data iczorl/1/, iczors/0/
788 data icplrl/1/, icplrs/0/
791 data ccv/1.0/, ccvb/1.0/, ccvt/1.0/
795 save ifp,fnglac,fnmxic,
796 & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
797 & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc,
798 & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
799 & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega,
803 & fnvmnc,fnvmxc,fnabsc,fnslpc,
804 & fnvmna,fnvmxa,fnabsa,fnslpa,
805 & ldebug,lgchek,lqcbgs,critp1,critp2,critp3,
808 & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos,
809 & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs,falfl,falfs,
810 & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots,
811 & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos,
812 & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs,
813 & fcstcl,fcstcs,fcalfl,fcalfs,
815 & fsihl,fsihs,fsicl,fsics,aislim,sihnew,
817 & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps,
819 & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos,
820 & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs,
821 & icstcl,icstcs,icalfl,icalfs,
822 & gausm, deads, qcmsk,
823 & monclm, monanl, monfcs, monmer, mondif, igrdbg,
826 & ctsfl, ctsfs, calbl, calfl, calbs, calfs, csmcs,
827 & csnol, csnos, czorl, czors, cplrl, cplrs, cstcl,
828 & cstcs, cvegl, cvwgs, cvetl, cvets, csotl, csots,
831 &, csihl, csihs, csicl, csics
833 &, cvmnl, cvmns, cvmxl, cvmxs, cslpl, cslps,
835 &, imsk, jmsk, slmskh, blnmsk, bltmsk
836 &, glacir, amxice, tsfcl0
837 &, caisl, caiss, cvegs
884 #ifdef INTERNAL_FILE_NML
885 read(input_nml_file, nml=namsfc)
894 print *,
'ftsfl,falbl,faisl,fsnol,fzorl=',
895 & ftsfl,falbl,faisl,fsnol,fzorl
896 print *,
'fsmcl=',fsmcl(1:lsoil)
897 print *,
'fstcl=',fstcl(1:lsoil)
898 print *,
'ftsfs,falbs,faiss,fsnos,fzors=',
899 & ftsfs,falbs,faiss,fsnos,fzors
900 print *,
'fsmcs=',fsmcs(1:lsoil)
901 print *,
'fstcs=',fstcs(1:lsoil)
902 print *,
' aislim=',aislim,
' sihnew=',sihnew
903 print *,
' isot=', isot,
' ivegsrc=',ivegsrc
906 if (ivegsrc == 2)
then
917 deltf = deltsfc / 24.0
920 if(ftsfl.ge.99999.) ctsfl=1.
921 if((ftsfl.gt.0.).and.(ftsfl.lt.99999)) ctsfl=exp(-deltf/ftsfl)
924 if(ftsfs.ge.99999.) ctsfs=1.
925 if((ftsfs.gt.0.).and.(ftsfs.lt.99999)) ctsfs=exp(-deltf/ftsfs)
929 if(fsmcl(k).ge.99999.) csmcl(k)=1.
930 if((fsmcl(k).gt.0.).and.(fsmcl(k).lt.99999))
931 & csmcl(k)=exp(-deltf/fsmcl(k))
933 if(fsmcs(k).ge.99999.) csmcs(k)=1.
934 if((fsmcs(k).gt.0.).and.(fsmcs(k).lt.99999))
935 & csmcs(k)=exp(-deltf/fsmcs(k))
939 if(falbl.ge.99999.) calbl=1.
940 if((falbl.gt.0.).and.(falbl.lt.99999)) calbl=exp(-deltf/falbl)
943 if(falfl.ge.99999.) calfl=1.
944 if((falfl.gt.0.).and.(falfl.lt.99999)) calfl=exp(-deltf/falfl)
947 if(falbs.ge.99999.) calbs=1.
948 if((falbs.gt.0.).and.(falbs.lt.99999)) calbs=exp(-deltf/falbs)
951 if(falfs.ge.99999.) calfs=1.
952 if((falfs.gt.0.).and.(falfs.lt.99999)) calfs=exp(-deltf/falfs)
955 if(faisl.ge.99999.) caisl=1.
956 if((faisl.gt.0.).and.(faisl.lt.99999)) caisl=1.
959 if(faiss.ge.99999.) caiss=1.
960 if((faiss.gt.0.).and.(faiss.lt.99999)) caiss=1.
963 if(fsnol.ge.99999.) csnol=1.
964 if((fsnol.gt.0.).and.(fsnol.lt.99999)) csnol=exp(-deltf/fsnol)
968 if(fsnol.lt.0.)csnol=fsnol
971 if(fsnos.ge.99999.) csnos=1.
972 if((fsnos.gt.0.).and.(fsnos.lt.99999)) csnos=exp(-deltf/fsnos)
975 if(fzorl.ge.99999.) czorl=1.
976 if((fzorl.gt.0.).and.(fzorl.lt.99999)) czorl=exp(-deltf/fzorl)
979 if(fzors.ge.99999.) czors=1.
980 if((fzors.gt.0.).and.(fzors.lt.99999)) czors=exp(-deltf/fzors)
992 if(fstcl(k).ge.99999.) cstcl(k)=1.
993 if((fstcl(k).gt.0.).and.(fstcl(k).lt.99999))
994 & cstcl(k)=exp(-deltf/fstcl(k))
996 if(fstcs(k).ge.99999.) cstcs(k)=1.
997 if((fstcs(k).gt.0.).and.(fstcs(k).lt.99999))
998 & cstcs(k)=exp(-deltf/fstcs(k))
1002 if(fvegl.ge.99999.) cvegl=1.
1003 if((fvegl.gt.0.).and.(fvegl.lt.99999)) cvegl=exp(-deltf/fvegl)
1006 if(fvegs.ge.99999.) cvegs=1.
1007 if((fvegs.gt.0.).and.(fvegs.lt.99999)) cvegs=exp(-deltf/fvegs)
1010 if(fvetl.ge.99999.) cvetl=1.
1011 if((fvetl.gt.0.).and.(fvetl.lt.99999)) cvetl=exp(-deltf/fvetl)
1014 if(fvets.ge.99999.) cvets=1.
1015 if((fvets.gt.0.).and.(fvets.lt.99999)) cvets=exp(-deltf/fvets)
1018 if(fsotl.ge.99999.) csotl=1.
1019 if((fsotl.gt.0.).and.(fsotl.lt.99999)) csotl=exp(-deltf/fsotl)
1022 if(fsots.ge.99999.) csots=1.
1023 if((fsots.gt.0.).and.(fsots.lt.99999)) csots=exp(-deltf/fsots)
1028 if(fsihl.ge.99999.) csihl=1.
1029 if((fsihl.gt.0.).and.(fsihl.lt.99999)) csihl=exp(-deltf/fsihl)
1032 if(fsihs.ge.99999.) csihs=1.
1033 if((fsihs.gt.0.).and.(fsihs.lt.99999)) csihs=exp(-deltf/fsihs)
1036 if(fsicl.ge.99999.) csicl=1.
1037 if((fsicl.gt.0.).and.(fsicl.lt.99999)) csicl=exp(-deltf/fsicl)
1040 if(fsics.ge.99999.) csics=1.
1041 if((fsics.gt.0.).and.(fsics.lt.99999)) csics=exp(-deltf/fsics)
1046 if(fvmnl.ge.99999.) cvmnl=1.
1047 if((fvmnl.gt.0.).and.(fvmnl.lt.99999)) cvmnl=exp(-deltf/fvmnl)
1050 if(fvmns.ge.99999.) cvmns=1.
1051 if((fvmns.gt.0.).and.(fvmns.lt.99999)) cvmns=exp(-deltf/fvmns)
1054 if(fvmxl.ge.99999.) cvmxl=1.
1055 if((fvmxl.gt.0.).and.(fvmxl.lt.99999)) cvmxl=exp(-deltf/fvmxl)
1058 if(fvmxs.ge.99999.) cvmxs=1.
1059 if((fvmxs.gt.0.).and.(fvmxs.lt.99999)) cvmxs=exp(-deltf/fvmxs)
1062 if(fslpl.ge.99999.) cslpl=1.
1063 if((fslpl.gt.0.).and.(fslpl.lt.99999)) cslpl=exp(-deltf/fslpl)
1066 if(fslps.ge.99999.) cslps=1.
1067 if((fslps.gt.0.).and.(fslps.lt.99999)) cslps=exp(-deltf/fslps)
1070 if(fabsl.ge.99999.) cabsl=1.
1071 if((fabsl.gt.0.).and.(fabsl.lt.99999)) cabsl=exp(-deltf/fabsl)
1074 if(fabss.ge.99999.) cabss=1.
1075 if((fabss.gt.0.).and.(fabss.lt.99999)) cabss=exp(-deltf/fabss)
1080 call
hmskrd(lugb,imsk,jmsk,fnmskh,
1081 & kpdmsk,slmskh,gausm,blnmsk,bltmsk,me)
1086 write(6,*)
' lugb=',lugb,
' len=',len,
' lsoil=',lsoil
1087 write(6,*)
'iy=',iy,
' im=',im,
' id=',id,
' ih=',ih,
' fh=',fh
1088 &,
' sig1t(1)=',sig1t(1)
1089 &,
' gausm=',gausm,
' blnmsk=',blnmsk,
' bltmsk=',bltmsk
1095 allocate (tsfcl0(len))
1096 allocate (glacir(len))
1097 allocate (amxice(len))
1103 call
fixrdc(lugb,fnglac,kpdgla,kpd7,kpd9,slmask,
1105 &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk
1113 call
fixrdc(lugb,fnmxic,kpdmxi,kpd7,kpd9,slmask,
1115 &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk
1121 call
rof01(glacir,len,
'ge',crit)
1122 call
rof01(amxice,len,
'ge',crit)
1126 call
qcmxice(glacir,amxice,len,me)
1140 write(6,*)
'=============='
1141 write(6,*)
'climatology'
1142 write(6,*)
'=============='
1147 call
clima(lugb,iy,im,id,ih,fh,len,lsoil,slmask,
1148 & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
1149 & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc,
1151 & fnvmnc,fnvmxc,fnslpc,fnabsc,
1152 & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm,
1153 & tg3clm,cvclm ,cvbclm,cvtclm,
1154 & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm,
1155 & vetclm,sotclm,alfclm,
1156 & vmnclm,vmxclm,slpclm,absclm,
1157 & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais,
1158 & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg,
1159 & kpdvet,kpdsot,kpdalf,tsfcl0,
1160 & kpdvmn,kpdvmx,kpdslp,kpdabs,
1162 &, imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk,me
1163 &, lprnt,iprnt,fnalbc2,ialb,tile_num_ch,i_index,j_index)
1169 call
scale(zorclm,len,zsca)
1171 call
scale(albclm,len,zsca)
1172 call
scale(albclm(1,2),len,zsca)
1173 call
scale(albclm(1,3),len,zsca)
1174 call
scale(albclm(1,4),len,zsca)
1175 call
scale(alfclm,len,zsca)
1176 call
scale(alfclm(1,2),len,zsca)
1179 call
scale(vmnclm,len,zsca)
1180 call
scale(vmxclm,len,zsca)
1181 call
scale(absclm,len,zsca)
1186 call
albocn(albclm,slmask,albomx,len)
1190 call
landtyp(vetclm,sotclm,slpclm,slmask,len)
1196 if(fnaisc(1:8).ne.
' ')
then
1199 sihclm(i) = 3.0*aisclm(i)
1200 sicclm(i) = aisclm(i)
1201 if(slmask(i).eq.0..and.glacir(i).eq.1..and.
1202 & sicclm(i).ne.1.)
then
1204 sihfcs(i) = glacir_hice
1209 call
rof01(aisclm,len,
'ge',crit)
1210 elseif(fnacnc(1:8).ne.
' ')
then
1213 sihclm(i) = 3.0*acnclm(i)
1214 sicclm(i) = acnclm(i)
1215 if(slmask(i).eq.0..and.glacir(i).eq.1..and.
1216 & sicclm(i).ne.1.)
then
1218 sihfcs(i) = glacir_hice
1221 call
rof01(acnclm,len,
'ge',aislim)
1223 aisclm(i) = acnclm(i)
1229 call
qcsice(aisclm,glacir,amxice,aicice,aicsea,sllnd,slmask,
1234 call
setlsi(slmask,aisclm,len,aicice,sliclm)
1244 call
qcsnow(snoclm,slmask,aisclm,glacir,len,snosmx,landice,me)
1246 call
setzro(snoclm,epssno,len)
1253 call
qcmxmn(
'snow ',snoclm,sliclm,snoclm,icefl1,
1254 & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn,
1255 & snojmx,snojmn,snosmx,snosmn,epssno,
1256 & rla,rlo,len,kqcm,percrit,lgchek,me)
1263 if(fnscvc(1:8).eq.
' ')
then
1264 call
getscv(snoclm,scvclm,len)
1269 call
snosfc(snoclm,tsfclm,tsfsmx,len,me)
1276 icefl2(i) = sicclm(i) .gt. 0.99999
1279 call
qcmxmn(
'tsfc ',tsfclm,sliclm,snoclm,icefl2,
1280 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
1281 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
1282 & rla,rlo,len,kqcm,percrit,lgchek,me)
1283 call
qcmxmn(
'tsf2 ',tsfcl2,sliclm,snoclm,icefl2,
1284 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
1285 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
1286 & rla,rlo,len,kqcm,percrit,lgchek,me)
1288 call
qcmxmn(
'albc ',albclm(1,kk),sliclm,snoclm,icefl1,
1289 & alblmx,alblmn,albomx,albomn,albimx,albimn,
1290 & albjmx,albjmn,albsmx,albsmn,epsalb,
1291 & rla,rlo,len,kqcm,percrit,lgchek,me)
1293 if(fnwetc(1:8).ne.
' ')
then
1294 call
qcmxmn(
'wetc ',wetclm,sliclm,snoclm,icefl1,
1295 & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn,
1296 & wetjmx,wetjmn,wetsmx,wetsmn,epswet,
1297 & rla,rlo,len,kqcm,percrit,lgchek,me)
1299 call
qcmxmn(
'zorc ',zorclm,sliclm,snoclm,icefl1,
1300 & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn,
1301 & zorjmx,zorjmn,zorsmx,zorsmn,epszor,
1302 & rla,rlo,len,kqcm,percrit,lgchek,me)
1309 call
qcmxmn(
'tg3c ',tg3clm,sliclm,snoclm,icefl1,
1310 & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn,
1311 & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3,
1312 & rla,rlo,len,kqcm,percrit,lgchek,me)
1316 if(fnsmcc(1:8).eq.
' ')
then
1317 call
getsmc(wetclm,len,lsoil,smcclm,me)
1319 call
qcmxmn(
'smc1c ',smcclm(1,1),sliclm,snoclm,icefl1,
1320 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1321 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1322 & rla,rlo,len,kqcm,percrit,lgchek,me)
1323 call
qcmxmn(
'smc2c ',smcclm(1,2),sliclm,snoclm,icefl1,
1324 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1325 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1326 & rla,rlo,len,kqcm,percrit,lgchek,me)
1329 call
qcmxmn(
'smc3c ',smcclm(1,3),sliclm,snoclm,icefl1,
1330 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1331 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1332 & rla,rlo,len,kqcm,percrit,lgchek,me)
1333 call
qcmxmn(
'smc4c ',smcclm(1,4),sliclm,snoclm,icefl1,
1334 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1335 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1336 & rla,rlo,len,kqcm,percrit,lgchek,me)
1338 if(fnstcc(1:8).eq.
' ')
then
1339 call
getstc(tsfclm,tg3clm,sliclm,len,lsoil,stcclm,tsfimx)
1341 call
qcmxmn(
'stc1c ',stcclm(1,1),sliclm,snoclm,icefl1,
1342 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1343 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1344 & rla,rlo,len,kqcm,percrit,lgchek,me)
1345 call
qcmxmn(
'stc2c ',stcclm(1,2),sliclm,snoclm,icefl1,
1346 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1347 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1348 & rla,rlo,len,kqcm,percrit,lgchek,me)
1351 call
qcmxmn(
'stc3c ',stcclm(1,3),sliclm,snoclm,icefl1,
1352 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1353 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1354 & rla,rlo,len,kqcm,percrit,lgchek,me)
1355 call
qcmxmn(
'stc4c ',stcclm(1,4),sliclm,snoclm,icefl1,
1356 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1357 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1358 & rla,rlo,len,kqcm,percrit,lgchek,me)
1360 call
qcmxmn(
'vegc ',vegclm,sliclm,snoclm,icefl1,
1361 & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn,
1362 & vegjmx,vegjmn,vegsmx,vegsmn,epsveg,
1363 & rla,rlo,len,kqcm,percrit,lgchek,me)
1364 call
qcmxmn(
'vetc ',vetclm,sliclm,snoclm,icefl1,
1365 & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn,
1366 & vetjmx,vetjmn,vetsmx,vetsmn,epsvet,
1367 & rla,rlo,len,kqcm,percrit,lgchek,me)
1368 call
qcmxmn(
'sotc ',sotclm,sliclm,snoclm,icefl1,
1369 & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn,
1370 & sotjmx,sotjmn,sotsmx,sotsmn,epssot,
1371 & rla,rlo,len,kqcm,percrit,lgchek,me)
1373 call
qcmxmn(
'sihc ',sihclm,sliclm,snoclm,icefl1,
1374 & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn,
1375 & sihjmx,sihjmn,sihsmx,sihsmn,epssih,
1376 & rla,rlo,len,kqcm,percrit,lgchek,me)
1377 call
qcmxmn(
'sicc ',sicclm,sliclm,snoclm,icefl1,
1378 & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn,
1379 & sicjmx,sicjmn,sicsmx,sicsmn,epssic,
1380 & rla,rlo,len,kqcm,percrit,lgchek,me)
1382 call
qcmxmn(
'vmnc ',vmnclm,sliclm,snoclm,icefl1,
1383 & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn,
1384 & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn,
1385 & rla,rlo,len,kqcm,percrit,lgchek,me)
1386 call
qcmxmn(
'vmxc ',vmxclm,sliclm,snoclm,icefl1,
1387 & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn,
1388 & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx,
1389 & rla,rlo,len,kqcm,percrit,lgchek,me)
1390 call
qcmxmn(
'slpc ',slpclm,sliclm,snoclm,icefl1,
1391 & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn,
1392 & slpjmx,slpjmn,slpsmx,slpsmn,epsslp,
1393 & rla,rlo,len,kqcm,percrit,lgchek,me)
1394 call
qcmxmn(
'absc ',absclm,sliclm,snoclm,icefl1,
1395 & abslmx,abslmn,absomx,absomn,absimx,absimn,
1396 & absjmx,absjmn,abssmx,abssmn,epsabs,
1397 & rla,rlo,len,kqcm,percrit,lgchek,me)
1405 print *,
'monitor of time and space interpolated climatology'
1409 call
monitr(
'tsfclm',tsfclm,sliclm,snoclm,len)
1410 call
monitr(
'albclm',albclm(1,1),sliclm,snoclm,len)
1411 call
monitr(
'albclm',albclm(1,2),sliclm,snoclm,len)
1412 call
monitr(
'albclm',albclm(1,3),sliclm,snoclm,len)
1413 call
monitr(
'albclm',albclm(1,4),sliclm,snoclm,len)
1414 call
monitr(
'aisclm',aisclm,sliclm,snoclm,len)
1415 call
monitr(
'snoclm',snoclm,sliclm,snoclm,len)
1416 call
monitr(
'scvclm',scvclm,sliclm,snoclm,len)
1417 call
monitr(
'smcclm1',smcclm(1,1),sliclm,snoclm,len)
1418 call
monitr(
'smcclm2',smcclm(1,2),sliclm,snoclm,len)
1419 call
monitr(
'stcclm1',stcclm(1,1),sliclm,snoclm,len)
1420 call
monitr(
'stcclm2',stcclm(1,2),sliclm,snoclm,len)
1423 call
monitr(
'smcclm3',smcclm(1,3),sliclm,snoclm,len)
1424 call
monitr(
'smcclm4',smcclm(1,4),sliclm,snoclm,len)
1425 call
monitr(
'stcclm3',stcclm(1,3),sliclm,snoclm,len)
1426 call
monitr(
'stcclm4',stcclm(1,4),sliclm,snoclm,len)
1428 call
monitr(
'tg3clm',tg3clm,sliclm,snoclm,len)
1429 call
monitr(
'zorclm',zorclm,sliclm,snoclm,len)
1431 call
monitr(
'cvaclm',cvclm ,sliclm,snoclm,len)
1432 call
monitr(
'cvbclm',cvbclm,sliclm,snoclm,len)
1433 call
monitr(
'cvtclm',cvtclm,sliclm,snoclm,len)
1435 call
monitr(
'sliclm',sliclm,sliclm,snoclm,len)
1437 call
monitr(
'orog ',orog ,sliclm,snoclm,len)
1438 call
monitr(
'vegclm',vegclm,sliclm,snoclm,len)
1439 call
monitr(
'vetclm',vetclm,sliclm,snoclm,len)
1440 call
monitr(
'sotclm',sotclm,sliclm,snoclm,len)
1442 call
monitr(
'sihclm',sihclm,sliclm,snoclm,len)
1443 call
monitr(
'sicclm',sicclm,sliclm,snoclm,len)
1445 call
monitr(
'vmnclm',vmnclm,sliclm,snoclm,len)
1446 call
monitr(
'vmxclm',vmxclm,sliclm,snoclm,len)
1447 call
monitr(
'slpclm',slpclm,sliclm,snoclm,len)
1448 call
monitr(
'absclm',absclm,sliclm,snoclm,len)
1454 write(6,*)
'=============='
1455 write(6,*)
' analysis'
1456 write(6,*)
'=============='
1461 call
filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl,
1462 & tg3anl,cvanl ,cvbanl,cvtanl,
1463 & cnpanl,smcanl,stcanl,slianl,scvanl,veganl,
1464 & vetanl,sotanl,alfanl,
1466 & vmnanl,vmxanl,slpanl,absanl,
1467 & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm,
1468 & tg3clm,cvclm ,cvbclm,cvtclm,
1469 & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm,
1470 & vetclm,sotclm,alfclm,
1472 & vmnclm,vmxclm,slpclm,absclm,
1478 call
scale(zoranl,len, zsca)
1480 call
scale(albanl,len,zsca)
1481 call
scale(albanl(1,2),len,zsca)
1482 call
scale(albanl(1,3),len,zsca)
1483 call
scale(albanl(1,4),len,zsca)
1484 call
scale(alfanl,len,zsca)
1485 call
scale(alfanl(1,2),len,zsca)
1488 call
scale(vmnanl,len,zsca)
1489 call
scale(vmxanl,len,zsca)
1490 call
scale(absanl,len,zsca)
1496 call
analy(lugb,iy,im,id,ih,fh,len,lsoil,slmask,
1497 & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
1498 & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega,
1500 & fnvmna,fnvmxa,fnslpa,fnabsa,
1501 & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl,
1502 & tg3anl,cvanl ,cvbanl,cvtanl,
1503 & smcanl,stcanl,slianl,scvanl,acnanl,veganl,
1504 & vetanl,sotanl,alfanl,tsfan0,
1505 & vmnanl,vmxanl,slpanl,absanl,
1506 & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais,
1507 & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg,
1508 & kpdvet,kpdsot,kpdalf,
1509 & kpdvmn,kpdvmx,kpdslp,kpdabs,
1510 & irttsf,irtwet,irtsno,irtzor,irtalb,irtais,
1511 & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg,
1512 & irtvet,irtsot,irtalf
1513 &, irtvmn,irtvmx,irtslp,irtabs,
1514 & imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk
1521 call
scale(zoranl,len, zsca)
1523 call
scale(albanl,len,zsca)
1524 call
scale(albanl(1,2),len,zsca)
1525 call
scale(albanl(1,3),len,zsca)
1526 call
scale(albanl(1,4),len,zsca)
1527 call
scale(alfanl,len,zsca)
1528 call
scale(alfanl(1,2),len,zsca)
1531 call
scale(vmnanl,len,zsca)
1532 call
scale(vmxanl,len,zsca)
1533 call
scale(absanl,len,zsca)
1537 if(fh > 0.0 .and. fntsfa(1:8) /=
' ' .and. lanom)
then
1538 call
anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len)
1545 if (use_ufo .and. .not. nst_anl)
then
1547 call
tsfcor(tsfanl,orog_uf,slmask,ztsfc,len,rlapse)
1552 if(fnaisa(1:8).ne.
' ')
then
1555 sihanl(i) = 3.0*aisanl(i)
1556 sicanl(i) = aisanl(i)
1557 if(slmask(i).eq.0..and.glacir(i).eq.1..and.
1558 & sicanl(i).ne.1.)
then
1560 sihfcs(i) = glacir_hice
1565 call
rof01(aisanl,len,
'ge',crit)
1566 elseif(fnacna(1:8).ne.
' ')
then
1569 sihanl(i) = 3.0*acnanl(i)
1570 sicanl(i) = acnanl(i)
1571 if(slmask(i).eq.0..and.glacir(i).eq.1..and.
1572 & sicanl(i).ne.1.)
then
1574 sihfcs(i) = glacir_hice
1579 if((slianl(i).eq.0.).and.(sicanl(i).ge.crit))
then
1582 else if((slianl(i).ge.2.).and.(sicanl(i).lt.crit))
then
1585 else if((slianl(i).eq.1.).and.(sicanl(i).ge.sicimn))
then
1598 call
rof01(acnanl,len,
'ge',aislim)
1606 call
qcsice(aisanl,glacir,amxice,aicice,aicsea,sllnd,slmask,
1611 call
setlsi(slmask,aisanl,len,aicice,slianl)
1618 if (slianl(i) .eq. 0)
then
1619 smcanl(i,k) = smcomx
1620 stcanl(i,k) = tsfanl(i)
1629 call
qcmxmn(
'siha ',sihanl,slianl,snoanl,icefl1,
1630 & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn,
1631 & sihjmx,sihjmn,sihsmx,sihsmn,epssih,
1632 & rla,rlo,len,kqcm,percrit,lgchek,me)
1633 call
qcmxmn(
'sica ',sicanl,slianl,snoanl,icefl1,
1634 & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn,
1635 & sicjmx,sicjmn,sicsmx,sicsmn,epssic,
1636 & rla,rlo,len,kqcm,percrit,lgchek,me)
1640 call
albocn(albanl,slmask,albomx,len)
1645 if(fnsnoa(1:8).ne.
' ')
then
1646 call
setzro(snoanl,epssno,len)
1647 call
qcsnow(snoanl,slmask,aisanl,glacir,len,ten,landice,me)
1648 if (.not.landice)
then
1649 call
snodpth2(glacir,snosmx,snoanl, len, me)
1652 call
snosfc(snoanl,tsfanl,tsfsmx,len,me)
1653 call
qcmxmn(
'snoa ',snoanl,slianl,snoanl,icefl1,
1654 & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn,
1655 & snojmx,snojmn,snosmx,snosmn,epssno,
1656 & rla,rlo,len,kqcm,percrit,lgchek,me)
1657 call
getscv(snoanl,scvanl,len)
1658 call
qcmxmn(
'sncva ',scvanl,slianl,snoanl,icefl1,
1659 & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn,
1660 & scvjmx,scvjmn,scvsmx,scvsmn,epsscv,
1661 & rla,rlo,len,kqcm,percrit,lgchek,me)
1664 call
rof01(scvanl,len,
'ge',crit)
1665 call
qcsnow(scvanl,slmask,aisanl,glacir,len,one,landice,me)
1666 call
qcmxmn(
'sncva ',scvanl,slianl,scvanl,icefl1,
1667 & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn,
1668 & scvjmx,scvjmn,scvsmx,scvsmn,epsscv,
1669 & rla,rlo,len,kqcm,percrit,lgchek,me)
1670 call
snodpth(scvanl,slianl,tsfanl,snoclm,
1671 & glacir,snwmax,snwmin,landice,len,snoanl,me)
1672 call
qcsnow(scvanl,slmask,aisanl,glacir,len,snosmx,landice,me)
1673 call
snosfc(snoanl,tsfanl,tsfsmx,len,me)
1674 call
qcmxmn(
'snowa ',snoanl,slianl,snoanl,icefl1,
1675 & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn,
1676 & snojmx,snojmn,snosmx,snosmn,epssno,
1677 & rla,rlo,len,kqcm,percrit,lgchek,me)
1681 icefl2(i) = sicanl(i) .gt. 0.99999
1683 call
qcmxmn(
'tsfa ',tsfanl,slianl,snoanl,icefl2,
1684 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
1685 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
1686 & rla,rlo,len,kqcm,percrit,lgchek,me)
1688 call
qcmxmn(
'alba ',albanl(1,kk),slianl,snoanl,icefl1,
1689 & alblmx,alblmn,albomx,albomn,albimx,albimn,
1690 & albjmx,albjmn,albsmx,albsmn,epsalb,
1691 & rla,rlo,len,kqcm,percrit,lgchek,me)
1693 if(fnwetc(1:8).ne.
' ' .or. fnweta(1:8).ne.
' ' )
then
1694 call
qcmxmn(
'weta ',wetanl,slianl,snoanl,icefl1,
1695 & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn,
1696 & wetjmx,wetjmn,wetsmx,wetsmn,epswet,
1697 & rla,rlo,len,kqcm,percrit,lgchek,me)
1699 call
qcmxmn(
'zora ',zoranl,slianl,snoanl,icefl1,
1700 & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn,
1701 & zorjmx,zorjmn,zorsmx,zorsmn,epszor,
1702 & rla,rlo,len,kqcm,percrit,lgchek,me)
1709 call
qcmxmn(
'tg3a ',tg3anl,slianl,snoanl,icefl1,
1710 & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn,
1711 & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3,
1712 & rla,rlo,len,kqcm,percrit,lgchek,me)
1716 if(fnsmca(1:8).eq.
' ' .and. fnsmcc(1:8).eq.
' ')
then
1717 call
getsmc(wetanl,len,lsoil,smcanl,me)
1719 call
qcmxmn(
'smc1a ',smcanl(1,1),slianl,snoanl,icefl1,
1720 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1721 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1722 & rla,rlo,len,kqcm,percrit,lgchek,me)
1723 call
qcmxmn(
'smc2a ',smcanl(1,2),slianl,snoanl,icefl1,
1724 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1725 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1726 & rla,rlo,len,kqcm,percrit,lgchek,me)
1729 call
qcmxmn(
'smc3a ',smcanl(1,3),slianl,snoanl,icefl1,
1730 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1731 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1732 & rla,rlo,len,kqcm,percrit,lgchek,me)
1733 call
qcmxmn(
'smc4a ',smcanl(1,4),slianl,snoanl,icefl1,
1734 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1735 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1736 & rla,rlo,len,kqcm,percrit,lgchek,me)
1738 if(fnstca(1:8).eq.
' ')
then
1739 call
getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx)
1741 call
qcmxmn(
'stc1a ',stcanl(1,1),slianl,snoanl,icefl1,
1742 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1743 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1744 & rla,rlo,len,kqcm,percrit,lgchek,me)
1745 call
qcmxmn(
'stc2a ',stcanl(1,2),slianl,snoanl,icefl1,
1746 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1747 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1748 & rla,rlo,len,kqcm,percrit,lgchek,me)
1751 call
qcmxmn(
'stc3a ',stcanl(1,3),slianl,snoanl,icefl1,
1752 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1753 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1754 & rla,rlo,len,kqcm,percrit,lgchek,me)
1755 call
qcmxmn(
'stc4a ',stcanl(1,4),slianl,snoanl,icefl1,
1756 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1757 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1758 & rla,rlo,len,kqcm,percrit,lgchek,me)
1760 call
qcmxmn(
'vega ',veganl,slianl,snoanl,icefl1,
1761 & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn,
1762 & vegjmx,vegjmn,vegsmx,vegsmn,epsveg,
1763 & rla,rlo,len,kqcm,percrit,lgchek,me)
1764 call
qcmxmn(
'veta ',vetanl,slianl,snoanl,icefl1,
1765 & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn,
1766 & vetjmx,vetjmn,vetsmx,vetsmn,epsvet,
1767 & rla,rlo,len,kqcm,percrit,lgchek,me)
1768 call
qcmxmn(
'sota ',sotanl,slianl,snoanl,icefl1,
1769 & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn,
1770 & sotjmx,sotjmn,sotsmx,sotsmn,epssot,
1771 & rla,rlo,len,kqcm,percrit,lgchek,me)
1773 call
qcmxmn(
'vmna ',vmnanl,slianl,snoanl,icefl1,
1774 & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn,
1775 & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn,
1776 & rla,rlo,len,kqcm,percrit,lgchek,me)
1777 call
qcmxmn(
'vmxa ',vmxanl,slianl,snoanl,icefl1,
1778 & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn,
1779 & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx,
1780 & rla,rlo,len,kqcm,percrit,lgchek,me)
1781 call
qcmxmn(
'slpa ',slpanl,slianl,snoanl,icefl1,
1782 & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn,
1783 & slpjmx,slpjmn,slpsmx,slpsmn,epsslp,
1784 & rla,rlo,len,kqcm,percrit,lgchek,me)
1785 call
qcmxmn(
'absa ',absanl,slianl,snoanl,icefl1,
1786 & abslmx,abslmn,absomx,absomn,absimx,absimn,
1787 & absjmx,absjmn,abssmx,abssmn,epsabs,
1788 & rla,rlo,len,kqcm,percrit,lgchek,me)
1796 print *,
'monitor of time and space interpolated analysis'
1800 call
monitr(
'tsfanl',tsfanl,slianl,snoanl,len)
1801 call
monitr(
'albanl',albanl,slianl,snoanl,len)
1802 call
monitr(
'aisanl',aisanl,slianl,snoanl,len)
1803 call
monitr(
'snoanl',snoanl,slianl,snoanl,len)
1804 call
monitr(
'scvanl',scvanl,slianl,snoanl,len)
1805 call
monitr(
'smcanl1',smcanl(1,1),slianl,snoanl,len)
1806 call
monitr(
'smcanl2',smcanl(1,2),slianl,snoanl,len)
1807 call
monitr(
'stcanl1',stcanl(1,1),slianl,snoanl,len)
1808 call
monitr(
'stcanl2',stcanl(1,2),slianl,snoanl,len)
1811 call
monitr(
'smcanl3',smcanl(1,3),slianl,snoanl,len)
1812 call
monitr(
'smcanl4',smcanl(1,4),slianl,snoanl,len)
1813 call
monitr(
'stcanl3',stcanl(1,3),slianl,snoanl,len)
1814 call
monitr(
'stcanl4',stcanl(1,4),slianl,snoanl,len)
1816 call
monitr(
'tg3anl',tg3anl,slianl,snoanl,len)
1817 call
monitr(
'zoranl',zoranl,slianl,snoanl,len)
1819 call
monitr(
'cvaanl',cvanl ,slianl,snoanl,len)
1820 call
monitr(
'cvbanl',cvbanl,slianl,snoanl,len)
1821 call
monitr(
'cvtanl',cvtanl,slianl,snoanl,len)
1823 call
monitr(
'slianl',slianl,slianl,snoanl,len)
1825 call
monitr(
'orog ',orog ,slianl,snoanl,len)
1826 call
monitr(
'veganl',veganl,slianl,snoanl,len)
1827 call
monitr(
'vetanl',vetanl,slianl,snoanl,len)
1828 call
monitr(
'sotanl',sotanl,slianl,snoanl,len)
1830 call
monitr(
'sihanl',sihanl,slianl,snoanl,len)
1831 call
monitr(
'sicanl',sicanl,slianl,snoanl,len)
1833 call
monitr(
'vmnanl',vmnanl,slianl,snoanl,len)
1834 call
monitr(
'vmxanl',vmxanl,slianl,snoanl,len)
1835 call
monitr(
'slpanl',slpanl,slianl,snoanl,len)
1836 call
monitr(
'absanl',absanl,slianl,snoanl,len)
1844 write(6,*)
'=============='
1845 write(6,*)
' fcst guess'
1846 write(6,*)
'=============='
1856 if (me .eq. 0)
write(6,*)
'this run is dead start run'
1857 call
filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs,
1858 & tg3fcs,cvfcs ,cvbfcs,cvtfcs,
1859 & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs,
1860 & vegfcs,vetfcs,sotfcs,alffcs,
1864 & vmnfcs,vmxfcs,slpfcs,absfcs,
1865 & tsfanl,wetanl,snoanl,zoranl,albanl,
1866 & tg3anl,cvanl ,cvbanl,cvtanl,
1867 & cnpanl,smcanl,stcanl,slianl,aisanl,
1868 & veganl,vetanl,sotanl,alfanl,
1872 & vmnanl,vmxanl,slpanl,absanl,
1874 if(sig1t(1).ne.0.)
then
1875 call
usesgt(sig1t,slianl,tg3anl,len,lsoil,tsffcs,stcfcs,
1878 icefl2(i) = sicfcs(i) .gt. 0.99999
1881 call
qcmxmn(
'tsff ',tsffcs,slifcs,snofcs,icefl2,
1882 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
1883 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
1884 & rla,rlo,len,kqcm,percrit,lgchek,me)
1885 call
qcmxmn(
'stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1,
1886 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1887 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1888 & rla,rlo,len,kqcm,percrit,lgchek,me)
1889 call
qcmxmn(
'stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1,
1890 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
1891 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
1892 & rla,rlo,len,kqcm,percrit,lgchek,me)
1901 orogd = orog - orog_uf
1907 if ( index(fntg3c,
"tileX.nc") == 0)
then
1909 call
tsfcor(tg3fcs,orogd,slmask,ztsfc,len,-rlapse)
1912 call
tsfcor(tsffcs,orogd,slmask,ztsfc,len,-rlapse)
1915 call
tsfcor(tsffcs,orog,slmask,ztsfc,len,-rlapse)
1924 if(smcfcs(i,j) .ne. 0.)
then
1925 swratio(i,j) = slcfcs(i,j)/smcfcs(i,j)
1927 swratio(i,j) = -999.
1933 if(lqcbgs .and. irtacn .eq. 0)
then
1934 call
qcsli(slianl,slifcs,len,me)
1935 call
albocn(albfcs,slmask,albomx,len)
1937 icefl2(i) = sicfcs(i) .gt. 0.99999
1940 call
qcmxmn(
'snof ',snofcs,slifcs,snofcs,icefl1,
1941 & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn,
1942 & snojmx,snojmn,snosmx,snosmn,epssno,
1943 & rla,rlo,len,kqcm,percrit,lgchek,me)
1944 call
qcmxmn(
'tsff ',tsffcs,slifcs,snofcs,icefl2,
1945 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
1946 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
1947 & rla,rlo,len,kqcm,percrit,lgchek,me)
1949 call
qcmxmn(
'albf ',albfcs(1,kk),slifcs,snofcs,icefl1,
1950 & alblmx,alblmn,albomx,albomn,albimx,albimn,
1951 & albjmx,albjmn,albsmx,albsmn,epsalb,
1952 & rla,rlo,len,kqcm,percrit,lgchek,me)
1954 if(fnwetc(1:8).ne.
' ' .or. fnweta(1:8).ne.
' ' )
1956 call
qcmxmn(
'wetf ',wetfcs,slifcs,snofcs,icefl1,
1957 & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn,
1958 & wetjmx,wetjmn,wetsmx,wetsmn,epswet,
1959 & rla,rlo,len,kqcm,percrit,lgchek,me)
1961 call
qcmxmn(
'zorf ',zorfcs,slifcs,snofcs,icefl1,
1962 & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn,
1963 & zorjmx,zorjmn,zorsmx,zorsmn,epszor,
1964 & rla,rlo,len,kqcm,percrit,lgchek,me)
1971 call
qcmxmn(
'tg3f ',tg3fcs,slifcs,snofcs,icefl1,
1972 & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn,
1973 & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3,
1974 & rla,rlo,len,kqcm,percrit,lgchek,me)
1976 call
qcmxmn(
'sihf ',sihfcs,slifcs,snofcs,icefl1,
1977 & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn,
1978 & sihjmx,sihjmn,sihsmx,sihsmn,epssih,
1979 & rla,rlo,len,kqcm,percrit,lgchek,me)
1980 call
qcmxmn(
'sicf ',sicfcs,slifcs,snofcs,icefl1,
1981 & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn,
1982 & sicjmx,sicjmn,sicsmx,sicsmn,epssic,
1983 & rla,rlo,len,kqcm,percrit,lgchek,me)
1984 call
qcmxmn(
'smc1f ',smcfcs(1,1),slifcs,snofcs,icefl1,
1985 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1986 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1987 & rla,rlo,len,kqcm,percrit,lgchek,me)
1988 call
qcmxmn(
'smc2f ',smcfcs(1,2),slifcs,snofcs,icefl1,
1989 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1990 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1991 & rla,rlo,len,kqcm,percrit,lgchek,me)
1994 call
qcmxmn(
'smc3f ',smcfcs(1,3),slifcs,snofcs,icefl1,
1995 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
1996 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
1997 & rla,rlo,len,kqcm,percrit,lgchek,me)
1998 call
qcmxmn(
'smc4f ',smcfcs(1,4),slifcs,snofcs,icefl1,
1999 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
2000 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
2001 & rla,rlo,len,kqcm,percrit,lgchek,me)
2003 call
qcmxmn(
'stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1,
2004 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2005 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2006 & rla,rlo,len,kqcm,percrit,lgchek,me)
2007 call
qcmxmn(
'stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1,
2008 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2009 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2010 & rla,rlo,len,kqcm,percrit,lgchek,me)
2013 call
qcmxmn(
'stc3f ',stcfcs(1,3),slifcs,snofcs,icefl1,
2014 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2015 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2016 & rla,rlo,len,kqcm,percrit,lgchek,me)
2017 call
qcmxmn(
'stc4f ',stcfcs(1,4),slifcs,snofcs,icefl1,
2018 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2019 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2020 & rla,rlo,len,kqcm,percrit,lgchek,me)
2022 call
qcmxmn(
'vegf ',vegfcs,slifcs,snofcs,icefl1,
2023 & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn,
2024 & vegjmx,vegjmn,vegsmx,vegsmn,epsveg,
2025 & rla,rlo,len,kqcm,percrit,lgchek,me)
2026 call
qcmxmn(
'vetf ',vetfcs,slifcs,snofcs,icefl1,
2027 & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn,
2028 & vetjmx,vetjmn,vetsmx,vetsmn,epsvet,
2029 & rla,rlo,len,kqcm,percrit,lgchek,me)
2030 call
qcmxmn(
'sotf ',sotfcs,slifcs,snofcs,icefl1,
2031 & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn,
2032 & sotjmx,sotjmn,sotsmx,sotsmn,epssot,
2033 & rla,rlo,len,kqcm,percrit,lgchek,me)
2036 call
qcmxmn(
'vmnf ',vmnfcs,slifcs,snofcs,icefl1,
2037 & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn,
2038 & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn,
2039 & rla,rlo,len,kqcm,percrit,lgchek,me)
2040 call
qcmxmn(
'vmxf ',vmxfcs,slifcs,snofcs,icefl1,
2041 & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn,
2042 & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx,
2043 & rla,rlo,len,kqcm,percrit,lgchek,me)
2044 call
qcmxmn(
'slpf ',slpfcs,slifcs,snofcs,icefl1,
2045 & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn,
2046 & slpjmx,slpjmn,slpsmx,slpsmn,epsslp,
2047 & rla,rlo,len,kqcm,percrit,lgchek,me)
2048 call
qcmxmn(
'absf ',absfcs,slifcs,snofcs,icefl1,
2049 & abslmx,abslmn,absomx,absomn,absimx,absimn,
2050 & absjmx,absjmn,abssmx,abssmn,epsabs,
2051 & rla,rlo,len,kqcm,percrit,lgchek,me)
2059 print *,
'monitor of guess'
2063 call
monitr(
'tsffcs',tsffcs,slifcs,snofcs,len)
2064 call
monitr(
'albfcs',albfcs,slifcs,snofcs,len)
2065 call
monitr(
'aisfcs',aisfcs,slifcs,snofcs,len)
2066 call
monitr(
'snofcs',snofcs,slifcs,snofcs,len)
2067 call
monitr(
'smcfcs1',smcfcs(1,1),slifcs,snofcs,len)
2068 call
monitr(
'smcfcs2',smcfcs(1,2),slifcs,snofcs,len)
2069 call
monitr(
'stcfcs1',stcfcs(1,1),slifcs,snofcs,len)
2070 call
monitr(
'stcfcs2',stcfcs(1,2),slifcs,snofcs,len)
2073 call
monitr(
'smcfcs3',smcfcs(1,3),slifcs,snofcs,len)
2074 call
monitr(
'smcfcs4',smcfcs(1,4),slifcs,snofcs,len)
2075 call
monitr(
'stcfcs3',stcfcs(1,3),slifcs,snofcs,len)
2076 call
monitr(
'stcfcs4',stcfcs(1,4),slifcs,snofcs,len)
2078 call
monitr(
'tg3fcs',tg3fcs,slifcs,snofcs,len)
2079 call
monitr(
'zorfcs',zorfcs,slifcs,snofcs,len)
2081 call
monitr(
'cvafcs',cvfcs ,slifcs,snofcs,len)
2082 call
monitr(
'cvbfcs',cvbfcs,slifcs,snofcs,len)
2083 call
monitr(
'cvtfcs',cvtfcs,slifcs,snofcs,len)
2085 call
monitr(
'slifcs',slifcs,slifcs,snofcs,len)
2087 call
monitr(
'orog ',orog ,slifcs,snofcs,len)
2088 call
monitr(
'vegfcs',vegfcs,slifcs,snofcs,len)
2089 call
monitr(
'vetfcs',vetfcs,slifcs,snofcs,len)
2090 call
monitr(
'sotfcs',sotfcs,slifcs,snofcs,len)
2092 call
monitr(
'sihfcs',sihfcs,slifcs,snofcs,len)
2093 call
monitr(
'sicfcs',sicfcs,slifcs,snofcs,len)
2095 call
monitr(
'vmnfcs',vmnfcs,slifcs,snofcs,len)
2096 call
monitr(
'vmxfcs',vmxfcs,slifcs,snofcs,len)
2097 call
monitr(
'slpfcs',slpfcs,slifcs,snofcs,len)
2098 call
monitr(
'absfcs',absfcs,slifcs,snofcs,len)
2107 if (fh-deltsfc > -0.001 )
then
2109 if(slianl(i) == 0.0)
then
2110 tsffcs(i) = tsffcs(i) + (tsfclm(i) - tsfcl2(i))
2117 call
qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi,len,lsoil,
2118 & snoanl,aisanl,slianl,tsfanl,albanl,
2120 & smcclm,tsfsmx,albomx,zoromx,me)
2125 write(6,*)
'=============='
2126 write(6,*)
' merging'
2127 write(6,*)
'=============='
2135 call
merge(len,lsoil,iy,im,id,ih,fh,deltsfc,
2137 & vmnfcs,vmxfcs,slpfcs,absfcs,
2138 & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs,
2139 & cvfcs ,cvbfcs,cvtfcs,
2140 & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs,
2141 & vetfcs,sotfcs,alffcs,
2143 & vmnanl,vmxanl,slpanl,absanl,
2144 & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl,
2145 & cvanl ,cvbanl,cvtanl,
2146 & cnpanl,smcanl,stcanl,slianl,veganl,
2147 & vetanl,sotanl,alfanl,
2148 & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl,
2149 & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs,
2150 & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots,
2152 & csihl,csihs,csicl,csics,
2153 & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss,
2154 & irttsf,irtwet,irtsno,irtzor,irtalb,irtais,
2155 & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg,
2156 & irtvmn,irtvmx,irtslp,irtabs,
2157 & irtvet,irtsot,irtalf,landice,me)
2159 call
setzro(snoanl,epssno,len)
2167 call
newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil,
2169 & sihnew,aislim,sihanl,sicanl,
2170 & albanl,snoanl,zoranl,smcanl,stcanl,
2171 & albomx,snoomx,zoromx,smcomx,smcimx,
2174 & tsfomn,tsfimx,albimn,zorimx,tgice,
2182 call
snosfc(snoanl,tsfanl,tsfsmx,len,me)
2185 icefl2(i) = sicanl(i) .gt. 0.99999
2188 call
qcmxmn(
'snowm ',snoanl,slianl,snoanl,icefl1,
2189 & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn,
2190 & snojmx,snojmn,snosmx,snosmn,epssno,
2191 & rla,rlo,len,kqcm,percrit,lgchek,me)
2192 call
qcmxmn(
'tsfm ',tsfanl,slianl,snoanl,icefl2,
2193 & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn,
2194 & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf,
2195 & rla,rlo,len,kqcm,percrit,lgchek,me)
2197 call
qcmxmn(
'albm ',albanl(1,kk),slianl,snoanl,icefl1,
2198 & alblmx,alblmn,albomx,albomn,albimx,albimn,
2199 & albjmx,albjmn,albsmx,albsmn,epsalb,
2200 & rla,rlo,len,kqcm,percrit,lgchek,me)
2202 if(fnwetc(1:8).ne.
' ' .or. fnweta(1:8).ne.
' ' )
2204 call
qcmxmn(
'wetm ',wetanl,slianl,snoanl,icefl1,
2205 & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn,
2206 & wetjmx,wetjmn,wetsmx,wetsmn,epswet,
2207 & rla,rlo,len,kqcm,percrit,lgchek,me)
2209 call
qcmxmn(
'zorm ',zoranl,slianl,snoanl,icefl1,
2210 & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn,
2211 & zorjmx,zorjmn,zorsmx,zorsmn,epszor,
2212 & rla,rlo,len,kqcm,percrit,lgchek,me)
2220 call
qcmxmn(
'stc1m ',stcanl(1,1),slianl,snoanl,icefl1,
2221 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2222 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2223 & rla,rlo,len,kqcm,percrit,lgchek,me)
2224 call
qcmxmn(
'stc2m ',stcanl(1,2),slianl,snoanl,icefl1,
2225 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2226 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2227 & rla,rlo,len,kqcm,percrit,lgchek,me)
2230 call
qcmxmn(
'stc3m ',stcanl(1,3),slianl,snoanl,icefl1,
2231 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2232 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2233 & rla,rlo,len,kqcm,percrit,lgchek,me)
2234 call
qcmxmn(
'stc4m ',stcanl(1,4),slianl,snoanl,icefl1,
2235 & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn,
2236 & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc,
2237 & rla,rlo,len,kqcm,percrit,lgchek,me)
2239 call
qcmxmn(
'smc1m ',smcanl(1,1),slianl,snoanl,icefl1,
2240 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
2241 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
2242 & rla,rlo,len,kqcm,percrit,lgchek,me)
2243 call
qcmxmn(
'smc2m ',smcanl(1,2),slianl,snoanl,icefl1,
2244 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
2245 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
2246 & rla,rlo,len,kqcm,percrit,lgchek,me)
2249 call
qcmxmn(
'smc3m ',smcanl(1,3),slianl,snoanl,icefl1,
2250 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
2251 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
2252 & rla,rlo,len,kqcm,percrit,lgchek,me)
2253 call
qcmxmn(
'smc4m ',smcanl(1,4),slianl,snoanl,icefl1,
2254 & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn,
2255 & smcjmx,smcjmn,smcsmx,smcsmn,epssmc,
2256 & rla,rlo,len,kqcm,percrit,lgchek,me)
2259 call
qcmxmn(
'vegm ',veganl,slianl,snoanl,icefl1,
2260 & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn,
2261 & vegjmx,vegjmn,vegsmx,vegsmn,epsveg,
2262 & rla,rlo,len,kqcm,percrit,lgchek,me)
2263 call
qcmxmn(
'vetm ',vetanl,slianl,snoanl,icefl1,
2264 & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn,
2265 & vetjmx,vetjmn,vetsmx,vetsmn,epsvet,
2266 & rla,rlo,len,kqcm,percrit,lgchek,me)
2267 call
qcmxmn(
'sotm ',sotanl,slianl,snoanl,icefl1,
2268 & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn,
2269 & sotjmx,sotjmn,sotsmx,sotsmn,epssot,
2270 & rla,rlo,len,kqcm,percrit,lgchek,me)
2272 call
qcmxmn(
'sihm ',sihanl,slianl,snoanl,icefl1,
2273 & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn,
2274 & sihjmx,sihjmn,sihsmx,sihsmn,epssih,
2275 & rla,rlo,len,kqcm,percrit,lgchek,me)
2276 call
qcmxmn(
'sicm ',sicanl,slianl,snoanl,icefl1,
2277 & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn,
2278 & sicjmx,sicjmn,sicsmx,sicsmn,epssic,
2279 & rla,rlo,len,kqcm,percrit,lgchek,me)
2281 call
qcmxmn(
'vmnm ',vmnanl,slianl,snoanl,icefl1,
2282 & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn,
2283 & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn,
2284 & rla,rlo,len,kqcm,percrit,lgchek,me)
2285 call
qcmxmn(
'vmxm ',vmxanl,slianl,snoanl,icefl1,
2286 & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn,
2287 & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx,
2288 & rla,rlo,len,kqcm,percrit,lgchek,me)
2289 call
qcmxmn(
'slpm ',slpanl,slianl,snoanl,icefl1,
2290 & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn,
2291 & slpjmx,slpjmn,slpsmx,slpsmn,epsslp,
2292 & rla,rlo,len,kqcm,percrit,lgchek,me)
2293 call
qcmxmn(
'absm ',absanl,slianl,snoanl,icefl1,
2294 & abslmx,abslmn,absomx,absomn,absimx,absimn,
2295 & absjmx,absjmn,abssmx,abssmn,epsabs,
2296 & rla,rlo,len,kqcm,percrit,lgchek,me)
2300 write(6,*)
'=============='
2301 write(6,*)
'final results'
2302 write(6,*)
'=============='
2314 if ( index(fntg3c,
"tileX.nc") == 0)
then
2316 call
tsfcor(tg3anl,orogd,slmask,ztsfc,len,rlapse)
2319 call
tsfcor(tsfanl,orogd,slmask,ztsfc,len,rlapse)
2322 call
tsfcor(tsfanl,orog,slmask,ztsfc,len,rlapse)
2331 print *,
'monitor of updated surface fields'
2332 print *,
' (includes angulation correction)'
2336 call
monitr(
'tsfanl',tsfanl,slianl,snoanl,len)
2337 call
monitr(
'albanl',albanl,slianl,snoanl,len)
2338 call
monitr(
'aisanl',aisanl,slianl,snoanl,len)
2339 call
monitr(
'snoanl',snoanl,slianl,snoanl,len)
2340 call
monitr(
'smcanl1',smcanl(1,1),slianl,snoanl,len)
2341 call
monitr(
'smcanl2',smcanl(1,2),slianl,snoanl,len)
2342 call
monitr(
'stcanl1',stcanl(1,1),slianl,snoanl,len)
2343 call
monitr(
'stcanl2',stcanl(1,2),slianl,snoanl,len)
2346 call
monitr(
'smcanl3',smcanl(1,3),slianl,snoanl,len)
2347 call
monitr(
'smcanl4',smcanl(1,4),slianl,snoanl,len)
2348 call
monitr(
'stcanl3',stcanl(1,3),slianl,snoanl,len)
2349 call
monitr(
'stcanl4',stcanl(1,4),slianl,snoanl,len)
2350 call
monitr(
'tg3anl',tg3anl,slianl,snoanl,len)
2351 call
monitr(
'zoranl',zoranl,slianl,snoanl,len)
2354 call
monitr(
'cvaanl',cvanl ,slianl,snoanl,len)
2355 call
monitr(
'cvbanl',cvbanl,slianl,snoanl,len)
2356 call
monitr(
'cvtanl',cvtanl,slianl,snoanl,len)
2358 call
monitr(
'slianl',slianl,slianl,snoanl,len)
2360 call
monitr(
'orog ',orog ,slianl,snoanl,len)
2361 call
monitr(
'cnpanl',cnpanl,slianl,snoanl,len)
2362 call
monitr(
'veganl',veganl,slianl,snoanl,len)
2363 call
monitr(
'vetanl',vetanl,slianl,snoanl,len)
2364 call
monitr(
'sotanl',sotanl,slianl,snoanl,len)
2366 call
monitr(
'sihanl',sihanl,slianl,snoanl,len)
2367 call
monitr(
'sicanl',sicanl,slianl,snoanl,len)
2369 call
monitr(
'vmnanl',vmnanl,slianl,snoanl,len)
2370 call
monitr(
'vmxanl',vmxanl,slianl,snoanl,len)
2371 call
monitr(
'slpanl',slpanl,slianl,snoanl,len)
2372 call
monitr(
'absanl',absanl,slianl,snoanl,len)
2378 tsffcs(i) = tsfanl(i) - tsffcs(i)
2379 snofcs(i) = snoanl(i) - snofcs(i)
2380 tg3fcs(i) = tg3anl(i) - tg3fcs(i)
2381 zorfcs(i) = zoranl(i) - zorfcs(i)
2384 slifcs(i) = slianl(i) - slifcs(i)
2385 aisfcs(i) = aisanl(i) - aisfcs(i)
2386 cnpfcs(i) = cnpanl(i) - cnpfcs(i)
2387 vegfcs(i) = veganl(i) - vegfcs(i)
2388 vetfcs(i) = vetanl(i) - vetfcs(i)
2389 sotfcs(i) = sotanl(i) - sotfcs(i)
2391 sihfcs(i) = sihanl(i) - sihfcs(i)
2392 sicfcs(i) = sicanl(i) - sicfcs(i)
2394 vmnfcs(i) = vmnanl(i) - vmnfcs(i)
2395 vmxfcs(i) = vmxanl(i) - vmxfcs(i)
2396 slpfcs(i) = slpanl(i) - slpfcs(i)
2397 absfcs(i) = absanl(i) - absfcs(i)
2401 smcfcs(i,j) = smcanl(i,j) - smcfcs(i,j)
2402 stcfcs(i,j) = stcanl(i,j) - stcfcs(i,j)
2407 albfcs(i,j) = albanl(i,j) - albfcs(i,j)
2415 print *,
'monitor of difference'
2416 print *,
' (includes angulation correction)'
2418 call
monitr(
'tsfdif',tsffcs,slianl,snoanl,len)
2419 call
monitr(
'albdif',albfcs,slianl,snoanl,len)
2420 call
monitr(
'albdif1',albfcs,slianl,snoanl,len)
2421 call
monitr(
'albdif2',albfcs(1,2),slianl,snoanl,len)
2422 call
monitr(
'albdif3',albfcs(1,3),slianl,snoanl,len)
2423 call
monitr(
'albdif4',albfcs(1,4),slianl,snoanl,len)
2424 call
monitr(
'aisdif',aisfcs,slianl,snoanl,len)
2425 call
monitr(
'snodif',snofcs,slianl,snoanl,len)
2426 call
monitr(
'smcanl1',smcfcs(1,1),slianl,snoanl,len)
2427 call
monitr(
'smcanl2',smcfcs(1,2),slianl,snoanl,len)
2428 call
monitr(
'stcanl1',stcfcs(1,1),slianl,snoanl,len)
2429 call
monitr(
'stcanl2',stcfcs(1,2),slianl,snoanl,len)
2432 call
monitr(
'smcanl3',smcfcs(1,3),slianl,snoanl,len)
2433 call
monitr(
'smcanl4',smcfcs(1,4),slianl,snoanl,len)
2434 call
monitr(
'stcanl3',stcfcs(1,3),slianl,snoanl,len)
2435 call
monitr(
'stcanl4',stcfcs(1,4),slianl,snoanl,len)
2437 call
monitr(
'tg3dif',tg3fcs,slianl,snoanl,len)
2438 call
monitr(
'zordif',zorfcs,slianl,snoanl,len)
2440 call
monitr(
'cvadif',cvfcs ,slianl,snoanl,len)
2441 call
monitr(
'cvbdif',cvbfcs,slianl,snoanl,len)
2442 call
monitr(
'cvtdif',cvtfcs,slianl,snoanl,len)
2444 call
monitr(
'slidif',slifcs,slianl,snoanl,len)
2446 call
monitr(
'cnpdif',cnpfcs,slianl,snoanl,len)
2447 call
monitr(
'vegdif',vegfcs,slianl,snoanl,len)
2448 call
monitr(
'vetdif',vetfcs,slianl,snoanl,len)
2449 call
monitr(
'sotdif',sotfcs,slianl,snoanl,len)
2451 call
monitr(
'sihdif',sihfcs,slianl,snoanl,len)
2452 call
monitr(
'sicdif',sicfcs,slianl,snoanl,len)
2454 call
monitr(
'vmndif',vmnfcs,slianl,snoanl,len)
2455 call
monitr(
'vmxdif',vmxfcs,slianl,snoanl,len)
2456 call
monitr(
'slpdif',slpfcs,slianl,snoanl,len)
2457 call
monitr(
'absdif',absfcs,slianl,snoanl,len)
2463 tsffcs(i) = tsfanl(i)
2464 snofcs(i) = snoanl(i)
2465 tg3fcs(i) = tg3anl(i)
2466 zorfcs(i) = zoranl(i)
2469 slifcs(i) = slianl(i)
2470 aisfcs(i) = aisanl(i)
2472 cvbfcs(i) = cvbanl(i)
2473 cvtfcs(i) = cvtanl(i)
2474 cnpfcs(i) = cnpanl(i)
2475 vegfcs(i) = veganl(i)
2476 vetfcs(i) = vetanl(i)
2477 sotfcs(i) = sotanl(i)
2479 vmnfcs(i) = vmnanl(i)
2480 vmxfcs(i) = vmxanl(i)
2481 slpfcs(i) = slpanl(i)
2482 absfcs(i) = absanl(i)
2486 smcfcs(i,j) = smcanl(i,j)
2487 if (slifcs(i) .gt. 0.0)
then
2488 stcfcs(i,j) = stcanl(i,j)
2490 stcfcs(i,j) = tsffcs(i)
2496 albfcs(i,j) = albanl(i,j)
2501 alffcs(i,j) = alfanl(i,j)
2508 sihfcs(i) = sihanl(i)
2509 sitfcs(i) = tsffcs(i)
2510 if (slifcs(i).ge.2.)
then
2511 if (sicfcs(i).gt.crit)
then
2512 tsffcs(i) = (sicanl(i)*tsffcs(i)
2513 & + (sicfcs(i)-sicanl(i))*tgice)/sicfcs(i)
2514 sitfcs(i) = (tsffcs(i)-tgice*(1.0-sicfcs(i))) / sicfcs(i)
2516 tsffcs(i) = tsfanl(i)
2521 sicfcs(i) = sicanl(i)
2524 if (slifcs(i).lt.1.5)
then
2527 sitfcs(i) = tsffcs(i)
2528 else if ((slifcs(i).ge.1.5).and.(sicfcs(i).lt.crit))
then
2529 print *,
'warning: check, slifcs and sicfcs',
2530 & slifcs(i),sicfcs(i)
2538 fixratio(k) = .false.
2539 if (fsmcl(k).lt.99999.) fixratio(k) = .true.
2543 print *,
'dbgx --fixratio:',(fixratio(k),k=1,lsoil)
2547 if(fixratio(k))
then
2549 if(swratio(i,k) .eq. -999.)
then
2550 slcfcs(i,k) = smcfcs(i,k)
2552 slcfcs(i,k) = swratio(i,k) * smcfcs(i,k)
2554 if (slifcs(i) .ne. 1.0) slcfcs(i,k) = 1.0
2561 if (slifcs(i) .eq. 1.0 .and.
2562 & nint(vetfcs(i)) == veg_type_landice)
then
2572 if(fsnol .lt. 99999.)
then
2574 print *,
'dbgx -- scale snwdph from sheleg'
2577 if(slifcs(i).eq.1.) swdfcs(i) = 10.* snofcs(i)
2586 if (slifcs(i).ne.1) swdfcs(i) = 3.*snofcs(i)
2590 if(slifcs(i).eq.1.)
then
2591 if(snofcs(i).ne.0. .and. swdfcs(i).eq.0.)
then
2592 print *,
'dbgx --scale snwdph from sheleg',
2593 + i, swdfcs(i), snofcs(i)
2594 swdfcs(i) = 10.* snofcs(i)
2605 if (slifcs(i) .eq. 1.0 .and.
2606 & nint(vetfcs(i)) == veg_type_landice)
then
2607 snofcs(i) = max(snofcs(i),100.0)
2608 swdfcs(i) = max(swdfcs(i),1000.0)
2609 tg3fcs(i) = min(tg3fcs(i),273.15)
2610 tsffcs(i) = min(tsffcs(i),273.15)
2627 use machine , only : kind_io8,kind_io4
2629 real (kind=kind_io8) rl3,rl1,rl0,rl2,rl6,rl7,rl4,rl5
2630 integer l8,l7,l1,l2,ijmax,l0,l3,l5,l6,l4,ij
2632 real (kind=kind_io8) slimsk(1),sno(1)
2642 if(slimsk(ij).eq.0.) l1 = l1 + 1
2643 if(slimsk(ij).eq.1. .and. sno(ij).le.0.) l0 = l0 + 1
2644 if(slimsk(ij).eq.2. .and. sno(ij).le.0.) l2 = l2 + 1
2645 if(slimsk(ij).eq.1. .and. sno(ij).gt.0.) l3 = l3 + 1
2646 if(slimsk(ij).eq.2. .and. sno(ij).gt.0.) l4 = l4 + 1
2652 rl0 = float(l0) / float(l8)*100.
2653 rl3 = float(l3) / float(l8)*100.
2654 rl1 = float(l1) / float(l8)*100.
2655 rl2 = float(l2) / float(l8)*100.
2656 rl4 = float(l4) / float(l8)*100.
2657 rl5 = float(l5) / float(l8)*100.
2658 rl6 = float(l6) / float(l8)*100.
2659 rl7 = float(l7) / float(l8)*100.
2660 print *,
'1) no. of not snow-covered land points ',l0,
' ',rl0,
' '
2661 print *,
'2) no. of snow covered land points ',l3,
' ',rl3,
' '
2662 print *,
'3) no. of open sea points ',l1,
' ',rl1,
' '
2663 print *,
'4) no. of not snow-covered seaice points ',l2,
' ',rl2,
' '
2664 print *,
'5) no. of snow covered sea ice points ',l4,
' ',rl4,
' '
2666 print *,
'6) no. of land points ',l5,
' ',rl5,
' '
2667 print *,
'7) no. sea points (including sea ice) ',l7,
' ',rl7,
' '
2668 print *,
' (no. of sea ice points) (',l6,
')',
' ',rl6,
' '
2670 print *,
'9) no. of total grid points ',l8
2690 use machine , only : kind_io8,kind_io4
2694 real (kind=kind_io8) fld(ijmax), slimsk(ijmax),sno(ijmax)
2696 real (kind=kind_io8) rmax(5),rmin(5)
2697 character(len=*) lfld
2707 if(slimsk(ij).eq.0.)
then
2708 rmax(1) = max(rmax(1), fld(ij))
2709 rmin(1) = min(rmin(1), fld(ij))
2710 elseif(slimsk(ij).eq.1.)
then
2711 if(sno(ij).le.0.)
then
2712 rmax(2) = max(rmax(2), fld(ij))
2713 rmin(2) = min(rmin(2), fld(ij))
2715 rmax(4) = max(rmax(4), fld(ij))
2716 rmin(4) = min(rmin(4), fld(ij))
2719 if(sno(ij).le.0.)
then
2720 rmax(3) = max(rmax(3), fld(ij))
2721 rmin(3) = min(rmin(3), fld(ij))
2723 rmax(5) = max(rmax(5), fld(ij))
2724 rmin(5) = min(rmin(5), fld(ij))
2730 print 101,rmax(1),rmin(1)
2731 print 102,rmax(2),rmin(2), rmax(4), rmin(4)
2732 print 103,rmax(3),rmin(3), rmax(5), rmin(5)
2738 100
format(
'0 *** ',a8,
' ***')
2739 101
format(
' open sea ......... max=',e12.4,
' min=',e12.4)
2740 102
format(
' land nosnow/snow .. max=',e12.4,
' min=',e12.4
2741 &,
' max=',e12.4,
' min=',e12.4)
2742 103
format(
' seaice nosnow/snow max=',e12.4,
' min=',e12.4
2743 &,
' max=',e12.4,
' min=',e12.4)
2763 integer ldy,i,idy,iyr,imo
2768 data month/0,31,28,31,30,31,30,31,31,30,31,30,31/
2769 if(mod(iyr,4).eq.0) month(3) = 29
2772 ldy = ldy + month(i)
2793 & kpds5,slmskh,gausm,blnmsk,bltmsk,me)
2794 use machine , only : kind_io8,kind_io4
2797 integer kpds5,me,i,imsk,jmsk,lugb
2799 character*500 fnmskh
2801 real (kind=kind_io8) slmskh(mdata)
2803 real (kind=kind_io8) blnmsk,bltmsk
2809 write(6,*)
' imsk=',imsk,
' jmsk=',jmsk,
' xdata=',xdata,
' ydata='
2813 call
fixrdg(lugb,imsk,jmsk,fnmskh,
2814 & kpds5,slmskh,gausm,blnmsk,bltmsk,me)
2820 slmskh(i) = nint(slmskh(i))
2841 & kpds5,gdata,gaus,blno,blto,me)
2842 use machine , only : kind_io8,kind_io4
2845 integer lgrib,n,lskip,jret,j,ndata,lugi,jdim,idim,lugb,
2846 & iret, me,kpds5,kdata,i,w3kindreal,w3kindint
2848 character*(*) fngrib
2850 real (kind=kind_io8) gdata(idim*jdim)
2852 real (kind=kind_io8) blno,blto
2853 real (kind=kind_io8),
allocatable :: data8(:)
2854 real (kind=kind_io4),
allocatable :: data4(:)
2856 logical*1,
allocatable :: lbms(:)
2858 integer kpds(200),kgds(200)
2859 integer jpds(200),jgds(200), kpds0(200)
2861 allocate(data8(1:idim*jdim))
2862 allocate(lbms(1:mdata))
2875 call baopenr(lugb,fngrib,iret)
2876 if (iret .ne. 0)
then
2877 write(6,*)
' FATAL ERROR: in opening file ',trim(fngrib)
2878 print *,
'FATAL ERROR: in opening file ',trim(fngrib)
2881 if (me .eq. 0)
write(6,*)
' file ',trim(fngrib),
2882 &
' opened. unit=',lugb
2891 call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata,
2892 & lskip,kpds,kgds,iret)
2895 write(6,*)
' first grib record.'
2896 write(6,*)
' kpds( 1-10)=',(kpds(j),j= 1,10)
2897 write(6,*)
' kpds(11-20)=',(kpds(j),j=11,20)
2898 write(6,*)
' kpds(21- )=',(kpds(j),j=21,22)
2905 write(6,*)
' FATAL ERROR: in getgbh. iret: ', iret
2906 if (iret == 99)
write(6,*)
' field not found.'
2913 call w3kind(w3kindreal,w3kindint)
2914 if (w3kindreal == 8)
then
2915 call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip,
2916 & kpds,kgds,lbms,data8,jret)
2917 else if (w3kindreal == 4)
then
2918 allocate(data4(1:idim*jdim))
2919 call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip,
2920 & kpds,kgds,lbms,data4,jret)
2921 data8 =
real(data4, kind=kind_io8)
2924 write(0,*)
' FATAL ERROR: Invalid w3kindreal '
2930 write(6,*)
' FATAL ERROR: in getgb'
2931 write(6,*)
' kpds=',kpds
2932 write(6,*)
' kgds=',kgds
2938 blno = kgds(5)*1.d-3
2939 blto = kgds(4)*1.d-3
2940 gdata(1:idim*jdim) = data8(1:idim*jdim)
2941 if (me == 0)
write(6,*)
'idim,jdim=',idim,jdim
2942 &,
' gaus=',gaus,
' blno=',blno,
' blto=',blto
2944 if (me ==. 0)
write(6,*)
'idim,jdim=',idim,jdim
2945 &,
' gaus=',gaus,
' blno=',blno,
' blto=',blto
2946 write(6,*)
' FATAL ERROR in getgb : jret=',jret
2947 write(6,*)
' kpds(13)=',kpds(13),
' kpds(15)=',kpds(15)
2970 subroutine getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr
2972 use machine , only : kind_io8,kind_io4
2975 real (kind=kind_io8) f0lon,f0lat,elon,dlon,dlat,rslat,wlon,rnlat
2983 write(6,*)
' kgds( 1-12)=',(kgds(j),j= 1,12)
2984 write(6,*)
' kgds(13-22)=',(kgds(j),j=13,22)
2987 if(kgds(1).eq.0)
then
2989 if (me .eq. 0)
write(6,*)
'lat/lon grid'
2990 dlat = float(kgds(10)) * 0.001
2991 dlon = float(kgds( 9)) * 0.001
2992 f0lon = float(kgds(5)) * 0.001
2993 f0lat = float(kgds(4)) * 0.001
2995 if(kgds11.ge.128)
then
2996 wlon = f0lon - dlon*(kgds(2)-1)
2998 if(dlon*kgds(2).gt.359.99)
then
2999 wlon =f0lon - dlon*kgds(2)
3002 kgds11 = kgds11 - 128
3005 elon = f0lon + dlon*(kgds(2)-1)
3006 if(dlon*kgds(2).gt.359.99)
then
3007 elon = f0lon + dlon*kgds(2)
3010 if(kgds11.ge.64)
then
3011 rnlat = f0lat + dlat*(kgds(3)-1)
3013 kgds11 = kgds11 - 64
3016 rslat = f0lat - dlat*(kgds(3)-1)
3019 if(kgds11.ge.32)
then
3025 if(wlon.gt.180.) wlon = wlon - 360.
3026 if(elon.gt.180.) elon = elon - 360.
3027 wlon = nint(wlon*1000.) * 0.001
3028 elon = nint(elon*1000.) * 0.001
3029 rslat = nint(rslat*1000.) * 0.001
3030 rnlat = nint(rnlat*1000.) * 0.001
3033 elseif(kgds(1).eq.1)
then
3034 write(6,*)
'FATAL ERROR: cannot process mercator grid.'
3037 elseif(kgds(1).eq.2)
then
3038 write(6,*)
'FATAL ERROR: cannot process gnomonic grid.'
3041 elseif(kgds(1).eq.3)
then
3042 write(6,*)
'FATAL ERROR: cannot process lambert conf grid.'
3044 elseif(kgds(1).eq.4)
then
3046 if (me .eq. 0)
write(6,*)
'gaussian grid'
3048 dlon = float(kgds( 9)) / 1000.0
3049 f0lon = float(kgds(5)) / 1000.0
3052 if(kgds11.ge.128)
then
3055 if(dlon*kgds(2).gt.359.99)
then
3056 wlon = f0lon - dlon*kgds(2)
3062 elon = f0lon + dlon*(kgds(2)-1)
3063 if(dlon*kgds(2).gt.359.99)
then
3064 elon = f0lon + dlon*kgds(2)
3067 if(kgds11.ge.64)
then
3070 kgds11 = kgds11 - 64
3076 if(kgds11.ge.32)
then
3083 elseif(kgds(1).eq.5)
then
3084 write(6,*)
'FATAL ERROR: cannot process'
3085 write(6,*)
'polar stereographic grid.'
3089 elseif(kgds(1).eq.13)
then
3090 write(6,*)
'FATAL ERROR: cannot process'
3091 write(6,*)
'oblique lambert conformal grid.'
3094 elseif(kgds(1).eq.50)
then
3095 write(6,*)
'FATAL ERROR: cannot process'
3096 write(6,*)
'spherical coefficient grid.'
3100 elseif(kgds(1).eq.90)
then
3102 write(6,*)
'FATAL ERROR: cannot process'
3103 write(6,*)
'space view perspective grid.'
3108 write(6,*)
'FATAL ERROR: unknown map projection'
3109 write(6,*)
'kgds(1)=',kgds(1)
3110 print *,
'FATAL ERROR: unknown map projection'
3111 print *,
'kgds(1)=',kgds(1)
3130 subroutine subst(data,imax,jmax,dlon,dlat,ijordr)
3131 use machine , only : kind_io8,kind_io4
3133 integer i,j,ii,jj,jmax,imax,iret
3134 real (kind=kind_io8) dlat,dlon
3138 real (kind=kind_io8) data(imax,jmax)
3139 real (kind=kind_io8),
allocatable :: work(:,:)
3142 & (ijordr.and.(dlat.gt.0..or.dlon.lt.0.)))
then
3143 allocate (work(imax,jmax))
3145 if(.not.ijordr)
then
3148 work(i,j) =
data(j,i)
3154 work(i,j) =
data(i,j)
3158 if (dlat > 0.0)
then
3159 if (dlon > 0.0)
then
3163 data(i,jj) = work(i,j)
3168 data(imax-i+1,jj) = work(i,j)
3172 if (dlon > 0.0)
then
3175 data(i,j) = work(i,j)
3181 data(imax-i+1,j) = work(i,j)
3186 deallocate (work, stat=iret)
3210 subroutine la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat,inttyp,
3211 & gauout,len,lmask,rslmsk,slmask
3212 &, outlat, outlon,me)
3213 use machine , only : kind_io8,kind_io4
3215 real (kind=kind_io8) wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4,
3216 & wsum,tem,wsumiv,sums,sumn,wi2j2,x,y,wi1j1,
3217 & wi1j2,wi2j1,rlat,rlon,aphi,
3219 integer jy,ifills,ix,len,inttyp,me,i,j,jmxin,imxin,jq,jx,j1,j2,
3222 integer,
allocatable,
save :: imxnx(:)
3223 integer,
allocatable :: ifill(:)
3227 real (kind=kind_io8) outlon(len),outlat(len),gauout(len),
3229 real (kind=kind_io8) regin (imxin,jmxin),rslmsk(imxin,jmxin)
3231 real (kind=kind_io8) rinlat(jmxin), rinlon(imxin)
3232 integer iindx1(len), iindx2(len)
3233 integer jindx1(len), jindx2(len)
3234 real (kind=kind_io8) ddx(len), ddy(len), wrk(len)
3241 save num_threads, first
3243 integer len_thread_m, len_thread, i1_t, i2_t
3249 if (.not.
allocated(imxnx))
allocate (imxnx(num_threads))
3285 len_thread_m = (len+num_threads-1) / num_threads
3287 if (inttyp /=1)
allocate (ifill(num_threads))
3303 i1_t = (it-1)*len_thread_m+1
3304 i2_t = min(i1_t+len_thread_m-1,len)
3305 len_thread = i2_t-i1_t+1
3311 if (alamd .lt. rlon) alamd = alamd + 360.0
3312 if (alamd .gt. 360.0+rlon) alamd = alamd - 360.0
3318 if(wrk(i) .ge. rinlon(ii)) iindx1(i) = ii
3323 if (i1 .lt. 1) i1 = imxin
3325 if (i2 .gt. imxin) i2 = 1
3328 denom = rinlon(i2) - rinlon(i1)
3329 if(denom.lt.0.) denom = denom + 360.
3330 rnume = wrk(i) - rinlon(i1)
3331 if(rnume.lt.0.) rnume = rnume + 360.
3332 ddx(i) = rnume / denom
3343 if(outlat(j).le.rinlat(jx)) jindx1(j) = jx
3349 if(jq.ge.1 .and. jq .lt. jmxin)
then
3352 ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1))
3353 elseif (jq .eq. 0)
then
3356 if(abs(90.-rinlat(j1)).gt.0.001)
then
3357 ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1))
3364 if(abs(-90.-rinlat(j1)).gt.0.001)
then
3365 ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1))
3379 if(outlat(j).le.rinlat(jx)) jindx1(j) = jx
3385 if(jq.gt.1 .and. jq .le. jmxin)
then
3388 ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1))
3389 elseif (jq .eq. 1)
then
3392 if(abs(-90.-rinlat(j1)).gt.0.001)
then
3393 ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1))
3400 if(abs(90.-rinlat(j1)).gt.0.001)
then
3401 ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1))
3437 sum1 = sum1 + regin(i,1) * rslmsk(i,1)
3438 sum2 = sum2 + regin(i,jmxin) * rslmsk(i,jmxin)
3439 wei1 = wei1 + rslmsk(i,1)
3440 wei2 = wei2 + rslmsk(i,jmxin)
3442 sum3 = sum3 + regin(i,1) * (1.0-rslmsk(i,1))
3443 sum4 = sum4 + regin(i,jmxin) * (1.0-rslmsk(i,jmxin))
3444 wei3 = wei3 + (1.0-rslmsk(i,1))
3445 wei4 = wei4 + (1.0-rslmsk(i,jmxin))
3470 sum1 = sum1 + regin(i,1)
3471 sum2 = sum2 + regin(i,jmxin)
3488 if(inttyp.eq.1)
then
3492 if(ddy(i) .ge. 0.5) jy = jindx2(i)
3494 if(ddx(i) .ge. 0.5) ix = iindx2(i)
3498 if (.not. lmask)
then
3500 gauout(i) = regin(ix,jy)
3504 if(slmask(i).eq.rslmsk(ix,jy))
then
3506 gauout(i) = regin(ix,jy)
3514 do nx=1,jmxin*imxin/2
3516 kxt=nx-int(kxs**2/4+1)
3517 select case(mod(kxs,4))
3534 elseif(jx.gt.jmxin)
then
3538 ix=modulo(ix-1,imxin)+1
3539 if(slmask(i).eq.rslmsk(ix,jx))
then
3540 gauout(i) = regin(ix,jx)
3548 if (num_threads == 1)
then
3549 print*,
'no matching mask found ',i,i1,j1,ix,jx
3550 print*,
'set to default value.'
3582 wi1j1 = (1.-x) * (1.-y)
3587 tem = 4.*slmask(i) - rslmsk(i1,j1) - rslmsk(i2,j1)
3588 & - rslmsk(i1,j2) - rslmsk(i2,j2)
3589 if(lmask .and. abs(tem) .gt. 0.01)
then
3590 if(slmask(i).eq.1.)
then
3591 wi1j1 = wi1j1 * rslmsk(i1,j1)
3592 wi2j1 = wi2j1 * rslmsk(i2,j1)
3593 wi1j2 = wi1j2 * rslmsk(i1,j2)
3594 wi2j2 = wi2j2 * rslmsk(i2,j2)
3596 wi1j1 = wi1j1 * (1.0-rslmsk(i1,j1))
3597 wi2j1 = wi2j1 * (1.0-rslmsk(i2,j1))
3598 wi1j2 = wi1j2 * (1.0-rslmsk(i1,j2))
3599 wi2j2 = wi2j2 * (1.0-rslmsk(i2,j2))
3603 wsum = wi1j1 + wi2j1 + wi1j2 + wi2j2
3609 gauout(i) = (wi1j1*regin(i1,j1) + wi2j1*regin(i2,j1) +
3610 & wi1j2*regin(i1,j2) + wi2j2*regin(i2,j2))
3614 if (rlat .gt. 0.0)
then
3615 if (slmask(i) .eq. 1.0)
then
3623 gauout(i) = (wi1j1*sumn +wi2j1*sumn +
3624 & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2))
3626 elseif (j1 .eq. jmxin)
then
3627 gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+
3628 & wi1j2*sums +wi2j2*sums )
3635 if (slmask(i) .eq. 1.0)
then
3643 gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+
3644 & wi1j2*sums +wi2j2*sums )
3646 elseif (j1 .eq. jmxin)
then
3647 gauout(i) = (wi1j1*sumn +wi2j1*sumn +
3648 & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2))
3660 if(wrk(i) .eq. 0.0)
then
3662 write(6,*)
' FATAL ERROR: la2ga called with lmask=true'
3663 write(6,*)
' But bad rslmsk or slmask given.'
3666 ifill(it) = ifill(it) + 1
3667 if(ifill(it) <= 2 )
then
3668 if (me == 0 .and. num_threads == 1)
then
3669 write(6,*)
'i1,i2,j1,j2=',i1,i2,j1,j2
3670 write(6,*)
'rslmsk=',rslmsk(i1,j1),rslmsk(i1,j2),
3671 & rslmsk(i2,j1),rslmsk(i2,j2)
3673 write(6,*)
'i=',i,
' slmask(i)=',slmask(i)
3674 &,
' outlon=',outlon(i),
' outlat=',outlat(i)
3678 do nx=1,jmxin*imxin/2
3680 kxt=nx-int(kxs**2/4+1)
3681 select case(mod(kxs,4))
3698 elseif(jx.gt.jmxin)
then
3702 ix=modulo(ix-1,imxin)+1
3703 if(slmask(i).eq.rslmsk(ix,jx))
then
3704 gauout(i) = regin(ix,jx)
3705 imxnx(it) = max(imxnx(it),nx)
3710 write(6,*)
' FATAL ERROR: no filling value'
3711 write(6,*)
' found in la2ga.'
3727 ifills = ifills + ifill(it)
3730 if(ifills.gt.1)
then
3732 write(6,*)
' unable to interpolate. filled with nearest',
3733 &
' point value at ',ifills,
' points'
3744 end subroutine la2ga
3753 use machine , only : kind_io8,kind_io4
3755 integer i,iimin,iimax,kmax,imax,k
3756 real (kind=kind_io8) fmin,fmax
3758 real (kind=kind_io8) f(imax,kmax)
3766 if(fmax.le.f(i,k))
then
3770 if(fmin.ge.f(i,k))
then
3852 subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,
3854 & tg3anl,cvanl ,cvbanl,cvtanl,
3855 & cnpanl,smcanl,stcanl,slianl,scvanl,veganl,
3856 & vetanl,sotanl,alfanl,
3858 & vmnanl,vmxanl,slpanl,absanl,
3859 & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,
3861 & tg3clm,cvclm ,cvbclm,cvtclm,
3862 & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm,
3863 & vetclm,sotclm,alfclm,
3865 & vmnclm,vmxclm,slpclm,absclm,
3867 use machine , only : kind_io8,kind_io4
3869 integer i,j,len,lsoil
3871 real (kind=kind_io8) tsfanl(len),tsfan2(len),wetanl(len),
3873 & zoranl(len),albanl(len,4),aisanl(len),
3875 & cvanl(len),cvbanl(len),cvtanl(len),
3877 & smcanl(len,lsoil),stcanl(len,lsoil),
3878 & slianl(len),scvanl(len),veganl(len),
3879 & vetanl(len),sotanl(len),alfanl(len,2)
3881 &, sihanl(len),sicanl(len)
3883 &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len)
3884 real (kind=kind_io8) tsfclm(len),tsfcl2(len),wetclm(len),
3886 & zorclm(len),albclm(len,4),aisclm(len),
3888 & cvclm(len),cvbclm(len),cvtclm(len),
3890 & smcclm(len,lsoil),stcclm(len,lsoil),
3891 & sliclm(len),scvclm(len),vegclm(len),
3892 & vetclm(len),sotclm(len),alfclm(len,2)
3894 &, sihclm(len),sicclm(len)
3896 &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len)
3899 tsfanl(i) = tsfclm(i)
3900 tsfan2(i) = tsfcl2(i)
3901 wetanl(i) = wetclm(i)
3902 snoanl(i) = snoclm(i)
3903 scvanl(i) = scvclm(i)
3904 aisanl(i) = aisclm(i)
3905 slianl(i) = sliclm(i)
3906 zoranl(i) = zorclm(i)
3908 tg3anl(i) = tg3clm(i)
3909 cnpanl(i) = cnpclm(i)
3910 veganl(i) = vegclm(i)
3911 vetanl(i) = vetclm(i)
3912 sotanl(i) = sotclm(i)
3914 cvbanl(i) = cvbclm(i)
3915 cvtanl(i) = cvtclm(i)
3917 sihanl(i) = sihclm(i)
3918 sicanl(i) = sicclm(i)
3920 vmnanl(i) = vmnclm(i)
3921 vmxanl(i) = vmxclm(i)
3922 slpanl(i) = slpclm(i)
3923 absanl(i) = absclm(i)
3928 smcanl(i,j) = smcclm(i,j)
3929 stcanl(i,j) = stcclm(i,j)
3934 albanl(i,j) = albclm(i,j)
3939 alfanl(i,j) = alfclm(i,j)
4072 subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil,
4073 & slmask,fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
4074 & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega,
4076 & fnvmna,fnvmxa,fnslpa,fnabsa,
4077 & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl,
4078 & tg3anl,cvanl ,cvbanl,cvtanl,
4079 & smcanl,stcanl,slianl,scvanl,acnanl,veganl,
4080 & vetanl,sotanl,alfanl,tsfan0,
4081 & vmnanl,vmxanl,slpanl,absanl,
4082 & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais,
4083 & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg,
4084 & kprvet,kpdsot,kpdalf,
4085 & kpdvmn,kpdvmx,kpdslp,kpdabs,
4086 & irttsf,irtwet,irtsno,irtzor,irtalb,irtais,
4087 & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg,
4088 & irtvet,irtsot,irtalf
4089 &, irtvmn,irtvmx,irtslp,irtabs
4090 &, imsk, jmsk, slmskh, outlat, outlon
4091 &, gaus, blno, blto, me, lanom)
4092 use machine , only : kind_io8,kind_io4
4095 integer irtsmc,irtacn,irtstc,irtvet,irtveg,irtscv,irtzor,irtsno,
4096 & irtalb,irttg3,irtais,iret,me,kk,kpdvet,i,irtalf,irtsot,
4098 & imsk,jmsk,irtwet,lsoil,len,kpdtsf,kpdsno,kpdsnd,kpdwet,iy,
4100 & lugb,im,ih,id,kpdveg,kpdstc,kprvet,irttsf,kpdsot,kpdsmc,
4101 & kpdais,kpdzor,kpdtg3,kpdacn,kpdscv,j
4103 &, kpdvmn,kpdvmx,kpdslp,kpdabs,irtvmn,irtvmx,irtslp,irtabs
4104 real (kind=kind_io8) blto,blno,fh
4106 real (kind=kind_io8) slmask(len)
4107 real (kind=kind_io8) slmskh(imsk,jmsk)
4108 real (kind=kind_io8) outlat(len), outlon(len)
4109 integer kpdalb(4), kpdalf(2)
4111 integer kpds(1000),kgds(1000),jpds(1000),jgds(1000)
4112 integer lugi, lskip, lgrib, ndata
4115 character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,
4116 & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega,
4119 &, fnvmna,fnvmxa,fnslpa,fnabsa
4121 real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len),
4122 & zoranl(len), albanl(len,4), aisanl(len),
4123 & tg3anl(len), acnanl(len),
4124 & cvanl(len), cvbanl(len), cvtanl(len),
4125 & slianl(len), scvanl(len), veganl(len),
4126 & vetanl(len), sotanl(len), alfanl(len,2),
4127 & smcanl(len,lsoil), stcanl(len,lsoil),
4130 &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len)
4137 if(fntsfa(1:8).ne.
' ')
then
4138 call
fixrda(lugb,fntsfa,kpdtsf,slmask,
4139 & iy,im,id,ih,fh,tsfanl,len,iret
4140 &, imsk, jmsk, slmskh, gaus,blno, blto
4141 &, outlat, outlon, me)
4144 write(6,*)
'FATAL ERROR: t surface analysis read error.'
4146 elseif(iret == -1)
then
4148 print *,
'old t surface analysis provided, indicating proper'
4149 &,
' file name is given. no error suspected.'
4150 write(6,*)
'forecast guess will be used'
4153 if (me == 0) print *,
't surface analysis provided.'
4158 print *,
'no tsf analysis available. climatology used'
4164 if(fntsfa(1:8).ne.
' ' .and. lanom)
then
4165 call
fixrda(lugb,fntsfa,kpdtsf,slmask,
4166 & iy,im,id,ih,0.,tsfan0,len,iret
4167 &, imsk, jmsk, slmskh, gaus,blno, blto
4168 &, outlat, outlon, me)
4170 write(6,*)
'FATAL ERROR: t surface at ft=0 analysis'
4171 write(6,*)
'read error.'
4173 elseif(iret == -1)
then
4175 write(6,*)
'FATAL ERROR: Could not find t surface'
4176 write(6,*)
'analysis at ft=0.'
4180 print *,
't surface analysis at ft=0 found.'
4191 if(fnalba(1:8).ne.
' ')
then
4193 call
fixrda(lugb,fnalba,kpdalb(kk),slmask,
4194 & iy,im,id,ih,fh,albanl(1,kk),len,iret
4195 &, imsk, jmsk, slmskh, gaus,blno, blto
4196 &, outlat, outlon, me)
4199 write(6,*)
'FATAL ERROR: Albedo analysis read error.'
4201 elseif(iret.eq.-1)
then
4203 print *,
'old albedo analysis provided, indicating proper',
4204 &
' file name is given. no error suspected.'
4205 write(6,*)
'forecast guess will be used'
4208 if (me .eq. 0 .and. kk .eq. 4)
4209 & print *,
'albedo analysis provided.'
4215 print *,
'no albedo analysis available. climatology used'
4222 if(fnalba(1:8).ne.
' ')
then
4224 call
fixrda(lugb,fnalba,kpdalf(kk),slmask,
4225 & iy,im,id,ih,fh,alfanl(1,kk),len,iret
4226 &, imsk, jmsk, slmskh, gaus,blno, blto
4227 &, outlat, outlon, me)
4230 write(6,*)
'FATAL ERROR: Albedo analysis read error.'
4232 elseif(iret.eq.-1)
then
4234 print *,
'old albedo analysis provided, indicating proper',
4235 &
' file name is given. no error suspected.'
4236 write(6,*)
'forecast guess will be used'
4239 if (me .eq. 0 .and. kk .eq. 4)
4240 & print *,
'albedo analysis provided.'
4246 print *,
'no vegfalbedo analysis available. climatology used'
4254 if(fnweta(1:8).ne.
' ')
then
4255 call
fixrda(lugb,fnweta,kpdwet,slmask,
4256 & iy,im,id,ih,fh,wetanl,len,iret
4257 &, imsk, jmsk, slmskh, gaus,blno, blto
4258 &, outlat, outlon, me)
4261 write(6,*)
'FATAL ERROR: Bucket wetness analysis read error.'
4263 elseif(iret.eq.-1)
then
4265 print *,
'old wetness analysis provided, indicating proper',
4266 &
' file name is given. no error suspected.'
4267 write(6,*)
'forecast guess will be used'
4270 if (me .eq. 0) print *,
'bucket wetness analysis provided.'
4272 elseif(fnsmca(1:8).ne.
' ')
then
4273 call
fixrda(lugb,fnsmca,kpdsmc,slmask,
4274 & iy,im,id,ih,fh,smcanl(1,1),len,iret
4275 &, imsk, jmsk, slmskh, gaus,blno, blto
4276 &, outlat, outlon, me)
4277 call
fixrda(lugb,fnsmca,kpdsmc,slmask,
4278 & iy,im,id,ih,fh,smcanl(1,2),len,iret
4279 &, imsk, jmsk, slmskh, gaus,blno, blto
4280 &, outlat, outlon, me)
4283 write(6,*)
'FATAL ERROR: Layer soil wetness analysis'
4284 write(6,*)
'read error.'
4286 elseif(iret.eq.-1)
then
4288 print *,
'old layer soil wetness analysis provided',
4289 &
' indicating proper file name is given.'
4290 print *,
' no error suspected.'
4291 write(6,*)
'forecast guess will be used'
4294 if (me .eq. 0) print *,
'layer soil wetness analysis provided.'
4299 print *,
'no soil wetness analysis available. climatology used'
4306 if(fnsnoa(1:8).ne.
' ')
then
4317 call baopenr(lugb,fnsnoa,iret)
4318 if (iret .ne. 0)
then
4319 write(6,*)
'FATAL ERROR: in opening file ',trim(fnsnoa)
4320 print *,
'FATAL ERROR: in opening file ',trim(fnsnoa)
4328 call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata,
4329 & lskip,kpds,kgds,iret)
4331 if (iret .ne. 0)
then
4332 write(6,*)
' FATAL ERROR: Reading header'
4333 write(6,*)
' of file: ',trim(fnsnoa)
4334 print *,
'FATAL ERROR: Reading header of file: ',trim(fnsnoa)
4337 if (kgds(1) == 4)
then
4338 call
fixrda(lugb,fnsnoa,kpdsnd,slmask,
4339 & iy,im,id,ih,fh,snoanl,len,iret
4340 &, imsk, jmsk, slmskh, gaus,blno, blto
4341 &, outlat, outlon, me)
4345 call
fixrda(lugb,fnsnoa,kpdsno,slmask,
4346 & iy,im,id,ih,fh,snoanl,len,iret
4347 &, imsk, jmsk, slmskh, gaus,blno, blto
4348 &, outlat, outlon, me)
4353 write(6,*)
'FATAL ERROR: snow depth analysis read error.'
4355 elseif(iret.eq.-1)
then
4357 print *,
'old snow depth analysis provided, indicating proper',
4358 &
' file name is given. no error suspected.'
4359 write(6,*)
'forecast guess will be used'
4362 if (me .eq. 0) print *,
'snow depth analysis provided.'
4365 elseif(fnscva(1:8).ne.
' ')
then
4369 call
fixrda(lugb,fnscva,kpdscv,slmask,
4370 & iy,im,id,ih,fh,scvanl,len,iret
4371 &, imsk, jmsk, slmskh, gaus,blno, blto
4372 &, outlat, outlon, me)
4375 write(6,*)
'FATAL ERROR: snow cover analysis read error.'
4377 elseif(iret.eq.-1)
then
4379 print *,
'old snow cover analysis provided, indicating proper',
4380 &
' file name is given. no error suspected.'
4381 write(6,*)
'forecast guess will be used'
4384 if (me .eq. 0) print *,
'snow cover analysis provided.'
4389 print *,
'no snow/snocov analysis available. climatology used'
4397 if(fnacna(1:8).ne.
' ')
then
4398 call
fixrda(lugb,fnacna,kpdacn,slmask,
4399 & iy,im,id,ih,fh,acnanl,len,iret
4400 &, imsk, jmsk, slmskh, gaus,blno, blto
4401 &, outlat, outlon, me)
4404 write(6,*)
'FATAL ERROR: ice concentration'
4405 write(6,*)
'analysis read error.'
4407 elseif(iret.eq.-1)
then
4409 print *,
'old ice concentration analysis provided',
4410 &
' indicating proper file name is given'
4411 print *,
' no error suspected.'
4412 write(6,*)
'forecast guess will be used'
4415 if (me .eq. 0) print *,
'ice concentration analysis provided.'
4417 elseif(fnaisa(1:8).ne.
' ')
then
4418 call
fixrda(lugb,fnaisa,kpdais,slmask,
4419 & iy,im,id,ih,fh,aisanl,len,iret
4420 &, imsk, jmsk, slmskh, gaus,blno, blto
4421 &, outlat, outlon, me)
4424 write(6,*)
'FATAL ERROR: ice mask analysis read error.'
4426 elseif(iret.eq.-1)
then
4428 print *,
'old ice-mask analysis provided, indicating proper',
4429 &
' file name is given. no error suspected.'
4430 write(6,*)
'forecast guess will be used'
4433 if (me .eq. 0) print *,
'ice mask analysis provided.'
4438 print *,
'no sea-ice analysis available. climatology used'
4445 if(fnzora(1:8).ne.
' ')
then
4446 call
fixrda(lugb,fnzora,kpdzor,slmask,
4447 & iy,im,id,ih,fh,zoranl,len,iret
4448 &, imsk, jmsk, slmskh, gaus,blno, blto
4449 &, outlat, outlon, me)
4452 write(6,*)
'FATAL ERROR: roughness analysis read error.'
4454 elseif(iret.eq.-1)
then
4456 print *,
'old roughness analysis provided, indicating proper',
4457 &
' file name is given. no error suspected.'
4458 write(6,*)
'forecast guess will be used'
4461 if (me .eq. 0) print *,
'roughness analysis provided.'
4466 print *,
'no srfc roughness analysis available. climatology used'
4474 if(fntg3a(1:8).ne.
' ')
then
4475 call
fixrda(lugb,fntg3a,kpdtg3,slmask,
4476 & iy,im,id,ih,fh,tg3anl,len,iret
4477 &, imsk, jmsk, slmskh, gaus,blno, blto
4478 &, outlat, outlon, me)
4481 write(6,*)
'FATAL ERROR: deep soil tmp analysis read error.'
4483 elseif(iret.eq.-1)
then
4485 print *,
'old deep soil temp analysis provided',
4486 &
' indicating proper file name is given.'
4487 print *,
' no error suspected.'
4488 write(6,*)
'forecast guess will be used'
4491 if (me .eq. 0) print *,
'deep soil tmp analysis provided.'
4493 elseif(fnstca(1:8).ne.
' ')
then
4494 call
fixrda(lugb,fnstca,kpdstc,slmask,
4495 & iy,im,id,ih,fh,stcanl(1,1),len,iret
4496 &, imsk, jmsk, slmskh, gaus,blno, blto
4497 &, outlat, outlon, me)
4498 call
fixrda(lugb,fnstca,kpdstc,slmask,
4499 & iy,im,id,ih,fh,stcanl(1,2),len,iret
4500 &, imsk, jmsk, slmskh, gaus,blno, blto
4501 &, outlat, outlon, me)
4504 write(6,*)
'FATAL ERROR: layer soil tmp analysis read error.'
4506 elseif(iret.eq.-1)
then
4508 print *,
'old deep soil temp analysis provided',
4509 &
'iindicating proper file name is given.'
4510 print *,
' no error suspected.'
4511 write(6,*)
'forecast guess will be used'
4514 if (me .eq. 0) print *,
'layer soil tmp analysis provided.'
4519 print *,
'no deep soil temp analy available. climatology used'
4526 if(fnvega(1:8).ne.
' ')
then
4527 call
fixrda(lugb,fnvega,kpdveg,slmask,
4528 & iy,im,id,ih,fh,veganl,len,iret
4529 &, imsk, jmsk, slmskh, gaus,blno, blto
4530 &, outlat, outlon, me)
4533 write(6,*)
'FATAL ERROR: vegetation cover analysis'
4534 write(6,*)
'read error.'
4536 elseif(iret.eq.-1)
then
4538 print *,
'old vegetation cover analysis provided',
4539 &
' indicating proper file name is given.'
4540 print *,
' no error suspected.'
4541 write(6,*)
'forecast guess will be used'
4544 if (me .eq. 0) print *,
'vegetation cover analysis provided.'
4549 print *,
'no vegetation cover anly available. climatology used'
4556 if(fnveta(1:8).ne.
' ')
then
4557 call
fixrda(lugb,fnveta,kpdvet,slmask,
4558 & iy,im,id,ih,fh,vetanl,len,iret
4559 &, imsk, jmsk, slmskh, gaus,blno, blto
4560 &, outlat, outlon, me)
4563 write(6,*)
'FATAL ERROR: vegetation type analysis read error.'
4565 elseif(iret.eq.-1)
then
4567 print *,
'old vegetation type analysis provided',
4568 &
' indicating proper file name is given.'
4569 print *,
' no error suspected.'
4570 write(6,*)
'forecast guess will be used'
4573 if (me .eq. 0) print *,
'vegetation type analysis provided.'
4578 print *,
'no vegetation type anly available. climatology used'
4585 if(fnsota(1:8).ne.
' ')
then
4586 call
fixrda(lugb,fnsota,kpdsot,slmask,
4587 & iy,im,id,ih,fh,sotanl,len,iret
4588 &, imsk, jmsk, slmskh, gaus,blno, blto
4589 &, outlat, outlon, me)
4592 write(6,*)
'FATAL ERROR: soil type analysis read error.'
4594 elseif(iret.eq.-1)
then
4596 print *,
'old soil type analysis provided',
4597 &
' indicating proper file name is given.'
4598 print *,
' no error suspected.'
4599 write(6,*)
'forecast guess will be used'
4602 if (me .eq. 0) print *,
'soil type analysis provided.'
4607 print *,
'no soil type anly available. climatology used'
4616 if(fnvmna(1:8).ne.
' ')
then
4617 call
fixrda(lugb,fnvmna,kpdvmn,slmask,
4618 & iy,im,id,ih,fh,vmnanl,len,iret
4619 &, imsk, jmsk, slmskh, gaus,blno, blto
4620 &, outlat, outlon, me)
4623 write(6,*)
'FATAL ERROR: shdmin analysis read error.'
4625 elseif(iret.eq.-1)
then
4627 print *,
'old shdmin analysis provided',
4628 &
' indicating proper file name is given.'
4629 print *,
' no error suspected.'
4630 write(6,*)
'forecast guess will be used'
4633 if (me .eq. 0) print *,
'shdmin analysis provided.'
4638 print *,
'no shdmin anly available. climatology used'
4646 if(fnvmxa(1:8).ne.
' ')
then
4647 call
fixrda(lugb,fnvmxa,kpdvmx,slmask,
4648 & iy,im,id,ih,fh,vmxanl,len,iret
4649 &, imsk, jmsk, slmskh, gaus,blno, blto
4650 &, outlat, outlon, me)
4653 write(6,*)
'FATAL ERROR: shdmax analysis read error.'
4655 elseif(iret.eq.-1)
then
4657 print *,
'old shdmax analysis provided',
4658 &
' indicating proper file name is given.'
4659 print *,
' no error suspected.'
4660 write(6,*)
'forecast guess will be used'
4663 if (me .eq. 0) print *,
'shdmax analysis provided.'
4668 print *,
'no shdmax anly available. climatology used'
4676 if(fnslpa(1:8).ne.
' ')
then
4677 call
fixrda(lugb,fnslpa,kpdslp,slmask,
4678 & iy,im,id,ih,fh,slpanl,len,iret
4679 &, imsk, jmsk, slmskh, gaus,blno, blto
4680 &, outlat, outlon, me)
4683 write(6,*)
'FATAL ERROR: slope type analysis read error.'
4685 elseif(iret.eq.-1)
then
4687 print *,
'old slope type analysis provided',
4688 &
' indicating proper file name is given.'
4689 print *,
' no error suspected.'
4690 write(6,*)
'forecast guess will be used'
4693 if (me .eq. 0) print *,
'slope type analysis provided.'
4698 print *,
'no slope type anly available. climatology used'
4706 if(fnabsa(1:8).ne.
' ')
then
4707 call
fixrda(lugb,fnabsa,kpdabs,slmask,
4708 & iy,im,id,ih,fh,absanl,len,iret
4709 &, imsk, jmsk, slmskh, gaus,blno, blto
4710 &, outlat, outlon, me)
4713 write(6,*)
'FATAL ERROR: snoalb analysis read error.'
4715 elseif(iret.eq.-1)
then
4717 print *,
'old snoalb analysis provided',
4718 &
' indicating proper file name is given.'
4719 print *,
' no error suspected.'
4720 write(6,*)
'forecast guess will be used'
4723 if (me .eq. 0) print *,
'snoalb analysis provided.'
4728 print *,
'no snoalb anly available. climatology used'
4793 subroutine filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs,
4794 & tg3fcs,cvfcs ,cvbfcs,cvtfcs,
4795 & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs,
4796 & vegfcs, vetfcs, sotfcs, alffcs,
4798 & vmnfcs,vmxfcs,slpfcs,absfcs,
4799 & tsfanl,wetanl,snoanl,zoranl,albanl,
4800 & tg3anl,cvanl ,cvbanl,cvtanl,
4801 & cnpanl,smcanl,stcanl,slianl,aisanl,
4802 & veganl, vetanl, sotanl, alfanl,
4804 & vmnanl,vmxanl,slpanl,absanl,
4807 use machine , only : kind_io8,kind_io4
4809 integer i,j,len,lsoil
4810 real (kind=kind_io8) tsffcs(len),wetfcs(len),snofcs(len),
4811 & zorfcs(len),albfcs(len,4),aisfcs(len),
4813 & cvfcs(len),cvbfcs(len),cvtfcs(len),
4815 & smcfcs(len,lsoil),stcfcs(len,lsoil),
4816 & slifcs(len),vegfcs(len),
4817 & vetfcs(len),sotfcs(len),alffcs(len,2)
4819 &, sihfcs(len),sicfcs(len)
4821 &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len)
4822 real (kind=kind_io8) tsfanl(len),wetanl(len),snoanl(len),
4823 & zoranl(len),albanl(len,4),aisanl(len),
4825 & cvanl(len),cvbanl(len),cvtanl(len),
4827 & smcanl(len,lsoil),stcanl(len,lsoil),
4828 & slianl(len),veganl(len),
4829 & vetanl(len),sotanl(len),alfanl(len,2)
4831 &, sihanl(len),sicanl(len)
4833 &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len)
4835 write(6,*)
' this is a dead start run, tsfc over land is',
4836 &
' set as lowest sigma level temperture if given.'
4837 write(6,*)
' if not, set to climatological tsf over land is used'
4841 tsffcs(i) = tsfanl(i)
4842 albfcs(i,1) = albanl(i,1)
4843 albfcs(i,2) = albanl(i,2)
4844 albfcs(i,3) = albanl(i,3)
4845 albfcs(i,4) = albanl(i,4)
4846 wetfcs(i) = wetanl(i)
4847 snofcs(i) = snoanl(i)
4848 aisfcs(i) = aisanl(i)
4849 slifcs(i) = slianl(i)
4850 zorfcs(i) = zoranl(i)
4852 tg3fcs(i) = tg3anl(i)
4853 cnpfcs(i) = cnpanl(i)
4855 cvbfcs(i) = cvbanl(i)
4856 cvtfcs(i) = cvtanl(i)
4857 vegfcs(i) = veganl(i)
4858 vetfcs(i) = vetanl(i)
4859 sotfcs(i) = sotanl(i)
4860 alffcs(i,1) = alfanl(i,1)
4861 alffcs(i,2) = alfanl(i,2)
4863 sihfcs(i) = sihanl(i)
4864 sicfcs(i) = sicanl(i)
4866 vmnfcs(i) = vmnanl(i)
4867 vmxfcs(i) = vmxanl(i)
4868 slpfcs(i) = slpanl(i)
4869 absfcs(i) = absanl(i)
4874 smcfcs(i,j) = smcanl(i,j)
4875 stcfcs(i,j) = stcanl(i,j)
4891 use machine , only : kind_io8,kind_io4
4894 real (kind=kind_io8) aisfld(len),crit
4899 if(aisfld(i).ge.crit)
then
4905 elseif(op.eq.
'gt')
then
4907 if(aisfld(i).gt.crit)
then
4913 elseif(op.eq.
'le')
then
4915 if(aisfld(i).le.crit)
then
4921 elseif(op.eq.
'lt')
then
4923 if(aisfld(i).lt.crit)
then
4930 write(6,*)
'FATAL ERROR: Illegal operator'
4931 write(6,*)
'in rof01. op=',op
4948 subroutine tsfcor(tsfc,orog,slmask,umask,len,rlapse)
4950 use machine , only : kind_io8,kind_io4
4953 real (kind=kind_io8) rlapse,umask
4954 real (kind=kind_io8) tsfc(len), orog(len), slmask(len)
4957 if(slmask(i).eq.umask)
then
4958 tsfc(i) = tsfc(i) - orog(i)*rlapse
4979 & glacir,snwmax,snwmin,landice,len,snoanl, me)
4980 use machine , only : kind_io8,kind_io4
4983 logical,
intent(in) :: landice
4984 real (kind=kind_io8) sno,snwmax,snwmin
4986 real (kind=kind_io8) scvanl(len), slianl(len), tsfanl(len),
4987 & snoclm(len), snoanl(len), glacir(len)
4989 if (me .eq. 0)
write(6,*)
'snodpth'
4998 if(slianl(i).eq.1.)
then
4999 if(scvanl(i).eq.1.0)
then
5000 if(tsfanl(i).lt.243.0)
then
5002 elseif(tsfanl(i).lt.273.0)
then
5003 sno = snwmin+(snwmax-snwmin)*(273.0-tsfanl(i))/30.0
5011 if (.not.landice)
then
5012 if(glacir(i).eq.1.0)
then
5014 if(sno.eq.0.) sno=snwmax
5023 if(slianl(i).eq.2.0)
then
5025 if(sno.eq.0.) sno=snwmax
5192 subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc,
5194 & vmnfcs,vmxfcs,slpfcs,absfcs,
5195 & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs,
5196 & cvfcs ,cvbfcs,cvtfcs,
5197 & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs,
5198 & vetfcs,sotfcs,alffcs,
5200 & vmnanl,vmxanl,slpanl,absanl,
5201 & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl,
5202 & cvanl ,cvbanl,cvtanl,
5203 & cnpanl,smcanl,stcanl,slianl,veganl,
5204 & vetanl,sotanl,alfanl,
5205 & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl,
5206 & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs,
5207 & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots,
5209 & csihl,csihs,csicl,csics,
5210 & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss,
5211 & irttsf,irtwet,irtsno,irtzor,irtalb,irtais,
5212 & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg,
5213 & irtvmn,irtvmx,irtslp,irtabs,
5214 & irtvet,irtsot,irtalf, landice, me)
5215 use machine , only : kind_io8,kind_io4
5216 use sfccyc_module, only : veg_type_landice, soil_type_landice
5218 integer k,i,im,id,iy,len,lsoil,ih,irtacn,irtsmc,irtscv,irtais,
5219 & irttg3,irtstc,irtalf,me,irtsot,irtveg,irtvet, irtzor,
5220 & irtalb,irtsno,irttsf,irtwet,j
5221 &, irtvmn,irtvmx,irtslp,irtabs
5222 logical,
intent(in) :: landice
5223 real (kind=kind_io8) rvegs,rvets,rzors,raiss,rsnos,rsots,rcnp,
5224 & rcvt,rcv,rcvb,rsnol,rzorl,raisl,ralbl,
5225 & ralfl,rvegl,ralbs,ralfs,rtsfs,rvetl,rsotl,
5226 & qzors,qvegs,qsnos,qalfs,qaiss,qvets,qcvt,
5227 & qcnp,qcvb,qsots,qcv,qaisl,qsnol,qalfl,
5228 & qtsfl,qalbl,qzorl,qtsfs,qalbs,qsotl,qvegl,
5229 & qvetl,rtsfl,calbs,caiss,ctsfs,czorl,cvegl,
5230 & csnos,ccvb,ccvt,ccv,czors,cvegs,caisl,csnol,
5231 & calbl,fh,ctsfl,ccnp,csots,calfl,csotl,cvetl,
5232 & cvets,calfs,deltsfc,
5233 & csihl,csihs,csicl,csics,
5234 & rsihl,rsihs,rsicl,rsics,
5235 & qsihl,qsihs,qsicl,qsics
5236 &, cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps
5237 &, cabsl,cabss,rvmnl,rvmns,rvmxl,rvmxs
5238 &, rslpl,rslps,rabsl,rabss,qvmnl,qvmns
5239 &, qvmxl,qvmxs,qslpl,qslps,qabsl,qabss
5241 real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len),
5242 & zorfcs(len), albfcs(len,4), aisfcs(len),
5243 & cvfcs(len), cvbfcs(len), cvtfcs(len),
5245 & smcfcs(len,lsoil),stcfcs(len,lsoil),
5246 & slifcs(len), vegfcs(len),
5247 & vetfcs(len), sotfcs(len), alffcs(len,2)
5248 &, sihfcs(len), sicfcs(len)
5249 &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len)
5250 real (kind=kind_io8) tsfanl(len),tsfan2(len),
5251 & wetanl(len),snoanl(len),
5252 & zoranl(len), albanl(len,4), aisanl(len),
5253 & cvanl(len), cvbanl(len), cvtanl(len),
5255 & smcanl(len,lsoil),stcanl(len,lsoil),
5256 & slianl(len), veganl(len),
5257 & vetanl(len), sotanl(len), alfanl(len,2)
5258 &, sihanl(len),sicanl(len)
5259 &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len)
5261 real (kind=kind_io8) csmcl(lsoil), csmcs(lsoil),
5262 & cstcl(lsoil), cstcs(lsoil)
5263 real (kind=kind_io8) rsmcl(lsoil), rsmcs(lsoil),
5264 & rstcl(lsoil), rstcs(lsoil)
5265 real (kind=kind_io8) qsmcl(lsoil), qsmcs(lsoil),
5266 & qstcl(lsoil), qstcs(lsoil)
5270 save num_threads, first
5272 integer len_thread_m, i1_t, i2_t, it
5333 if (fh-deltsfc < -0.001 .and. irttsf == 1)
then
5347 if(irttsf == -1)
then
5351 if(irtalb == -1)
then
5357 if(irtais == -1)
then
5361 if(irtsno == -1 .or. irtscv == -1)
then
5365 if(irtsmc == -1 .or. irtwet == -1)
then
5373 if(irtstc.eq.-1)
then
5379 if(irtzor == -1)
then
5383 if(irtveg == -1)
then
5387 if(irtvet.eq.-1)
then
5391 if(irtsot == -1)
then
5396 if(irtacn == -1)
then
5400 if(irtvmn == -1)
then
5404 if(irtvmx == -1)
then
5408 if(irtslp == -1)
then
5412 if(irtabs == -1)
then
5417 if(raiss == 1. .or. irtacn == -1)
then
5418 if (me == 0) print *,
'use forecast land-sea-ice mask'
5420 aisanl(i) = aisfcs(i)
5421 slianl(i) = slifcs(i)
5426 write(6,100) rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl
5427 100
format(
'rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl=',10f7.3)
5428 write(6,101) rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs
5429 101
format(
'rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs=',10f7.3)
5474 qsmcl(k) = 1. - rsmcl(k)
5475 qsmcs(k) = 1. - rsmcs(k)
5476 qstcl(k) = 1. - rstcl(k)
5477 qstcs(k) = 1. - rstcs(k)
5483 print *,
'dbgx-- csmcl:', (csmcl(k),k=1,lsoil)
5484 print *,
'dbgx-- rsmcl:', (rsmcl(k),k=1,lsoil)
5485 print *,
'dbgx-- csnol, csnos:',csnol,csnos
5486 print *,
'dbgx-- rsnol, rsnos:',rsnol,rsnos
5500 len_thread_m = (len+num_threads-1) / num_threads
5504 i1_t = (it-1)*len_thread_m+1
5505 i2_t = min(i1_t+len_thread_m-1,len)
5507 if(slianl(i).eq.0.)
then
5508 vetanl(i) = vetfcs(i)*rvets + vetanl(i)*qvets
5509 sotanl(i) = sotfcs(i)*rsots + sotanl(i)*qsots
5511 vetanl(i) = vetfcs(i)*rvetl + vetanl(i)*qvetl
5512 sotanl(i) = sotfcs(i)*rsotl + sotanl(i)*qsotl
5521 i1_t = (it-1)*len_thread_m+1
5522 i2_t = min(i1_t+len_thread_m-1,len)
5525 if(slianl(i).eq.0.)
then
5530 tsfanl(i) = tsffcs(i)*rtsfs + tsfanl(i)*qtsfs
5532 aisanl(i) = aisfcs(i)*raiss + aisanl(i)*qaiss
5533 snoanl(i) = snofcs(i)*rsnos + snoanl(i)*qsnos
5535 zoranl(i) = zorfcs(i)*rzors + zoranl(i)*qzors
5536 veganl(i) = vegfcs(i)*rvegs + veganl(i)*qvegs
5537 sihanl(i) = sihfcs(i)*rsihs + sihanl(i)*qsihs
5538 sicanl(i) = sicfcs(i)*rsics + sicanl(i)*qsics
5539 vmnanl(i) = vmnfcs(i)*rvmns + vmnanl(i)*qvmns
5540 vmxanl(i) = vmxfcs(i)*rvmxs + vmxanl(i)*qvmxs
5541 slpanl(i) = slpfcs(i)*rslps + slpanl(i)*qslps
5542 absanl(i) = absfcs(i)*rabss + absanl(i)*qabss
5544 tsfanl(i) = tsffcs(i)*rtsfl + tsfanl(i)*qtsfl
5546 aisanl(i) = aisfcs(i)*raisl + aisanl(i)*qaisl
5548 snoanl(i) = snofcs(i)*rsnol + snoanl(i)*qsnol
5550 if(snoanl(i).ne.0)
then
5551 snoanl(i) = max(-snoanl(i)/rsnol,
5552 & min(-snoanl(i)*rsnol, snofcs(i)))
5555 zoranl(i) = zorfcs(i)*rzorl + zoranl(i)*qzorl
5556 veganl(i) = vegfcs(i)*rvegl + veganl(i)*qvegl
5557 vmnanl(i) = vmnfcs(i)*rvmnl + vmnanl(i)*qvmnl
5558 vmxanl(i) = vmxfcs(i)*rvmxl + vmxanl(i)*qvmxl
5559 slpanl(i) = slpfcs(i)*rslpl + slpanl(i)*qslpl
5560 absanl(i) = absfcs(i)*rabsl + absanl(i)*qabsl
5561 sihanl(i) = sihfcs(i)*rsihl + sihanl(i)*qsihl
5562 sicanl(i) = sicfcs(i)*rsicl + sicanl(i)*qsicl
5565 cnpanl(i) = cnpfcs(i)*rcnp + cnpanl(i)*qcnp
5569 if(slianl(i).eq.2.)
then
5570 snoanl(i) = snofcs(i)
5580 if (nint(slianl(i)) == 1)
then
5581 if (nint(vetanl(i)) == veg_type_landice)
then
5582 sotanl(i) = soil_type_landice
5593 cvanl(i) = cvfcs(i)*rcv + cvanl(i)*qcv
5594 cvbanl(i) = cvbfcs(i)*rcvb + cvbanl(i)*qcvb
5595 cvtanl(i) = cvtfcs(i)*rcvt + cvtanl(i)*qcvt
5600 if(slianl(i).eq.0.)
then
5601 albanl(i,k) = albfcs(i,k)*ralbs + albanl(i,k)*qalbs
5603 albanl(i,k) = albfcs(i,k)*ralbl + albanl(i,k)*qalbl
5610 if(slianl(i).eq.0.)
then
5611 alfanl(i,k) = alffcs(i,k)*ralfs + alfanl(i,k)*qalfs
5613 alfanl(i,k) = alffcs(i,k)*ralfl + alfanl(i,k)*qalfl
5620 if(slianl(i).eq.0.)
then
5621 smcanl(i,k) = smcfcs(i,k)*rsmcs(k) + smcanl(i,k)*qsmcs(k)
5622 stcanl(i,k) = stcfcs(i,k)*rstcs(k) + stcanl(i,k)*qstcs(k)
5627 stcanl(i,k) = stcfcs(i,k)*rstcl(k) + stcanl(i,k)*qstcl(k)
5628 if (landice .and. slianl(i) == 1.0 .and.
5629 & nint(vetanl(i)) == veg_type_landice)
then
5631 stcanl(i,k) = min(stcanl(i,k), 273.15)
5633 smcanl(i,k) = smcfcs(i,k)*rsmcl(k) + smcanl(i,k)*qsmcl(k)
5642 end subroutine merge
5676 subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil,
5677 & sihnew,sicnew,sihanl,sicanl,
5678 & albanl,snoanl,zoranl,smcanl,stcanl,
5679 & albsea,snosea,zorsea,smcsea,smcice,
5680 & tsfmin,tsfice,albice,zorice,tgice,
5683 use machine , only : kind_io8,kind_io4
5685 real (kind=kind_io8),
parameter :: one=1.0
5686 real (kind=kind_io8) tgice,albice,zorice,tsfice,albsea,snosea,
5687 & smcice,tsfmin,zorsea,smcsea
5690 integer i,me,kount1,kount2,k,len,lsoil
5691 real (kind=kind_io8) slianl(len), slifcs(len),
5692 & tsffcs(len),tsfanl(len)
5693 real (kind=kind_io8) albanl(len,4), snoanl(len), zoranl(len)
5694 real (kind=kind_io8) smcanl(len,lsoil), stcanl(len,lsoil)
5696 real (kind=kind_io8) sihanl(len), sicanl(len)
5698 real (kind=kind_io8) rla(len), rlo(len)
5700 if (me .eq. 0)
write(6,*)
'newice'
5705 if(slifcs(i).ne.slianl(i))
then
5706 if(slifcs(i).eq.1..or.slianl(i).eq.1.)
then
5707 print *,
'FATAL ERROR: Inconsistency in slifcs or slianl'
5708 print 910,rla(i),rlo(i),slifcs(i),slianl(i),
5709 & tsffcs(i),tsfanl(i)
5710 910
format(2x,
'at lat=',f5.1,
' lon=',f5.1,
' slifcs=',f4.1,
5711 &
' slimsk=',f4.1,
' tsffcs=',f5.1,
' set to tsfanl=',f5.1)
5717 if(slianl(i).eq.0..and.slifcs(i).eq.2.)
then
5719 albanl(i,1) = albsea
5720 albanl(i,2) = albsea
5721 albanl(i,3) = albsea
5722 albanl(i,4) = albsea
5726 smcanl(i,k) = smcsea
5738 if(slianl(i).eq.2..and.slifcs(i).eq.0.)
then
5740 albanl(i,1) = albice
5741 albanl(i,2) = albice
5742 albanl(i,3) = albice
5743 albanl(i,4) = albice
5747 smcanl(i,k) = smcice
5752 sicanl(i) = min(one, max(sicnew,sicanl(i)))
5759 if(kount1.gt.0)
then
5760 write(6,*)
'sea ice melted. tsf,alb,zor are filled',
5761 &
' at ',kount1,
' points'
5763 if(kount2.gt.0)
then
5764 write(6,*)
'sea ice formed. tsf,alb,zor are filled',
5765 &
' at ',kount2,
' points'
5783 subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval,
5785 use machine , only : kind_io8,kind_io4
5787 integer kount,i,len,me
5788 logical,
intent(in) :: landice
5789 real (kind=kind_io8) per,snoval
5790 real (kind=kind_io8) snoanl(len),slmask(len),
5791 & aisanl(len),glacir(len)
5794 write(6,*)
'qc of snow'
5796 if (.not.landice)
then
5799 if(glacir(i).ne.0..and.snoanl(i).eq.0.)
then
5805 per = float(kount) / float(len)*100.
5808 print *,
'snow filled over glacier points at ',kount,
5809 &
' points (',per,
'percent)'
5815 if(slmask(i).eq.0.and.aisanl(i).eq.0)
then
5820 per = float(kount) / float(len)*100.
5823 print *,
'snow set to zero over open sea at ',kount,
5824 &
' points (',per,
'percent)'
5844 subroutine qcsice(ais,glacir,amxice,aicice,aicsea,sllnd,slmask,
5846 use machine , only : kind_io8,kind_io4
5848 integer kount1,kount,i,me,len
5849 real (kind=kind_io8) per,aicsea,aicice,sllnd
5851 real (kind=kind_io8) ais(len), glacir(len),
5852 & amxice(len), slmask(len)
5853 real (kind=kind_io8) rla(len), rlo(len)
5857 if (me .eq. 0)
write(6,*)
'qc of sea ice'
5861 if(ais(i).ne.aicice.and.ais(i).ne.aicsea)
then
5862 print *,
'FATAL ERROR: sea ice'
5863 print *,
'mask not ',aicice,
' or ',aicsea
5864 print *,
'ais(i),aicice,aicsea,rla(i),rlo(i,=',
5865 & ais(i),aicice,aicsea,rla(i),rlo(i)
5868 if(slmask(i).eq.0..and.glacir(i).eq.1..and.
5870 & ais(i).ne.1.)
then
5874 if(slmask(i).eq.sllnd.and.ais(i).eq.aicice)
then
5880 per = float(kount) / float(len)*100.
5883 print *,
' sea ice over land mask at ',kount,
' points (',per,
5887 per = float(kount1) / float(len)*100.
5888 if(kount1.gt.0)
then
5890 print *,
' sea ice set over glacier points over ocean at ',
5891 & kount1,
' points (',per,
'percent)'
5953 subroutine setlsi(slmask,aisfld,len,aicice,slifld)
5955 use machine , only : kind_io8,kind_io4
5958 real (kind=kind_io8) aicice
5959 real (kind=kind_io8) slmask(len), slifld(len), aisfld(len)
5964 slifld(i) = slmask(i)
5966 if(aisfld(i).eq.aicice .and. slmask(i) .eq. 0.0)
5980 use machine , only : kind_io8,kind_io4
5983 real (kind=kind_io8) fld(len),scl
5985 fld(i) = fld(i) * scl
6022 & fldlmx,fldlmn,fldomx,fldomn,fldimx,fldimn,
6023 & fldjmx,fldjmn,fldsmx,fldsmn,epsfld,
6024 & rla,rlo,len,mode,percrit,lgchek,me)
6026 use machine , only : kind_io8,kind_io4
6028 real (kind=kind_io8) permax,per,fldimx,fldimn,fldjmx,fldomn,
6029 & fldlmx,fldlmn,fldomx,fldjmn,percrit,
6030 & fldsmx,fldsmn,epsfld
6031 integer kmaxi,kmini,kmaxj,kmino,kmaxl,kminl,kmaxo,mmprt,kminj,
6032 & ij,nprt,kmaxs,kmins,i,me,len,mode
6037 real (kind=kind_io8) fld(len),slimsk(len),sno(len),
6038 & rla(len), rlo(len)
6045 save num_threads, first
6047 integer len_thread_m, i1_t, i2_t, it
6059 print *,
'performing qc of ',ttl,
' mode=',mode,
6060 &
'(0=count only, 1=replace)'
6063 len_thread_m = (len+num_threads-1) / num_threads
6082 i1_t = (it-1)*len_thread_m+1
6083 i2_t = min(i1_t+len_thread_m-1,len)
6089 if (fldlmn .ne. 999.0)
then
6091 if(slimsk(i).eq.1..and.sno(i).le.0..and.
6092 & fld(i).lt.fldlmn-epsfld)
then
6097 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6098 nprt = min(mmprt,kminl)
6101 print 8001,rla(ij),rlo(ij),fld(ij),fldlmn
6102 8001
format(
' bare land min. check. lat=',f5.1,
6103 &
' lon=',f6.1,
' fld=',e13.6,
' to ',e13.6)
6106 if (mode .eq. 1)
then
6108 fld(iwk(i)) = fldlmn
6115 if (fldlmx .ne. 999.0)
then
6117 if(slimsk(i).eq.1..and.sno(i).le.0..and.
6118 & fld(i).gt.fldlmx+epsfld)
then
6123 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6124 nprt = min(mmprt,kmaxl)
6127 print 8002,rla(ij),rlo(ij),fld(ij),fldlmx
6128 8002
format(
' bare land max. check. lat=',f5.1,
6129 &
' lon=',f6.1,
' fld=',e13.6,
' to ',e13.6)
6132 if (mode .eq. 1)
then
6134 fld(iwk(i)) = fldlmx
6141 if (fldsmn .ne. 999.0)
then
6143 if(slimsk(i).eq.1..and.sno(i).gt.0..and.
6144 & fld(i).lt.fldsmn-epsfld)
then
6149 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6150 nprt = min(mmprt,kmins)
6153 print 8003,rla(ij),rlo(ij),fld(ij),fldsmn
6154 8003
format(
' sno covrd land min. check. lat=',f5.1,
6155 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6158 if (mode .eq. 1)
then
6160 fld(iwk(i)) = fldsmn
6167 if (fldsmx .ne. 999.0)
then
6169 if(slimsk(i).eq.1..and.sno(i).gt.0..and.
6170 & fld(i).gt.fldsmx+epsfld)
then
6175 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6176 nprt = min(mmprt,kmaxs)
6179 print 8004,rla(ij),rlo(ij),fld(ij),fldsmx
6180 8004
format(
' snow land max. check. lat=',f5.1,
6181 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6184 if (mode .eq. 1)
then
6186 fld(iwk(i)) = fldsmx
6193 if (fldomn .ne. 999.0)
then
6195 if(slimsk(i).eq.0..and.
6196 & fld(i).lt.fldomn-epsfld)
then
6201 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6202 nprt = min(mmprt,kmino)
6205 print 8005,rla(ij),rlo(ij),fld(ij),fldomn
6206 8005
format(
' open ocean min. check. lat=',f5.1,
6207 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6210 if (mode .eq. 1)
then
6212 fld(iwk(i)) = fldomn
6219 if (fldomx .ne. 999.0)
then
6221 if(fldomx.ne.999..and.slimsk(i).eq.0..and.
6222 & fld(i).gt.fldomx+epsfld)
then
6227 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6228 nprt = min(mmprt,kmaxo)
6231 print 8006,rla(ij),rlo(ij),fld(ij),fldomx
6232 8006
format(
' open ocean max. check. lat=',f5.1,
6233 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6236 if (mode .eq. 1)
then
6238 fld(iwk(i)) = fldomx
6245 if (fldimn .ne. 999.0)
then
6247 if(slimsk(i).eq.2..and.sno(i).le.0..and.
6248 & fld(i).lt.fldimn-epsfld)
then
6253 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6254 nprt = min(mmprt,kmini)
6257 print 8007,rla(ij),rlo(ij),fld(ij),fldimn
6258 8007
format(
' seaice no snow min. check lat=',f5.1,
6259 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6262 if (mode .eq. 1)
then
6264 fld(iwk(i)) = fldimn
6271 if (fldimx .ne. 999.0)
then
6273 if(slimsk(i).eq.2..and.sno(i).le.0..and.
6274 & fld(i).gt.fldimx+epsfld .and. iceflg(i))
then
6280 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6281 nprt = min(mmprt,kmaxi)
6284 print 8008,rla(ij),rlo(ij),fld(ij),fldimx
6285 8008
format(
' seaice no snow max. check lat=',f5.1,
6286 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6289 if (mode .eq. 1)
then
6291 fld(iwk(i)) = fldimx
6298 if (fldjmn .ne. 999.0)
then
6300 if(slimsk(i).eq.2..and.sno(i).gt.0..and.
6301 & fld(i).lt.fldjmn-epsfld)
then
6306 if(me == 0 . and. it == 1 .and. num_threads == 1)
then
6307 nprt = min(mmprt,kminj)
6310 print 8009,rla(ij),rlo(ij),fld(ij),fldjmn
6311 8009
format(
' sea ice snow min. check lat=',f5.1,
6312 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6315 if (mode .eq. 1)
then
6317 fld(iwk(i)) = fldjmn
6324 if (fldjmx .ne. 999.0)
then
6326 if(slimsk(i).eq.2..and.sno(i).gt.0..and.
6327 & fld(i).gt.fldjmx+epsfld .and. iceflg(i))
then
6333 if(me == 0 .and. it == 1 .and. num_threads == 1)
then
6334 nprt = min(mmprt,kmaxj)
6337 print 8010,rla(ij),rlo(ij),fld(ij),fldjmx
6338 8010
format(
' seaice snow max check lat=',f5.1,
6339 &
' lon=',f6.1,
' fld=',e11.4,
' to ',e11.4)
6342 if (mode .eq. 1)
then
6344 fld(iwk(i)) = fldjmx
6357 per=float(kminl)/float(len)*100.
6358 print 9001,fldlmn,kminl,per
6359 9001
format(
' bare land min check. modified to ',f8.1,
6360 &
' at ',i5,
' points ',f8.1,
'percent')
6361 if(per.gt.permax) permax=per
6364 per=float(kmaxl)/float(len)*100.
6365 print 9002,fldlmx,kmaxl,per
6366 9002
format(
' bare land max check. modified to ',f8.1,
6367 &
' at ',i5,
' points ',f4.1,
'percent')
6368 if(per.gt.permax) permax=per
6371 per=float(kmino)/float(len)*100.
6372 print 9003,fldomn,kmino,per
6373 9003
format(
' open ocean min check. modified to ',f8.1,
6374 &
' at ',i5,
' points ',f4.1,
'percent')
6375 if(per.gt.permax) permax=per
6378 per=float(kmaxo)/float(len)*100.
6379 print 9004,fldomx,kmaxo,per
6380 9004
format(
' open sea max check. modified to ',f8.1,
6381 &
' at ',i5,
' points ',f4.1,
'percent')
6382 if(per.gt.permax) permax=per
6385 per=float(kmins)/float(len)*100.
6386 print 9009,fldsmn,kmins,per
6387 9009
format(
' snow covered land min check. modified to ',f8.1,
6388 &
' at ',i5,
' points ',f4.1,
'percent')
6389 if(per.gt.permax) permax=per
6392 per=float(kmaxs)/float(len)*100.
6393 print 9010,fldsmx,kmaxs,per
6394 9010
format(
' snow covered land max check. modified to ',f8.1,
6395 &
' at ',i5,
' points ',f4.1,
'percent')
6396 if(per.gt.permax) permax=per
6399 per=float(kmini)/float(len)*100.
6400 print 9005,fldimn,kmini,per
6401 9005
format(
' bare ice min check. modified to ',f8.1,
6402 &
' at ',i5,
' points ',f4.1,
'percent')
6403 if(per.gt.permax) permax=per
6406 per=float(kmaxi)/float(len)*100.
6407 print 9006,fldimx,kmaxi,per
6408 9006
format(
' bare ice max check. modified to ',f8.1,
6409 &
' at ',i5,
' points ',f4.1,
'percent')
6410 if(per.gt.permax) permax=per
6413 per=float(kminj)/float(len)*100.
6414 print 9007,fldjmn,kminj,per
6415 9007
format(
' snow covered ice min check. modified to ',f8.1,
6416 &
' at ',i5,
' points ',f4.1,
'percent')
6417 if(per.gt.permax) permax=per
6420 per=float(kmaxj)/float(len)*100.
6421 print 9008,fldjmx,kmaxj,per
6422 9008
format(
' snow covered ice max check. modified to ',f8.1,
6423 &
' at ',i5,
' points ',f4.1,
'percent')
6424 if(per.gt.permax) permax=per
6447 use machine , only : kind_io8,kind_io4
6450 real (kind=kind_io8) fld(len),eps
6452 if(abs(fld(i)).lt.eps) fld(i) = 0.
6465 use machine , only : kind_io8,kind_io4
6468 real (kind=kind_io8) snofld(len),scvfld(len)
6472 if(snofld(i).gt.0.) scvfld(i) = 1.
6487 subroutine getstc(tsffld,tg3fld,slifld,len,lsoil,stcfld,tsfimx)
6489 use machine , only : kind_io8,kind_io4
6491 integer k,i,len,lsoil
6492 real (kind=kind_io8) factor,tsfimx
6493 real (kind=kind_io8) tsffld(len), tg3fld(len), slifld(len)
6494 real (kind=kind_io8) stcfld(len,lsoil)
6500 if(slifld(i).eq.1.0)
then
6501 factor = ((k-1) * 2 + 1) / (2. * lsoil)
6502 stcfld(i,k) = factor*tg3fld(i)+(1.-factor)*tsffld(i)
6503 elseif(slifld(i).eq.2.0)
then
6504 factor = ((k-1) * 2 + 1) / (2. * lsoil)
6505 stcfld(i,k) = factor*tsfimx+(1.-factor)*tsffld(i)
6507 stcfld(i,k) = tg3fld(i)
6514 stcfld(i,k) = stcfld(i,2)
6529 subroutine getsmc(wetfld,len,lsoil,smcfld,me)
6531 use machine , only : kind_io8,kind_io4
6533 integer k,i,len,lsoil,me
6534 real (kind=kind_io8) wetfld(len), smcfld(len,lsoil)
6536 if (me .eq. 0)
write(6,*)
'getsmc'
6542 smcfld(i,k) = (wetfld(i)*1000./150.)*.37 + .1
6560 subroutine usesgt(sig1t,slianl,tg3anl,len,lsoil,tsfanl,stcanl,
6563 use machine , only : kind_io8,kind_io4
6566 real (kind=kind_io8) tsfimx
6567 real (kind=kind_io8) sig1t(len), slianl(len), tg3anl(len)
6568 real (kind=kind_io8) tsfanl(len), stcanl(len,lsoil)
6572 if(sig1t(1).gt.0.)
then
6574 if(slianl(i).ne.0.)
then
6575 tsfanl(i) = sig1t(i)
6579 call
getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx)
6593 subroutine snosfc(snoanl,tsfanl,tsfsmx,len,me)
6594 use machine , only : kind_io8,kind_io4
6596 integer kount,i,len,me
6597 real (kind=kind_io8) per,tsfsmx
6598 real (kind=kind_io8) snoanl(len), tsfanl(len)
6600 if (me .eq. 0)
write(6,*)
'set snow temp to tsfsmx if greater'
6603 if(snoanl(i).gt.0.)
then
6604 if(tsfanl(i).gt.tsfsmx) tsfanl(i)=tsfsmx
6610 per=float(kount)/float(len)*100.
6611 write(6,*)
'snow sfc. tsf set to ',tsfsmx,
' at ',
6612 & kount,
' points ',per,
'percent'
6626 use machine , only : kind_io8,kind_io4
6629 real (kind=kind_io8) albomx
6630 real (kind=kind_io8) albclm(len,4), slmask(len)
6632 if(slmask(i).eq.0)
then
6633 albclm(i,1) = albomx
6634 albclm(i,2) = albomx
6635 albclm(i,3) = albomx
6636 albclm(i,4) = albomx
6650 use machine , only : kind_io8,kind_io4
6652 integer i,kount,len,me
6653 real (kind=kind_io8) glacir(len),amxice(len),per
6654 if (me .eq. 0)
write(6,*)
'qc of maximum ice extent'
6657 if(glacir(i).eq.1..and.amxice(i).eq.0.)
then
6663 per = float(kount) / float(len)*100.
6664 if(me .eq. 0)
write(6,*)
' max ice limit less than glacier'
6665 &,
' coverage at ', kount,
' points ',per,
'percent'
6679 use machine , only : kind_io8,kind_io4
6681 integer i,kount,len,me
6682 real (kind=kind_io8) slianl(len), slifcs(len),per
6689 if(slianl(i).eq.1..and.slifcs(i).eq.0.)
then
6693 if(slianl(i).eq.0..and.slifcs(i).eq.1.)
then
6697 if(slianl(i).eq.2..and.slifcs(i).eq.1.)
then
6701 if(slianl(i).eq.1..and.slifcs(i).eq.2.)
then
6707 per=float(kount)/float(len)*100.
6709 write(6,*)
' inconsistency of slmask between forecast and',
6710 &
' analysis corrected at ',kount,
' points ',per,
6766 subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi,
6767 & len,lsoil,snoanl,aisanl,slianl,tsfanl,albanl,
6769 & smcclm,tsfsmx,albomx,zoromx, me)
6771 use machine , only : kind_io8,kind_io4
6773 integer kount,me,k,i,lsoil,len
6774 real (kind=kind_io8) zoromx,per,albomx,qctsfi,qcsnos,qctsfs,tsfsmx
6775 real (kind=kind_io8) tsffcs(len), snofcs(len)
6776 real (kind=kind_io8) snoanl(len), aisanl(len),
6777 & slianl(len), zoranl(len),
6778 & tsfanl(len), albanl(len,4),
6780 real (kind=kind_io8) smcclm(len,lsoil)
6782 if (me .eq. 0)
write(6,*)
'qc of snow and sea-ice analysis'
6790 if(slianl(i).gt.0..and.
6791 & tsffcs(i).gt.qctsfs.and.snoanl(i).gt.0.)
then
6794 tsfanl(i) = tsffcs(i)
6798 per=float(kount)/float(len)*100.
6800 write(6,*) .gt.
' guess surface temp ',qctsfs,
6801 &
' but snow analysis indicates snow cover'
6802 write(6,*)
' snow analysis set to zero',
6803 &
' at ',kount,
' points ',per,
'percent'
6811 if(slianl(i).gt.0..and.
6812 & snofcs(i).gt.qcsnos.and.snoanl(i).lt.0.)
then
6814 snoanl(i) = snofcs(i)
6815 tsfanl(i) = tsffcs(i)
6819 per=float(kount)/float(len)*100.
6821 write(6,*) .gt.
' guess snow depth ',qcsnos,
6822 &
' but snow analysis indicates no snow cover'
6823 write(6,*)
' snow analysis set to guess value',
6824 &
' at ',kount,
' points ',per,
'percent'
6888 subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat,
6889 &
data,imax,jmax,rlnout,rltout,lmask,rslmsk
6890 &, gaus,blno, blto, kgds1, kpds4, lbms)
6891 use machine , only : kind_io8,kind_io4
6894 real (kind=kind_io8) blno,blto,wlon,rnlat,crit,data_max
6895 integer i,j,ijmax,jgaul,igaul,kpds5,jmax,imax, kgds1, kspla
6896 integer,
intent(in) :: kpds4
6897 logical*1,
intent(in) :: lbms(imax,jmax)
6898 real*4 :: dummy(imax,jmax)
6900 real (kind=kind_io8) slmask(igaul,jgaul)
6901 real (kind=kind_io8) data(imax,jmax),rslmsk(imax,jmax)
6902 &, rlnout(imax), rltout(jmax)
6903 real (kind=kind_io8) a(jmax), w(jmax), radi, dlat, dlon
6908 if (kgds1 .eq. 4)
then
6910 call splat(kspla, jmax, a, w)
6912 radi = 180.0 / (4.*atan(1.))
6914 rltout(j) = acos(a(j)) * radi
6917 if (rnlat .gt. 0.0)
then
6919 rltout(j) = 90. - rltout(j)
6923 rltout(j) = -90. + rltout(j)
6926 elseif (kgds1 .eq. 0)
then
6927 dlat = -(rnlat+rnlat) / float(jmax-1)
6929 rltout(j) = rnlat + (j-1) * dlat
6932 write(6,*)
' FATAL ERROR: Mask data on'
6933 write(6,*)
' unsupported grid.'
6938 rlnout(i) = wlon + (i-1)*dlon
6945 if(kpds5 == kpdtsf .and. imax == 138 .and. jmax == 116
6946 & .and. kpds4 == 128)
then
6950 elseif(kpds5 == kpdtsf)
then
6956 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
6957 &, rlnout, rltout, gaus, blno, blto)
6960 call
rof01(rslmsk,ijmax,
'ge',crit)
6965 elseif(kpds5.eq.kpdwet)
then
6966 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
6967 &, rlnout, rltout, gaus, blno, blto)
6970 call
rof01(rslmsk,ijmax,
'ge',crit)
6978 elseif(kpds5 == kpdsnd)
then
6979 if(kpds4 == 192)
then
6995 elseif(kpds5.eq.kpdsno)
then
6996 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
6997 &, rlnout, rltout, gaus, blno, blto)
7000 call
rof01(rslmsk,ijmax,
'ge',crit)
7008 elseif(kpds5.eq.kpdsmc)
then
7009 if(kpds4 == 192)
then
7020 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
7021 &, rlnout, rltout, gaus, blno, blto)
7023 call
rof01(rslmsk,ijmax,
'ge',crit)
7029 elseif(kpds5.eq.kpdzor)
then
7032 rslmsk(i,j)=
data(i,j)
7036 call
rof01(rslmsk,ijmax,
'lt',crit)
7060 elseif(kpds5.eq.kpdalb(1))
then
7061 if (kpds4 == 192)
then
7074 elseif(kpds5.eq.kpdalb(2))
then
7076 if (kpds4 == 192)
then
7089 elseif(kpds5.eq.kpdalb(3))
then
7091 if (kpds4 == 192)
then
7104 elseif(kpds5.eq.kpdalb(4))
then
7106 if (kpds4 == 192)
then
7122 elseif(kpds5.eq.kpdalf(1))
then
7128 elseif(kpds5.eq.kpdalf(2))
then
7137 elseif(kpds5.eq.kpdais)
then
7147 rslmsk(i,j) =
data(i,j)
7148 data_max= max(data_max,
data(i,j))
7152 if (data_max .gt. crit)
then
7153 call
rof01(rslmsk,ijmax,
'gt',crit)
7164 elseif(kpds5.eq.kpdtg3)
then
7189 elseif(kpds5.eq.kpdgla)
then
7194 elseif(kpds5.eq.kpdmxi)
then
7199 elseif(kpds5.eq.kpdscv)
then
7200 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
7201 &, rlnout, rltout, gaus, blno, blto)
7204 call
rof01(rslmsk,ijmax,
'ge',crit)
7212 elseif(kpds5.eq.kpdacn)
then
7214 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
7215 &, rlnout, rltout, gaus, blno, blto)
7218 call
rof01(rslmsk,ijmax,
'ge',crit)
7226 elseif(kpds5.eq.kpdveg)
then
7228 if (kpds4 == 192)
then
7233 rslmsk(i,jmax-j+1) = 1.
7240 call
ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat
7241 &, rlnout, rltout, gaus, blno, blto)
7243 call
rof01(rslmsk,ijmax,
'ge',crit)
7250 elseif(kpds5.eq.kpdsot)
then
7252 if (kpds4 == 192)
then
7265 rslmsk(i,j) =
data(i,j)
7269 call
rof01(rslmsk,ijmax,
'gt',crit)
7275 elseif(kpds5.eq.kpdvet)
then
7277 if (kpds4 == 192)
then
7290 rslmsk(i,j) =
data(i,j)
7294 call
rof01(rslmsk,ijmax,
'gt',crit)
7300 elseif(kpds5.eq.kpdvmn)
then
7306 rslmsk(i,j) =
data(i,j)
7311 call
rof01(rslmsk,ijmax,
'gt',crit)
7315 elseif(kpds5.eq.kpdvmx)
then
7321 rslmsk(i,j) =
data(i,j)
7326 call
rof01(rslmsk,ijmax,
'gt',crit)
7330 elseif(kpds5.eq.kpdslp)
then
7336 rslmsk(i,j) =
data(i,j)
7341 call
rof01(rslmsk,ijmax,
'gt',crit)
7346 elseif(kpds5.eq.kpdabs)
then
7347 if (kpds4 == 192)
then
7360 rslmsk(i,j) =
data(i,j)
7364 call
rof01(rslmsk,ijmax,
'gt',crit)
7388 subroutine ga2la(gauin,imxin,jmxin,regout,imxout,jmxout,
7389 & wlon,rnlat,rlnout,rltout,gaus,blno, blto)
7390 use machine , only : kind_io8,kind_io4
7392 integer i1,i2,j2,ishft,i,jj,j1,jtem,jmxout,imxin,jmxin,imxout,
7394 real (kind=kind_io8) alamd,dxin,aphi,x,sum1,sum2,y,dlati,wlon,
7395 & rnlat,dxout,dphi,dlat,facns,tem,blno,
7400 real (kind=kind_io8) gauin (imxin,jmxin), regout(imxout,jmxout)
7401 &, rlnout(imxout), rltout(jmxout)
7404 real,
allocatable :: gaul(:)
7405 real (kind=kind_io8) ddx(imxout),ddy(jmxout)
7406 integer iindx1(imxout), iindx2(imxout),
7407 & jindx1(jmxout), jindx2(jmxout)
7408 integer jmxsav,n,kspla
7410 save jmxsav, gaul, dlati
7411 real (kind=kind_io8) radi
7412 real (kind=kind_io8) a(jmxin), w(jmxin)
7418 save num_threads, first
7420 integer len_thread_m, j1_t, j2_t, it
7428 if (jmxin .ne. jmxsav)
then
7429 if (jmxsav .gt. 0)
deallocate (gaul, stat=iret)
7430 allocate (gaul(jmxin))
7437 call splat(kspla, jmxin, a, w)
7439 radi = 180.0 / (4.*atan(1.))
7441 gaul(n) = acos(a(n)) * radi
7445 gaul(j) = 90. - gaul(j)
7448 dlat = -2*blto / float(jmxin-1)
7451 gaul(j) = blto + (j-1) * dlat
7457 dxin = 360. / float(imxin )
7461 i1 = floor((alamd-blno)/dxin) + 1
7462 ddx(i) = (alamd-blno)/dxin-(i1-1)
7463 iindx1(i) = modulo(i1-1,imxin) + 1
7464 iindx2(i) = modulo(i1 ,imxin) + 1
7468 len_thread_m = (jmxout+num_threads-1) / num_threads
7478 j1_t = (it-1)*len_thread_m+1
7479 j2_t = min(j1_t+len_thread_m-1,jmxout)
7485 if(aphi.lt.gaul(jj)) go to 50
7490 if(j2.gt.2) go to 43
7495 if(j2.le.jmxin) go to 45
7504 ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1))
7516 j1_t = (it-1)*len_thread_m+1
7517 j2_t = min(j1_t+len_thread_m-1,jmxout)
7522 jtem = (aphi - blto) * dlati + 1
7523 if (jtem .ge. 1 .and. jtem .lt. jmxin)
then
7526 ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1))
7527 elseif (jtem .eq. jmxin)
then
7565 j1_t = (it-1)*len_thread_m+1
7566 j2_t = min(j1_t+len_thread_m-1,jmxout)
7576 regout(i,j) = (1.-x)*((1.-y)*gauin(i1,j1) + y*gauin(i1,j2))
7577 & + x *((1.-y)*gauin(i2,j1) + y*gauin(i2,j2))
7586 sum1 = sum1 + gauin(i,1)
7587 sum2 = sum2 + gauin(i,jmxin)
7589 sum1 = sum1 / float(imxin)
7590 sum2 = sum2 / float(imxin)
7593 if (rnlat .gt. 0.0)
then
7596 regout(i,jmxout) = sum2
7601 regout(i,jmxout) = sum1
7605 if (blto .lt. 0.0)
then
7606 if (rnlat .gt. 0.0)
then
7609 regout(i,jmxout) = sum1
7614 regout(i,jmxout) = sum2
7618 if (rnlat .lt. 0.0)
then
7621 regout(i,jmxout) = sum1
7626 regout(i,jmxout) = sum2
7643 subroutine landtyp(vegtype,soiltype,slptype,slmask,len)
7644 use machine , only : kind_io8,kind_io4
7647 real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len)
7653 if (slmask(i) .eq. 1)
then
7654 if (vegtype(i) .eq. 0.) vegtype(i) = 7
7655 if (soiltype(i) .eq. 0.) soiltype(i) = 2
7656 if (slptype(i) .eq. 0.) slptype(i) = 1
7669 use machine , only : kind_io8,kind_io4
7672 real (kind=kind_io8) radi
7673 real (kind=kind_io8) a(k), w(k), gaul(k)
7675 call splat(4, k, a, w)
7677 radi = 180.0 / (4.*atan(1.))
7679 gaul(n) = acos(a(n)) * radi
7687 6000
format(//5x,
'error in gauaw'//)
7699 subroutine anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len)
7701 use machine , only : kind_io8,kind_io4
7704 real (kind=kind_io8) tsfanl(len), tsfan0(len),
7705 & tsfclm(len), tsfcl0(len)
7710 write(6,*)
'anomint'
7712 tsfanl(i) = tsfan0(i) - tsfcl0(i) + tsfclm(i)
7828 subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,
7829 & slmask,fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
7830 & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc,
7832 & fnvmnc,fnvmxc,fnslpc,fnabsc,
7833 & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm,
7834 & tg3clm,cvclm ,cvbclm,cvtclm,
7835 & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm,
7836 & vetclm,sotclm,alfclm,
7837 & vmnclm,vmxclm,slpclm,absclm,
7838 & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais,
7839 & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg,
7840 & kpdvet,kpdsot,kpdalf,tsfcl0,
7841 & kpdvmn,kpdvmx,kpdslp,kpdabs,
7843 &, imsk, jmsk, slmskh, outlat, outlon
7844 &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb
7845 &, tile_num_ch, i_index, j_index)
7847 use machine , only : kind_io8,kind_io4
7849 character(len=*),
intent(in) :: tile_num_ch
7850 integer,
intent(in) :: i_index(len), j_index(len)
7851 real (kind=kind_io8) rjday,wei1x,wei2x,rjdayh,wei2m,wei1m,wei1s,
7852 & wei2s,fh,stcmon1s,blto,blno,deltsfc,rjdayh2
7853 real (kind=kind_io8) wei1y,wei2y
7854 integer jdoy,jday,jh,jdow,mmm,mmp,mm,iret,monend,i,k,jm,jd,iy4,
7855 & jy,mon1,is2,isx,kpd9,is1,l,nn,mon2,mon,is,kpdsno,
7856 & kpdzor,kpdtsf,kpdwet,kpdscv,kpdacn,kpdais,kpdtg3,im,id,
7857 & lugb,iy,len,lsoil,ih,kpdsmc,iprnt,me,m1,m2,k1,k2,
7858 & kpdvet,kpdsot,kpdstc,kpdveg,jmsk,imsk,j,ialb
7859 &, kpdvmn,kpdvmx,kpdslp,kpdabs,landice_cat
7860 integer kpdalb(4), kpdalf(2)
7862 character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,
7863 & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc,
7864 & fnvetc,fnsotc,fnalbc2
7865 &, fnvmnc,fnvmxc,fnslpc,fnabsc
7866 real (kind=kind_io8) tsfclm(len),tsfcl2(len),
7867 & wetclm(len),snoclm(len),
7868 & zorclm(len),albclm(len,4),aisclm(len),
7869 & tg3clm(len),acnclm(len),
7870 & cvclm(len),cvbclm(len),cvtclm(len),
7872 & smcclm(len,lsoil),stcclm(len,lsoil),
7873 & sliclm(len),scvclm(len),vegclm(len),
7874 & vetclm(len),sotclm(len),alfclm(len,2)
7875 &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len)
7876 real (kind=kind_io8) slmskh(imsk,jmsk)
7877 real (kind=kind_io8) outlat(len), outlon(len)
7879 real (kind=kind_io8) slmask(len), tsfcl0(len)
7880 real (kind=kind_io8),
allocatable :: slmask_noice(:)
7882 logical lanom, gaus, first
7885 real (kind=kind_io8) z0_sib(13)
7886 data z0_sib /2.653, 0.826, 0.563, 1.089, 0.854, 0.856,
7887 & 0.035, 0.238, 0.065, 0.076, 0.011, 0.125,
7890 real (kind=kind_io8) z0_igbp_min(20), z0_igbp_max(20)
7891 real (kind=kind_io8) z0_season(12)
7892 data z0_igbp_min /1.089, 2.653, 0.854, 0.826, 0.800, 0.050,
7893 & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130,
7894 & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076,
7896 data z0_igbp_max /1.089, 2.653, 0.854, 0.826, 0.800, 0.050,
7897 & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130,
7898 & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076,
7903 real (kind=kind_io8) dayhf(13)
7904 data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0,
7905 & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/
7907 real (kind=kind_io8) fha(5)
7909 integer w3kindreal,w3kindint
7910 integer ida(8),jda(8),ivtyp, kpd7
7912 real (kind=kind_io8),
allocatable :: tsf(:,:),sno(:,:),
7913 & zor(:,:),wet(:,:),
7914 & ais(:,:), acn(:,:), scv(:,:), smc(:,:,:),
7915 & tg3(:), alb(:,:,:), alf(:,:),
7916 & vet(:), sot(:), tsf2(:),
7917 & veg(:,:), stc(:,:,:)
7918 &, vmn(:), vmx(:), slp(:), absm(:)
7920 integer mon1s, mon2s, sea1s, sea2s, sea1, sea2, hyr1, hyr2
7922 data mon1s/0/, mon2s/0/, sea1s/0/, sea2s/0/
7924 save first, tsf, sno, zor, wet, ais, acn, scv, smc, tg3,
7925 & alb, alf, vet, sot, tsf2, veg, stc,
7926 & vmn, vmx, slp, absm,
7927 & mon1s, mon2s, sea1s, sea2s, dayhf, k1, k2, m1, m2,
7976 allocate (tsf(len,2), sno(len,2), zor(len,2),
7977 & wet(len,2), ais(len,2), acn(len,2),
7978 & scv(len,2), smc(len,lsoil,2),
7979 & tg3(len), alb(len,4,2), alf(len,2),
7980 & vet(len), sot(len), tsf2(len),
7982 & vmn(len), vmx(len), slp(len), absm(len),
7983 & veg(len,2), stc(len,lsoil,2))
7989 if (me == 0) print*,
'bosu fh gt 0'
7992 if (iy < 101) iy4 = 1900 + iy4
8001 call w3kind(w3kindreal,w3kindint)
8002 if(w3kindreal == 4)
then
8004 call w3movdat(fha4,ida,jda)
8006 call w3movdat(fha,ida,jda)
8012 if (me == 0)
write(6,*)
' forecast jy,jm,jd,jh',
8017 call w3doxdat(jda,jdow,jdoy,jday)
8018 rjday = jdoy + jda(5) / 24.
8019 if(rjday < dayhf(1)) rjday = rjday + 365.
8021 if (me == 0)
write(6,*)
'forecast jy,jm,jd,jh=',jy,jm,jd,jh
8029 if(rjday >= dayhf(mmm) .and. rjday < dayhf(mmp))
then
8035 print *,
'FATAL ERROR: Wrong rjday',rjday
8038 wei1m = (dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1))
8041 if (mon2 == 13) mon2 = 1
8042 if (me == 0) print *,
'rjday,mon1,mon2,wei1m,wei2m=',
8043 & rjday,mon1,mon2,wei1m,wei2m
8050 if (nn == 2) mon = mon2
8051 call
fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask,
8052 & tsf(1,nn),len,iret
8053 &, imsk, jmsk, slmskh, gaus,blno, blto
8054 &, outlat, outlon, me)
8060 tsfcl0(i) = wei1m * tsf(i,1) + wei2m * tsf(i,2)
8068 if (iy < 101) iy4=1900+iy4
8077 call w3kind(w3kindreal,w3kindint)
8078 if(w3kindreal == 4)
then
8080 call w3movdat(fha4,ida,jda)
8082 call w3movdat(fha,ida,jda)
8093 call w3doxdat(jda,jdow,jdoy,jday)
8094 rjday = jdoy + jda(5) / 24.
8095 if(rjday < dayhf(1)) rjday = rjday + 365.
8097 if (me == 0)
write(6,*)
' forecast jy,jm,jd,jh,rjday=',
8100 if (me == 0)
write(6,*)
'forecast jy,jm,jd,jh=',jy,jm,jd,jh
8108 if(rjday >= dayhf(mmm) .and. rjday < dayhf(mmp))
then
8114 print *,
'FATAL ERROR: Wrong rjday',rjday
8117 wei1m = (dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1))
8120 if (mon2 == 13) mon2 = 1
8121 if (me == 0) print *,
'rjday,mon1,mon2,wei1m,wei2m=',
8122 & rjday,mon1,mon2,wei1m,wei2m
8132 if(rjday >= dayhf(mmm) .and. rjday < dayhf(mmp))
then
8138 print *,
'FATAL ERROR: Wrong rjday',rjday
8141 wei1s = (dayhf(sea2)-rjday)/(dayhf(sea2)-dayhf(sea1))
8144 if (sea2 == 13) sea2 = 1
8145 if (me == 0) print *,
'rjday,sea1,sea2,wei1s,wei2s=',
8146 & rjday,sea1,sea2,wei1s,wei2s
8156 if(rjday >= dayhf(mmm) .and. rjday < dayhf(mmp))
then
8162 print *,
'FATAL ERROR: Wrong rjday',rjday
8165 wei1y = (dayhf(hyr2)-rjday)/(dayhf(hyr2)-dayhf(hyr1))
8168 if (hyr2 == 13) hyr2 = 1
8169 if (me == 0) print *,
'rjday,hyr1,hyr2,wei1y,wei2y=',
8170 & rjday,hyr1,hyr2,wei1y,wei2y
8174 first_time :
if (first)
then
8176 if (me == 0) print*,
'bosu first time thru'
8193 if ( index(fnalbc2,
"tileX.nc") == 0)
then
8194 call
fixrdc(lugb,fnalbc2,kpdalf(1),kpd7,kpd9,slmask
8196 &, imsk, jmsk, slmskh, gaus,blno, blto
8197 &, outlat, outlon, me)
8199 call
fixrdc_tile(fnalbc2, tile_num_ch, i_index, j_index,
8200 & kpdalf(1), alf(:,1), 1, len, me)
8203 call
fixrdc(lugb,fnalbc,kpdalf(1),kpd7,kpd9,slmask
8205 &, imsk, jmsk, slmskh, gaus,blno, blto
8206 &, outlat, outlon, me)
8209 if(slmask(i).eq.1.)
then
8210 alf(i,2) = 100. - alf(i,1)
8216 if(fntg3c(1:8).ne.
' ')
then
8217 if ( index(fntg3c,
"tileX.nc") == 0)
then
8219 call
fixrdc(lugb,fntg3c,kpdtg3,kpd7,kpd9,slmask,
8221 &, imsk, jmsk, slmskh, gaus,blno, blto
8222 &, outlat, outlon, me)
8224 call
fixrdc_tile(fntg3c, tile_num_ch, i_index, j_index,
8225 & kpdtg3, tg3, 1, len, me)
8234 if(fnvetc(1:8).ne.
' ')
then
8235 if ( index(fnvetc,
"tileX.nc") == 0)
then
8237 call
fixrdc(lugb,fnvetc,kpdvet,kpd7,kpd9,slmask,
8239 &, imsk, jmsk, slmskh, gaus,blno, blto
8240 &, outlat, outlon, me)
8242 if (maxval(vet)> 13.0) landice_cat=15
8244 call
fixrdc_tile(fnvetc, tile_num_ch, i_index, j_index,
8245 & kpdvet, vet, 1, len, me)
8248 if (me .eq. 0)
write(6,*)
'climatological vegetation',
8250 elseif(index(fnsmcc,
'soilmgldas') /= 0)
then
8251 if (me .eq. 0)
write(6,*)
'FATAL ERROR: must choose'
8252 if (me .eq. 0)
write(6,*)
'climatological veg type when'
8253 if (me .eq. 0)
write(6,*)
'using new gldas soil moisture.'
8259 if(fnsotc(1:8).ne.
' ')
then
8260 if ( index(fnsotc,
"tileX.nc") == 0)
then
8262 call
fixrdc(lugb,fnsotc,kpdsot,kpd7,kpd9,slmask,
8264 &, imsk, jmsk, slmskh, gaus,blno, blto
8265 &, outlat, outlon, me)
8267 call
fixrdc_tile(fnsotc, tile_num_ch, i_index, j_index,
8268 & kpdsot, sot, 1, len, me)
8270 if (me .eq. 0)
write(6,*)
'climatological soil type read in.'
8276 if(fnvmnc(1:8).ne.
' ')
then
8277 if ( index(fnvmnc,
"tileX.nc") == 0)
then
8279 call
fixrdc(lugb,fnvmnc,kpdvmn,kpd7,kpd9,slmask,
8281 &, imsk, jmsk, slmskh, gaus,blno, blto
8282 &, outlat, outlon, me)
8284 call
fixrdc_tile(fnvmnc, tile_num_ch, i_index, j_index,
8285 & 257, vmn, 99, len, me)
8288 if (me .eq. 0)
write(6,*)
'climatological shdmin read in.'
8293 if(fnvmxc(1:8).ne.
' ')
then
8294 if ( index(fnvmxc,
"tileX.nc") == 0)
then
8296 call
fixrdc(lugb,fnvmxc,kpdvmx,kpd7,kpd9,slmask,
8298 &, imsk, jmsk, slmskh, gaus,blno, blto
8299 &, outlat, outlon, me)
8301 call
fixrdc_tile(fnvmxc, tile_num_ch, i_index, j_index,
8302 & 256, vmx, 99, len, me)
8304 if (me .eq. 0)
write(6,*)
'climatological shdmax read in.'
8309 if(fnslpc(1:8).ne.
' ')
then
8310 if ( index(fnslpc,
"tileX.nc") == 0)
then
8312 call
fixrdc(lugb,fnslpc,kpdslp,kpd7,kpd9,slmask,
8314 &, imsk, jmsk, slmskh, gaus,blno, blto
8315 &, outlat, outlon, me)
8317 call
fixrdc_tile(fnslpc, tile_num_ch, i_index, j_index,
8318 & kpdslp, slp, 1, len, me)
8320 if (me .eq. 0)
write(6,*)
'climatological slope read in.'
8325 if(fnabsc(1:8).ne.
' ')
then
8326 if ( index(fnabsc,
"tileX.nc") == 0)
then
8328 call
fixrdc(lugb,fnabsc,kpdabs,kpd7,kpd9,slmask,
8330 &, imsk, jmsk, slmskh, gaus,blno, blto
8331 &, outlat, outlon, me)
8333 call
fixrdc_tile(fnabsc, tile_num_ch, i_index, j_index,
8334 & kpdabs, absm, 1, len, me)
8336 if (me .eq. 0)
write(6,*)
'climatological snoalb read in.'
8342 if (is1 .eq. 5) is1 = 1
8343 if (is2 .eq. 5) is2 = 1
8352 if(isx.eq.1) kpd9 = 12
8353 if(isx.eq.2) kpd9 = 3
8354 if(isx.eq.3) kpd9 = 6
8355 if(isx.eq.4) kpd9 = 9
8367 call
fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask,
8368 & alb(1,k,nn),len,iret
8369 &, imsk, jmsk, slmskh, gaus,blno, blto
8370 &, outlat, outlon, me)
8377 if (nn .eq. 2) mon = mon2
8381 if ( index(fnalbc,
"tileX.nc") == 0)
then
8384 call
fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask,
8385 & alb(1,k,nn),len,iret
8386 &, imsk, jmsk, slmskh, gaus,blno, blto
8387 &, outlat, outlon, me)
8391 call
fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index,
8392 & kpdalb(k), alb(:,k,nn), mon, len, me)
8402 call
fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask,
8403 & tsf(1,nn),len,iret
8404 &, imsk, jmsk, slmskh, gaus,blno, blto
8405 &, outlat, outlon, me)
8424 if(fnwetc(1:8).ne.
' ')
then
8426 call
fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask,
8427 & wet(1,nn),len,iret
8428 &, imsk, jmsk, slmskh, gaus,blno, blto
8429 &, outlat, outlon, me)
8430 elseif(fnsmcc(1:8).ne.
' ')
then
8431 if (index(fnsmcc,
'global_soilmcpc.1x1.grb') /= 0)
then
8433 call
fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask,
8434 & smc(1,lsoil,nn),len,iret
8435 &, imsk, jmsk, slmskh, gaus,blno, blto
8436 &, outlat, outlon, me)
8439 smc(i,l,nn) = smc(i,lsoil,nn)
8445 allocate(slmask_noice(len))
8448 if (nint(vet(i)) < 1 .or.
8449 & nint(vet(i)) == landice_cat)
then
8450 slmask_noice(i) = 0.0
8456 if (k==3) kpd7=10340
8457 if (k==4) kpd7=25800
8458 call
fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice,
8459 & smc(1,k,nn),len,iret
8460 &, imsk, jmsk, slmskh, gaus,blno, blto
8461 &, outlat, outlon, me)
8463 deallocate(slmask_noice)
8466 write(6,*)
'FATAL ERROR: climatological soil'
8467 write(6,*)
'wetness file not given.'
8473 if(fnstcc(1:8).ne.
' ')
then
8475 call
fixrdc(lugb,fnstcc,kpdstc,kpd7,mon,slmask,
8476 & stc(1,lsoil,nn),len,iret
8477 &, imsk, jmsk, slmskh, gaus,blno, blto
8478 &, outlat, outlon, me)
8481 stc(i,l,nn) = stc(i,lsoil,nn)
8489 if(fnacnc(1:8).ne.
' ')
then
8490 call
fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask,
8491 & acn(1,nn),len,iret
8492 &, imsk, jmsk, slmskh, gaus,blno, blto
8493 &, outlat, outlon, me)
8494 elseif(fnaisc(1:8).ne.
' ')
then
8495 call
fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask,
8496 & ais(1,nn),len,iret
8497 &, imsk, jmsk, slmskh, gaus,blno, blto
8498 &, outlat, outlon, me)
8500 write(6,*)
'FATAL ERROR: climatological ice'
8501 write(6,*)
'cover file not given.'
8508 call
fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask,
8509 & sno(1,nn),len,iret
8510 &, imsk, jmsk, slmskh, gaus,blno, blto
8511 &, outlat, outlon, me)
8515 if(fnscvc(1:8).ne.
' ')
then
8517 call
fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask,
8518 & scv(1,nn),len,iret
8519 &, imsk, jmsk, slmskh, gaus,blno, blto
8520 &, outlat, outlon, me)
8521 write(6,*)
'climatological snow cover read in.'
8526 if(fnzorc(1:3) ==
'sib')
then
8528 write(6,*)
'roughness length to be set from sib veg type'
8530 elseif(fnzorc(1:4) ==
'igbp')
then
8532 write(6,*)
'roughness length to be set from igbp veg type'
8536 call
fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask,
8537 & zor(1,nn),len,iret
8538 &, imsk, jmsk, slmskh, gaus,blno, blto
8539 &, outlat, outlon, me)
8553 if(fnvegc(1:8).ne.
' ')
then
8554 if ( index(fnvegc,
"tileX.nc") == 0)
then
8556 call
fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask,
8557 & veg(1,nn),len,iret
8558 &, imsk, jmsk, slmskh, gaus,blno, blto
8559 &, outlat, outlon, me)
8561 call
fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index,
8562 & kpdveg, veg(:,nn), mon, len, me)
8564 if (me .eq. 0)
write(6,*)
'climatological vegetation',
8565 &
' cover read in for mon=',mon
8570 mon1s = mon1 ; mon2s = mon2 ; sea1s = sea1 ; sea2s = sea2
8572 if (me == 0) print *,
' mon1s=',mon1s,
' mon2s=',mon2s
8573 &,
' sea1s=',sea1s,
' sea2s=',sea2s
8584 rjdayh = rjday - deltsfc/24.0
8590 if (rjdayh .ge. dayhf(mon1))
then
8591 if (mon2 .eq. 1) mon2 = 13
8592 wei1x = (dayhf(mon2)-rjdayh)/(dayhf(mon2)-dayhf(mon1))
8594 if (mon2 .eq. 13) mon2 = 1
8597 if (rjdayh .lt. dayhf(1)) rjdayh2 = rjdayh2 + 365.0
8598 if (mon1s .eq. mon1)
then
8600 if (mon1s .eq. 0) mon1s = 12
8605 call
fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask,
8606 & tsf(1,k1),len,iret
8607 &, imsk, jmsk, slmskh, gaus,blno, blto
8608 &, outlat, outlon, me)
8612 wei1x = (dayhf(mon2s)-rjdayh2)/(dayhf(mon2s)-dayhf(mon1s))
8614 if (mon2s .eq. 13) mon2s = 1
8616 tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2)
8621 if (sea1 .ne. sea1s)
then
8630 if (isx == 5) isx = 1
8631 if (isx == 1) kpd9 = 12
8632 if (isx == 2) kpd9 = 3
8633 if (isx == 3) kpd9 = 6
8634 if (isx == 4) kpd9 = 9
8645 call
fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask
8646 &, alb(1,k,m2),len,iret
8647 &, imsk, jmsk, slmskh, gaus,blno, blto
8648 &, outlat, outlon, me)
8654 if (mon1 .ne. mon1s)
then
8667 if (me == 0) print*,
'bosu 2nd time in clima for month ',
8669 if ( index(fnalbc,
"tileX.nc") == 0)
then
8672 call
fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask,
8673 & alb(1,k,nn),len,iret
8674 &, imsk, jmsk, slmskh, gaus,blno, blto
8675 &, outlat, outlon, me)
8679 call
fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index,
8680 & kpdalb(k), alb(:,k,nn), mon, len, me)
8688 call
fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask,
8689 & tsf(1,nn),len,iret
8690 &, imsk, jmsk, slmskh, gaus,blno, blto
8691 &, outlat, outlon, me)
8695 if (fnwetc(1:8).ne.
' ')
then
8697 call
fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask,
8698 & wet(1,nn),len,iret
8699 &, imsk, jmsk, slmskh, gaus,blno, blto
8700 &, outlat, outlon, me)
8701 elseif (fnsmcc(1:8).ne.
' ')
then
8702 if (index(fnsmcc,
'global_soilmcpc.1x1.grb') /= 0)
then
8704 call
fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask,
8705 & smc(1,lsoil,nn),len,iret
8706 &, imsk, jmsk, slmskh, gaus,blno, blto
8707 &, outlat, outlon, me)
8710 smc(i,l,nn) = smc(i,lsoil,nn)
8716 allocate(slmask_noice(len))
8719 if (nint(vet(i)) < 1 .or.
8720 & nint(vet(i)) == landice_cat)
then
8721 slmask_noice(i) = 0.0
8727 if (k==3) kpd7=10340
8728 if (k==4) kpd7=25800
8729 call
fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice,
8730 & smc(1,k,nn),len,iret
8731 &, imsk, jmsk, slmskh, gaus,blno, blto
8732 &, outlat, outlon, me)
8734 deallocate(slmask_noice)
8737 write(6,*)
'FATAL ERROR: climatological soil'
8738 write(6,*)
'wetness file not given.'
8745 if (fnacnc(1:8).ne.
' ')
then
8746 call
fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask,
8747 & acn(1,nn),len,iret
8748 &, imsk, jmsk, slmskh, gaus,blno, blto
8749 &, outlat, outlon, me)
8750 elseif (fnaisc(1:8).ne.
' ')
then
8751 call
fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask,
8752 & ais(1,nn),len,iret
8753 &, imsk, jmsk, slmskh, gaus,blno, blto
8754 &, outlat, outlon, me)
8756 write(6,*)
'FATAL ERROR: climatological ice cover'
8757 write(6,*)
'file not given.'
8764 call
fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask,
8765 & sno(1,nn),len,iret
8766 &, imsk, jmsk, slmskh, gaus,blno, blto
8767 &, outlat, outlon, me)
8771 if (fnscvc(1:8).ne.
' ')
then
8773 call
fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask,
8774 & scv(1,nn),len,iret
8775 &, imsk, jmsk, slmskh, gaus,blno, blto
8776 &, outlat, outlon, me)
8777 write(6,*)
'climatological snow cover read in.'
8782 if (fnzorc(1:3) ==
'sib')
then
8784 write(6,*)
'roughness length to be set from sib veg type'
8786 elseif(fnzorc(1:4) ==
'igbp')
then
8788 write(6,*)
'roughness length to be set from igbp veg type'
8792 call
fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask,
8793 & zor(1,nn),len,iret
8794 &, imsk, jmsk, slmskh, gaus,blno, blto
8795 &, outlat, outlon, me)
8800 if (fnvegc(1:8) .ne.
' ')
then
8801 if ( index(fnvegc,
"tileX.nc") == 0)
then
8803 call
fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask,
8804 & veg(1,nn),len,iret
8805 &, imsk, jmsk, slmskh, gaus,blno, blto
8806 &, outlat, outlon, me)
8808 call
fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index,
8809 & kpdveg, veg(:,nn), mon, len, me)
8822 if (fnzorc(1:3) ==
'sib')
then
8823 if (fnvetc(1:4) ==
' ')
then
8825 write(6,*)
" FATAL ERROR: Must choose sib"
8826 write(6,*)
" veg type climo file."
8832 ivtyp = nint(vet(i))
8833 if (ivtyp >= 1 .and. ivtyp <= 13)
then
8834 zorclm(i) = z0_sib(ivtyp)
8837 elseif(fnzorc(1:4) ==
'igbp')
then
8838 if (fnvetc(1:4) ==
' ')
then
8840 write(6,*)
" FATAL ERROR: Must choose igbp"
8841 write(6,*)
" veg type climo file."
8847 ivtyp = nint(vet(i))
8848 if (ivtyp >= 1 .and. ivtyp <= 20)
then
8849 z0_season(1) = z0_igbp_min(ivtyp)
8850 z0_season(7) = z0_igbp_max(ivtyp)
8851 if (outlat(i) < 0.0)
then
8852 zorclm(i) = wei1y * z0_season(hyr2) +
8853 & wei2y * z0_season(hyr1)
8855 zorclm(i) = wei1y * z0_season(hyr1) +
8856 & wei2y * z0_season(hyr2)
8862 zorclm(i) = wei1m * zor(i,k1) + wei2m * zor(i,k2)
8867 tsfclm(i) = wei1m * tsf(i,k1) + wei2m * tsf(i,k2)
8868 snoclm(i) = wei1m * sno(i,k1) + wei2m * sno(i,k2)
8878 if (fh .eq. 0.0)
then
8880 tsfcl0(i) = tsfclm(i)
8883 if (rjdayh .ge. dayhf(mon1))
then
8885 tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2)
8894 if(fnacnc(1:8).ne.
' ')
then
8896 acnclm(i) = wei1m * acn(i,k1) + wei2m * acn(i,k2)
8898 elseif(fnaisc(1:8).ne.
' ')
then
8900 aisclm(i) = wei1m * ais(i,k1) + wei2m * ais(i,k2)
8904 if(fnwetc(1:8).ne.
' ')
then
8906 wetclm(i) = wei1m * wet(i,k1) + wei2m * wet(i,k2)
8908 elseif(fnsmcc(1:8).ne.
' ')
then
8911 smcclm(i,k) = wei1m * smc(i,k,k1) + wei2m * smc(i,k,k2)
8916 if(fnscvc(1:8).ne.
' ')
then
8918 scvclm(i) = wei1m * scv(i,k1) + wei2m * scv(i,k2)
8922 if(fntg3c(1:8).ne.
' ')
then
8926 elseif(fnstcc(1:8).ne.
' ')
then
8929 stcclm(i,k) = wei1m * stc(i,k,k1) + wei2m * stc(i,k,k2)
8934 if(fnvegc(1:8).ne.
' ')
then
8936 vegclm(i) = wei1m * veg(i,k1) + wei2m * veg(i,k2)
8940 if(fnvetc(1:8).ne.
' ')
then
8946 if(fnsotc(1:8).ne.
' ')
then
8955 if(fnvmnc(1:8).ne.
' ')
then
8961 if(fnvmxc(1:8).ne.
' ')
then
8967 if(fnslpc(1:8).ne.
' ')
then
8973 if(fnabsc(1:8).ne.
' ')
then
8981 if (me == 0) print*,
'monthly albedo weights are ',
8982 & wei1m,
' for k', k1, wei2m,
' for k', k2
8987 albclm(i,k) = wei1m * alb(i,k,k1) + wei2m * alb(i,k,k2)
8993 albclm(i,k) = wei1s * alb(i,k,m1) + wei2s * alb(i,k,m2)
9000 alfclm(i,k) = alf(i,k)
9007 end subroutine clima
9025 & i_index, j_index, kpds,
9026 & var, mon, npts, me)
9030 character(len=*),
intent(in) :: filename_raw
9031 character(len=*),
intent(in) :: tile_num_ch
9032 integer,
intent(in) :: npts, me, kpds, mon
9033 integer,
intent(in) :: i_index(npts)
9034 integer,
intent(in) :: j_index(npts)
9035 real(kind_io8),
intent(out) :: var(npts)
9036 character(len=500) :: filename
9037 character(len=80) :: errmsg
9038 integer :: i, ii, ncid, t
9039 integer :: error, id_dim
9040 integer :: nx, ny, num_times
9042 real(kind=4),
allocatable :: dummy(:,:,:)
9043 ii=index(filename_raw,
"tileX")
9045 do i = 1, len(filename)
9049 filename = filename_raw(1:ii-1) // tile_num_ch //
".nc"
9051 if (me == 0) print*,
' in fixrdc_tile for mon=',mon,
9052 &
' filename=', trim(filename)
9054 error=nf90_open(trim(filename), nf90_nowrite, ncid)
9055 if (error /= nf90_noerr) call
netcdf_err(error)
9057 error=nf90_inq_dimid(ncid,
'nx', id_dim)
9058 if (error /= nf90_noerr) call
netcdf_err(error)
9059 error=nf90_inquire_dimension(ncid,id_dim,len=nx)
9060 if (error /= nf90_noerr) call
netcdf_err(error)
9062 error=nf90_inq_dimid(ncid,
'ny', id_dim)
9063 if (error /= nf90_noerr) call
netcdf_err(error)
9064 error=nf90_inquire_dimension(ncid,id_dim,len=ny)
9065 if (error /= nf90_noerr) call
netcdf_err(error)
9067 error=nf90_inq_dimid(ncid,
'time', id_dim)
9068 if (error /= nf90_noerr) call
netcdf_err(error)
9069 error=nf90_inquire_dimension(ncid,id_dim,len=num_times)
9070 if (error /= nf90_noerr) call
netcdf_err(error)
9074 error=nf90_inq_varid(ncid,
'substrate_temperature', id_var)
9076 error=nf90_inq_varid(ncid,
'vegetation_greenness', id_var)
9078 error=nf90_inq_varid(ncid,
'maximum_snow_albedo', id_var)
9080 error=nf90_inq_varid(ncid,
'visible_black_sky_albedo', id_var)
9082 error=nf90_inq_varid(ncid,
'visible_white_sky_albedo', id_var)
9084 error=nf90_inq_varid(ncid,
'near_IR_black_sky_albedo', id_var)
9086 error=nf90_inq_varid(ncid,
'near_IR_white_sky_albedo', id_var)
9088 error=nf90_inq_varid(ncid,
'facsf', id_var)
9090 error=nf90_inq_varid(ncid,
'soil_type', id_var)
9092 error=nf90_inq_varid(ncid,
'vegetation_type', id_var)
9094 error=nf90_inq_varid(ncid,
'slope_type', id_var)
9096 error=nf90_inq_varid(ncid,
'vegetation_greenness', id_var)
9098 print*,
'FATAL ERROR in fixrdc_tile of sfcsub.F.'
9099 print*,
'unknown variable.'
9102 if (error /= nf90_noerr) call
netcdf_err(error)
9104 allocate(dummy(nx,ny,1))
9106 if (kpds == 256)
then
9110 error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/),
9111 &
count=(/nx,ny,1/) )
9112 if (error /= nf90_noerr) call
netcdf_err(error)
9114 var(ii) = max(var(ii), dummy(i_index(ii),j_index(ii),1))
9118 elseif (kpds == 257)
then
9122 error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/),
9123 &
count=(/nx,ny,1/) )
9124 if (error /= nf90_noerr) call
netcdf_err(error)
9126 var(ii) = min(var(ii), dummy(i_index(ii),j_index(ii),1))
9132 error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,mon/),
9133 &
count=(/nx,ny,1/) )
9134 if (error /= nf90_noerr) call
netcdf_err(error)
9137 var(ii) = dummy(i_index(ii),j_index(ii),1)
9144 error=nf90_close(ncid)
9150 where (var < 0.0) var = 0.0
9171 integer,
intent(in) :: error
9172 character(len=256) :: errmsg
9174 errmsg = nf90_strerror(error)
9175 print*,
'FATAL ERROR in sfcsub.F: ', trim(errmsg)
9205 subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask,
9207 &, imsk, jmsk, slmskh, gaus,blno, blto
9208 &, outlat, outlon, me)
9209 use machine , only : kind_io8,kind_io4
9212 integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk,
9213 & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami
9214 &, jj,w3kindreal,w3kindint
9215 real (kind=kind_io8) wlon,elon,rnlat,dlat,dlon,rslat,blno,blto
9217 character*500 fngrib
9220 real (kind=kind_io8) slmskh(imsk,jmsk)
9222 real (kind=kind_io8) gdata(len), slmask(len)
9223 real (kind=kind_io8),
allocatable :: data(:,:), rslmsk(:,:)
9224 real (kind=kind_io8),
allocatable :: data8(:)
9225 real (kind=kind_io4),
allocatable :: data4(:)
9226 real (kind=kind_io8),
allocatable :: rlngrb(:), rltgrb(:)
9228 logical lmask, yr2kc, gaus, ijordr
9229 logical*1,
allocatable :: lbms(:)
9231 integer,
intent(in) :: kpds7
9232 integer kpds(1000),kgds(1000)
9233 integer jpds(1000),jgds(1000), kpds0(1000)
9234 real (kind=kind_io8) outlat(len), outlon(len)
9236 allocate(data8(1:mdata))
9237 allocate(lbms(mdata))
9247 if (me .eq. 0)
write(6,*)
' in fixrdc for mon=',mon
9248 &,
' fngrib=',trim(fngrib)
9251 call baopenr(lugb,fngrib,iret)
9252 if (iret .ne. 0)
then
9253 write(6,*)
' FATAL ERROR: in opening file ',trim(fngrib)
9254 print *,
'FATAL ERROR: in opening file ',trim(fngrib)
9257 if (me .eq. 0)
write(6,*)
' file ',trim(fngrib),
9258 &
' opened. unit=',lugb
9268 call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata,
9269 & lskip,kpds,kgds,iret)
9271 write(6,*)
' first grib record.'
9272 write(6,*)
' kpds( 1-10)=',(kpds(j),j= 1,10)
9273 write(6,*)
' kpds(11-20)=',(kpds(j),j=11,20)
9274 write(6,*)
' kpds(21- )=',(kpds(j),j=21,22)
9276 yr2kc = (kpds(8) / 100) .gt. 0
9281 write(6,*)
' FATAL ERROR: in getgbh. iret: ', iret
9282 if (iret==99)
write(6,*)
' field not found.'
9292 if(jpds(9).eq.13) jpds(9) = 1
9293 call w3kind(w3kindreal,w3kindint)
9294 if (w3kindreal==8)
then
9295 call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip,
9296 & kpds,kgds,lbms,data8,jret)
9297 else if (w3kindreal==4)
then
9298 allocate(data4(1:mdata))
9299 call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip,
9300 & kpds,kgds,lbms,data4,jret)
9301 data8 =
real(data4, kind=kind_io8)
9304 if (me .eq. 0)
write(6,*)
' input grib file dates=',
9308 write(6,*)
' FATAL ERROR: in getgb.'
9309 write(6,*)
' kpds=',kpds
9310 write(6,*)
' kgds=',kgds
9316 allocate (
data(imax,jmax))
9320 data(i,j) = data8(jj+i)
9323 if (me .eq. 0)
write(6,*)
'imax,jmax,ijmax=',imax,jmax,ijmax
9325 write(6,*)
' FATAL ERROR: in getgb - jret=', jret
9335 call
getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me)
9337 write(6,*)
'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat='
9338 write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat
9340 call
subst(
data,imax,jmax,dlon,dlat,ijordr)
9344 allocate (rlngrb(imax), rltgrb(jmax))
9345 allocate (rslmsk(imax,jmax))
9347 call
setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat,
9348 &
data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk
9349 &, gaus,blno, blto, kgds(1), kpds(4), lbms)
9353 if(kpds5.eq.225) inttyp = 1
9354 if(kpds5.eq.230) inttyp = 1
9355 if(kpds5.eq.236) inttyp = 1
9356 if(kpds5.eq.224) inttyp = 1
9358 if(inttyp.eq.1) print *,
' nearest grid point used'
9359 &,
' kpds5=',kpds5,
' lmask = ',lmask
9362 call
la2ga(
data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp,
9363 & gdata,len,lmask,rslmsk,slmask
9364 &, outlat, outlon,me)
9366 deallocate (rlngrb, stat=iret)
9367 deallocate (rltgrb, stat=iret)
9368 deallocate (
data, stat=iret)
9369 deallocate (rslmsk, stat=iret)
9370 call baclose(lugb,iret)
9407 & iy,im,id,ih,fh,gdata,len,iret
9408 &, imsk, jmsk, slmskh, gaus,blno, blto
9409 &, outlat, outlon, me)
9410 use machine , only : kind_io8,kind_io4
9413 integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi,
9414 & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret,
9415 & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me,
9416 & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint
9417 real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno,
9424 parameter(nrepmx=15, nvalid=4)
9426 character*500 fngrib
9429 real (kind=kind_io8) slmskh(imsk,jmsk)
9431 real (kind=kind_io8) gdata(len), slmask(len)
9432 real (kind=kind_io8),
allocatable :: data(:,:),rslmsk(:,:)
9433 real (kind=kind_io8),
allocatable :: data8(:)
9434 real (kind=kind_io4),
allocatable :: data4(:)
9435 real (kind=kind_io8),
allocatable :: rlngrb(:), rltgrb(:)
9437 logical lmask, yr2kc, gaus, ijordr
9438 logical*1 lbms(mdata)
9440 integer kpds(1000),kgds(1000)
9441 integer jpds(1000),jgds(1000), kpds0(1000)
9442 real (kind=kind_io8) outlat(len), outlon(len)
9446 real (kind=kind_io8) dayhf(13)
9447 data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0,
9448 & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/
9453 data mjday/31,28,31,30,31,30,31,31,30,31,30,31/
9455 real (kind=kind_io8) fha(5)
9457 integer ida(8),jda(8)
9459 allocate(data8(1:mdata))
9466 if(iy.lt.101) iy4=1900+iy4
9475 call w3kind(w3kindreal,w3kindint)
9476 if(w3kindreal==4)
then
9478 call w3movdat(fha4,ida,jda)
9480 call w3movdat(fha,ida,jda)
9491 call w3doxdat(jda,jdow,jdoy,jday)
9492 rjday=jdoy+jda(5)/24.
9493 if(rjday.lt.dayhf(1)) rjday=rjday+365.
9495 if (me .eq. 0)
write(6,*)
' forecast jy,jm,jd,jh,rjday=',
9499 write(6,*)
'forecast jy,jm,jd,jh=',jy,jm,jd,jh
9502 write(6,*)
'************************************************'
9506 call baopenr(lugb,fngrib,iret)
9507 if (iret .ne. 0)
then
9508 write(6,*)
' FATAL ERROR: in opening file ',trim(fngrib)
9509 print *,
' FATAL ERROR: in opening file ',trim(fngrib)
9512 if (me .eq. 0)
write(6,*)
' file ',trim(fngrib),
9513 &
' opened. unit=',lugb
9522 call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata,
9523 & lskip,kpds,kgds,iret)
9525 write(6,*)
' first grib record.'
9526 write(6,*)
' kpds( 1-10)=',(kpds(j),j= 1,10)
9527 write(6,*)
' kpds(11-20)=',(kpds(j),j=11,20)
9528 write(6,*)
' kpds(21- )=',(kpds(j),j=21,22)
9530 yr2kc = (kpds(8) / 100) .gt. 0
9535 write(6,*)
' FATAL ERROR: in getgbh. iret: ', iret
9536 if(iret==99)
write(6,*)
' field not found.'
9548 if(iyr.le.100) iyr=2050-mod(2050-iyr,100)
9556 jpds(8) = mod(iyr,1900)
9559 jpds( 8)=mod(iyr-1,100)+1
9563 jpds(21)=(iyr-1)/100+1
9564 call w3kind(w3kindreal,w3kindint)
9565 if (w3kindreal == 8)
then
9566 call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip,
9567 & kpds,kgds,lbms,data8,jret)
9568 elseif (w3kindreal == 4)
then
9569 allocate (data4(1:mdata))
9570 call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip,
9571 & kpds,kgds,lbms,data4,jret)
9572 data8 =
real(data4, kind=kind_io8)
9575 if (me .eq. 0)
write(6,*)
' input grib file dates=',
9579 write(6,*)
' FATAL ERROR: in getgb.'
9580 write(6,*)
' kpds=',kpds
9581 write(6,*)
' kgds=',kgds
9587 allocate (
data(imax,jmax))
9591 data(i,j) = data8(jj+i)
9597 write(6,*)
' no matching dates found. start searching',
9598 &
' nearest matching dates (going back).'
9607 elseif(ihr.eq.12)
then
9610 elseif(ihr.eq.18)
then
9613 elseif(ihr.eq.0.or.ihr.eq.-1)
then
9623 if(imo.eq.4.or.imo.eq.6.or.imo.eq.9.or.imo.eq.11) idy=30
9625 if(mod(iyr,4).eq.0)
then
9633 if (me .eq. 0)
write(6,*)
' decremented dates=',
9636 if(nrept.gt.nvalid) iret=-1
9637 if(nrept.gt.nrepmx)
then
9639 write(6,*)
' <warning:cycl> searching range exceeded.'
9640 &,
' may be wrong grib file given'
9641 write(6,*)
' <warning:cycl> fngrib=',trim(fngrib)
9642 write(6,*)
' <warning:cycl> terminating search and',
9643 &
' and setting gdata to -999'
9644 write(6,*)
' range max=',nrepmx
9657 write(6,*)
' search of analysis for ihr=',ihr,
' failed.'
9658 write(6,*)
' kpds=',kpds
9659 write(6,*)
' iyr,imo,idy,ihr=',iyr,imo,idy,ihr
9672 call
getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me)
9674 write(6,*)
'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat='
9675 write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat
9677 call
subst(
data,imax,jmax,dlon,dlat,ijordr)
9681 allocate (rlngrb(imax), rltgrb(jmax))
9682 allocate (rslmsk(imax,jmax))
9683 call
setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat,
9684 &
data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk
9687 &, gaus,blno, blto, kgds(1), kpds(4), lbms)
9692 if(kpds5.eq.225) inttyp = 1
9693 if(kpds5.eq.230) inttyp = 1
9694 if(kpds5.eq.66) inttyp = 1
9695 if(inttyp.eq.1) print *,
' nearest grid point used'
9697 call
la2ga(
data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp,
9698 & gdata,len,lmask,rslmsk,slmask
9699 &, outlat, outlon, me)
9701 deallocate (rlngrb, stat=iret)
9702 deallocate (rltgrb, stat=iret)
9703 deallocate (
data, stat=iret)
9704 deallocate (rslmsk, stat=iret)
9705 call baclose(lugb,iret2)
9716 call baclose(lugb,iret2)
9731 use machine , only : kind_io8,kind_io4
9734 real (kind=kind_io8) snwmax
9736 real (kind=kind_io8) snoanl(len), glacir(len)
9738 if (me .eq. 0)
write(6,*)
'snodpth2'
9744 if(glacir(i).ne.0..and.snoanl(i).lt.snwmax*0.5)
then
9745 snoanl(i) = snwmax + snoanl(i)
subroutine setlsi(slmask, aisfld, len, aicice, slifld)
Set land-sea-ice mask at sea ice.
integer function num_parthds()
Return the number of omp threads.
subroutine snodpth(scvanl, slianl, tsfanl, snoclm, glacir, snwmax, snwmin, landice, len, snoanl, me)
Estimate snow depth at glacial, land and sea ice points.
subroutine getstc(tsffld, tg3fld, slifld, len, lsoil, stcfld, tsfimx)
Set soil temperature and sea ice column temperature.
subroutine hmskrd(lugb, imsk, jmsk, fnmskh, kpds5, slmskh, gausm, blnmsk, bltmsk, me)
Read a high-resolution land mask.
subroutine snodpth2(glacir, snwmax, snoanl, len, me)
Ensure deep snow pack at permanent glacial points.
subroutine count(slimsk, sno, ijmax)
Counts the number of model points that are snow covered land, snow-free land, open water...
subroutine getscv(snofld, scvfld, len)
Set snow cover flag based on snow depth.
subroutine qcbyfc(tsffcs, snofcs, qctsfs, qcsnos, qctsfi, len, lsoil, snoanl, aisanl, slianl, tsfanl, albanl, zoranl, smcanl, smcclm, tsfsmx, albomx, zoromx, me)
Quality control analysis fields using the first guess.
subroutine snosfc(snoanl, tsfanl, tsfsmx, len, me)
Check skin temperature at points with snow.
subroutine fixrdc_tile(filename_raw, tile_num_ch, i_index, j_index, kpds, var, mon, npts, me)
Reads in climatological data on the model grid tile for a given month.
subroutine analy(lugb, iy, im, id, ih, fh, len, lsoil, slmask, fntsfa, fnweta, fnsnoa, fnzora, fnalba, fnaisa, fntg3a, fnscva, fnsmca, fnstca, fnacna, fnvega, fnveta, fnsota, fnvmna, fnvmxa, fnslpa, fnabsa, tsfanl, wetanl, snoanl, zoranl, albanl, aisanl, tg3anl, cvanl, cvbanl, cvtanl, smcanl, stcanl, slianl, scvanl, acnanl, veganl, vetanl, sotanl, alfanl, tsfan0, vmnanl, vmxanl, slpanl, absanl, kpdtsf, kpdwet, kpdsno, kpdsnd, kpdzor, kpdalb, kpdais, kpdtg3, kpdscv, kpdacn, kpdsmc, kpdstc, kpdveg, kprvet, kpdsot, kpdalf, kpdvmn, kpdvmx, kpdslp, kpdabs, irttsf, irtwet, irtsno, irtzor, irtalb, irtais, irttg3, irtscv, irtacn, irtsmc, irtstc, irtveg, irtvet, irtsot, irtalf, irtvmn, irtvmx, irtslp, irtabs, imsk, jmsk, slmskh, outlat, outlon, gaus, blno, blto, me, lanom)
Read analysis fields.
subroutine anomint(tsfan0, tsfclm, tsfcl0, tsfanl, len)
Add initial SST anomaly to date interpolated climatology.
subroutine qcmxice(glacir, amxice, len, me)
Quality control maximum ice extent.
subroutine rof01(aisfld, len, op, crit)
Round a field up to one or down to zero.
subroutine albocn(albclm, slmask, albomx, len)
Set the albedo at open water points.
subroutine qcsice(ais, glacir, amxice, aicice, aicsea, sllnd, slmask, rla, rlo, len, me)
Check the sea ice cover mask against the land-sea mask.
subroutine setzro(fld, eps, len)
Set a field to zero if it is less than a threshold.
subroutine netcdf_err(error)
Print the error message for a given netCDF return code.
Holds machine dependent constants for global_cycle.
subroutine fixrdc(lugb, fngrib, kpds5, kpds7, mon, slmask, gdata, len, iret, imsk, jmsk, slmskh, gaus, blno, blto, outlat, outlon, me)
Read in grib1 climatology data for a specific month and and horizontally interpolate to the model gri...
subroutine filanl(tsfanl, tsfan2, wetanl, snoanl, zoranl, albanl, aisanl, tg3anl, cvanl, cvbanl, cvtanl, cnpanl, smcanl, stcanl, slianl, scvanl, veganl, vetanl, sotanl, alfanl, sihanl, sicanl, vmnanl, vmxanl, slpanl, absanl, tsfclm, tsfcl2, wetclm, snoclm, zorclm, albclm, aisclm, tg3clm, cvclm, cvbclm, cvtclm, cnpclm, smcclm, stcclm, sliclm, scvclm, vegclm, vetclm, sotclm, alfclm, sihclm, sicclm, vmnclm, vmxclm, slpclm, absclm, len, lsoil)
Fill in analysis arrays with climatology before reading analysis data.
subroutine clima(lugb, iy, im, id, ih, fh, len, lsoil, slmask, fntsfc, fnwetc, fnsnoc, fnzorc, fnalbc, fnaisc, fntg3c, fnscvc, fnsmcc, fnstcc, fnacnc, fnvegc, fnvetc, fnsotc, fnvmnc, fnvmxc, fnslpc, fnabsc, tsfclm, tsfcl2, wetclm, snoclm, zorclm, albclm, aisclm, tg3clm, cvclm, cvbclm, cvtclm, cnpclm, smcclm, stcclm, sliclm, scvclm, acnclm, vegclm, vetclm, sotclm, alfclm, vmnclm, vmxclm, slpclm, absclm, kpdtsf, kpdwet, kpdsno, kpdzor, kpdalb, kpdais, kpdtg3, kpdscv, kpdacn, kpdsmc, kpdstc, kpdveg, kpdvet, kpdsot, kpdalf, tsfcl0, kpdvmn, kpdvmx, kpdslp, kpdabs, deltsfc, lanom, imsk, jmsk, slmskh, outlat, outlon, gaus, blno, blto, me, lprnt, iprnt, fnalbc2, ialb, tile_num_ch, i_index, j_index)
Driver routine that reads in climatological data for a given time, and, if necessary, interpolates it to the model grid.
subroutine setrmsk(kpds5, slmask, igaul, jgaul, wlon, rnlat, data, imax, jmax, rlnout, rltout, lmask, rslmsk, gaus, blno, blto, kgds1, kpds4, lbms)
Set the mask for the input data.
subroutine landtyp(vegtype, soiltype, slptype, slmask, len)
Set vegetation, soil and slope type at undefined model points.
subroutine getarea(kgds, dlat, dlon, rslat, rnlat, wlon, elon, ijordr, me)
For a given GRIB1 grid description section array, determine some grid specifications.
subroutine subst(data, imax, jmax, dlon, dlat, ijordr)
Take an array of data on a lat/lon based grid and rearrange it so the corner point is in the 'lower l...
subroutine monitr(lfld, fld, slimsk, sno, ijmax)
Determine the maximum and minimum values of a surface field at snow-free and snow covered land...
subroutine scale(fld, len, scl)
Multiply a field by a scaling factor.
subroutine qcmxmn(ttl, fld, slimsk, sno, iceflg, fldlmx, fldlmn, fldomx, fldomn, fldimx, fldimn, fldjmx, fldjmn, fldsmx, fldsmn, epsfld, rla, rlo, len, mode, percrit, lgchek, me)
Range check a field.
subroutine fixrda(lugb, fngrib, kpds5, slmask, iy, im, id, ih, fh, gdata, len, iret, imsk, jmsk, slmskh, gaus, blno, blto, outlat, outlon, me)
Read in grib1 analysis data for the requested date and horizontally interpolate to the model grid...
subroutine dayoyr(iyr, imo, idy, ldy)
Compute day of the year based on month and day.
This program runs in two different modes:
subroutine tsfcor(tsfc, orog, slmask, umask, len, rlapse)
Adjust skin temperature or SST for terrain.
subroutine merge(len, lsoil, iy, im, id, ih, fh, deltsfc, sihfcs, sicfcs, vmnfcs, vmxfcs, slpfcs, absfcs, tsffcs, wetfcs, snofcs, zorfcs, albfcs, aisfcs, cvfcs, cvbfcs, cvtfcs, cnpfcs, smcfcs, stcfcs, slifcs, vegfcs, vetfcs, sotfcs, alffcs, sihanl, sicanl, vmnanl, vmxanl, slpanl, absanl, tsfanl, tsfan2, wetanl, snoanl, zoranl, albanl, aisanl, cvanl, cvbanl, cvtanl, cnpanl, smcanl, stcanl, slianl, veganl, vetanl, sotanl, alfanl, ctsfl, calbl, caisl, csnol, csmcl, czorl, cstcl, cvegl, ctsfs, calbs, caiss, csnos, csmcs, czors, cstcs, cvegs, ccv, ccvb, ccvt, ccnp, cvetl, cvets, csotl, csots, calfl, calfs, csihl, csihs, csicl, csics, cvmnl, cvmns, cvmxl, cvmxs, cslpl, cslps, cabsl, cabss, irttsf, irtwet, irtsno, irtzor, irtalb, irtais, irttg3, irtscv, irtacn, irtsmc, irtstc, irtveg, irtvmn, irtvmx, irtslp, irtabs, irtvet, irtsot, irtalf, landice, me)
Blend the model forecast (or first guess) fields with the analysis/climatology.
subroutine getsmc(wetfld, len, lsoil, smcfld, me)
Set soil moisture from soil wetness.
subroutine maxmin(f, imax, kmax)
Compute the maxmimum and minimum of a field.
subroutine newice(slianl, slifcs, tsfanl, tsffcs, len, lsoil, sihnew, sicnew, sihanl, sicanl, albanl, snoanl, zoranl, smcanl, stcanl, albsea, snosea, zorsea, smcsea, smcice, tsfmin, tsfice, albice, zorice, tgice, rla, rlo, me)
Adjust surface fields when ice melts or forms.
subroutine gaulat(gaul, k)
Calculate gaussian latitudes.
subroutine filfcs(tsffcs, wetfcs, snofcs, zorfcs, albfcs, tg3fcs, cvfcs, cvbfcs, cvtfcs, cnpfcs, smcfcs, stcfcs, slifcs, aisfcs, vegfcs, vetfcs, sotfcs, alffcs, sihfcs, sicfcs, vmnfcs, vmxfcs, slpfcs, absfcs, tsfanl, wetanl, snoanl, zoranl, albanl, tg3anl, cvanl, cvbanl, cvtanl, cnpanl, smcanl, stcanl, slianl, aisanl, veganl, vetanl, sotanl, alfanl, sihanl, sicanl, vmnanl, vmxanl, slpanl, absanl, len, lsoil)
Fill in model grid guess arrays with analysis values if this is a dead start.
subroutine usesgt(sig1t, slianl, tg3anl, len, lsoil, tsfanl, stcanl, tsfimx)
Set soil temperature and sea ice column temperature for a dead start.
subroutine ga2la(gauin, imxin, jmxin, regout, imxout, jmxout, wlon, rnlat, rlnout, rltout, gaus, blno, blto)
Interpolation from lat/lon or gaussian grid to a lat/lon grid.
subroutine qcsli(slianl, slifcs, len, me)
Check consistency between the forecast and analysis land-sea-ice mask.
subroutine sfccycle(lugb, len, lsoil, sig1t, deltsfc, iy, im, id, ih, fh, rla, rlo, slmask, orog, orog_uf, use_ufo, nst_anl, sihfcs, sicfcs, sitfcs, swdfcs, slcfcs, vmnfcs, vmxfcs, slpfcs, absfcs, tsffcs, snofcs, zorfcs, albfcs, tg3fcs, cnpfcs, smcfcs, stcfcs, slifcs, aisfcs, vegfcs, vetfcs, sotfcs, alffcs, cvfcs, cvbfcs, cvtfcs, me, nlunit, sz_nml, input_nml_file, ialb, isot, ivegsrc, tile_num_ch, i_index, j_index)
Surface cycling driver routine.
subroutine la2ga(regin, imxin, jmxin, rinlon, rinlat, rlon, rlat, inttyp, gauout, len, lmask, rslmsk, slmask, outlat, outlon, me)
Interpolate data from a lat/lon grid to the model grid.
subroutine fixrdg(lugb, idim, jdim, fngrib, kpds5, gdata, gaus, blno, blto, me)
Read a GRIB1 file.
subroutine qcsnow(snoanl, slmask, aisanl, glacir, len, snoval, landice, me)
Quality control snow at the model points.