Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radiation lw/sw pre/post routine name changes, optional arguments #45

Merged
merged 2 commits into from
Feb 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions GFS_layer/GFS_radiation_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ module module_radiation_driver !
& profsw_type,cmpfsw_type,NBDSW
use rrtmg_sw, only: rswinit, rrtmg_sw_run

use GFS_RRTMG_pre, only: GFS_RRTMG_pre_run
use GFS_RRTMG_post, only: GFS_RRTMG_post_run
use GFS_radsw_pre, only: GFS_radsw_pre_run
use GFS_radsw_post, only: GFS_radsw_post_run
use GFS_radlw_pre, only: GFS_radlw_pre_run
use GFS_radlw_post, only: GFS_radlw_post_run
use GFS_rrtmg_pre, only: GFS_rrtmg_pre_run
use GFS_rrtmg_post, only: GFS_rrtmg_post_run
use rrtmg_sw_pre, only: rrtmg_sw_pre_run
use rrtmg_sw_post, only: rrtmg_sw_post_run
use rrtmg_lw_pre, only: rrtmg_lw_pre_run
use rrtmg_lw_post, only: rrtmg_lw_post_run
use module_radlw_parameters, only: topflw_type, sfcflw_type, &
& proflw_type, NBDLW
use rrtmg_lw, only: rlwinit, rrtmg_lw_run
Expand Down Expand Up @@ -1209,10 +1209,10 @@ subroutine GFS_radiation_driver &
type (cmpfsw_type), dimension(size(Grid%xlon,1)) :: scmpsw

! CCPP: L1211-1577
call GFS_RRTMG_pre_run (Model, Grid, Sfcprop, Statein, & ! input
call GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Tbd, Cldprop, Radtend, &
lm, im, lmk, lmp, kd, kt, kb, raddt, plvl, plyr, & ! output
tlvl, tlyr, tsfg, tsfa, qlyr,nday, idxday, olyr, &
tlvl, tlyr, tsfg, tsfa, qlyr, olyr, &
gasvmr(:,:,1), gasvmr(:,:,2), gasvmr(:,:,3), &
gasvmr(:,:,4), gasvmr(:,:,5), gasvmr(:,:,6), &
gasvmr(:,:,7), gasvmr(:,:,8), gasvmr(:,:,9), gasvmr(:,:,10), &
Expand All @@ -1228,35 +1228,37 @@ subroutine GFS_radiation_driver &
! Grid, Tbd, Cldprop, Radtend, Diag)
! *DH
! CCPP: L1582-1596
call GFS_radsw_pre_run (Model, Grid, Sfcprop, Radtend, im, &
tsfg, tsfa, sfcalb(:,1), sfcalb(:,2), sfcalb(:,3), &
sfcalb(:,4) )
call rrtmg_sw_pre_run (Model, Grid, Sfcprop, Radtend, im, &
nday, idxday, tsfg, tsfa, sfcalb(:,1), sfcalb(:,2), &
sfcalb(:,3), sfcalb(:,4) )

! DH*
!call GFS_diagtoscreen_run(Model, Statein, Stateout, Sfcprop, Coupling, &
! Grid, Tbd, Cldprop, Radtend, Diag)
! *DH
! CCPP: L1598-1618
call rrtmg_sw_run (plyr, plvl, tlyr, tlvl, qlyr, olyr, & ! input
gasvmr(:, :, 1), &
gasvmr(:, :, 2), gasvmr(:, :, 3), gasvmr(:, :, 4), &
Tbd%icsdsw, faersw(:, :, :, 1), faersw(:, :, :, 2), &
faersw(:, :, :, 3), sfcalb(:,1), sfcalb(:,2),sfcalb(:,3), &
sfcalb(:,4),Radtend%coszen, Model%solcon, nday, idxday, im, &
gasvmr(:,:,1), gasvmr(:,:,2), gasvmr(:,:,3), &
gasvmr(:,:,4), gasvmr(:,:,5), gasvmr(:,:,6), &
gasvmr(:,:,7), gasvmr(:,:,8), gasvmr(:,:,9), &
Tbd%icsdsw, &
faersw(:,:,:,1), faersw(:,:,:,2), faersw(:,:,:,3), &
sfcalb(:,1), sfcalb(:,2), sfcalb(:,3), sfcalb(:,4), &
Radtend%coszen, Model%solcon, nday, idxday, im, &
lmk, lmp, Model%lprnt, clouds(:,:,1), Model%lsswr, &
htswc, Diag%topfsw, Radtend%sfcfsw, & ! outputs
hsw0=htsw0, fdncmp=scmpsw, & ! optional outputs
cld_lwp=clouds(:, :, 2), cld_ref_liq=clouds(:, :, 3), & ! Optional input
cld_iwp=clouds(:, :, 4), cld_ref_ice=clouds(:, :, 5), &
cld_rwp=clouds(:, :, 6), cld_ref_rain=clouds(:, :, 7), &
cld_swp=clouds(:, :, 8), cld_ref_snow=clouds(:, :, 9))
htswc, Diag%topfsw, Radtend%sfcfsw, & ! output
hsw0=htsw0, fdncmp=scmpsw, & ! optional output
cld_lwp=clouds(:,:,2), cld_ref_liq=clouds(:,:,3), & ! optional input
cld_iwp=clouds(:,:,4), cld_ref_ice=clouds(:,:,5), &
cld_rwp=clouds(:,:,6), cld_ref_rain=clouds(:,:,7), &
cld_swp=clouds(:,:,8), cld_ref_snow=clouds(:,:,9))

