Skip to content

Commit 906d03b

Browse files
authored
Merge pull request #1397 from rgknox/trivial-zenith-defaults-raderrorfix
radiation refactors - rad_error and rad profile diagnostics
2 parents f6355b1 + 7ba3727 commit 906d03b

File tree

7 files changed

+233
-238
lines changed

7 files changed

+233
-238
lines changed

biogeochem/EDPatchDynamicsMod.F90

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,10 +3273,6 @@ subroutine fuse_2_patches(csite, dp, rp)
32733273
rp%c_stomata = (dp%c_stomata*dp%area + rp%c_stomata*rp%area) * inv_sum_area
32743274
rp%c_lblayer = (dp%c_lblayer*dp%area + rp%c_lblayer*rp%area) * inv_sum_area
32753275

3276-
! Radiation
3277-
rp%rad_error(1) = (dp%rad_error(1)*dp%area + rp%rad_error(1)*rp%area) * inv_sum_area
3278-
rp%rad_error(2) = (dp%rad_error(2)*dp%area + rp%rad_error(2)*rp%area) * inv_sum_area
3279-
32803276
rp%area = rp%area + dp%area !THIS MUST COME AT THE END!
32813277

32823278
!insert donor cohorts into recipient patch

biogeochem/FatesPatchMod.F90

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ module FatesPatchMod
149149
real(r8) :: c_stomata ! mean stomatal conductance of all leaves in the patch [umol/m2/s]
150150
real(r8) :: c_lblayer ! mean boundary layer conductance of all leaves in the patch [umol/m2/s]
151151

152-
real(r8),allocatable :: nrmlzd_parprof_pft_dir_z(:,:,:,:) !num_rad_stream_types,nclmax,maxpft,nlevleaf)
153-
real(r8),allocatable :: nrmlzd_parprof_pft_dif_z(:,:,:,:) !num_rad_stream_types,nclmax,maxpft,nlevleaf)
152+
real(r8),allocatable :: nrmlzd_parprof_pft_dir_z(:,:,:) ! nclmax,maxpft,nlevleaf)
153+
real(r8),allocatable :: nrmlzd_parprof_pft_dif_z(:,:,:) ! nclmax,maxpft,nlevleaf)
154154

155155
!---------------------------------------------------------------------------
156156

@@ -172,11 +172,6 @@ module FatesPatchMod
172172
real(r8),allocatable :: ed_laisun_z(:,:,:) !nclmax,maxpft,nlevleaf)
173173
real(r8),allocatable :: ed_laisha_z(:,:,:) !nclmax,maxpft,nlevleaf)
174174

175-
176-
! radiation profiles for comparison against observations
177-
real(r8),allocatable :: parprof_pft_dir_z(:,:,:) !nclmax,maxpft,nlevleaf) ! direct-beam PAR profile through canopy, by canopy, PFT, leaf level [W/m2]
178-
real(r8),allocatable :: parprof_pft_dif_z(:,:,:) !nclmax,maxpft,nlevleaf) ! diffuse PAR profile through canopy, by canopy, PFT, leaf level [W/m2]
179-
180175
real(r8), allocatable :: tr_soil_dir(:) ! fraction of incoming direct radiation transmitted to the soil as direct, by numSWB [0-1]
181176
real(r8), allocatable :: tr_soil_dif(:) ! fraction of incoming diffuse radiation that is transmitted to the soil as diffuse [0-1]
182177
real(r8), allocatable :: tr_soil_dir_dif(:) ! fraction of incoming direct radiation that is transmitted to the soil as diffuse [0-1]
@@ -372,8 +367,6 @@ subroutine ReAllocateDynamics(this)
372367
deallocate(this%ed_parsha_z)
373368
deallocate(this%ed_laisun_z)
374369
deallocate(this%ed_laisha_z)
375-
deallocate(this%parprof_pft_dir_z)
376-
deallocate(this%parprof_pft_dif_z)
377370
deallocate(this%canopy_area_profile)
378371
else
379372
! The number of canopy layers has not changed
@@ -401,14 +394,12 @@ subroutine ReAllocateDynamics(this)
401394
allocate(this%fabd_sha_z(ncan,numpft,nveg))
402395
allocate(this%fabi_sun_z(ncan,numpft,nveg))
403396
allocate(this%fabi_sha_z(ncan,numpft,nveg))
404-
allocate(this%nrmlzd_parprof_pft_dir_z(num_rad_stream_types,ncan,numpft,nveg))
405-
allocate(this%nrmlzd_parprof_pft_dif_z(num_rad_stream_types,ncan,numpft,nveg))
397+
allocate(this%nrmlzd_parprof_pft_dir_z(ncan,numpft,nveg))
398+
allocate(this%nrmlzd_parprof_pft_dif_z(ncan,numpft,nveg))
406399
allocate(this%ed_parsun_z(ncan,numpft,nveg))
407400
allocate(this%ed_parsha_z(ncan,numpft,nveg))
408401
allocate(this%ed_laisun_z(ncan,numpft,nveg))
409402
allocate(this%ed_laisha_z(ncan,numpft,nveg))
410-
allocate(this%parprof_pft_dir_z(ncan,numpft,nveg))
411-
allocate(this%parprof_pft_dif_z(ncan,numpft,nveg))
412403
end if
413404

