Skip to content

Commit b9f01c0

Browse files
committed
Frontport changes from code review in CAM
1 parent 686803a commit b9f01c0

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

src/aerosol/aerosol_optics_core.F90

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ function create_aerosol_optics_object(aeroprops, aerostate, ibin, &
4646

4747
class(aerosol_properties), intent(in), target :: aeroprops
4848
class(aerosol_state), intent(in), target :: aerostate
49-
integer, intent(in) :: ibin
50-
integer, intent(in) :: ncol
51-
integer, intent(in) :: nlev
52-
integer, intent(in) :: nswbands
53-
integer, intent(in) :: nlwbands
54-
integer, intent(in) :: numrh
55-
real(r8), intent(in) :: relh(:, :)
56-
real(r8), intent(in) :: sulfwtpct(:, :)
57-
complex(r8), intent(in) :: crefwsw(:)
58-
complex(r8), intent(in) :: crefwlw(:)
59-
real(r8), intent(in), optional, target :: geometric_radius(:, :)
49+
integer, intent(in) :: ibin
50+
integer, intent(in) :: ncol
51+
integer, intent(in) :: nlev
52+
integer, intent(in) :: nswbands
53+
integer, intent(in) :: nlwbands
54+
integer, intent(in) :: numrh
55+
real(r8), intent(in) :: relh(:, :)
56+
real(r8), intent(in) :: sulfwtpct(:, :)
57+
complex(r8), intent(in) :: crefwsw(:)
58+
complex(r8), intent(in) :: crefwlw(:)
59+
real(r8), intent(in), optional, pointer :: geometric_radius(:, :)
6060

6161
class(aerosol_optics), pointer :: aero_optics
6262

@@ -90,8 +90,10 @@ function create_aerosol_optics_object(aeroprops, aerostate, ibin, &
9090

9191
case ('volcanic_radius', 'volcanic_radius1', 'volcanic_radius2', 'volcanic_radius3', 'volcanic_radius5')
9292
if (present(geometric_radius)) then
93-
aero_optics => volcrad_aerosol_optics(aeroprops, aerostate, &
94-
ibin, ncol, nlev, geometric_radius)
93+
if (associated(geometric_radius)) then
94+
aero_optics => volcrad_aerosol_optics(aeroprops, aerostate, &
95+
ibin, ncol, nlev, geometric_radius)
96+
end if
9597
end if
9698

9799
end select
@@ -132,7 +134,7 @@ subroutine aerosol_optics_sw_bin(aeroprops, aerostate, ibin, &
132134
real(r8), intent(in) :: mass(:, :) ! layer mass (pdeldry*rga)
133135
complex(r8), intent(in) :: crefwsw(:)
134136
complex(r8), intent(in) :: crefwlw(:)
135-
real(r8), intent(in), optional, target :: geometric_radius(:, :)
137+
real(r8), intent(in), optional, pointer :: geometric_radius(:, :)
136138

137139
real(r8), intent(out) :: tau_bin(:, :, :) ! (ncol,nlev,nswbands) extinction OD
138140
real(r8), intent(out) :: ssa_bin(:, :, :) ! (ncol,nlev,nswbands) single scatter albedo
@@ -360,7 +362,7 @@ subroutine aerosol_optics_lw_bin(aeroprops, aerostate, ibin, &
360362
real(r8), intent(in) :: mass(:, :)
361363
complex(r8), intent(in) :: crefwsw(:)
362364
complex(r8), intent(in) :: crefwlw(:)
363-
real(r8), intent(in), optional, target :: geometric_radius(:, :)
365+
real(r8), intent(in), optional, pointer :: geometric_radius(:, :)
364366
real(r8), intent(out) :: tau_lw_bin(:, :, :) ! (ncol,nlev,nlwbands) absorption OD
365367
real(r8), intent(out) :: absorp_bin(:, :, :) ! (ncol,nlev,nlwbands) raw specific absorption (pabs)
366368

src/aerosol/volcrad_aerosol_optics_mod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function constructor(aero_props, aero_state, ibin, ncols, nlevs, geometric_radiu
5454
class(aerosol_state), intent(in) :: aero_state ! aerosol_state object
5555
integer, intent(in) :: ibin ! bin number
5656
integer, intent(in) :: ncols, nlevs
57-
real(r8),intent(in) :: geometric_radius(ncols,nlevs)
57+
real(r8),intent(in) :: geometric_radius(:,:)
5858

5959
type(volcrad_aerosol_optics), pointer :: newobj
6060

0 commit comments

Comments
 (0)