Skip to content

Commit

Permalink
Getting closer...
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Sep 24, 2019
1 parent f5562ee commit 4b61376
Show file tree
Hide file tree
Showing 25 changed files with 312 additions and 342 deletions.
24 changes: 12 additions & 12 deletions physics/GFS_rrtmgp_lw_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
intent = in
optional = F
[fluxlwUP_allsky]
standard_name = lw_flux_profile_upward_allsky
standard_name = RRTMGP_lw_flux_profile_upward_allsky
long_name = RRTMGP upward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -69,7 +69,7 @@
intent = in
optional = F
[fluxlwDOWN_allsky]
standard_name = lw_flux_profile_downward_allsky
standard_name = RRTMGP_lw_flux_profile_downward_allsky
long_name = RRTMGP downward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -78,7 +78,7 @@
intent = in
optional = F
[fluxlwUP_clrsky]
standard_name = lw_flux_profile_upward_clrsky
standard_name = RRTMGP_lw_flux_profile_upward_clrsky
long_name = RRTMGP upward longwave clr-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -87,7 +87,7 @@
intent = in
optional = F
[fluxlwDOWN_clrsky]
standard_name = lw_flux_profile_downward_clrsky
standard_name = RRTMGP_lw_flux_profile_downward_clrsky
long_name = RRTMGP downward longwave clr-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -96,10 +96,10 @@
intent = in
optional = F
[hlwc]
standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step
long_name = longwave total sky heating rate
standard_name = RRTMGP_lw_heating_rate_all_sky
long_name = RRTMGP longwave all sky heating rate
units = K s-1
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = out
Expand All @@ -121,18 +121,18 @@
intent = inout
optional = F
[flxprf_lw]
standard_name = lw_fluxes
standard_name = RRTMGP_lw_fluxes
long_name = lw fluxes total sky / csk and up / down at levels
units = W m-2
dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation)
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = proflw_type
intent = inout
optional = T
[hlw0]
standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step
long_name = longwave clear sky heating rate
standard_name = RRTMGP_lw_heating_rate_clear_sky
long_name = RRTMGP longwave clear sky heating rate
units = K s-1
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
Expand Down
6 changes: 3 additions & 3 deletions physics/GFS_rrtmgp_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end subroutine GFS_rrtmgp_post_init
!! \htmlinclude GFS_rrtmgp_post.html
!!
subroutine GFS_rrtmgp_post_run (Model, Grid, Diag, Radtend, Statein, Coupling, scmpsw, &
ncol, raddt, aerodp, cldsa, mtopa, mbota, cloud_fraction, cldtaulw, cldtausw, &
ncol, raddt, aerodp, cldsa, mtopa, mbota, cld_frac, cldtaulw, cldtausw, &
errmsg, errflg)