414405
return
@@ -425,8 +416,8 @@ subroutine NanDynamics(this)
425416
this%tlai_profile(:,:,:) = nan
426417
this%tsai_profile(:,:,:) = nan
427418
this%canopy_area_profile(:,:,:) = nan
428-
this%nrmlzd_parprof_pft_dir_z(:,:,:,:) = nan
429-
this%nrmlzd_parprof_pft_dif_z(:,:,:,:) = nan
419+
this%nrmlzd_parprof_pft_dir_z(:,:,:) = nan
420+
this%nrmlzd_parprof_pft_dif_z(:,:,:) = nan
430421

431422
this%fabd_sun_z(:,:,:) = nan
432423
this%fabd_sha_z(:,:,:) = nan
@@ -437,8 +428,6 @@ subroutine NanDynamics(this)
437428
this%ed_parsun_z(:,:,:) = nan
438429
this%ed_parsha_z(:,:,:) = nan
439430
this%f_sun(:,:,:) = nan
440-
this%parprof_pft_dir_z(:,:,:) = nan
441-
this%parprof_pft_dif_z(:,:,:) = nan
442431

443432
end subroutine NanDynamics
444433

@@ -559,8 +548,8 @@ subroutine ZeroDynamics(this)
559548
this%fabi_sun_z(:,:,:) = 0._r8
560549
this%fabd_sha_z(:,:,:) = 0._r8
561550
this%fabi_sha_z(:,:,:) = 0._r8
562-
this%nrmlzd_parprof_pft_dir_z(:,:,:,:) = 0._r8
563-
this%nrmlzd_parprof_pft_dif_z(:,:,:,:) = 0._r8
551+
this%nrmlzd_parprof_pft_dir_z(:,:,:) = 0._r8
552+
this%nrmlzd_parprof_pft_dif_z(:,:,:) = 0._r8
564553

565554
! Added
566555
this%elai_profile(:,:,:) = 0._r8
@@ -573,8 +562,6 @@ subroutine ZeroDynamics(this)
573562
this%ed_laisha_z(:,:,:) = 0._r8
574563
this%ed_parsun_z(:,:,:) = 0._r8
575564
this%ed_parsha_z(:,:,:) = 0._r8
576-
this%parprof_pft_dir_z(:,:,:) = 0._r8
577-
this%parprof_pft_dif_z(:,:,:) = 0._r8
578565

579566
end subroutine ZeroDynamics
580567

@@ -600,13 +587,13 @@ subroutine ZeroValues(this)
600587
this%c_lblayer = 0.0_r8
601588

602589
! RADIATION
603-
this%rad_error(:) = 0.0_r8
604590
this%tr_soil_dir_dif(:) = 0.0_r8
605591
this%fab(:) = 0.0_r8
606592
this%fabi(:) = 0.0_r8
607593
this%fabd(:) = 0.0_r8
608594
this%sabs_dir(:) = 0.0_r8
609595
this%sabs_dif(:) = 0.0_r8
596+
this%rad_error(:) = hlm_hio_ignore_val
610597

611598
! ROOTS
612599
this%btran_ft(:) = 0.0_r8
@@ -944,8 +931,6 @@ subroutine FreeMemory(this, regeneration_model, numpft)
944931
deallocate(this%ed_parsha_z)
945932
deallocate(this%ed_laisun_z)
946933
deallocate(this%ed_laisha_z)
947-
deallocate(this%parprof_pft_dir_z)
948-
deallocate(this%parprof_pft_dif_z)
949934
deallocate(this%canopy_area_profile)
950935
end if
951936

0 commit comments

Comments
 (0)