@@ -4052,11 +4052,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4052
4052
4053
4053
end if
4054
4054
4055
- ! prepare for longwave rad.
4056
-
4057
- air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4
4058
- cir = (2.-emv*(1.-emg))*emv*sb
4059
- !
4060
4055
if(opt_sfc == 4) then
4061
4056
4062
4057
gdx = sqrt(garea1)
@@ -4203,6 +4198,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4203
4198
end if
4204
4199
end if
4205
4200
4201
+ ! prepare for longwave rad.
4202
+
4203
+ air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4
4204
+ cir = (2.-emv*(1.-emg))*emv*sb
4205
+
4206
4206
! prepare for sensible heat flux above veg.
4207
4207
4208
4208
cah = 1./rahc
@@ -4265,7 +4265,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4265
4265
4266
4266
! update vegetation surface temperature
4267
4267
tv = tv + dtv
4268
- ! tah = ata + bta*tv ! canopy air t; update here for consistency
4268
+ tah = ata + bta*tv ! canopy air t; update here for consistency
4269
4269
4270
4270
! for computing m-o length in the next iteration
4271
4271
h = rhoair*cpair*(tah - sfctmp) /rahc
@@ -4278,15 +4278,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4278
4278
qfx = (qsfc-qair)*rhoair*caw
4279
4279
endif
4280
4280
4281
-
4282
- if (liter == 1) then
4283
- exit loop1
4284
- endif
4285
- if (iter >= 5 .and. abs(dtv) <= 0.01 .and. liter == 0) then
4286
- liter = 1
4287
- endif
4288
-
4289
- end do loop1 ! end stability iteration
4281
+ ! after canopy balance, do the under-canopy ground balance
4290
4282
4291
4283
! under-canopy fluxes and tg
4292
4284
@@ -4296,8 +4288,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4296
4288
cev = rhoair*cpair / (gammag*(rawg+rsurf)) ! barlage: change to ground v3.6
4297
4289
cgh = 2.*df(isnow+1)/dzsnso(isnow+1)
4298
4290
4299
- loop2: do iter = 1, niterg
4300
-
4301
4291
t = tdc(tg)
4302
4292
call esat(t, esatw, esati, dsatw, dsati)
4303
4293
if (t .gt. 0.) then
@@ -4323,7 +4313,14 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
4323
4313
gh = gh + cgh*dtg
4324
4314
tg = tg + dtg
4325
4315
4326
- end do loop2
4316
+ if (liter == 1) then
4317
+ exit loop1
4318
+ endif
4319
+ if (iter >= 5 .and. abs(dtv) <= 0.01 .and. abs(dtg) <= 0.01 .and. liter == 0) then
4320
+ liter = 1 ! if conditions are met, then do one final loop
4321
+ endif
4322
+
4323
+ end do loop1
4327
4324
4328
4325
! tah = (cah*sfctmp + cvh*tv + cgh*tg)/(cah + cvh + cgh)
4329
4326
0 commit comments