! Inputs
Expand Down Expand Up @@ -54,7 +54,7 @@ subroutine GFS_rrtmgp_post_run (Model, Grid, Diag, Radtend, Statein, Coupling, s
mbota, & ! vertical indices for low, middle and high cloud tops
mtopa ! vertical indices for low, middle and high cloud bases
real(kind_phys), dimension(ncol,Model%levs), intent(in) :: &
cloud_fraction, & ! Total cloud fraction in each layer
cld_frac, & ! Total cloud fraction in each layer
cldtausw, & ! approx .55mu band layer cloud optical depth
cldtaulw ! approx 10.mu band layer cloud optical depth
! Inputs (optional)
Expand Down Expand Up @@ -186,7 +186,7 @@ subroutine GFS_rrtmgp_post_run (Model, Grid, Diag, Radtend, Statein, Coupling, s
! if (.not. Model%uni_cld) then
if (Model%lgocart .or. Model%ldiag3d) then
do k = 1, Model%levs
Coupling%cldcovi(1:ncol,k) = cloud_fraction(1:ncol,k)
Coupling%cldcovi(1:ncol,k) = cld_frac(1:ncol,k)
enddo
endif
endif ! end_if_lssav
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rrtmgp_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
type = integer
intent = in
optional = F
[cloud_fraction]
standard_name = total_cloud_fraction
[cld_frac]
standard_name = RRTMGP_total_cloud_fraction
long_name = layer total cloud fraction
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = in
Expand All @@ -126,7 +126,7 @@
standard_name = RRTMGP_cloud_optical_depth_layers_at_10mu_band
long_name = approx 10mu band layer cloud optical depth
units = none
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = in
Expand Down
24 changes: 12 additions & 12 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ end subroutine GFS_rrtmgp_pre_init
subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop, Tbd, & ! IN
ncol, lw_gas_props, sw_gas_props, & ! IN
raddt, p_lay, t_lay, p_lev, t_lev, tsfg, tsfa, alb1d, cld_frac, cld_lwp, & ! OUT
cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, cld_rerain, faerlw, & ! OUT
faersw, cldsa, mtopa, mbota, de_lgth, aerodp, nday, idxday, gas_concentrations, errmsg, errflg)
cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, cld_rerain, aerosolslw, & ! OUT
aerosolssw, cldsa, mtopa, mbota, de_lgth, aerodp, nday, idxday, gas_concentrations, errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Expand Down Expand Up @@ -133,9 +133,9 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,
cld_rwp, & ! Cloud rain water path
cld_rerain ! Cloud rain effective radius
real(kind_phys), dimension(ncol,Model%levs,sw_gas_props%get_nband(),NF_AESW), intent(out) ::&
faersw ! Aerosol radiative properties in each SW band.
aerosolssw ! Aerosol radiative properties in each SW band.
real(kind_phys), dimension(ncol,Model%levs,lw_gas_props%get_nband(),NF_AELW), intent(out) ::&
faerlw ! Aerosol radiative properties in each LW band.
aerosolslw ! Aerosol radiative properties in each LW band.
integer,dimension(ncol,3),intent(out) :: &
mbota, & ! Vertical indices for cloud tops
mtopa ! Vertical indices for cloud bases
Expand All @@ -157,7 +157,7 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,
real(kind_phys), dimension(ncol, Model%levs, 2:Model%ntrac) :: tracer
real(kind_phys), dimension(ncol, Model%levs, NF_VGAS) :: gas_vmr
real(kind_phys), dimension(ncol, Model%levs, NF_CLDS) :: clouds
real(kind_phys), dimension(ncol, Model%levs, sw_gas_props%get_nband(), NF_AESW)::faersw2
real(kind_phys), dimension(ncol, Model%levs, sw_gas_props%get_nband(), NF_AESW)::aerosolssw2

! Initialize CCPP error handling variables
errmsg = ''
Expand Down Expand Up @@ -283,18 +283,18 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,
! #######################################################################################
call setaer(p_lev, p_lay, Statein%prslk(1:NCOL,iSFC:iTOA), tv_lay, relhum, &
Sfcprop%slmsk, tracer, Grid%xlon, Grid%xlat, NCOL, Model%levs, Model%levs+1, &
Model%lsswr, Model%lslwr, faersw2, faerlw, aerodp)
Model%lsswr, Model%lslwr, aerosolssw2, aerosolslw, aerodp)

! Store aerosol optical properties
! SW.
! For RRTMGP SW the bands are now ordered from [IR(band) -> nIR -> UV], in RRTMG the
! band ordering was [nIR -> UV -> IR(band)]
faersw(1:NCOL,1:Model%levs,1,1) = faersw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),1)
faersw(1:NCOL,1:Model%levs,1,2) = faersw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),2)
faersw(1:NCOL,1:Model%levs,1,3) = faersw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),3)
faersw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),1) = faersw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,1)
faersw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),2) = faersw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,2)
faersw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),3) = faersw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,3)
aerosolssw(1:NCOL,1:Model%levs,1,1) = aerosolssw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),1)
aerosolssw(1:NCOL,1:Model%levs,1,2) = aerosolssw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),2)
aerosolssw(1:NCOL,1:Model%levs,1,3) = aerosolssw2(1:NCOL,1:Model%levs,sw_gas_props%get_nband(),3)
aerosolssw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),1) = aerosolssw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,1)
aerosolssw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),2) = aerosolssw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,2)
aerosolssw(1:NCOL,1:Model%levs,2:sw_gas_props%get_nband(),3) = aerosolssw2(1:NCOL,1:Model%levs,1:sw_gas_props%get_nband()-1,3)

