Skip to content

Commit

Permalink
Update BRDF Functions to work with LIDORT 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mcduffie committed Aug 31, 2021
1 parent 96a038b commit 41bf472
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/Implementation/brdf_functions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module brdf_functions_m

use iso_c_binding

USE LIDORT_pars_m, only : fpk, DEG_TO_RAD, MAXBEAMS, MAXSTREAMS_BRDF, &
MAX_BRDF_KERNELS, MAXSTHALF_BRDF, MAX_BRDF_PARAMETERS, &
ZERO, ONE, TWO, PIE, MAX_USER_STREAMS, MAX_USER_RELAZMS, &
USE LIDORT_pars_m, only : fpk, DEG_TO_RAD, MAXBEAMS, MAXSTREAMS_BRDF, MAX_BRDF_KERNELS, &
MAXSTHALF_BRDF, MAX_BRDF_PARAMETERS, ZERO, ONE, TWO, PIE, &
MAX_USER_STREAMS, MAX_USER_RELAZMS, &
BPDFVEGN_IDX, BPDFSOIL_IDX, RAHMAN_IDX

implicit none
Expand Down Expand Up @@ -110,7 +110,7 @@ real(kind=c_double) function exact_brdf_value_f(breon_type, params, sza, vza, az
N_BRDF_PARAMETERS(2) = 3
BRDF_PARAMETERS = ZERO
! Breon refactive index squared, same as value hardcoded inside lrad
BRDF_PARAMETERS(1,1) = 2.25_fpk
BRDF_PARAMETERS(1,1) = 1.5_fpk ! refractive index (value itself, not the square of it)
BRDF_PARAMETERS(2,1) = params(2) ! hotspot parameter
BRDF_PARAMETERS(2,2) = params(3) ! Asymmetry parameter
BRDF_PARAMETERS(2,3) = params(4) ! anisotropy
Expand Down Expand Up @@ -216,8 +216,7 @@ end function black_sky_albedo_soil_f

real(kind=c_double) function black_sky_albedo_f(breon_type, params, sza) bind(c)

! USE brdf_sup_aux_m, only : BRDF_GAULEG, BRDF_QUADRATURE_Gaussian
USE brdf_sup_aux_m, only : GETQUAD2, BRDF_QUADRATURE_Gaussian
USE brdf_sup_aux_m, only : GETQUAD2, BRDF_QUADRATURE_Gaussian

! There should only be 5 parameters, ordered how GroundBrdf does so
integer(c_int), intent(in) :: breon_type
Expand Down Expand Up @@ -315,7 +314,7 @@ real(kind=c_double) function black_sky_albedo_f(breon_type, params, sza) bind(c)
N_BRDF_PARAMETERS(2) = 3
BRDF_PARAMETERS = ZERO
! Breon refactive index squared, same as value hardcoded inside lrad
BRDF_PARAMETERS(1,1) = 2.25_fpk
BRDF_PARAMETERS(1,1) = 1.5_fpk ! refractive index (value itself, not the square of it)
BRDF_PARAMETERS(2,1) = params(2) ! Overall amplitude
BRDF_PARAMETERS(2,2) = params(3) ! Asymmetry parameter
BRDF_PARAMETERS(2,3) = params(4) ! Geometric factor
Expand Down Expand Up @@ -344,8 +343,7 @@ real(kind=c_double) function black_sky_albedo_f(breon_type, params, sza) bind(c)
! Set up Quadrature streams for BSA Scaling.

SCAL_NSTREAMS = MAXSTREAMS_SCALING
! CALL BRDF_GAULEG ( ZERO, ONE, SCAL_QUAD_STREAMS, SCAL_QUAD_WEIGHTS, SCAL_NSTREAMS )
CALL GETQUAD2 ( ZERO, ONE, SCAL_NSTREAMS, SCAL_QUAD_STREAMS, SCAL_QUAD_WEIGHTS )
CALL GETQUAD2(ZERO, ONE, SCAL_NSTREAMS, SCAL_QUAD_STREAMS, SCAL_QUAD_WEIGHTS)
DO I = 1, SCAL_NSTREAMS
SCAL_QUAD_SINES(I) = SQRT(ONE-SCAL_QUAD_STREAMS(I)*SCAL_QUAD_STREAMS(I))
SCAL_QUAD_STRMWTS(I) = SCAL_QUAD_STREAMS(I) * SCAL_QUAD_WEIGHTS(I)
Expand Down Expand Up @@ -407,8 +405,8 @@ SUBROUTINE SCALING_BRDF_MAKER &
! module, dimensions and numbers

USE LIDORT_pars_m, only : fpk, MAX_BRDF_PARAMETERS, &
MAXBEAMS, &
MAXSTREAMS_BRDF
MAXBEAMS, &
MAXSTREAMS_BRDF

USE brdf_sup_routines_m, only : BRDF_FUNCTION

Expand Down

0 comments on commit 41bf472

Please sign in to comment.