Skip to content

Commit

Permalink
Two bug fixes both are array out of bounds issues. One with CADS in t…
Browse files Browse the repository at this point in the history
…he cloud height array. The other with abi2km bias correction array.
  • Loading branch information
wx20jjung committed Sep 26, 2023
1 parent ebd2989 commit b3b02f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
28 changes: 15 additions & 13 deletions src/gsi/qcmod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2368,20 +2368,22 @@ subroutine qc_irsnd(nchanl,is,ndat,nsig,ich,sea,land,ice,snow,luse,goessndr,airs
endif
end do

do i=1, nchanl ! use surface channel to derive cloud amount
m = nuchan(ich(i))
if ( m == isurface_chan ) then ! interpolate cloud top temperature
cloud_temperature = ((tvp(lcloud) -tvp(lcloud -1)/ log(prsltmp(lcloud) / prsltmp(lcloud - 1))) &
if ( lcloud >= 2 ) then
do i=1, nchanl ! use surface channel to derive cloud amount
m = nuchan(ich(i))
if ( m == isurface_chan ) then ! interpolate cloud top temperature
cloud_temperature = ((tvp(lcloud) -tvp(lcloud -1)/ log(prsltmp(lcloud) / prsltmp(lcloud - 1))) &
*log(cldp/prsltmp(lcloud-1))) + tvp(lcloud-1)
call crtm_planck_radiance(1,m,tb_bc(i),radiance_chan) ! observation radiance. same as tb_obs + bias correction
call crtm_planck_radiance(1,m,tsim(i),radiance_model) ! model derived radiance
call crtm_planck_radiance(1,m,cloud_temperature,radiance_cloud) ! cloud top temperature radiance
cloudp = (radiance_chan - radiance_model) / (radiance_cloud - radiance_model)
cloudp = min(max(cloudp,zero),one)
exit
endif ! surface channel
end do
cldp = cldp * r10
call crtm_planck_radiance(1,m,tb_bc(i),radiance_chan) ! observation radiance. same as tb_obs + bias correction
call crtm_planck_radiance(1,m,tsim(i),radiance_model) ! model derived radiance
call crtm_planck_radiance(1,m,cloud_temperature,radiance_cloud) ! cloud top temperature radiance
cloudp = (radiance_chan - radiance_model) / (radiance_cloud - radiance_model)
cloudp = min(max(cloudp,zero),one)
exit
endif ! surface channel
end do
cldp = cldp * r10
endif
endif
endif

Expand Down
6 changes: 3 additions & 3 deletions src/gsi/setuprad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,9 @@ subroutine setuprad(obsLL,odiagLL,lunin,mype,aivals,stats,nchanl,nreal,nobs,&

predbias=zero
abi2km_bc = zero
abi2km_bc(2) = 233.5_r_kind
abi2km_bc(3) = 241.7_r_kind
abi2km_bc(4) = 250.5_r_kind
abi2km_bc(1) = 233.5_r_kind
abi2km_bc(2) = 241.7_r_kind
abi2km_bc(3) = 250.5_r_kind
!$omp parallel do schedule(dynamic,1) private(i,mm,j,k,tlap,node,bias)
do i=1,nchanl
mm=ich(i)
Expand Down

0 comments on commit b3b02f7

Please sign in to comment.