! Setup surface ground temperature and ground/air skin temperature if required.
tsfg(1:NCOL) = Sfcprop%tsfc(1:NCOL)
Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_rrtmgp_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
kind = kind_phys
intent = out
optional = F
[faerlw]
[aerosolslw]
standard_name = RRTMGP_aerosol_optical_properties_for_longwave_bands_01_16
long_name = aerosol optical properties for longwave bands 01-16
units = various
Expand All @@ -234,7 +234,7 @@
kind = kind_phys
intent = out
optional = F
[faersw]
[aerosolssw]
standard_name = RRTMGP_aerosol_optical_properties_for_shortwave_bands_01_16
long_name = aerosol optical properties for shortwave bands 01-16
units = various
Expand Down
26 changes: 13 additions & 13 deletions physics/GFS_rrtmgp_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subroutine GFS_rrtmgp_setup_init ( &
icliq_sw, crick_proof, ccnorm, &
imp_physics, &
norad_precip, idate, iflip, &
im, faerlw, faersw, aerodp, & ! for consistency checks
im, aerosolslw, aerosolssw, aerodp, & ! for consistency checks
me, errmsg, errflg)
! ================= subprogram documentation block ================ !
! !
Expand Down Expand Up @@ -185,17 +185,17 @@ subroutine GFS_rrtmgp_setup_init ( &
integer, intent(in) :: iflip
! For consistency checks
integer, intent(in) :: im
real(kind_phys), intent(in) :: faerlw(:,:,:,:)
real(kind_phys), intent(in) :: faersw(:,:,:,:)
real(kind_phys), intent(in) :: aerosolslw(:,:,:,:)
real(kind_phys), intent(in) :: aerosolssw(:,:,:,:)
real(kind_phys), intent(in) :: aerodp(:,:)
! End for consistency checks
integer, intent(in) :: me
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

! For consistency checks
real(kind_phys), dimension(im,levr,NBDLW,NF_AELW) :: faerlw_check
real(kind_phys), dimension(im,levr,NBDSW,NF_AESW) :: faersw_check
real(kind_phys), dimension(im,levr,NBDLW,NF_AELW) :: aerosolslw_check
real(kind_phys), dimension(im,levr,NBDSW,NF_AESW) :: aerosolssw_check
real(kind_phys), dimension(im,NSPC1) :: aerodp_check
! End for consistency checks

Expand All @@ -208,21 +208,21 @@ subroutine GFS_rrtmgp_setup_init ( &
! Consistency checks for dimensions of arrays, this is required
! to detect differences in FV3's parameters that are used to
! dimension certain arrays and the values in ccpp-physics
if (size(faerlw(1,:,:,:)).ne.size(faerlw_check(1,:,:,:))) then
if (size(aerosolslw(1,:,:,:)).ne.size(aerosolslw_check(1,:,:,:))) then
write(errmsg,"(3a,4i4,a,4i4)") &
"Runtime error: dimension mismatch for faerlw,", &
"Runtime error: dimension mismatch for aerosolslw,", &
" check definitions of Model%levs, nbdlw, nf_aelw:", &
" expected shape ", shape(faerlw_check(:,:,:,:)), &
" but got ", shape(faerlw(:,:,:,:))
" expected shape ", shape(aerosolslw_check(:,:,:,:)), &
" but got ", shape(aerosolslw(:,:,:,:))
errflg = 1
return
end if
if (size(faersw(1,:,:,:)).ne.size(faersw_check(1,:,:,:))) then
if (size(aerosolssw(1,:,:,:)).ne.size(aerosolssw_check(1,:,:,:))) then
write(errmsg,"(3a,4i4,a,4i4)") &
"Runtime error: dimension mismatch for faersw,", &
"Runtime error: dimension mismatch for aerosolssw,", &
" check definitions of Model%levs, nbdsw, nf_aesw:", &
" expected shape ", shape(faersw_check(:,:,:,:)), &
" but got ", shape(faersw(:,:,:,:))
" expected shape ", shape(aerosolssw_check(:,:,:,:)), &
" but got ", shape(aerosolssw(:,:,:,:))
errflg = 1
return
end if
Expand Down
18 changes: 9 additions & 9 deletions physics/GFS_rrtmgp_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,24 @@
type = integer
intent = in
optional = F
[faerlw]
standard_name = aerosol_optical_properties_for_longwave_bands_01_16
long_name = optical properties for longwave bands 01-16
[aerosolssw]
standard_name = RRTMGP_aerosol_optical_properties_for_shortwave_bands_01_16
long_name = aerosol optical properties for shortwave bands 01-16
units = various
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation,number_of_aerosol_output_fields_for_longwave_radiation)
dimensions = (horizontal_dimension,vertical_dimension_plus_one, number_of_sw_bands_rrtmgp, number_of_aerosol_output_fields_for_shortwave_radiation)
type = real
kind = kind_phys
intent = in
optional = F
[faersw]
standard_name = aerosol_optical_properties_for_shortwave_bands_01_16
long_name = aerosol optical properties for shortwave bands 01-16
[aerosolslw]
standard_name = RRTMGP_aerosol_optical_properties_for_longwave_bands_01_16
long_name = aerosol optical properties for longwave bands 01-16
units = various
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation,number_of_aerosol_output_fields_for_shortwave_radiation)
dimensions = (horizontal_dimension,vertical_dimension_plus_one, number_of_lw_bands_rrtmgp,number_of_aerosol_output_fields_for_longwave_radiation)
type = real
kind = kind_phys
intent = in
optional = F
intent = in
[aerodp]
standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles
long_name = vertical integrated optical depth for various aerosol species
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_rrtmgp_sw_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ subroutine GFS_rrtmgp_sw_post_run (Model, Grid, Diag, Radtend, Coupling, &
Model ! Fortran DDT containing FV3-GFS model control parameters
type(GFS_grid_type), intent(in) :: &
Grid ! Fortran DDT containing FV3-GFS grid and interpolation related data
type(GFS_coupling_type), intent(inout) :: &
type(GFS_coupling_type), intent(inout) :: &
Coupling ! Fortran DDT containing FV3-GFS fields to/from coupling with other components
type(GFS_radtend_type), intent(inout) :: &
Radtend ! Fortran DDT containing FV3-GFS radiation tendencies
Expand Down
24 changes: 12 additions & 12 deletions physics/GFS_rrtmgp_sw_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
intent = in
optional = F
[fluxswUP_allsky]
standard_name = sw_flux_profile_upward_allsky
standard_name = RRTMGP_sw_flux_profile_upward_allsky
long_name = RRTMGP upward shortwave all-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -92,7 +92,7 @@
intent = in
optional = F
[fluxswDOWN_allsky]
standard_name = sw_flux_profile_downward_allsky
standard_name = RRTMGP_sw_flux_profile_downward_allsky
long_name = RRTMGP downward shortwave all-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -101,7 +101,7 @@
intent = in
optional = F
[fluxswUP_clrsky]
standard_name = sw_flux_profile_upward_clrsky
standard_name = RRTMGP_sw_flux_profile_upward_clrsky
long_name = RRTMGP upward shortwave clr-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -110,7 +110,7 @@
intent = in
optional = F
[fluxswDOWN_clrsky]
standard_name = sw_flux_profile_downward_clrsky
standard_name = RRTMGP_sw_flux_profile_downward_clrsky
long_name = RRTMGP downward shortwave clr-sky flux profile
units = W m-2
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
Expand All @@ -127,14 +127,14 @@
intent = in
optional = F
[hswc]
standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step
long_name = shortwave total sky heating rate
standard_name = RRTMGP_sw_heating_rate_all_sky
long_name = RRTMGP shortwave all sky heating rate
units = K s-1
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = out
optional = F
intent = out
[topflx_sw]
standard_name = sw_fluxes_top_atmosphere
long_name = shortwave total sky fluxes at the top of the atm
Expand All @@ -152,16 +152,16 @@
intent = inout
optional = F
[flxprf_sw]
standard_name = sw_fluxes
standard_name = RRTMGP_sw_fluxes
long_name = sw fluxes total sky / csk and up / down at levels
units = W m-2
dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation)
dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_plus_one)
type = profsw_type
intent = inout
optional = T
[hsw0]
standard_name = sw_heating_rate_clear_sky
long_name = shortwave clear sky heating rate
standard_name = RRTMGP_sw_heating_rate_clear_sky
long_name = RRTMGP shortwave clear sky heating rate
units = K s-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
Expand Down
Loading

0 comments on commit 4b61376

Please sign in to comment.