120 U3D,V3D,T3D,QV3D,P3D,dz8w, & !in
121 th3d,pi3d,qc3d, & !in
122 PSFCPA,PBLH,MAVAIL,XLAND,DX, & !in
123 ISFFLX,isftcflx,lsm,lsm_ruc, & !in
124 compute_flux,compute_diag, & !in
125 iz0tlnd,psi_opt, & !in
126 sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
128 redrag,sfc_z0_type, &
129 itimestep,iter,flag_iter, &
132 tskin_wat, tskin_lnd, tskin_ice, &
133 tsurf_wat, tsurf_lnd, tsurf_ice, &
134 qsfc_wat, qsfc_lnd, qsfc_ice, &
135 snowh_wat, snowh_lnd, snowh_ice, &
136 znt_wat, znt_lnd, znt_ice, &
137 ust_wat, ust_lnd, ust_ice, &
138 cm_wat, cm_lnd, cm_ice, &
139 ch_wat, ch_lnd, ch_ice, &
140 rb_wat, rb_lnd, rb_ice, &
141 stress_wat,stress_lnd,stress_ice, &
142 fm_wat, fm_lnd, fm_ice, &
143 fh_wat, fh_lnd, fh_ice, &
144 fm10_wat, fm10_lnd, fm10_ice, &
145 fh2_wat, fh2_lnd, fh2_ice, &
146 hflx_wat, hflx_lnd, hflx_ice, &
147 qflx_wat, qflx_lnd, qflx_ice, &
148 ch,chs,chs2,cqs2,cpm, &
149 znt,ustm,zol,mol,rmol, &
151 hflx,hfx,qflx,qfx,lh,flhc,flqc, &
155 spp_sfc,pattern_spp_sfc, &
156 ids,ide, jds,jde, kds,kde, &
157 ims,ime, jms,jme, kms,kme, &
158 its,ite, jts,jte, kts,kte, &
258 INTEGER,
INTENT(IN) :: ids,ide, jds,jde, kds,kde, &
259 ims,ime, jms,jme, kms,kme, &
260 its,ite, jts,jte, kts,kte
261 INTEGER,
INTENT(IN) :: itimestep,iter
263 integer,
intent(in) :: ISFFLX, LSM, LSM_RUC
264 INTEGER,
OPTIONAL,
INTENT(IN) :: ISFTCFLX, IZ0TLND
265 INTEGER,
OPTIONAL,
INTENT(IN) :: spp_sfc, psi_opt
266 logical,
intent(in) :: compute_flux,compute_diag
267 integer,
intent(in) :: ivegsrc
268 integer,
intent(in) :: sfc_z0_type
269 logical,
intent(in) :: redrag
270 logical,
intent(in) :: flag_restart
273 integer,
dimension(ims:ime),
intent(in) :: vegtype
274 real(kind_phys),
dimension(ims:ime),
intent(in) :: &
275 & sigmaf,shdmax,z0pert,ztpert
279 REAL(kind_phys),
DIMENSION( ims:ime, kms:kme ) , &
280 INTENT(IN ) :: dz8w, &
289 REAL(kind_phys),
DIMENSION( :,: ),
OPTIONAL, &
290 INTENT(IN) :: pattern_spp_sfc
294 REAL(kind_phys),
DIMENSION( ims:ime ) , &
295 INTENT(IN ) :: MAVAIL, &
301 REAL(kind_phys),
DIMENSION( ims:ime ) , &
302 INTENT(OUT ) :: U10,V10, &
306 REAL(kind_phys),
DIMENSION( ims:ime ) , &
307 INTENT(INOUT) :: HFLX,HFX, &
319 REAL(kind_phys),
DIMENSION( ims:ime ),
OPTIONAL , &
320 INTENT(INOUT) :: USTM, &
328 LOGICAL,
DIMENSION( ims:ime ),
INTENT(IN) :: &
329& wet, dry, icy, flag_iter
331 REAL(kind_phys),
DIMENSION( ims:ime ),
INTENT(IN) :: &
332 & tskin_wat, tskin_lnd, tskin_ice, &
333 & tsurf_wat, tsurf_lnd, tsurf_ice, &
334 & snowh_wat, snowh_lnd, snowh_ice
336 REAL(kind_phys),
DIMENSION( ims:ime),
INTENT(INOUT) :: &
337 & ZNT_wat, ZNT_lnd, ZNT_ice, &
338 & UST_wat, UST_lnd, UST_ice, &
339 & cm_wat, cm_lnd, cm_ice, &
340 & ch_wat, ch_lnd, ch_ice, &
341 & rb_wat, rb_lnd, rb_ice, &
342 & stress_wat,stress_lnd,stress_ice, &
343 & fm_wat, fm_lnd, fm_ice, &
344 & fh_wat, fh_lnd, fh_ice, &
345 & fm10_wat, fm10_lnd, fm10_ice, &
346 & fh2_wat, fh2_lnd, fh2_ice, &
347 & HFLX_wat, HFLX_lnd, HFLX_ice, &
348 & QFLX_wat, QFLX_lnd, QFLX_ice, &
349 & qsfc_wat, qsfc_lnd, qsfc_ice
352 character(len=*),
intent(inout) :: errmsg
353 integer,
intent(inout) :: errflg
357 REAL(kind_phys),
DIMENSION( ims:ime ) :: qstar
362 REAL(kind_phys),
DIMENSION( its:ite ) :: U1D,V1D, &
370 REAL(kind_phys),
DIMENSION( its:ite ) :: rstoch1D
372 INTEGER :: I,J,K,itf,ktf
393 IF (debug_code >= 1)
THEN
394 write(*,*)
"======= printing of constants:"
395 write(*,*)
"cp=", cp,
" g=", grav
396 write(*,*)
"Rd=", rd,
" ep1=", ep1
397 write(*,*)
"xlv=", xlv,
" xlf=", xlf
398 write(*,*)
"ep2=", ep2
409 dz8w1d(i) = dz8w(i,kts)
410 dz2w1d(i) = dz8w(i,kts+1)
414 u1d2(i) =u3d(i,kts+1)
415 v1d2(i) =v3d(i,kts+1)
421 rstoch1d(i)=pattern_spp_sfc(i,kts)
428 IF (itimestep==1 .AND. iter==1)
THEN
433 IF (.not. flag_restart)
THEN
435 if (ust_wat(i) .lt. 1e-4 .or. ust_wat(i) .gt. 3.0)
then
436 ust_wat(i)=max(0.04*sqrt(u1d(i)*u1d(i) + v1d(i)*v1d(i)),0.001_kind_phys)
438 if (ust_lnd(i) .lt. 1e-4 .or. ust_lnd(i) .gt. 3.0)
then
439 ust_lnd(i)=max(0.04*sqrt(u1d(i)*u1d(i) + v1d(i)*v1d(i)),0.001_kind_phys)
441 if (ust_ice(i) .lt. 1e-4 .or. ust_ice(i) .gt. 3.0)
then
442 ust_ice(i)=max(0.04*sqrt(u1d(i)*u1d(i) + v1d(i)*v1d(i)),0.001_kind_phys)
450 qsfc(i)=qv3d(i,kts)/(1.+qv3d(i,kts))
453 qsfc(i)=qv3d(i,kts)/(1.+qv3d(i,kts))
465 j,u1d,v1d,t1d,qv1d,p1d,dz8w1d, &
467 psfcpa,pblh,mavail,xland,dx, &
468 isfflx,isftcflx,iz0tlnd,psi_opt, &
469 compute_flux,compute_diag, &
470 sigmaf,vegtype,shdmax,ivegsrc, &
472 redrag,sfc_z0_type, &
473 itimestep,iter,flag_restart,lsm,
lsm_ruc, &
475 tskin_wat, tskin_lnd, tskin_ice, &
476 tsurf_wat, tsurf_lnd, tsurf_ice, &
477 qsfc_wat, qsfc_lnd, qsfc_ice, &
478 snowh_wat, snowh_lnd, snowh_ice, &
479 znt_wat, znt_lnd, znt_ice, &
480 ust_wat, ust_lnd, ust_ice, &
481 cm_wat, cm_lnd, cm_ice, &
482 ch_wat, ch_lnd, ch_ice, &
483 rb_wat, rb_lnd, rb_ice, &
484 stress_wat, stress_lnd, stress_ice, &
485 fm_wat, fm_lnd, fm_ice, &
486 fh_wat, fh_lnd, fh_ice, &
487 fm10_wat, fm10_lnd, fm10_ice, &
488 fh2_wat, fh2_lnd, fh2_ice, &
489 hflx_wat, hflx_lnd, hflx_ice, &
490 qflx_wat, qflx_lnd, qflx_ice, &
491 ch,chs,chs2,cqs2,cpm, &
492 znt,ustm,zol,mol,rmol, &
494 hflx,hfx,qflx,qfx,lh,flhc,flqc, &
495 qgh,qsfc,u10,v10,th2,t2,q2, &
496 gz1oz0,wspd,wstar,qstar, &
498 ids,ide, jds,jde, kds,kde, &
499 ims,ime, jms,jme, kms,kme, &
500 its,ite, jts,jte, kts,kte, &
522 J,U1D,V1D,T1D,QV1D,P1D,dz8w1d,U1D2,V1D2,dz2w1d, &
523 PSFCPA,PBLH,MAVAIL,XLAND,DX, &
524 ISFFLX,isftcflx,iz0tlnd,psi_opt, &
525 compute_flux,compute_diag, &
526 sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
528 redrag,sfc_z0_type, &
529 itimestep,iter,flag_restart,lsm,
lsm_ruc, &
531 tskin_wat, tskin_lnd, tskin_ice, &
532 tsurf_wat, tsurf_lnd, tsurf_ice, &
533 qsfc_wat, qsfc_lnd, qsfc_ice, &
534 snowh_wat, snowh_lnd, snowh_ice, &
535 znt_wat, znt_lnd, znt_ice, &
536 ust_wat, ust_lnd, ust_ice, &
537 cm_wat, cm_lnd, cm_ice, &
538 ch_wat, ch_lnd, ch_ice, &
539 rb_wat, rb_lnd, rb_ice, &
540 stress_wat, stress_lnd, stress_ice, &
541 psix_wat, psix_lnd, psix_ice, &
542 psit_wat, psit_lnd, psit_ice, &
543 psix10_wat, psix10_lnd, psix10_ice, &
544 psit2_wat, psit2_lnd, psit2_ice, &
545 hflx_wat, hflx_lnd, hflx_ice, &
546 qflx_wat, qflx_lnd, qflx_ice, &
547 ch,chs,chs2,cqs2,cpm, &
548 znt,ustm,zol,mol,rmol, &
550 hflx,hfx,qflx,qfx,lh,flhc,flqc, &
553 gz1oz0,wspd,wstar,qstar, &
555 ids,ide, jds,jde, kds,kde, &
556 ims,ime, jms,jme, kms,kme, &
557 its,ite, jts,jte, kts,kte, &
565 INTEGER,
INTENT(IN) :: ids,ide, jds,jde, kds,kde, &
566 ims,ime, jms,jme, kms,kme, &
567 its,ite, jts,jte, kts,kte, &
568 J, itimestep, iter, lsm, lsm_ruc
569 LOGICAL,
INTENT(IN) :: flag_restart
571 REAL(kind_phys),
PARAMETER :: XKA=2.4e-5
572 REAL(kind_phys),
PARAMETER :: PRT=1.
573 REAL(kind_phys),
PARAMETER :: snowh_thresh = 50.
578 integer,
intent(in) :: ISFFLX
579 integer,
optional,
intent(in) :: ISFTCFLX, IZ0TLND
580 logical,
intent(in) :: compute_flux,compute_diag
581 integer,
intent(in) :: spp_sfc, psi_opt
582 integer,
intent(in) :: ivegsrc
583 integer,
intent(in) :: sfc_z0_type
584 logical,
intent(in) :: redrag
587 integer,
dimension(ims:ime),
intent(in) :: vegtype
588 real(kind_phys),
dimension(ims:ime),
intent(in) :: &
589 & sigmaf,shdmax,z0pert,ztpert
594 REAL(kind_phys),
DIMENSION( ims:ime ), &
595 INTENT(IN) :: MAVAIL, &
601 REAL(kind_phys),
DIMENSION( its:ite ), &
602 INTENT(IN) :: U1D,V1D, &
609 REAL(kind_phys),
DIMENSION( ims:ime ), &
610 INTENT(OUT) :: QFX,HFX, &
612 REAL(kind_phys),
DIMENSION( ims:ime ), &
613 INTENT(INOUT) :: HFLX,QFLX, &
623 REAL(kind_phys),
DIMENSION( ims:ime ),
OPTIONAL, &
624 INTENT(INOUT) :: MOL, &
630 LOGICAL,
DIMENSION( ims:ime ),
INTENT(IN) :: &
631 & wet, dry, icy, flag_iter
633 REAL(kind_phys),
DIMENSION( ims:ime ),
INTENT(in) :: &
634 & tskin_wat, tskin_lnd, tskin_ice, &
635 & tsurf_wat, tsurf_lnd, tsurf_ice, &
636 & snowh_wat, snowh_lnd, snowh_ice
638 REAL(kind_phys),
DIMENSION( ims:ime ),
INTENT(inout) :: &
639 & ZNT_wat, ZNT_lnd, ZNT_ice, &
640 & UST_wat, UST_lnd, UST_ice, &
641 & cm_wat, cm_lnd, cm_ice, &
642 & ch_wat, ch_lnd, ch_ice, &
643 & rb_wat, rb_lnd, rb_ice, &
644 & stress_wat,stress_lnd,stress_ice, &
645 & psix_wat, psix_lnd, psix_ice, &
646 & psit_wat, psit_lnd, psit_ice, &
647 & psix10_wat,psix10_lnd,psix10_ice, &
648 & psit2_wat, psit2_lnd, psit2_ice, &
649 & HFLX_wat, HFLX_lnd, HFLX_ice, &
650 & QFLX_wat, QFLX_lnd, QFLX_ice, &
651 & qsfc_wat, qsfc_lnd, qsfc_ice
653 REAL(kind_phys),
DIMENSION( its:ite ), &
654 & INTENT(IN) :: rstoch1D
657 REAL(kind_phys),
DIMENSION( ims:ime ), &
658 & INTENT(OUT) :: U10, V10, &
664 REAL(kind_phys),
DIMENSION( ims:ime ), &
665 & INTENT(OUT) :: qstar
666 REAL(kind_phys),
DIMENSION( ims:ime ),
OPTIONAL, &
667 & INTENT(OUT) :: wstar
672 character(len=*),
intent(inout) :: errmsg
673 integer,
intent(inout) :: errflg
680 character(len=512) :: device_errmsg
681 integer :: device_errflg
687 character(len=512) :: device_special_errmsg
688 integer :: device_special_errflg
694 REAL(kind_phys),
DIMENSION(its:ite) :: &
711 zratio_lnd, zratio_ice, zratio_wat, &
712 TSK_lnd, TSK_ice, TSK_wat, &
713 THSK_lnd, THSK_ice, THSK_wat, &
714 THVSK_lnd, THVSK_ice, THVSK_wat, &
715 GZ1OZ0_lnd, GZ1OZ0_ice, GZ1OZ0_wat, &
716 GZ1OZt_lnd, GZ1OZt_ice, GZ1OZt_wat, &
717 GZ2OZ0_lnd, GZ2OZ0_ice, GZ2OZ0_wat, &
718 GZ2OZt_lnd, GZ2OZt_ice, GZ2OZt_wat, &
719 GZ10OZ0_lnd, GZ10OZ0_ice, GZ10OZ0_wat, &
720 GZ10OZt_lnd, GZ10OZt_ice, GZ10OZt_wat, &
721 ZNTstoch_lnd, ZNTstoch_ice, ZNTstoch_wat, &
722 ZT_lnd, ZT_ice, ZT_wat, &
723 ZQ_lnd, ZQ_ice, ZQ_wat, &
724 PSIQ_lnd, PSIQ_ice, PSIQ_wat, &
725 PSIQ2_lnd, PSIQ2_ice, PSIQ2_wat, &
726 QSFCMR_lnd, QSFCMR_ice, QSFCMR_wat
728 INTEGER :: N,I,K,L,yesno
730 REAL(kind_phys) :: PL,E1,TABS
731 REAL(kind_phys) :: WSPD_lnd, WSPD_ice, WSPD_wat
732 REAL(kind_phys) :: DTHVDZ,DTHVM,VCONV,ZOL2,ZOL10,ZOLZA,ZOLZ0,ZOLZT
733 REAL(kind_phys) :: DTG,DTTHX,PSIQ,PSIQ2,PSIQ10,PSIT10
734 REAL(kind_phys) :: FLUXC,VSGD
735 REAL(kind_phys) :: restar,VISC,DQG,OLDUST,OLDTST
740 device_errflg = errflg
741 device_errmsg = errmsg
742 device_special_errflg = errflg
743 device_special_errmsg = errmsg
802 psfc(i)=psfcpa(i)/1000.
804 if ( flag_iter(i) )
then
806 IF (itimestep == 1)
THEN
809 tsk_wat(i) = tskin_wat(i)
810 IF (tsk_wat(i) .LT. 273.15)
THEN
812 e1=svp1*exp(4648*(1./273.15 - 1./tsk_wat(i)) - &
813 & 11.64*log(273.15/tsk_wat(i)) + 0.02265*(273.15 - tsk_wat(i)))
816 e1=svp1*exp(svp2*(tsk_wat(i)-svpt0)/(tsk_wat(i)-svp3))
818 qsfc_wat(i)=ep2*e1/(psfc(i)-ep3*e1)
819 qsfcmr_wat(i)=ep2*e1/(psfc(i)-e1)
820 IF(qsfc_wat(i)>1..or.qsfc_wat(i)<0.) print *,
' QSFC_wat(I)',itimestep,i,qsfc_wat(i),tsk_wat(i)
823 tsk_lnd(i) = tskin_lnd(i)
825 qsfcmr_lnd(i)=qsfc_lnd(i)/(1.-qsfc_lnd(i))
827 tabs = 0.5*(tsk_lnd(i) + t1d(i))
828 IF (tabs .LT. 273.15)
THEN
830 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
831 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
834 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
836 qsfc_lnd(i)=ep2*e1/(psfc(i)-ep3*e1)
837 qsfc_lnd(i)=0.5*(qsfc_lnd(i) + qsfc(i))
838 qsfcmr_lnd(i)=qsfc_lnd(i)/(1.-qsfc_lnd(i))
840 IF(qsfc_lnd(i)>1..or.qsfc_lnd(i)<0.) print *,
' QSFC_lnd(I)',itimestep,i,qsfc_lnd(i),tskin_lnd(i),tsurf_lnd(i),qsfc(i)
843 tsk_ice(i) = tskin_ice(i)
845 qsfcmr_ice(i)=qsfc_ice(i)/(1.-qsfc_ice(i))
847 IF (tsk_ice(i) .LT. 273.15)
THEN
849 e1=svp1*exp(4648*(1./273.15 - 1./tsk_ice(i)) - &
850 & 11.64*log(273.15/tsk_ice(i)) + 0.02265*(273.15 - tsk_ice(i)))
853 e1=svp1*exp(svp2*(tsk_ice(i)-svpt0)/(tsk_ice(i)-svp3))
855 qsfc_ice(i)=ep2*e1/(psfc(i)-ep3*e1)
856 qsfcmr_ice(i)=ep2*e1/(psfc(i)-e1)
858 IF(qsfc_ice(i)>1..or.qsfc_ice(i)<0.) print *,
' QSFC_ice(I)',itimestep,i,qsfc_ice(i),tsk_ice(i)
865 tsk_wat(i) = tskin_wat(i)
866 IF (tsk_wat(i) .LT. 273.15)
THEN
868 e1=svp1*exp(4648*(1./273.15 - 1./tsk_wat(i)) - &
869 & 11.64*log(273.15/tsk_wat(i)) + 0.02265*(273.15 - tsk_wat(i)))
872 e1=svp1*exp(svp2*(tsk_wat(i)-svpt0)/(tsk_wat(i)-svp3))
874 qsfc_wat(i)=ep2*e1/(psfc(i)-ep3*e1)
876 IF (dry(i).and.(qsfc_lnd(i)>1..or.qsfc_lnd(i)<0.))
then
878 tabs = 0.5*(tskin_lnd(i) + t1d(i))
879 IF (tabs .LT. 273.15)
THEN
881 e1=svp1*exp(4648*(1./273.15 - 1./tabs) - &
882 & 11.64*log(273.15/tabs) + 0.02265*(273.15 - tabs))
885 e1=svp1*exp(svp2*(tabs-svpt0)/(tabs-svp3))
887 qsfc_lnd(i)=ep2*e1/(psfc(i)-ep3*e1)
888 qsfc_lnd(i)=0.5*(qsfc_lnd(i) + qsfc(i))
890 IF (icy(i).and.(qsfc_ice(i)>1..or.qsfc_ice(i)<0.))
then
892 IF (tskin_ice(i) .LT. 273.15)
THEN
894 e1=svp1*exp(4648*(1./273.15 - 1./tskin_ice(i)) - &
895 & 11.64*log(273.15/tskin_ice(i)) + 0.02265*(273.15 - tskin_ice(i)))
898 e1=svp1*exp(svp2*(tskin_ice(i)-svpt0)/(tskin_ice(i)-svp3))
900 qsfc_ice(i)=ep2*e1/(psfc(i)-ep3*e1)
903 IF (wet(i)) qsfcmr_wat(i)=qsfc_wat(i)/(1.-qsfc_wat(i))
904 IF (dry(i)) qsfcmr_lnd(i)=qsfc_lnd(i)/(1.-qsfc_lnd(i))
905 IF (icy(i)) qsfcmr_ice(i)=qsfc_ice(i)/(1.-qsfc_ice(i))
915 IF (debug_code >= 1)
THEN
916 write(0,*)
"ITIMESTEP=",itimestep,
" iter=",iter
918 write(0,*)
"=== important input to mynnsfclayer, i:", i
920 write(0,*)
"dry=",dry(i),
" pblh=",pblh(i),
" tsk=", tskin_lnd(i),&
921 " tsurf=", tsurf_lnd(i),
" qsfc=", qsfc_lnd(i),
" znt=", znt_lnd(i),&
922 " ust=", ust_lnd(i),
" snowh=", snowh_lnd(i),
" psfcpa=",psfcpa(i), &
923 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
926 write(0,*)
"icy=",icy(i),
" pblh=",pblh(i),
" tsk=", tskin_ice(i),&
927 " tsurf=", tsurf_ice(i),
" qsfc=", qsfc_ice(i),
" znt=", znt_ice(i),&
928 " ust=", ust_ice(i),
" snowh=", snowh_ice(i),
"psfcpa=",psfcpa(i), &
929 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
932 write(0,*)
"wet=",wet(i),
" pblh=",pblh(i),
" tsk=", tskin_wat(i),&
933 " tsurf=", tsurf_wat(i),
" qsfc=", qsfc_wat(i),
" znt=", znt_wat(i),&
934 " ust=", ust_wat(i),
" snowh=", snowh_wat(i),
"psfcpa=",psfcpa(i), &
935 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
947 psfc(i)=psfcpa(i)/1000.
948 qvsh(i)=qv1d(i)/(1.+qv1d(i))
949 thcon(i)=(100000./psfcpa(i))**rovcp
950 if( flag_iter(i) )
then
953 tsk_lnd(i) = tskin_lnd(i)
956 thsk_lnd(i) = tsk_lnd(i)*thcon(i)
957 thvsk_lnd(i) = thsk_lnd(i)*(1.+ep1*qsfc_lnd(i))
958 if(thvsk_lnd(i) < 160. .or. thvsk_lnd(i) > 390.) &
959 print *,
'THVSK_lnd(I)',itimestep,i,thvsk_lnd(i),thsk_lnd(i),tsurf_lnd(i),tskin_lnd(i),qsfc_lnd(i)
962 tsk_ice(i) = tskin_ice(i)
965 thsk_ice(i) = tsk_ice(i)*thcon(i)
966 thvsk_ice(i) = thsk_ice(i)*(1.+ep1*qsfc_ice(i))
967 if(thvsk_ice(i) < 160. .or. thvsk_ice(i) > 390.) &
968 print *,
'THVSK_ice(I)',itimestep,i,thvsk_ice(i),thsk_ice(i),tsurf_ice(i),tskin_ice(i),qsfc_ice(i)
971 tsk_wat(i) = tskin_wat(i)
974 thsk_wat(i) = tsk_wat(i)*thcon(i)
975 thvsk_wat(i) = thsk_wat(i)*(1.+ep1*qvsh(i))
976 if(thvsk_wat(i) < 160. .or. thvsk_wat(i) > 390.) &
977 print *,
'THVSK_wat(I)',i,thvsk_wat(i),thsk_wat(i),tsurf_wat(i),tskin_wat(i),qsfc_wat(i)
985 th1d(i)=t1d(i)*(100000./p1d(i))**rovcp
986 tc1d(i)=t1d(i)-273.15
992 thv1d(i)=th1d(i)*(1.+ep1*qvsh(i))
993 tv1d(i)=t1d(i)*(1.+ep1*qvsh(i))
998 rho1d(i)=p1d(i)/(rd*tv1d(i))
1000 za2(i)=dz8w1d(i) + 0.5*dz2w1d(i)
1001 govrth(i)=grav/th1d(i)
1007 qfx(i)=qflx(i)*rho1d(i)
1008 hfx(i)=hflx(i)*rho1d(i)*cp
1015 IF (debug_code ==2)
THEN
1018 write(*,*)
"=== derived quantities in mynn sfc layer, i:", i
1019 write(*,*)
" land, ice, water"
1020 write(*,*)
"dry=",dry(i),
" icy=",icy(i),
" wet=",wet(i)
1021 write(*,*)
"tsk=", tsk_lnd(i),tsk_ice(i),tsk_wat(i)
1022 write(*,*)
"thvsk=", thvsk_lnd(i),thvsk_ice(i),thvsk_wat(i)
1023 write(*,*)
"THV1D=", thv1d(i),
" TV1D=",tv1d(i)
1024 write(*,*)
"RHO1D=", rho1d(i),
" GOVRTH=",govrth(i)
1033 IF (t1d(i) .LT. 273.15)
THEN
1035 e1=svp1*exp(4648.*(1./273.15 - 1./t1d(i)) - &
1036 & 11.64*log(273.15/t1d(i)) + 0.02265*(273.15 - t1d(i)))
1039 e1=svp1*exp(svp2*(t1d(i)-svpt0)/(t1d(i)-svp3))
1043 qgh(i)=ep2*e1/(pl-e1)
1044 cpm(i)=cp*(1.+0.84*qv1d(i))
1051 IF (debug_code == 2)
THEN
1052 write(*,*)
"ITIMESTEP=",itimestep
1055 write(*,*)
"==== q-bombs, i:",i,
" wet"
1056 write(*,*)
"QSFC_wat=", qsfc_wat(i),
" QSFCMR_wat=", qsfcmr_wat(i),
" QGH=",qgh(i)
1059 write(*,*)
"==== q-bombs, i:",i,
" dry"
1060 write(*,*)
"QSFC_lnd=", qsfc_lnd(i),
" QSFCMR_lnd=", qsfcmr_lnd(i),
" QGH=",qgh(i)
1063 write(*,*)
"==== q-bombs, i:",i,
" ice"
1064 write(*,*)
"QSFC_ice=", qsfc_ice(i),
" QSFCMR_ice=", qsfcmr_ice(i),
" QGH=",qgh(i)
1076 if( flag_iter(i) )
then
1081 wspd(i)=sqrt(u1d(i)*u1d(i)+v1d(i)*v1d(i))
1087 dthvdz=(thv1d(i)-thvsk_wat(i))
1096 fluxc = max(hfx(i)/rho1d(i)/cp &
1097 & + ep1*thvsk_wat(i)*qfx(i)/rho1d(i),0._kind_phys)
1099 wstar(i) = vconvc*(grav/tsk_wat(i)*pblh(i)*fluxc)**onethird
1104 vsgd = min( 0.25 * (max(dx(i)/5000.-1.,0._kind_phys))**onethird , 0.5_kind_phys)
1105 wspd_wat=sqrt(wspd(i)*wspd(i)+wstar(i)*wstar(i)+vsgd*vsgd)
1106 wspd_wat=max(wspd_wat,wmin)
1111 rb_wat(i)=govrth(i)*za(i)*dthvdz/(wspd_wat*wspd_wat)
1112 rb_wat(i)=max(rb_wat(i),-2.0_kind_phys)
1113 rb_wat(i)=min(rb_wat(i), 2.0_kind_phys)
1117 dthvdz=(thv1d(i)-thvsk_lnd(i))
1126 fluxc = max(hfx(i)/rho1d(i)/cp &
1127 & + ep1*thvsk_lnd(i)*qfx(i)/rho1d(i),0._kind_phys)
1131 wstar(i) = vconvc*(grav/tsk_lnd(i)*min(1.5*pblh(i),4000._kind_phys)*fluxc)**onethird
1136 vsgd = min( 0.32 * (max(dx(i)/5000.-1.,0._kind_phys))**onethird , 0.5_kind_phys)
1137 wspd_lnd=sqrt(wspd(i)*wspd(i)+wstar(i)*wstar(i)+vsgd*vsgd)
1138 wspd_lnd=max(wspd_lnd,wmin)
1143 rb_lnd(i)=govrth(i)*za(i)*dthvdz/(wspd_lnd*wspd_lnd)
1150 rb_lnd(i)=max(rb_lnd(i),-2.0_kind_phys)
1151 rb_lnd(i)=min(rb_lnd(i), 2.0_kind_phys)
1155 dthvdz=(thv1d(i)-thvsk_ice(i))
1164 fluxc = max(hfx(i)/rho1d(i)/cp &
1165 & + ep1*thvsk_ice(i)*qfx(i)/rho1d(i),0._kind_phys)
1169 wstar(i) = vconvc*(grav/tsk_ice(i)*min(1.5*pblh(i),4000._kind_phys)*fluxc)**onethird
1174 vsgd = min( 0.32 * (max(dx(i)/5000.-1.,0._kind_phys))**onethird , 0.5_kind_phys)
1175 wspd_ice=sqrt(wspd(i)*wspd(i)+wstar(i)*wstar(i)+vsgd*vsgd)
1176 wspd_ice=max(wspd_ice,wmin)
1181 rb_ice(i)=govrth(i)*za(i)*dthvdz/(wspd_ice*wspd_ice)
1182 rb_ice(i)=max(rb_ice(i),-2.0_kind_phys)
1183 rb_ice(i)=min(rb_ice(i), 2.0_kind_phys)
1187 wspd(i) = max(wspd_ice,wspd_wat)
1188 wspd(i) = max(wspd_lnd,wspd(i))
1190 IF (debug_code == 2)
THEN
1191 write(*,*)
"===== After rb calc in mynn sfc layer:"
1192 write(*,*)
"ITIMESTEP=",itimestep
1193 write(*,*)
"WSPD=", wspd(i),
" WSTAR=", wstar(i),
" vsgd=",vsgd
1194 IF (icy(i))
write(*,*)
"rb_ice=", rb_ice(i),
" DTHVDZ=",dthvdz
1195 IF (wet(i))
write(*,*)
"rb_wat=", rb_wat(i),
" DTHVDZ=",dthvdz
1196 IF (dry(i))
write(*,*)
"rb_lnd=", rb_lnd(i),
" DTHVDZ=",dthvdz
1207 1006
format(a,f7.3,a,f9.4,a,f9.5,a,f9.4)
1208 1007
format(a,f2.0,a,f6.2,a,f7.3,a,f7.2)
1246 if( flag_iter(i) )
then
1250 visc=1.326e-5*(1. + 6.542e-3*tc1d(i) + 8.301e-6*tc1d(i)*tc1d(i) &
1251 - 4.84e-9*tc1d(i)*tc1d(i)*tc1d(i))
1257 if (sfc_z0_type >= 0)
then
1261 IF (debug_code == 2)
THEN
1262 write(*,*)
"=============Input to ZNT over water:"
1263 write(*,*)
"u*:",ust_wat(i),
" wspd=",wspd(i),
" visc=",visc,
" za=",za(i)
1266 IF (
PRESENT(isftcflx) )
THEN
1267 IF ( isftcflx .EQ. 0 )
THEN
1268 IF (coare_opt .EQ. 3.0)
THEN
1270 CALL charnock_1955(znt_wat(i),ust_wat(i),wspd(i),visc,za(i))
1275 ELSEIF ( isftcflx .EQ. 1 .OR. isftcflx .EQ. 2 )
THEN
1277 ELSEIF ( isftcflx .EQ. 3 )
THEN
1279 ELSEIF ( isftcflx .EQ. 4 )
THEN
1281 CALL gfs_z0_wat(znt_wat(i),ust_wat(i),wspd(i),za(i),sfc_z0_type,redrag)
1285 IF (coare_opt .EQ. 3.0)
THEN
1287 CALL charnock_1955(znt_wat(i),ust_wat(i),wspd(i),visc,za(i))
1296 if (spp_sfc==1)
then
1297 zntstoch_wat(i) = max(znt_wat(i) + znt_wat(i)*1.0*rstoch1d(i), 1e-6_kind_phys)
1299 zntstoch_wat(i) = znt_wat(i)
1302 IF (debug_code > 1)
THEN
1303 write(*,*)
"==========Output ZNT over water:"
1304 write(*,*)
"ZNT:",zntstoch_wat(i)
1311 restar=max(ust_wat(i)*zntstoch_wat(i)/visc, 0.1_kind_phys)
1316 IF (debug_code > 1)
THEN
1317 write(*,*)
"=============Input to ZT over water:"
1318 write(*,*)
"u*:",ust_wat(i),
" restar=",restar,
" visc=",visc
1321 IF (
PRESENT(isftcflx) )
THEN
1322 IF ( isftcflx .EQ. 0 )
THEN
1323 IF (coare_opt .EQ. 3.0)
THEN
1325 rstoch1d(i),spp_sfc)
1328 rstoch1d(i),spp_sfc)
1330 ELSEIF ( isftcflx .EQ. 1 )
THEN
1331 IF (coare_opt .EQ. 3.0)
THEN
1333 rstoch1d(i),spp_sfc)
1336 rstoch1d(i),spp_sfc)
1338 ELSEIF ( isftcflx .EQ. 2 )
THEN
1339 CALL garratt_1992(zt_wat(i),zq_wat(i),zntstoch_wat(i),restar,2.0_kind_phys)
1340 ELSEIF ( isftcflx .EQ. 3 )
THEN
1341 IF (coare_opt .EQ. 3.0)
THEN
1343 rstoch1d(i),spp_sfc)
1346 rstoch1d(i),spp_sfc)
1348 ELSEIF ( isftcflx .EQ. 4 )
THEN
1350 CALL gfs_zt_wat(zt_wat(i),zntstoch_wat(i),restar,wspd(i),za(i),sfc_z0_type,device_errmsg,device_errflg)
1355 IF (coare_opt .EQ. 3.0)
THEN
1357 rstoch1d(i),spp_sfc)
1360 rstoch1d(i),spp_sfc)
1364 IF (debug_code > 1)
THEN
1365 write(*,*)
"=============Output ZT & ZQ over water:"
1366 write(*,*)
"ZT:",zt_wat(i),
" ZQ:",zq_wat(i)
1369 gz1oz0_wat(i)= log((za(i)+zntstoch_wat(i))/zntstoch_wat(i))
1370 gz1ozt_wat(i)= log((za(i)+zntstoch_wat(i))/zt_wat(i))
1371 gz2oz0_wat(i)= log((2.0+zntstoch_wat(i))/zntstoch_wat(i))
1372 gz2ozt_wat(i)= log((2.0+zntstoch_wat(i))/zt_wat(i))
1373 gz10oz0_wat(i)=log((10.+zntstoch_wat(i))/zntstoch_wat(i))
1374 gz10ozt_wat(i)=log((10.+zntstoch_wat(i))/zt_wat(i))
1375 zratio_wat(i)=zntstoch_wat(i)/zt_wat(i)
1381 if ( iz0tlnd .EQ. 4 )
then
1382 CALL gfs_z0_lnd(znt_lnd(i),shdmax(i),za(i),vegtype(i),ivegsrc,z0pert(i))
1386 if (spp_sfc==1)
then
1387 zntstoch_lnd(i) = max(znt_lnd(i) + znt_lnd(i)*1.0*rstoch1d(i), 1e-6_kind_phys)
1389 zntstoch_lnd(i) = znt_lnd(i)
1392 zntstoch_lnd(i) = min(zntstoch_lnd(i), dz8w1d(i)*0.0666_kind_phys)
1398 restar=max(ust_lnd(i)*zntstoch_lnd(i)/visc, 0.1_kind_phys)
1403 IF (snowh_lnd(i) > 50.)
THEN
1404 CALL andreas_2002(zntstoch_lnd(i),visc,ust_lnd(i),zt_lnd(i),zq_lnd(i))
1406 IF (
PRESENT(iz0tlnd) )
THEN
1407 IF ( iz0tlnd .LE. 1 )
THEN
1409 ust_lnd(i),karman,1.0_kind_phys,iz0tlnd,spp_sfc,rstoch1d(i))
1410 ELSEIF ( iz0tlnd .EQ. 2 )
THEN
1413 device_special_errmsg =
'Logic error: qstar is not set correctly when calling Yang_2008'
1414 device_special_errflg = 1
1419 errmsg = device_special_errmsg
1420 errflg = device_special_errflg
1423 CALL yang_2008(zntstoch_lnd(i),zt_lnd(i),zq_lnd(i),ust_lnd(i),mol(i),&
1424 qstar(i),restar,visc)
1425 ELSEIF ( iz0tlnd .EQ. 3 )
THEN
1427 CALL garratt_1992(zt_lnd(i),zq_lnd(i),zntstoch_lnd(i),restar,1.0_kind_phys)
1428 ELSEIF ( iz0tlnd .EQ. 4 )
THEN
1430 CALL gfs_zt_lnd(zt_lnd(i),zntstoch_lnd(i),sigmaf(i),ztpert(i),ust_lnd(i))
1436 ust_lnd(i),karman,1.0_kind_phys,0,spp_sfc,rstoch1d(i))
1440 IF (zntstoch_lnd(i) < 1e-8 .OR. zt_lnd(i) < 1e-10)
THEN
1441 write(0,*)
"===(land) capture bad input in mynn sfc layer, i=:",i
1442 write(0,*)
" ZNT=", zntstoch_lnd(i),
" ZT=",zt_lnd(i)
1443 write(0,*)
" tsk=", tskin_lnd(i),
" restar=",restar,&
1444 " tsurf=", tsurf_lnd(i),
" qsfc=", qsfc_lnd(i),
" znt=", znt_lnd(i),&
1445 " ust=", ust_lnd(i),
" snowh=", snowh_lnd(i),
"psfcpa=",psfcpa(i), &
1446 " dz=",dz8w1d(i),
" qflx=",qflx_lnd(i),
" hflx=",hflx_lnd(i),
" hpbl=",pblh(i)
1449 gz1oz0_lnd(i)= log((za(i)+zntstoch_lnd(i))/zntstoch_lnd(i))
1450 gz1ozt_lnd(i)= log((za(i)+zntstoch_lnd(i))/zt_lnd(i))
1451 gz2oz0_lnd(i)= log((2.0+zntstoch_lnd(i))/zntstoch_lnd(i))
1452 gz2ozt_lnd(i)= log((2.0+zntstoch_lnd(i))/zt_lnd(i))
1453 gz10oz0_lnd(i)=log((10.+zntstoch_lnd(i))/zntstoch_lnd(i))
1454 gz10ozt_lnd(i)=log((10.+zntstoch_lnd(i))/zt_lnd(i))
1455 zratio_lnd(i)=zntstoch_lnd(i)/zt_lnd(i)
1462 if (spp_sfc==1)
then
1463 zntstoch_ice(i) = max(znt_ice(i) + znt_ice(i)*1.0*rstoch1d(i), 1e-6_kind_phys)
1465 zntstoch_ice(i) = znt_ice(i)
1472 restar=max(ust_ice(i)*zntstoch_ice(i)/visc, 0.1_kind_phys)
1476 CALL andreas_2002(zntstoch_ice(i),visc,ust_ice(i),zt_ice(i),zq_ice(i))
1478 gz1oz0_ice(i)= log((za(i)+zntstoch_ice(i))/zntstoch_ice(i))
1479 gz1ozt_ice(i)= log((za(i)+zntstoch_ice(i))/zt_ice(i))
1480 gz2oz0_ice(i)= log((2.0+zntstoch_ice(i))/zntstoch_ice(i))
1481 gz2ozt_ice(i)= log((2.0+zntstoch_ice(i))/zt_ice(i))
1482 gz10oz0_ice(i)=log((10.+zntstoch_ice(i))/zntstoch_ice(i))
1483 gz10ozt_ice(i)=log((10.+zntstoch_ice(i))/zt_ice(i))
1484 zratio_ice(i)=zntstoch_ice(i)/zt_ice(i)
1491 znt(i)=zntstoch_lnd(i)
1492 ELSEIF (wet(i))
THEN
1493 znt(i)=zntstoch_wat(i)
1494 ELSEIF (icy(i))
THEN
1495 znt(i)=zntstoch_ice(i)
1504 IF (rb_wat(i) .GT. 0.0)
THEN
1506 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1508 CALL li_etal_2010(zol(i),rb_wat(i),za(i)/zntstoch_wat(i),zratio_wat(i))
1510 zol(i)=max(zol(i),0.0_kind_phys)
1511 zol(i)=min(zol(i),20._kind_phys)
1513 IF (debug_code >= 1)
THEN
1514 IF (zntstoch_wat(i) < 1e-8 .OR. zt_wat(i) < 1e-10)
THEN
1515 write(0,*)
"===(wet) capture bad input in mynn sfc layer, i=:",i
1516 write(0,*)
"rb=", rb_wat(i),
" ZNT=", zntstoch_wat(i),
" ZT=",zt_wat(i)
1517 write(0,*)
" tsk=", tskin_wat(i),
" prev z/L=",zol(i),&
1518 " tsurf=", tsurf_wat(i),
" qsfc=", qsfc_wat(i),
" znt=", znt_wat(i),&
1519 " ust=", ust_wat(i),
" snowh=", snowh_wat(i),
"psfcpa=",psfcpa(i), &
1520 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1527 zol(i)=zolrib(rb_wat(i),za(i),zntstoch_wat(i),zt_wat(i),gz1oz0_wat(i),gz1ozt_wat(i),zol(i),psi_opt)
1529 zol(i)=max(zol(i),0.0_kind_phys)
1530 zol(i)=min(zol(i),20._kind_phys)
1532 zolzt = zol(i)*zt_wat(i)/za(i)
1533 zolz0 = zol(i)*zntstoch_wat(i)/za(i)
1534 zolza = zol(i)*(za(i)+zntstoch_wat(i))/za(i)
1535 zol10 = zol(i)*(10.+zntstoch_wat(i))/za(i)
1536 zol2 = zol(i)*(2.+zntstoch_wat(i))/za(i)
1552 rmol(i)= zol(i)/za(i)
1554 ELSEIF(rb_wat(i) .EQ. 0.)
THEN
1568 ELSEIF(rb_wat(i) .LT. 0.)
THEN
1574 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1575 CALL li_etal_2010(zol(i),rb_wat(i),za(i)/zntstoch_wat(i),zratio_wat(i))
1577 zol(i)=max(zol(i),-20.0_kind_phys)
1578 zol(i)=min(zol(i),0.0_kind_phys)
1580 IF (debug_code >= 1)
THEN
1581 IF (zntstoch_wat(i) < 1e-8 .OR. zt_wat(i) < 1e-10)
THEN
1582 write(0,*)
"===(wet) capture bad input in mynn sfc layer, i=:",i
1583 write(0,*)
"rb=", rb_wat(i),
" ZNT=", zntstoch_wat(i),
" ZT=",zt_wat(i)
1584 write(0,*)
" tsk=", tskin_wat(i),
" wstar=",wstar(i),
" prev z/L=",zol(i),&
1585 " tsurf=", tsurf_wat(i),
" qsfc=", qsfc_wat(i),
" znt=", znt_wat(i),&
1586 " ust=", ust_wat(i),
" snowh=", snowh_wat(i),
"psfcpa=",psfcpa(i), &
1587 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1594 zol(i)=zolrib(rb_wat(i),za(i),zntstoch_wat(i),zt_wat(i),gz1oz0_wat(i),gz1ozt_wat(i),zol(i),psi_opt)
1596 zol(i)=max(zol(i),-20.0_kind_phys)
1597 zol(i)=min(zol(i),0.0_kind_phys)
1599 zolzt = zol(i)*zt_wat(i)/za(i)
1600 zolz0 = zol(i)*zntstoch_wat(i)/za(i)
1601 zolza = zol(i)*(za(i)+zntstoch_wat(i))/za(i)
1602 zol10 = zol(i)*(10.+zntstoch_wat(i))/za(i)
1603 zol2 = zol(i)*(2.+zntstoch_wat(i))/za(i)
1620 psih(i)=min(psih(i),0.9*gz1ozt_wat(i))
1621 psim(i)=min(psim(i),0.9*gz1oz0_wat(i))
1622 psih2(i)=min(psih2(i),0.9*gz2ozt_wat(i))
1623 psim10(i)=min(psim10(i),0.9*gz10oz0_wat(i))
1624 psih10(i)=min(psih10(i),0.9*gz10ozt_wat(i))
1626 rmol(i) = zol(i)/za(i)
1631 psix_wat(i) =max(gz1oz0_wat(i)-psim(i) , 1.0_kind_phys)
1632 psix10_wat(i)=max(gz10oz0_wat(i)-psim10(i), 1.0_kind_phys)
1633 psit_wat(i) =max(gz1ozt_wat(i)-psih(i) , 1.0_kind_phys)
1634 psit2_wat(i) =max(gz2ozt_wat(i)-psih2(i) , 1.0_kind_phys)
1635 psiq_wat(i) =max(log((za(i)+zq_wat(i))/zq_wat(i))-psih(i) ,1.0_kind_phys)
1636 psiq2_wat(i) =max(log((2.0+zq_wat(i))/zq_wat(i))-psih2(i) ,1.0_kind_phys)
1641 IF (rb_lnd(i) .GT. 0.0)
THEN
1643 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1645 CALL li_etal_2010(zol(i),rb_lnd(i),za(i)/zntstoch_lnd(i),zratio_lnd(i))
1647 zol(i)=max(zol(i),0.0_kind_phys)
1648 zol(i)=min(zol(i),20._kind_phys)
1650 IF (debug_code >= 1)
THEN
1651 IF (zntstoch_lnd(i) < 1e-8 .OR. zt_lnd(i) < 1e-10)
THEN
1652 write(0,*)
"===(land) capture bad input in mynn sfc layer, i=:",i
1653 write(0,*)
"rb=", rb_lnd(i),
" ZNT=", zntstoch_lnd(i),
" ZT=",zt_lnd(i)
1654 write(0,*)
" tsk=", tskin_lnd(i),
" prev z/L=",zol(i),&
1655 " tsurf=", tsurf_lnd(i),
" qsfc=", qsfc_lnd(i),
" znt=", znt_lnd(i),&
1656 " ust=", ust_lnd(i),
" snowh=", snowh_lnd(i),
"psfcpa=",psfcpa(i), &
1657 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1664 zol(i)=zolrib(rb_lnd(i),za(i),zntstoch_lnd(i),zt_lnd(i),gz1oz0_lnd(i),gz1ozt_lnd(i),zol(i),psi_opt)
1666 zol(i)=max(zol(i),0.0_kind_phys)
1667 zol(i)=min(zol(i),20._kind_phys)
1669 zolzt = zol(i)*zt_lnd(i)/za(i)
1670 zolz0 = zol(i)*zntstoch_lnd(i)/za(i)
1671 zolza = zol(i)*(za(i)+zntstoch_lnd(i))/za(i)
1672 zol10 = zol(i)*(10.+zntstoch_lnd(i))/za(i)
1673 zol2 = zol(i)*(2.+zntstoch_lnd(i))/za(i)
1688 rmol(i)= zol(i)/za(i)
1690 ELSEIF(rb_lnd(i) .EQ. 0.)
THEN
1704 ELSEIF(rb_lnd(i) .LT. 0.)
THEN
1709 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1711 CALL li_etal_2010(zol(i),rb_lnd(i),za(i)/zntstoch_lnd(i),zratio_lnd(i))
1713 zol(i)=max(zol(i),-20.0_kind_phys)
1714 zol(i)=min(zol(i),0.0_kind_phys)
1716 IF (debug_code >= 1)
THEN
1717 IF (zntstoch_lnd(i) < 1e-8 .OR. zt_lnd(i) < 1e-10)
THEN
1718 write(0,*)
"===(land) capture bad input in mynn sfc layer, i=:",i
1719 write(0,*)
"rb=", rb_lnd(i),
" ZNT=", zntstoch_lnd(i),
" ZT=",zt_lnd(i)
1720 write(0,*)
" tsk=", tskin_lnd(i),
" wstar=",wstar(i),
" prev z/L=",zol(i),&
1721 " tsurf=", tsurf_lnd(i),
" qsfc=", qsfc_lnd(i),
" znt=", znt_lnd(i),&
1722 " ust=", ust_lnd(i),
" snowh=", snowh_lnd(i),
"psfcpa=",psfcpa(i), &
1723 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1730 zol(i)=zolrib(rb_lnd(i),za(i),zntstoch_lnd(i),zt_lnd(i),gz1oz0_lnd(i),gz1ozt_lnd(i),zol(i),psi_opt)
1732 zol(i)=max(zol(i),-20.0_kind_phys)
1733 zol(i)=min(zol(i),0.0_kind_phys)
1735 zolzt = zol(i)*zt_lnd(i)/za(i)
1736 zolz0 = zol(i)*zntstoch_lnd(i)/za(i)
1737 zolza = zol(i)*(za(i)+zntstoch_lnd(i))/za(i)
1738 zol10 = zol(i)*(10.+zntstoch_lnd(i))/za(i)
1739 zol2 = zol(i)*(2.+zntstoch_lnd(i))/za(i)
1755 psih(i)=min(psih(i),0.9*gz1ozt_lnd(i))
1756 psim(i)=min(psim(i),0.9*gz1oz0_lnd(i))
1757 psih2(i)=min(psih2(i),0.9*gz2ozt_lnd(i))
1758 psim10(i)=min(psim10(i),0.9*gz10oz0_lnd(i))
1759 psih10(i)=min(psih10(i),0.9*gz10ozt_lnd(i))
1761 rmol(i) = zol(i)/za(i)
1766 psix_lnd(i) =max(gz1oz0_lnd(i)-psim(i), 1.0_kind_phys)
1767 psix10_lnd(i)=max(gz10oz0_lnd(i)-psim10(i), 1.0_kind_phys)
1768 psit_lnd(i) =max(gz1ozt_lnd(i)-psih(i) , 1.0_kind_phys)
1769 psit2_lnd(i) =max(gz2ozt_lnd(i)-psih2(i), 1.0_kind_phys)
1770 psiq_lnd(i) =max(log((za(i)+zq_lnd(i))/zq_lnd(i))-psih(i) ,1.0_kind_phys)
1771 psiq2_lnd(i) =max(log((2.0+zq_lnd(i))/zq_lnd(i))-psih2(i) ,1.0_kind_phys)
1776 IF (rb_ice(i) .GT. 0.0)
THEN
1778 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1780 CALL li_etal_2010(zol(i),rb_ice(i),za(i)/zntstoch_ice(i),zratio_ice(i))
1782 zol(i)=max(zol(i),0.0_kind_phys)
1783 zol(i)=min(zol(i),20._kind_phys)
1785 IF (debug_code >= 1)
THEN
1786 IF (zntstoch_ice(i) < 1e-8 .OR. zt_ice(i) < 1e-10)
THEN
1787 write(0,*)
"===(ice) capture bad input in mynn sfc layer, i=:",i
1788 write(0,*)
"rb=", rb_ice(i),
" ZNT=", zntstoch_ice(i),
" ZT=",zt_ice(i)
1789 write(0,*)
" tsk=", tskin_ice(i),
" prev z/L=",zol(i),&
1790 " tsurf=", tsurf_ice(i),
" qsfc=", qsfc_ice(i),
" znt=", znt_ice(i),&
1791 " ust=", ust_ice(i),
" snowh=", snowh_ice(i),
"psfcpa=",psfcpa(i), &
1792 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1799 zol(i)=zolrib(rb_ice(i),za(i),zntstoch_ice(i),zt_ice(i),gz1oz0_ice(i),gz1ozt_ice(i),zol(i),psi_opt)
1801 zol(i)=max(zol(i),0.0_kind_phys)
1802 zol(i)=min(zol(i),20._kind_phys)
1804 zolzt = zol(i)*zt_ice(i)/za(i)
1805 zolz0 = zol(i)*zntstoch_ice(i)/za(i)
1806 zolza = zol(i)*(za(i)+zntstoch_ice(i))/za(i)
1807 zol10 = zol(i)*(10.+zntstoch_ice(i))/za(i)
1808 zol2 = zol(i)*(2.+zntstoch_ice(i))/za(i)
1823 rmol(i)= zol(i)/za(i)
1825 ELSEIF(rb_ice(i) .EQ. 0.)
THEN
1839 ELSEIF(rb_ice(i) .LT. 0.)
THEN
1844 IF (.not. flag_restart .or. (flag_restart .and. itimestep > 1) )
THEN
1846 CALL li_etal_2010(zol(i),rb_ice(i),za(i)/zntstoch_ice(i),zratio_ice(i))
1848 zol(i)=max(zol(i),-20.0_kind_phys)
1849 zol(i)=min(zol(i),0.0_kind_phys)
1851 IF (debug_code >= 1)
THEN
1852 IF (zntstoch_ice(i) < 1e-8 .OR. zt_ice(i) < 1e-10)
THEN
1853 write(0,*)
"===(ice) capture bad input in mynn sfc layer, i=:",i
1854 write(0,*)
"rb=", rb_ice(i),
" ZNT=", zntstoch_ice(i),
" ZT=",zt_ice(i)
1855 write(0,*)
" tsk=", tskin_ice(i),
" wstar=",wstar(i),
" prev z/L=",zol(i),&
1856 " tsurf=", tsurf_ice(i),
" qsfc=", qsfc_ice(i),
" znt=", znt_ice(i),&
1857 " ust=", ust_ice(i),
" snowh=", snowh_ice(i),
"psfcpa=",psfcpa(i), &
1858 " dz=",dz8w1d(i),
" qflx=",qflx(i),
" hflx=",hflx(i),
" hpbl=",pblh(i)
1865 zol(i)=zolrib(rb_ice(i),za(i),zntstoch_ice(i),zt_ice(i),gz1oz0_ice(i),gz1ozt_ice(i),zol(i),psi_opt)
1867 zol(i)=max(zol(i),-20.0_kind_phys)
1868 zol(i)=min(zol(i),0.0_kind_phys)
1870 zolzt = zol(i)*zt_ice(i)/za(i)
1871 zolz0 = zol(i)*zntstoch_ice(i)/za(i)
1872 zolza = zol(i)*(za(i)+zntstoch_ice(i))/za(i)
1873 zol10 = zol(i)*(10.+zntstoch_ice(i))/za(i)
1874 zol2 = zol(i)*(2.+zntstoch_ice(i))/za(i)
1890 psih(i)=min(psih(i),0.9*gz1ozt_ice(i))
1891 psim(i)=min(psim(i),0.9*gz1oz0_ice(i))
1892 psih2(i)=min(psih2(i),0.9*gz2ozt_ice(i))
1893 psim10(i)=min(psim10(i),0.9*gz10oz0_ice(i))
1894 psih10(i)=min(psih10(i),0.9*gz10ozt_ice(i))
1896 rmol(i) = zol(i)/za(i)
1901 psix_ice(i) =max(gz1oz0_ice(i)-psim(i) , 1.0_kind_phys)
1902 psix10_ice(i)=max(gz10oz0_ice(i)-psim10(i), 1.0_kind_phys)
1903 psit_ice(i) =max(gz1ozt_ice(i)-psih(i) , 1.0_kind_phys)
1904 psit2_ice(i) =max(gz2ozt_ice(i)-psih2(i) , 1.0_kind_phys)
1905 psiq_ice(i) =max(log((za(i)+zq_ice(i))/zq_ice(i))-psih(i) ,1.0_kind_phys)
1906 psiq2_ice(i) =max(log((2.0+zq_ice(i))/zq_ice(i))-psih2(i) ,1.0_kind_phys)
1917 ust_wat(i)=0.5*ust_wat(i)+0.5*karman*wspd(i)/psix_wat(i)
1920 stress_wat(i)=ust_wat(i)**2
1923 wspdi(i)=max(sqrt(u1d(i)*u1d(i)+v1d(i)*v1d(i)), wmin)
1925 ustm(i)=0.5*ustm(i)+0.5*karman*wspdi(i)/psix_wat(i)
1928 if (.not. icy(i)) ust_ice(i)=ust_wat(i)
1934 ust_lnd(i)=0.5*ust_lnd(i)+0.5*karman*wspd(i)/psix_lnd(i)
1943 ust_lnd(i)=max(ust_lnd(i),0.005_kind_phys)
1944 stress_lnd(i)=ust_lnd(i)**2
1954 ust_ice(i)=0.5*ust_ice(i)+0.5*karman*wspd(i)/psix_ice(i)
1957 ust_ice(i)=max(ust_ice(i),0.005_kind_phys)
1958 stress_ice(i)=ust_ice(i)**2
1966 if (.not. wet(i)) ust_wat(i)=ust_ice(i)
1976 dtg=thv1d(i)-thvsk_wat(i)
1978 mol(i)=karman*dtg/psit_wat(i)/prt
1982 dqg=(qvsh(i)-qsfc_wat(i))*1000.
1983 qstar(i)=karman*dqg/psiq_wat(i)/prt
1987 dtg=thv1d(i)-thvsk_lnd(i)
1989 mol(i)=karman*dtg/psit_lnd(i)/prt
1993 dqg=(qvsh(i)-qsfc_lnd(i))*1000.
1994 qstar(i)=karman*dqg/psiq_lnd(i)/prt
1998 dtg=thv1d(i)-thvsk_ice(i)
2000 mol(i)=karman*dtg/psit_ice(i)/prt
2004 dqg=(qvsh(i)-qsfc_ice(i))*1000.
2005 qstar(i)=karman*dqg/psiq_ice(i)/prt
2017 IF (device_special_errflg /= 0)
THEN
2018 errflg = device_special_errflg
2019 errmsg = device_special_errmsg
2031 IF (debug_code == 2)
THEN
2033 IF(wet(i))
write(*,*)
"==== AT END OF MAIN LOOP, i=",i,
"(wet)"
2034 IF(dry(i))
write(*,*)
"==== AT END OF MAIN LOOP, i=",i,
"(land)"
2035 IF(icy(i))
write(*,*)
"==== AT END OF MAIN LOOP, i=",i,
"(ice)"
2036 write(*,*)
"z/L:",zol(i),
" wspd:",wspd(i),
" Tstar:",mol(i)
2037 IF(wet(i))
write(*,*)
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2038 " DTHV:",thv1d(i)-thvsk_wat(i)
2039 IF(dry(i))
write(*,*)
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2040 " DTHV:",thv1d(i)-thvsk_lnd(i)
2041 IF(icy(i))
write(*,*)
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2042 " DTHV:",thv1d(i)-thvsk_ice(i)
2043 write(*,*)
"CPM:",cpm(i),
" RHO1D:",rho1d(i),
" q*:",qstar(i),
" T*:",mol(i)
2044 IF(wet(i))
write(*,*)
"U*:",ust_wat(i),
" Z0:",zntstoch_wat(i),
" Zt:",zt_wat(i)
2045 IF(dry(i))
write(*,*)
"U*:",ust_lnd(i),
" Z0:",zntstoch_lnd(i),
" Zt:",zt_lnd(i)
2046 IF(icy(i))
write(*,*)
"U*:",ust_ice(i),
" Z0:",zntstoch_ice(i),
" Zt:",zt_ice(i)
2047 write(*,*)
"hfx:",hfx(i),
" MAVAIL:",mavail(i),
" QVSH(I):",qvsh(i)
2048 write(*,*)
"============================================="
2075 if( flag_iter(i) )
then
2077 IF (isfflx .LT. 1)
THEN
2105 flqc(i)=rho1d(i)*mavail(i)*ust_lnd(i)*karman/psiq_lnd(i)
2106 flhc(i)=rho1d(i)*cpm(i)*ust_lnd(i)*karman/psit_lnd(i)
2108 IF (compute_flux)
THEN
2112 qfx(i)=flqc(i)*(qsfcmr_lnd(i)-qv1d(i))
2114 qfx(i)=max(qfx(i),-0.02_kind_phys)
2117 qflx_lnd(i)=qfx(i)/rho1d(i)
2124 hfx(i)=rho1d(i)*cpm(i)*karman*wspd(i)/psix_lnd(i)*karman/psit_lnd(i)*(thsk_lnd(i)-th1d(i))
2125 hfx(i)=max(hfx(i),-250._kind_phys)
2127 hflx_lnd(i)=hfx(i)/(rho1d(i)*cpm(i))
2136 chs(i)=ust_lnd(i)*karman/psit_lnd(i)
2139 cqs2(i)=ust_lnd(i)*karman/psiq2_lnd(i)
2140 chs2(i)=ust_lnd(i)*karman/psit2_lnd(i)
2144 ELSEIF (wet(i))
THEN
2150 flqc(i)=rho1d(i)*mavail(i)*ust_wat(i)*karman/psiq_wat(i)
2151 flhc(i)=rho1d(i)*cpm(i)*ust_wat(i)*karman/psit_wat(i)
2153 IF (compute_flux)
THEN
2157 qfx(i)=flqc(i)*(qsfcmr_wat(i)-qv1d(i))
2159 qfx(i)=max(qfx(i),-0.02_kind_phys)
2162 qflx_wat(i)=qfx(i)/rho1d(i)
2169 hfx(i)=rho1d(i)*cpm(i)*karman*wspd(i)/psix_wat(i)*karman/psit_wat(i)*(thsk_wat(i)-th1d(i))
2170 IF (
PRESENT(isftcflx) )
THEN
2171 IF ( isftcflx.NE.0 )
THEN
2173 hfx(i)=hfx(i)+rho1d(i)*ustm(i)*ustm(i)*wspdi(i)
2177 hflx_wat(i)=hfx(i)/(rho1d(i)*cpm(i))
2184 chs(i)=ust_wat(i)*karman/psit_wat(i)
2187 cqs2(i)=ust_wat(i)*karman/psiq2_wat(i)
2188 chs2(i)=ust_wat(i)*karman/psit2_wat(i)
2192 ELSEIF (icy(i))
THEN
2198 flqc(i)=rho1d(i)*mavail(i)*ust_ice(i)*karman/psiq_ice(i)
2199 flhc(i)=rho1d(i)*cpm(i)*ust_ice(i)*karman/psit_ice(i)
2201 IF (compute_flux)
THEN
2205 qfx(i)=flqc(i)*(qsfcmr_ice(i)-qv1d(i))
2207 qfx(i)=max(qfx(i),-0.02_kind_phys)
2210 qflx_ice(i)=qfx(i)/rho1d(i)
2217 hfx(i)=rho1d(i)*cpm(i)*karman*wspd(i)/psix_ice(i)*karman/psit_ice(i)*(thsk_ice(i)-th1d(i))
2218 hfx(i)=max(hfx(i),-250._kind_phys)
2220 hflx_ice(i)=hfx(i)/(rho1d(i)*cpm(i))
2227 chs(i)=ust_ice(i)*karman/psit_ice(i)
2230 cqs2(i)=ust_ice(i)*karman/psiq2_ice(i)
2231 chs2(i)=ust_ice(i)*karman/psit2_ice(i)
2237 IF (debug_code > 1)
THEN
2238 write(*,*)
"QFX=",qfx(i),
"FLQC=",flqc(i)
2239 if(icy(i))
write(*,*)
"ice, MAVAIL:",mavail(i),
" u*=",ust_ice(i),
" psiq=",psiq_ice(i)
2240 if(dry(i))
write(*,*)
"lnd, MAVAIL:",mavail(i),
" u*=",ust_lnd(i),
" psiq=",psiq_lnd(i)
2241 if(wet(i))
write(*,*)
"ocn, MAVAIL:",mavail(i),
" u*=",ust_wat(i),
" psiq=",psiq_wat(i)
2246 ch(i)=flhc(i)/( cpm(i)*rho1d(i) )
2252 ch_wat(i)=(karman/psix_wat(i))*(karman/psit_wat(i))
2253 cm_wat(i)=(karman/psix_wat(i))*(karman/psix_wat(i))
2256 ch_lnd(i)=(karman/psix_lnd(i))*(karman/psit_lnd(i))
2257 cm_lnd(i)=(karman/psix_lnd(i))*(karman/psix_lnd(i))
2260 ch_ice(i)=(karman/psix_ice(i))*(karman/psit_ice(i))
2261 cm_ice(i)=(karman/psix_ice(i))*(karman/psix_ice(i))
2268IF (compute_diag)
then
2282 if( flag_iter(i) )
then
2290 if (za(i) .le. 7.0)
then
2292 if(za2(i) .gt. 7.0 .and. za2(i) .lt. 13.0)
then
2301 u10(i)=u1d(i)*log(10./zntstoch_lnd(i))/log(za(i)/zntstoch_lnd(i))
2302 v10(i)=v1d(i)*log(10./zntstoch_lnd(i))/log(za(i)/zntstoch_lnd(i))
2303 ELSEIF (wet(i))
THEN
2304 u10(i)=u1d(i)*log(10./zntstoch_wat(i))/log(za(i)/zntstoch_wat(i))
2305 v10(i)=v1d(i)*log(10./zntstoch_wat(i))/log(za(i)/zntstoch_wat(i))
2306 ELSEIF (icy(i))
THEN
2307 u10(i)=u1d(i)*log(10./zntstoch_ice(i))/log(za(i)/zntstoch_ice(i))
2308 v10(i)=v1d(i)*log(10./zntstoch_ice(i))/log(za(i)/zntstoch_ice(i))
2311 elseif (za(i) .gt. 7.0 .and. za(i) .lt. 13.0)
then
2317 u10(i)=u1d(i)*log(10./zntstoch_lnd(i))/log(za(i)/zntstoch_lnd(i))
2318 v10(i)=v1d(i)*log(10./zntstoch_lnd(i))/log(za(i)/zntstoch_lnd(i))
2319 ELSEIF (wet(i))
THEN
2320 u10(i)=u1d(i)*log(10./zntstoch_wat(i))/log(za(i)/zntstoch_wat(i))
2321 v10(i)=v1d(i)*log(10./zntstoch_wat(i))/log(za(i)/zntstoch_wat(i))
2322 ELSEIF (icy(i))
THEN
2323 u10(i)=u1d(i)*log(10./zntstoch_ice(i))/log(za(i)/zntstoch_ice(i))
2324 v10(i)=v1d(i)*log(10./zntstoch_ice(i))/log(za(i)/zntstoch_ice(i))
2329 u10(i)=u1d(i)*psix10_lnd(i)/psix_lnd(i)
2330 v10(i)=v1d(i)*psix10_lnd(i)/psix_lnd(i)
2331 ELSEIF (wet(i))
THEN
2332 u10(i)=u1d(i)*psix10_wat(i)/psix_wat(i)
2333 v10(i)=v1d(i)*psix10_wat(i)/psix_wat(i)
2334 ELSEIF (icy(i))
THEN
2335 u10(i)=u1d(i)*psix10_ice(i)/psix_ice(i)
2336 v10(i)=v1d(i)*psix10_ice(i)/psix_ice(i)
2345 dtg=th1d(i)-thsk_lnd(i)
2346 th2(i)=thsk_lnd(i)+dtg*psit2_lnd(i)/psit_lnd(i)
2349 IF ((th1d(i)>thsk_lnd(i) .AND. (th2(i)<thsk_lnd(i) .OR. th2(i)>th1d(i))) .OR. &
2350 (th1d(i)<thsk_lnd(i) .AND. (th2(i)>thsk_lnd(i) .OR. th2(i)<th1d(i))))
THEN
2351 th2(i)=thsk_lnd(i) + 2.*(th1d(i)-thsk_lnd(i))/za(i)
2353 t2(i)=th2(i)*(psfcpa(i)/100000.)**rovcp
2355 q2(i)=qsfc_lnd(i)+(qv1d(i)-qsfc_lnd(i))*psiq2_lnd(i)/psiq_lnd(i)
2356 q2(i)= max(q2(i), min(qsfc_lnd(i), qv1d(i)))
2357 q2(i)= min(q2(i), 1.05*qv1d(i))
2358 ELSEIF (wet(i))
THEN
2359 dtg=th1d(i)-thsk_wat(i)
2360 th2(i)=thsk_wat(i)+dtg*psit2_wat(i)/psit_wat(i)
2363 IF ((th1d(i)>thsk_wat(i) .AND. (th2(i)<thsk_wat(i) .OR. th2(i)>th1d(i))) .OR. &
2364 (th1d(i)<thsk_wat(i) .AND. (th2(i)>thsk_wat(i) .OR. th2(i)<th1d(i))))
THEN
2365 th2(i)=thsk_wat(i) + 2.*(th1d(i)-thsk_wat(i))/za(i)
2367 t2(i)=th2(i)*(psfcpa(i)/100000.)**rovcp
2369 q2(i)=qsfc_wat(i)+(qv1d(i)-qsfc_wat(i))*psiq2_wat(i)/psiq_wat(i)
2370 q2(i)= max(q2(i), min(qsfc_wat(i), qv1d(i)))
2371 q2(i)= min(q2(i), 1.05*qv1d(i))
2372 ELSEIF (icy(i))
THEN
2373 dtg=th1d(i)-thsk_ice(i)
2374 th2(i)=thsk_ice(i)+dtg*psit2_ice(i)/psit_ice(i)
2377 IF ((th1d(i)>thsk_ice(i) .AND. (th2(i)<thsk_ice(i) .OR. th2(i)>th1d(i))) .OR. &
2378 (th1d(i)<thsk_ice(i) .AND. (th2(i)>thsk_ice(i) .OR. th2(i)<th1d(i))))
THEN
2379 th2(i)=thsk_ice(i) + 2.*(th1d(i)-thsk_ice(i))/za(i)
2381 t2(i)=th2(i)*(psfcpa(i)/100000.)**rovcp
2383 q2(i)=qsfc_ice(i)+(qv1d(i)-qsfc_ice(i))*psiq2_ice(i)/psiq_ice(i)
2384 q2(i)= max(q2(i), min(qsfc_ice(i), qv1d(i)))
2385 q2(i)= min(q2(i), 1.05*qv1d(i))
2404IF ( debug_code == 2)
THEN
2407 IF (compute_flux)
THEN
2408 IF (hfx(i) > 1200. .OR. hfx(i) < -700.)
THEN
2409 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2413 IF (lh(i) > 1200. .OR. lh(i) < -700.)
THEN
2414 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2420 IF (ust_wat(i) < 0.0 .OR. ust_wat(i) > 4.0 )
THEN
2421 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2422 i,j,
"UST_wat: ",ust_wat(i)
2427 IF (ust_lnd(i) < 0.0 .OR. ust_lnd(i) > 4.0 )
THEN
2428 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2429 i,j,
"UST_lnd: ",ust_lnd(i)
2434 IF (ust_ice(i) < 0.0 .OR. ust_ice(i) > 4.0 )
THEN
2435 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2436 i,j,
"UST_ice: ",ust_ice(i)
2440 IF (wstar(i)<0.0 .OR. wstar(i) > 6.0)
THEN
2441 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2442 i,j,
"WSTAR: ",wstar(i)
2445 IF (rho1d(i)<0.0 .OR. rho1d(i) > 1.6 )
THEN
2446 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2447 i,j,
"rho: ",rho1d(i)
2451 IF (qsfc_lnd(i)*1000. <0.0 .OR. qsfc_lnd(i)*1000. >40.)
THEN
2452 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2453 i,j,
"QSFC_lnd: ",qsfc_lnd(i)
2457 IF (pblh(i)<0. .OR. pblh(i)>6000.)
THEN
2458 print*,
"SUSPICIOUS VALUES IN MYNN SFCLAYER",&
2459 i,j,
"PBLH: ",pblh(i)
2463 IF (yesno == 1)
THEN
2465 print*,
" OTHER INFO over water:"
2466 print*,
"z/L:",zol(i),
" U*:",ust_wat(i),
" Tstar:",mol(i)
2467 print*,
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2468 " DTHV:",thv1d(i)-thvsk_wat(i)
2469 print*,
"CPM:",cpm(i),
" RHO1D:",rho1d(i),
" L:",&
2470 zol(i)/za(i),
" DTH:",th1d(i)-thsk_wat(i)
2471 print*,
" Z0:",zntstoch_wat(i),
" Zt:",zt_wat(i),
" za:",za(i)
2472 print*,
"MAVAIL:",mavail(i),
" QSFC_wat(I):",&
2473 qsfc_wat(i),
" QVSH(I):",qvsh(i)
2474 print*,
"PSIX=",psix_wat(i),
" T1D(i):",t1d(i)
2475 write(*,*)
"============================================="
2478 print*,
" OTHER INFO over land:"
2479 print*,
"z/L:",zol(i),
" U*:",ust_lnd(i),&
2481 print*,
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2482 " DTHV:",thv1d(i)-thvsk_lnd(i)
2483 print*,
"CPM:",cpm(i),
" RHO1D:",rho1d(i),
" L:",&
2484 zol(i)/za(i),
" DTH:",th1d(i)-thsk_lnd(i)
2485 print*,
" Z0:",zntstoch_lnd(i),
" Zt:",zt_lnd(i),
" za:",za(i)
2486 print*,
" MAVAIL:",mavail(i),
" QSFC_lnd(I):",&
2487 qsfc_lnd(i),
" QVSH(I):",qvsh(i)
2488 print*,
"PSIX=",psix_lnd(i),
" T1D(i):",t1d(i)
2489 write(*,*)
"============================================="
2492 print*,
" OTHER INFO:"
2493 print*,
"z/L:",zol(i),
" U*:",ust_ice(i),&
2495 print*,
"PSIM:",psim(i),
" PSIH:",psih(i),
" W*:",wstar(i),&
2496 " DTHV:",thv1d(i)-thvsk_ice(i)
2497 print*,
"CPM:",cpm(i),
" RHO1D:",rho1d(i),
" L:",&
2498 zol(i)/za(i),
" DTH:",th1d(i)-thsk_ice(i)
2499 print*,
" Z0:",zntstoch_ice(i),
" Zt:",zt_ice(i),
" za:",za(i)
2500 print*,
" MAVAIL:",mavail(i),
" QSFC_ice(I):",&
2501 qsfc_ice(i),
" QVSH(I):",qvsh(i)
2502 print*,
"PSIX=",psix_ice(i),
" T1D(i):",t1d(i)
2503 write(*,*)
"============================================="
2531IF (device_errflg /= 0)
THEN
2532 errflg = device_errflg
2533 errmsg = device_errmsg