Skip to content

Commit

Permalink
Merge pull request #733 from dustinswales/hotfix_gpflxadj
Browse files Browse the repository at this point in the history
Bugfixes for RRTMGP
  • Loading branch information
climbfuji authored Oct 7, 2021
2 parents 2ececb0 + 2f8c13f commit 3423a13
Show file tree
Hide file tree
Showing 24 changed files with 241 additions and 195 deletions.
8 changes: 4 additions & 4 deletions physics/GFS_cloud_diagnostics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
Expand All @@ -75,9 +75,9 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rrtmgp_cloud_overlap_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@
kind = kind_phys
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rrtmgp_gfdlmp_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_rrtmgp_lw_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure level
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
Expand Down
25 changes: 21 additions & 4 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ end subroutine GFS_rrtmgp_pre_init
!!
subroutine GFS_rrtmgp_pre_run(nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhswr, fhlwr, &
xlat, xlon, prsl, tgrs, prslk, prsi, qgrs, tsfc, con_eps, con_epsm1, con_fvirt, &
con_epsqs, minGPpres, minGPtemp, raddt, p_lay, t_lay, p_lev, t_lev, tsfg, tsfa, &
qs_lay, q_lay, tv_lay, relhum, tracer, gas_concentrations, errmsg, errflg)
con_epsqs, minGPpres, maxGPpres, minGPtemp, maxGPtemp, raddt, p_lay, t_lay, p_lev, &
t_lev, tsfg, tsfa, qs_lay, q_lay, tv_lay, relhum, tracer, gas_concentrations, &
tsfc_radtime, errmsg, errflg)

! Inputs
integer, intent(in) :: &
Expand All @@ -112,7 +113,9 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhswr, f
lslwr ! Call LW radiation
real(kind_phys), intent(in) :: &
minGPtemp, & ! Minimum temperature allowed in RRTMGP.
maxGPtemp, & ! Maximum ...
minGPpres, & ! Minimum pressure allowed in RRTMGP.
maxGPpres, & ! Maximum pressure allowed in RRTMGP.
fhswr, & ! Frequency of SW radiation call.
fhlwr ! Frequency of LW radiation call.
real(kind_phys), intent(in) :: &
Expand Down Expand Up @@ -142,7 +145,8 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhswr, f
raddt ! Radiation time-step
real(kind_phys), dimension(ncol), intent(inout) :: &
tsfg, & ! Ground temperature
tsfa ! Skin temperature
tsfa, & ! Skin temperature
tsfc_radtime ! Surface temperature at radiation timestep
real(kind_phys), dimension(nCol,nLev), intent(inout) :: &
p_lay, & ! Pressure at model-layer
t_lay, & ! Temperature at model layer
Expand Down Expand Up @@ -202,18 +206,31 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nTracers, i_o3, lsswr, lslwr, fhswr, f
! Temperature at layer-center
t_lay(1:NCOL,:) = tgrs(1:NCOL,:)

! Bound temperature at layer centers.
! Bound temperature/pressure at layer centers.
do iCol=1,NCOL
do iLay=1,nLev
if (t_lay(iCol,iLay) .le. minGPtemp) then
t_lay(iCol,iLay) = minGPtemp + epsilon(minGPtemp)
endif
if (p_lay(iCol,iLay) .le. minGPpres) then
p_lay(iCol,iLay) = minGPpres + epsilon(minGPpres)
endif
if (t_lay(iCol,iLay) .ge. maxGPtemp) then
t_lay(iCol,iLay) = maxGPtemp - epsilon(maxGPtemp)
endif
if (p_lay(iCol,iLay) .ge. maxGPpres) then
p_lay(iCol,iLay) = maxGPpres - epsilon(maxGPpres)
endif
enddo
enddo

! Temperature at layer-interfaces
call cmp_tlev(nCol,nLev,minGPpres,p_lay,t_lay,p_lev,tsfc,t_lev)

! Save surface temperature at radiation time-step, used for LW flux adjustment betwen
! radiation calls.
tsfc_radtime = tsfc

! Compute a bunch of thermodynamic fields needed by the cloud microphysics schemes.
! Relative humidity, saturation mixing-ratio, vapor mixing-ratio, virtual temperature,
! layer thickness,...
Expand Down
35 changes: 31 additions & 4 deletions physics/GFS_rrtmgp_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@
kind = kind_phys
intent = in
optional = F
[maxGPpres]
standard_name = maximum_pressure_in_RRTMGP
long_name = maximum pressure allowed in RRTMGP
units = Pa
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[minGPtemp]
standard_name = minimum_temperature_in_RRTMGP
long_name = minimum temperature allowed in RRTMGP
Expand All @@ -239,6 +248,15 @@
kind = kind_phys
intent = in
optional = F
[maxGPtemp]
standard_name = maximum_temperature_in_RRTMGP
long_name = maximum temperature allowed in RRTMGP
units = K
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[raddt]
standard_name = time_step_for_radiation
long_name = radiation time step
Expand All @@ -249,18 +267,18 @@
intent = inout
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
Expand All @@ -284,6 +302,15 @@
kind = kind_phys
intent = inout
optional = F
[tsfc_radtime]
standard_name = surface_skin_temperature_on_radiation_timestep
long_name = surface skin temperature on radiation timestep
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = F
[tsfg]
standard_name = surface_ground_temperature_for_radiation
long_name = surface ground temperature for radiation
Expand Down
4 changes: 2 additions & 2 deletions physics/GFS_rrtmgp_sw_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure level
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rrtmgp_thompsonmp_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_rrtmgp_zhaocarr_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@
intent = in
optional = F
[p_lev]
standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa
standard_name = air_pressure_at_interface_for_RRTMGP
long_name = air pressure at vertical interface for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
standard_name = air_pressure_at_layer_for_RRTMGP
long_name = air pressure at vertical layer for radiation calculation
units = hPa
units = Pa
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
Expand Down
14 changes: 6 additions & 8 deletions physics/GFS_suite_interstitial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_
enddo

! --- ... sfc lw fluxes used by atmospheric model are saved for output
if (.not. use_LW_jacobian) then
if (frac_grid) then
do i=1,im
if (frac_grid) then
do i=1,im
tem = (one - frland(i)) * cice(i) ! tem = ice fraction wrt whole cell
if (flag_cice(i)) then
adjsfculw(i) = adjsfculw_lnd(i) * frland(i) &
Expand All @@ -247,9 +246,9 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_
+ adjsfculw_ice(i) * tem &
+ adjsfculw_wat(i) * (one - frland(i) - tem)
endif
enddo
else
do i=1,im
enddo
else
do i=1,im
if (dry(i)) then ! all land
adjsfculw(i) = adjsfculw_lnd(i)
elseif (icy(i)) then ! ice (and water)
Expand All @@ -270,8 +269,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_
else ! all water
adjsfculw(i) = adjsfculw_wat(i)
endif
enddo
endif
enddo
endif

do i=1,im
Expand Down
Loading

0 comments on commit 3423a13

Please sign in to comment.