! DH*
!call GFS_diagtoscreen_run(Model, Statein, Stateout, Sfcprop, Coupling, &
! Grid, Tbd, Cldprop, Radtend, Diag)
! *DH
!CCPP: L1620-1686
call GFS_radsw_post_run (Model, Grid, Diag, Radtend, Coupling, &
call rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, &
LTP, nday, lm, kd, htswc, htsw0, &
sfcalb(:,1), sfcalb(:,2), sfcalb(:,3), sfcalb(:,4), scmpsw)

Expand All @@ -1265,30 +1267,30 @@ subroutine GFS_radiation_driver &
! Grid, Tbd, Cldprop, Radtend, Diag)
! *DH
!CCPP: L1689-1698
call GFS_radlw_pre_run (Model, Grid, Sfcprop, Radtend, &
call rrtmg_lw_pre_run (Model, Grid, Sfcprop, Radtend, &
im, tsfg, tsfa)

!CCPP: L1703-1714
call rrtmg_lw_run (plyr, plvl, tlyr, tlvl, qlyr, olyr, & ! inputs
gasvmr(:, :, 1), gasvmr(:, :, 2), gasvmr(:, :, 3), &
gasvmr(:, :, 4), gasvmr(:, :, 5), gasvmr(:, :, 6), &
gasvmr(:, :, 7), gasvmr(:, :, 8), gasvmr(:, :, 9), &
call rrtmg_lw_run (plyr, plvl, tlyr, tlvl, qlyr, olyr, & ! input
gasvmr(:,:,1), gasvmr(:,:,2), gasvmr(:,:,3), &
gasvmr(:,:,4), gasvmr(:,:,5), gasvmr(:,:,6), &
gasvmr(:,:,7), gasvmr(:,:,8), gasvmr(:,:,9), &
Tbd%icsdlw, faerlw(:,:,:,1), faerlw(:,:,:,2), Radtend%semis, &
tsfg, im, lmk, lmp, Model%lprnt, clouds(:, :, 1), &
tsfg, im, lmk, lmp, Model%lprnt, clouds(:,:,1), &
Model%lslwr, &
htlwc, Diag%topflw, Radtend%sfcflw, & ! outputs
htlwc, Diag%topflw, Radtend%sfcflw, & ! output
hlw0=htlw0, & ! optional output
cld_lwp=clouds(:, :, 2), cld_ref_liq=clouds(:, :, 3), & ! optional input
cld_iwp=clouds(:, :, 4), cld_ref_ice=clouds(:, :, 5), &
cld_rwp=clouds(:, :, 6), cld_ref_rain=clouds(:, :, 7), &
cld_swp=clouds(:, :, 8), cld_ref_snow=clouds(:, :, 9))
cld_lwp=clouds(:,:,2), cld_ref_liq=clouds(:,:,3), & ! optional input
cld_iwp=clouds(:,:,4), cld_ref_ice=clouds(:,:,5), &
cld_rwp=clouds(:,:,6), cld_ref_rain=clouds(:,:,7), &
cld_swp=clouds(:,:,8), cld_ref_snow=clouds(:,:,9))

!CCPP: L1718-1747
call GFS_radlw_post_run (Model, Grid, Radtend, Coupling, &
call rrtmg_lw_post_run (Model, Grid, Radtend, Coupling, &
LTP, lm, kd, tsfa, htlwc, htlw0)

!CCPP: L1757-1841
call GFS_RRTMG_post_run (Model, Grid, Diag, Radtend, Statein, &
call GFS_rrtmg_post_run (Model, Grid, Diag, Radtend, Statein, &
Coupling, scmpsw, im, lm, LTP, kt, kb, kd, raddt, aerodp, &
cldsa, mtopa, mbota, clouds(:,:,1))

Expand Down
12 changes: 6 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ SRCS_F90 = \
./GFS_layer/GFS_abstraction_layer.F90 \
./GFS_layer/GFS_diagnostics.F90 \
./GFS_layer/GFS_driver.F90 \
./physics/GFS_RRTMG_pre.F90 \
./physics/GFS_RRTMG_post.F90 \
./physics/GFS_radsw_pre.F90 \
./physics/GFS_radsw_post.F90 \
./physics/GFS_radlw_pre.F90 \
./physics/GFS_radlw_post.F90 \
./physics/GFS_rrtmg_pre.F90 \
./physics/GFS_rrtmg_post.F90 \
./physics/rrtmg_sw_pre.F90 \
./physics/rrtmg_sw_post.F90 \
./physics/rrtmg_lw_pre.F90 \
./physics/rrtmg_lw_post.F90 \
$(GFS_PHYSICS_DRIVER) \
$(GFS_RADIATION_DRIVER) \
./GFS_layer/GFS_restart.F90 \
Expand Down
26 changes: 13 additions & 13 deletions physics/GFS_RRTMG_post.F90 → physics/GFS_rrtmg_post.F90
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
!>\file GFS_RRTMG_post.f90
!>\file GFS_rrtmg_post.f90
!! This file contains
module GFS_RRTMG_post
module GFS_rrtmg_post
contains

!>\defgroup GFS_RRTMG_post GFS RRTMG Scheme Post
!>\defgroup GFS_rrtmg_post GFS RRTMG Scheme Post
!! @{
!> \section arg_table_GFS_RRTMG_post_init Argument Table
!> \section arg_table_GFS_rrtmg_post_init Argument Table
!!
subroutine GFS_RRTMG_post_init ()
end subroutine GFS_RRTMG_post_init
subroutine GFS_rrtmg_post_init ()
end subroutine GFS_rrtmg_post_init

!> \section arg_table_GFS_RRTMG_post_run Argument Table
!> \section arg_table_GFS_rrtmg_post_run Argument Table
!! | local var name | longname | description | units | rank | type | kind | intent | optional |
!! |-------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-------------------------------|-----------|--------|----------|
!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
Expand All @@ -33,7 +33,7 @@ end subroutine GFS_RRTMG_post_init
!! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | in | F |
!! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | in | F |
!!
subroutine GFS_RRTMG_post_run (Model, Grid, Diag, Radtend, Statein, &
subroutine GFS_rrtmg_post_run (Model, Grid, Diag, Radtend, Statein, &
Coupling, scmpsw, im, lm, ltp, kt, kb, kd, raddt, aerodp, &
cldsa, mtopa, mbota, clouds1)

Expand Down Expand Up @@ -160,12 +160,12 @@ subroutine GFS_RRTMG_post_run (Model, Grid, Diag, Radtend, Statein, &
endif
endif ! end_if_lssav
!
end subroutine GFS_RRTMG_post_run
end subroutine GFS_rrtmg_post_run

!> \section arg_table_GFS_RRTMG_post_finalize Argument Table
!> \section arg_table_GFS_rrtmg_post_finalize Argument Table
!!
subroutine GFS_RRTMG_post_finalize ()
end subroutine GFS_RRTMG_post_finalize
subroutine GFS_rrtmg_post_finalize ()
end subroutine GFS_rrtmg_post_finalize

!! @}
end module GFS_RRTMG_post
end module GFS_rrtmg_post
51 changes: 17 additions & 34 deletions physics/GFS_RRTMG_pre.F90 → physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
!> \file GFS_RRTMG_pre.f90
!> \file GFS_rrtmg_pre.f90
!! This file contains
module GFS_RRTMG_pre
module GFS_rrtmg_pre

public GFS_RRTMG_pre_run
public GFS_rrtmg_pre_run

contains

!> \defgroup GFS_RRTMG_pre GFS RRTMG Scheme Pre
!> \defgroup GFS_rrtmg_pre GFS RRTMG Scheme Pre
!! @{
!! \section arg_table_GFS_RRTMG_pre_init Argument Table
!! \section arg_table_GFS_rrtmg_pre_init Argument Table
!!
subroutine GFS_RRTMG_pre_init ()
end subroutine GFS_RRTMG_pre_init
subroutine GFS_rrtmg_pre_init ()
end subroutine GFS_rrtmg_pre_init

!> \section arg_table_GFS_RRTMG_pre_run Argument Table
!> \section arg_table_GFS_rrtmg_pre_run Argument Table
!! | local var name | longname | description | units | rank | type | kind | intent | optional |
!! |-------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-------------------------------|-----------|--------|----------|
!! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
Expand All @@ -38,8 +38,6 @@ end subroutine GFS_RRTMG_pre_init
!! | tsfg | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | out | F |
!! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | out | F |
!! | qlyr | water_vapor_specific_humidity_at_layer_for_radiation | water vapor specific humidity at vertical layer for radiation calculation | kg kg-1 | 2 | real | kind_phys | out | F |
!! | nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | out | F |
!! | idxday | daytime_points | daytime points | index | 1 | integer | | out | F |
!! | olyr | ozone_concentration_at_layer_for_radiation | ozone concentration | kg kg-1 | 2 | real | kind_phys | out | F |
!! | gasvmr_co2 | volume_mixing_ratio_co2 | CO2 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F |
!! | gasvmr_n2o | volume_mixing_ratio_n2o | N2O volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F |
Expand Down Expand Up @@ -74,10 +72,10 @@ end subroutine GFS_RRTMG_pre_init
! DH* Attention - the output arguments lm, im, lmk, lmp should not be set
! here in the CCPP version - they are defined in the interstitial_create routine *DH
! DH* TODO add intent information for each variable (be careful with intent(out))!
subroutine GFS_RRTMG_pre_run (Model, Grid, Sfcprop, Statein, & ! input
subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Tbd, Cldprop, Radtend, &
lm, im, lmk, lmp, kd, kt, kb, raddt, plvl, plyr, & ! output
tlvl, tlyr, tsfg, tsfa, qlyr, nday, idxday, olyr, &
tlvl, tlyr, tsfg, tsfa, qlyr, olyr, &
gasvmr_co2, gasvmr_n2o, gasvmr_ch4, gasvmr_o2, &
gasvmr_co, gasvmr_cfc11, gasvmr_cfc12, &
gasvmr_cfc22, gasvmr_ccl4, gasvmr_cfc113, &
Expand Down Expand Up @@ -131,16 +129,13 @@ subroutine GFS_RRTMG_pre_run (Model, Grid, Sfcprop, Statein, & ! input
#ifdef CCPP
integer, intent(in) :: im, lm, lmk, lmp
integer :: me, nfxr, ntrac
! nday is intent(out)
integer :: i, j, k, k1, lv, itop, ibtc, nday, LP1, kd, &
integer :: i, j, k, k1, lv, itop, ibtc, LP1, kd, &
lla, llb, lya, lyb, kt, kb
#else
integer :: me, im, lm, nfxr, ntrac
! nday is intent(out)
integer :: i, j, k, k1, lv, itop, ibtc, nday, LP1, LMK, LMP, kd, &
integer :: i, j, k, k1, lv, itop, ibtc, LP1, LMK, LMP, kd, &
lla, llb, lya, lyb, kt, kb
#endif
integer, dimension(size(Grid%xlon,1)), intent(out) :: idxday
integer, dimension(size(Grid%xlon,1),3) :: mbota, mtopa

!--- REAL VARIABLES
Expand Down Expand Up @@ -424,18 +419,6 @@ subroutine GFS_RRTMG_pre_run (Model, Grid, Sfcprop, Statein, & ! input

endif ! end_if_ivflip

!> - Check for daytime points for SW radiation.

nday = 0
idxday = 0
do i = 1, IM
if (Radtend%coszen(i) >= 0.0001) then
nday = nday + 1
idxday(nday) = i
endif
enddo


!> - Call module_radiation_aerosols::setaer(),to setup aerosols
!! property profile for radiation.

Expand Down Expand Up @@ -615,14 +598,14 @@ subroutine GFS_RRTMG_pre_run (Model, Grid, Sfcprop, Statein, & ! input
enddo
enddo

end subroutine GFS_RRTMG_pre_run
end subroutine GFS_rrtmg_pre_run

!> \section arg_table_GFS_RRTMG_pre_finalize Argument Table
!> \section arg_table_GFS_rrtmg_pre_finalize Argument Table
!!
subroutine GFS_RRTMG_pre_finalize ()
end subroutine GFS_RRTMG_pre_finalize
subroutine GFS_rrtmg_pre_finalize ()
end subroutine GFS_rrtmg_pre_finalize

!! @}
end module GFS_RRTMG_pre
end module GFS_rrtmg_pre


Loading