@@ -21,6 +21,11 @@ module cloud_rad_props
2121
2222use cam_logfile, only: iulog
2323use cam_abortutils, only: endrun
24+ use rrtmgp_cloud_optics_setup, only: g_mu_ccpp = > g_mu, g_lambda_ccpp = > g_lambda, g_d_eff_ccpp = > g_d_eff
25+ use rrtmgp_cloud_optics_setup, only: abs_lw_liq_ccpp = > abs_lw_liq, abs_lw_ice_ccpp = > abs_lw_ice
26+ use rrtmgp_cloud_optics_setup, only: ext_sw_liq_ccpp = > ext_sw_liq, ext_sw_ice_ccpp = > ext_sw_ice
27+ use rrtmgp_cloud_optics_setup, only: ssa_sw_liq_ccpp = > ssa_sw_liq, ssa_sw_ice_ccpp = > ssa_sw_ice
28+ use rrtmgp_cloud_optics_setup, only: asm_sw_liq_ccpp = > asm_sw_liq, asm_sw_ice_ccpp = > asm_sw_ice
2429
2530
2631implicit none
@@ -78,9 +83,7 @@ module cloud_rad_props
7883contains
7984! ==============================================================================
8085
81- subroutine cloud_rad_props_init (abs_lw_liq_out , abs_lw_ice_out , ext_sw_liq_out , &
82- ssa_sw_liq_out , asm_sw_liq_out , ext_sw_ice_out , ssa_sw_ice_out , &
83- asm_sw_ice_out , g_mu_out , g_lambda_out , g_d_eff_out , tiny_out )
86+ subroutine cloud_rad_props_init (tiny_out )
8487 use netcdf
8588 use spmd_utils, only: masterproc
8689 use ioFileMod, only: getfil
@@ -90,18 +93,7 @@ subroutine cloud_rad_props_init(abs_lw_liq_out, abs_lw_ice_out, ext_sw_liq_out,
9093#if ( defined SPMD )
9194 use mpishorthand
9295#endif
93- real (r8 ), allocatable , intent (out ) :: abs_lw_liq_out(:,:,:)
94- real (r8 ), allocatable , intent (out ) :: ext_sw_liq_out(:,:,:)
95- real (r8 ), allocatable , intent (out ) :: asm_sw_liq_out(:,:,:)
96- real (r8 ), allocatable , intent (out ) :: ssa_sw_liq_out(:,:,:)
97- real (r8 ), allocatable , intent (out ) :: abs_lw_ice_out(:,:)
98- real (r8 ), allocatable , intent (out ) :: ext_sw_ice_out(:,:)
99- real (r8 ), allocatable , intent (out ) :: asm_sw_ice_out(:,:)
100- real (r8 ), allocatable , intent (out ) :: ssa_sw_ice_out(:,:)
101- real (r8 ), allocatable , intent (out ) :: g_mu_out(:)
102- real (r8 ), allocatable , intent (out ) :: g_lambda_out(:,:)
103- real (r8 ), allocatable , intent (out ) :: g_d_eff_out(:)
104- real (r8 ), intent (out ) :: tiny_out
96+ real (r8 ), intent (out ) :: tiny_out
10597
10698 character (len= 256 ) :: liquidfile
10799 character (len= 256 ) :: icefile
@@ -142,51 +134,52 @@ subroutine cloud_rad_props_init(abs_lw_liq_out, abs_lw_ice_out, ext_sw_liq_out,
142134 call cnst_get_ind(' CLDICE' , ixcldice)
143135 call cnst_get_ind(' CLDLIQ' , ixcldliq)
144136
145- call rrtmgp_cloud_optics_setup_init(liqopticsfile, iceopticsfile, abs_lw_liq, &
146- abs_lw_ice, ext_sw_liq, ext_sw_ice, ssa_sw_liq, ssa_sw_ice, asm_sw_liq, &
147- asm_sw_ice, g_lambda, g_mu, g_d_eff, errmsg, err)
137+ call rrtmgp_cloud_optics_setup_init(liqopticsfile, iceopticsfile, errmsg, err)
148138 if (err /= 0 ) then
149139 call endrun(sub// ' : ' // errmsg)
150140 end if
151141
142+ ! Set module-level variables
143+ ! Set output variables
144+ nmu = size (g_mu_ccpp)
145+ nlambda = size (g_lambda_ccpp, 2 )
146+ n_g_d = size (g_d_eff_ccpp)
147+ allocate (abs_lw_liq(nmu,nlambda,nlwbands), stat= ierr)
148+ call handle_allocate_error(ierr, sub, ' abs_lw_liq' )
149+ abs_lw_liq = abs_lw_liq_ccpp
150+ allocate (ext_sw_liq(nmu,nlambda,nswbands), stat= ierr)
151+ call handle_allocate_error(ierr, sub, ' ext_sw_liq' )
152+ ext_sw_liq = ext_sw_liq_ccpp
153+ allocate (ssa_sw_liq(nmu,nlambda,nswbands), stat= ierr)
154+ call handle_allocate_error(ierr, sub, ' ssa_sw_liq' )
155+ ssa_sw_liq = ssa_sw_liq_ccpp
156+ allocate (asm_sw_liq(nmu,nlambda,nswbands), stat= ierr)
157+ call handle_allocate_error(ierr, sub, ' asm_sw_liq' )
158+ asm_sw_liq = asm_sw_liq_ccpp
159+ allocate (abs_lw_ice(n_g_d,nlwbands), stat= ierr)
160+ call handle_allocate_error(ierr, sub, ' abs_lw_ice' )
161+ abs_lw_ice = abs_lw_ice_ccpp
162+ allocate (ext_sw_ice(n_g_d,nswbands), stat= ierr)
163+ call handle_allocate_error(ierr, sub, ' ext_sw_ice' )
164+ ext_sw_ice = ext_sw_ice_ccpp
165+ allocate (ssa_sw_ice(n_g_d,nswbands), stat= ierr)
166+ call handle_allocate_error(ierr, sub, ' ssa_sw_ice' )
167+ ssa_sw_ice = ssa_sw_ice_ccpp
168+ allocate (asm_sw_ice(n_g_d,nswbands), stat= ierr)
169+ call handle_allocate_error(ierr, sub, ' asm_sw_ice' )
170+ asm_sw_ice = asm_sw_ice_ccpp
171+ allocate (g_mu(nmu), stat= ierr)
172+ call handle_allocate_error(ierr, sub, ' g_mu' )
173+ g_mu = g_mu_ccpp
174+ allocate (g_lambda(nmu,nlambda), stat= ierr)
175+ call handle_allocate_error(ierr, sub, ' g_lambda' )
176+ g_lambda = g_lambda_ccpp
177+ allocate (g_d_eff(n_g_d), stat= ierr)
178+ call handle_allocate_error(ierr, sub, ' g_d_eff' )
179+ g_d_eff = g_d_eff_ccpp
180+
152181 ! Set output variables
153- nmu = size (g_mu)
154- nlambda = size (g_lambda, 2 )
155- n_g_d = size (g_d_eff)
156182 tiny_out = tiny
157- allocate (abs_lw_liq_out(nmu,nlambda,nlwbands), stat= ierr)
158- call handle_allocate_error(ierr, sub, ' abs_lw_liq_out' )
159- abs_lw_liq_out = abs_lw_liq
160- allocate (ext_sw_liq_out(nmu,nlambda,nswbands), stat= ierr)
161- call handle_allocate_error(ierr, sub, ' ext_sw_liq_out' )
162- ext_sw_liq_out = ext_sw_liq
163- allocate (ssa_sw_liq_out(nmu,nlambda,nswbands), stat= ierr)
164- call handle_allocate_error(ierr, sub, ' ssa_sw_liq_out' )
165- ssa_sw_liq_out = ssa_sw_liq
166- allocate (asm_sw_liq_out(nmu,nlambda,nswbands), stat= ierr)
167- call handle_allocate_error(ierr, sub, ' asm_sw_liq_out' )
168- asm_sw_liq_out = asm_sw_liq
169- allocate (abs_lw_ice_out(n_g_d,nlwbands), stat= ierr)
170- call handle_allocate_error(ierr, sub, ' abs_lw_ice_out' )
171- abs_lw_ice_out = abs_lw_ice
172- allocate (ext_sw_ice_out(n_g_d,nswbands), stat= ierr)
173- call handle_allocate_error(ierr, sub, ' ext_sw_ice_out' )
174- ext_sw_ice_out = ext_sw_ice
175- allocate (ssa_sw_ice_out(n_g_d,nswbands), stat= ierr)
176- call handle_allocate_error(ierr, sub, ' ssa_sw_ice_out' )
177- ssa_sw_ice_out = ssa_sw_ice
178- allocate (asm_sw_ice_out(n_g_d,nswbands), stat= ierr)
179- call handle_allocate_error(ierr, sub, ' asm_sw_ice_out' )
180- asm_sw_ice_out = asm_sw_ice
181- allocate (g_mu_out(nmu), stat= ierr)
182- call handle_allocate_error(ierr, sub, ' g_mu_out' )
183- g_mu_out = g_mu
184- allocate (g_lambda_out(nmu,nlambda), stat= ierr)
185- call handle_allocate_error(ierr, sub, ' g_lambda_out' )
186- g_lambda_out = g_lambda
187- allocate (g_d_eff_out(n_g_d), stat= ierr)
188- call handle_allocate_error(ierr, sub, ' g_d_eff_out' )
189- g_d_eff_out = g_d_eff
190183 return
191184
192185end subroutine cloud_rad_props_init
0 commit comments