Skip to content

Commit

Permalink
radiation statistics: fix clear-sky thl tendencies thlswtendca, thllw…
Browse files Browse the repository at this point in the history
…tendca

Convert swu, swd, etc fields to field_r precision, update radfull routine for this.
Also make 1d profile output of swu, swd, swuca, etc always positive.
  • Loading branch information
fjansson committed Nov 27, 2023
1 parent 8cdaccd commit bae8c0b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
8 changes: 4 additions & 4 deletions src/modraddata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ module modraddata
real mu !< cosine of the solar zenith angle

real(field_r), allocatable :: thlprad(:,:,:)!< the radiative tendencies
real, allocatable :: swd(:,:,:) !< shortwave downward radiative flux
real(field_r), allocatable :: swd(:,:,:) !< shortwave downward radiative flux
real(field_r), allocatable :: swdir(:,:,:) !< Direct shortwave downward radiative flux
real(field_r), allocatable :: swdif(:,:,:) !< Difuse shortwave downward radiative flux
real(field_r), allocatable :: lwc(:,:,:) !< Liquid water content calculated in rrtmg
real, allocatable :: swu(:,:,:) !< shortwave upward radiative flux
real, allocatable :: lwd(:,:,:) !< longwave downward radiative flux
real, allocatable :: lwu(:,:,:) !< longwave upward radiative flux
real(field_r), allocatable :: swu(:,:,:) !< shortwave upward radiative flux
real(field_r), allocatable :: lwd(:,:,:) !< longwave downward radiative flux
real(field_r), allocatable :: lwu(:,:,:) !< longwave upward radiative flux
!
real(field_r), allocatable :: swdca(:,:,:) !< clear air shortwave downward radiative flux
real(field_r), allocatable :: swuca(:,:,:) !< clear air shortwave upward radiative flux
Expand Down
3 changes: 2 additions & 1 deletion src/modradfull.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module modradfull

use RandomNumbers
use modglobal, only : pi
use modprecision, only: field_r
implicit none
private
public :: radfull,d4stream
Expand Down Expand Up @@ -207,7 +208,7 @@ subroutine d4stream(i1,ih,j1,jh,k1, tskin, albedo, CCN, dn0, &
real, dimension (2-ih:i1+ih,2-jh:j1+jh,k1), intent (in) :: tk, rv, rc
real, optional, dimension (2-ih:i1+ih,2-jh:j1+jh,k1), intent (in) :: rr
logical, optional, intent(in) :: lclear
real, dimension (2-ih:i1+ih,2-jh:j1+jh,k1), intent (out) :: fus3D,fds3D,fuir3D,fdir3D
real(field_r), dimension (2-ih:i1+ih,2-jh:j1+jh,k1), intent (out) :: fus3D,fds3D,fuir3D,fdir3D
real, dimension (1:i1+1,1:j1+1), intent (in) :: tskin, albedo

integer :: kk
Expand Down
36 changes: 18 additions & 18 deletions src/modradstat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ module modradstat
real(field_r), allocatable :: thlswtendav(:)
real(field_r), allocatable :: thllwtendcaav(:)
real(field_r), allocatable :: thlswtendcaav(:)
real, allocatable :: lwuav(:)
real, allocatable :: lwdav(:)
real, allocatable :: swdav(:)
real(field_r), allocatable :: lwuav(:)
real(field_r), allocatable :: lwdav(:)
real(field_r), allocatable :: swdav(:)
real(field_r), allocatable :: swdirav(:)
real(field_r), allocatable :: swdifav(:)
real, allocatable :: swuav(:)
real, allocatable :: lwucaav(:)
real, allocatable :: lwdcaav(:)
real, allocatable :: swdcaav(:)
real, allocatable :: swucaav(:)
real(field_r), allocatable :: swuav(:)
real(field_r), allocatable :: lwucaav(:)
real(field_r), allocatable :: lwdcaav(:)
real(field_r), allocatable :: swdcaav(:)
real(field_r), allocatable :: swucaav(:)

!
real, allocatable :: thltendmn(:)
Expand Down Expand Up @@ -307,10 +307,10 @@ subroutine radclearair
use modsurfdata, only : albedo, tskin, qskin, thvs, ps
use modmicrodata, only : Nc_0
use modmpi, only : slabsum
use modraddata, only: irad_full, iradiation
use modraddata, only: irad_full, iradiation, swdca,swuca,lwdca,lwuca
implicit none
real, dimension(k1) :: rhof_b, exnf_b
real, dimension(2-ih:i1+ih,2-jh:j1+jh,k1) :: temp_b, qv_b, ql_b,swdca,swuca,lwdca,lwuca
real, dimension(2-ih:i1+ih,2-jh:j1+jh,k1) :: temp_b, qv_b, ql_b
integer :: i,j,k

real :: exnersurf
Expand Down Expand Up @@ -466,14 +466,14 @@ subroutine writeradstat
vars(:, 2) = thllwtendmn
vars(:, 3) = thlswtendmn
vars(:, 4) = thlradlsmn
vars(:, 5) = lwumn
vars(:, 6) = lwdmn
vars(:, 7) = swumn
vars(:, 8) = swdmn
vars(:, 9) = lwucamn
vars(:,10) = lwdcamn
vars(:,11) = swucamn
vars(:,12) = swdcamn
vars(:, 5) = abs(lwumn)
vars(:, 6) = abs(lwdmn)
vars(:, 7) = abs(swumn)
vars(:, 8) = abs(swdmn)
vars(:, 9) = abs(lwucamn)
vars(:,10) = abs(lwdcamn)
vars(:,11) = abs(swucamn)
vars(:,12) = abs(swdcamn)
vars(:,13) = thllwtendcamn
vars(:,14) = thlswtendcamn

Expand Down

0 comments on commit bae8c0b

Please sign in to comment.