Skip to content

Commit

Permalink
Merge pull request #76 from JCSDA/hotfix/btj_fix_abi_NaN
Browse files Browse the repository at this point in the history
removed unnecessarily commented lines from ADA_Module.f90...
  • Loading branch information
BenjaminTJohnson authored Sep 23, 2023
2 parents 8ef293d + 2c3c62d commit 9fe2d07
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions src/RTSolution/ADA/ADA_Module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ SUBROUTINE CRTM_ADA(n_Layers, & ! Input number of atmospheric layers
RTV%s_Level_Rad_UP = ZERO
RTV%s_Layer_Source_UP = ZERO
RTV%s_Layer_Source_DOWN = ZERO
refl_down = ZERO
temporal_matrix = ZERO

RTV%s_Level_Refl_UP(1:nZ,1:nZ,n_Layers)=reflectivity(1:nZ,1:nZ)

Expand Down Expand Up @@ -722,11 +724,11 @@ SUBROUTINE CRTM_AMOM_layer( n_streams, & ! Input, number of streams
END DO
END DO
! specific treatment for downeward source function
!! IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
!! source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
!! ELSE
!! source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
!! END IF
IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
ELSE
source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
END IF

source_up(1:nZ) = source_up(1:nZ)*s_transmittance
source_down(1:nZ) = source_down(1:nZ)*s_transmittance
Expand Down Expand Up @@ -1519,15 +1521,15 @@ SUBROUTINE CRTM_AMOM_layer_TL( n_streams, & ! Input, number of streams
END DO
!
! specific treatment for downeward source function
!! IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
!! source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
!! source_down_TL(nZ) =source_down_TL(nZ) +(EXPfactor_TL-trans_TL(nZ,nZ))*Sfac2/V0(N2,N2) &
!! +(EXPfactor-trans(nZ,nZ))*Sfac2_TL/V0(N2,N2)-(EXPfactor-trans(nZ,nZ))*Sfac2*V0_TL(N2,N2)/V0(N2,N2)/V0(N2,N2)
!! ELSE
!! source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
!! source_down_TL(nZ) =source_down_TL(nZ) -EXPfactor_TL*Sfac2*optical_depth/COS_Angle(nZ) &
!! -EXPfactor*Sfac2_TL*optical_depth/COS_Angle(nZ)-EXPfactor*Sfac2*optical_depth_TL/COS_Angle(nZ)
!! END IF
IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
source_down_TL(nZ) =source_down_TL(nZ) +(EXPfactor_TL-trans_TL(nZ,nZ))*Sfac2/V0(N2,N2) &
+(EXPfactor-trans(nZ,nZ))*Sfac2_TL/V0(N2,N2)-(EXPfactor-trans(nZ,nZ))*Sfac2*V0_TL(N2,N2)/V0(N2,N2)/V0(N2,N2)
ELSE
source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
source_down_TL(nZ) =source_down_TL(nZ) -EXPfactor_TL*Sfac2*optical_depth/COS_Angle(nZ) &
-EXPfactor*Sfac2_TL*optical_depth/COS_Angle(nZ)-EXPfactor*Sfac2*optical_depth_TL/COS_Angle(nZ)
END IF

! source_up(1:nZ) = source_up(1:nZ)*s_transmittance
source_up_TL(1:nZ) = source_up_TL(1:nZ)*s_transmittance+source_up(1:nZ)*s_transmittance_TL
Expand Down Expand Up @@ -1925,11 +1927,11 @@ SUBROUTINE CRTM_AMOM_layer_AD( n_streams, & ! Input, number of streams
END DO
END DO
! specific treatment for downeward source function
!! IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
!! source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
!! ELSE
!! source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
!! END IF
IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
source_down(nZ) =source_down(nZ) +(EXPfactor-trans(nZ,nZ))*Sfac2/V0(N2,N2)
ELSE
source_down(nZ) =source_down(nZ) -EXPfactor*Sfac2*optical_depth/COS_Angle(nZ)
END IF

! forward part end ********
!
Expand All @@ -1939,16 +1941,16 @@ SUBROUTINE CRTM_AMOM_layer_AD( n_streams, & ! Input, number of streams
source_up_AD(1:nZ) = source_up_AD(1:nZ)*s_transmittance
!
! specific treatment for downeward source function
!! IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
!! V0_AD(N2,N2)=V0_AD(N2,N2)-(EXPfactor-trans(nZ,nZ))*Sfac2*source_down_AD(nZ)/V0(N2,N2)/V0(N2,N2)
!! Sfac2_AD = Sfac2_AD+(EXPfactor-trans(nZ,nZ))*source_down_AD(nZ)/V0(N2,N2)
!! EXPfactor_AD = EXPfactor_AD+source_down_AD(nZ)*Sfac2/V0(N2,N2)
!! trans_AD(nZ,nZ) = trans_AD(nZ,nZ)-source_down_AD(nZ)*Sfac2/V0(N2,N2)
!! ELSE
!! optical_depth_AD = optical_depth_AD -EXPfactor*Sfac2*source_down_AD(nZ)/COS_Angle(nZ)
!! Sfac2_AD = Sfac2_AD-EXPfactor*source_down_AD(nZ)*optical_depth/COS_Angle(nZ)
!! EXPfactor_AD = EXPfactor_AD-source_down_AD(nZ)*Sfac2*optical_depth/COS_Angle(nZ)
!! END IF
IF( abs( V0(N2,N2) ) > 0.0001_fp ) THEN
V0_AD(N2,N2)=V0_AD(N2,N2)-(EXPfactor-trans(nZ,nZ))*Sfac2*source_down_AD(nZ)/V0(N2,N2)/V0(N2,N2)
Sfac2_AD = Sfac2_AD+(EXPfactor-trans(nZ,nZ))*source_down_AD(nZ)/V0(N2,N2)
EXPfactor_AD = EXPfactor_AD+source_down_AD(nZ)*Sfac2/V0(N2,N2)
trans_AD(nZ,nZ) = trans_AD(nZ,nZ)-source_down_AD(nZ)*Sfac2/V0(N2,N2)
ELSE
optical_depth_AD = optical_depth_AD -EXPfactor*Sfac2*source_down_AD(nZ)/COS_Angle(nZ)
Sfac2_AD = Sfac2_AD-EXPfactor*source_down_AD(nZ)*optical_depth/COS_Angle(nZ)
EXPfactor_AD = EXPfactor_AD-source_down_AD(nZ)*Sfac2*optical_depth/COS_Angle(nZ)
END IF

DO i = nZ, 1, -1
DO j = nZ, 1, -1
Expand Down

0 comments on commit 9fe2d07

Please sign in to comment.