@@ -17,6 +17,7 @@ module SatellitePhenologyMod
1717 use perf_mod , only : t_startf, t_stopf
1818 use spmdMod , only : masterproc, mpicom, iam
1919 use laiStreamMod , only : lai_init, lai_advance, lai_interp
20+ use clm_varctl , only : use_fates
2021 use ncdio_pio
2122 !
2223 ! !PUBLIC TYPES:
@@ -170,7 +171,7 @@ subroutine UpdateSatellitePhenologyCanopy(bounds, num_filter, filter, &
170171 use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type
171172 use CanopyStateType , only : canopystate_type
172173 use PatchType , only : patch
173- use clm_varctl , only : use_fates
174+
174175
175176 !
176177 ! !ARGUMENTS:
@@ -415,7 +416,9 @@ subroutine readMonthlyVegetation (bounds, fveg, months, canopystate_inst)
415416 use clm_time_manager , only : get_nstep
416417 use CanopyStateType , only : canopystate_type
417418 use PatchType , only : patch
419+ use ColumnType , only : col
418420 use clm_varcon , only : grlnd
421+ use clm_varpar , only : surfpft_lb,surfpft_ub
419422 use netcdf
420423 !
421424 ! !ARGUMENTS:
@@ -428,6 +431,7 @@ subroutine readMonthlyVegetation (bounds, fveg, months, canopystate_inst)
428431 character (len= 256 ) :: locfn ! local file name
429432 type (file_desc_t) :: ncid ! netcdf id
430433 integer :: g,n,k,l,m,p,ni,nj,ns ! indices
434+ integer :: c,ft ! indices
431435 integer :: dimid,varid ! input netCDF id's
432436 integer :: ntim ! number of input data time samples
433437 integer :: nlon_i ! number of input data longitudes
@@ -485,25 +489,40 @@ subroutine readMonthlyVegetation (bounds, fveg, months, canopystate_inst)
485489 ! Assign lai/sai/hgtt/hgtb to the top [maxsoil_patches] patches
486490 ! as determined in subroutine surfrd
487491
488- do p = bounds% begp,bounds% endp
489- g = patch% gridcell(p)
490- if (patch% itype(p) /= noveg) then ! vegetated pft
491- do l = 0 , maxveg
492- if (l == patch% itype(p)) then
493- mlai2t(p,k) = mlai(g,l)
494- msai2t(p,k) = msai(g,l)
495- mhvt2t(p,k) = mhgtt(g,l)
496- mhvb2t(p,k) = mhgtb(g,l)
497- end if
498- end do
499- else ! non-vegetated pft
500- mlai2t(p,k) = 0._r8
501- msai2t(p,k) = 0._r8
502- mhvt2t(p,k) = 0._r8
503- mhvb2t(p,k) = 0._r8
504- end if
505- end do ! end of loop over patches
506-
492+ if_fates: if (use_fates)then
493+ do c = bounds% begc,bounds% endc
494+ if (col% is_fates(c))then
495+ do ft = surfpft_lb,surfpft_ub
496+ p = ft + col% patchi(c)
497+ g = patch% gridcell(p)
498+ mlai2t(p,k) = mlai(g,ft)
499+ msai2t(p,k) = msai(g,ft)
500+ mhvt2t(p,k) = mhgtt(g,ft)
501+ mhvb2t(p,k) = mhgtb(g,ft)
502+ end do
503+ end if
504+ end do
505+ else
506+ do p = bounds% begp,bounds% endp
507+ g = patch% gridcell(p)
508+ if (patch% itype(p) /= noveg ) then ! vegetated pft
509+ do l = 0 , maxveg
510+ if (l == patch% itype(p)) then
511+ mlai2t(p,k) = mlai(g,l)
512+ msai2t(p,k) = msai(g,l)
513+ mhvt2t(p,k) = mhgtt(g,l)
514+ mhvb2t(p,k) = mhgtb(g,l)
515+ end if
516+ end do
517+ else ! non-vegetated pft
518+ mlai2t(p,k) = 0._r8
519+ msai2t(p,k) = 0._r8
520+ mhvt2t(p,k) = 0._r8
521+ mhvb2t(p,k) = 0._r8
522+ end if
523+ end do ! end of loop over patches
524+ end if if_fates
525+
507526 end do ! end of loop over months
508527
509528 call ncd_pio_closefile(ncid)
0 commit comments