Skip to content

Commit

Permalink
fixed treatment of longwave radiation from file
Browse files Browse the repository at this point in the history
  • Loading branch information
bolding committed Jan 27, 2021
1 parent 3b04bff commit 22dd709
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
30 changes: 15 additions & 15 deletions src/airsea/airsea.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ module airsea_driver
!
! surface shortwave radiation
! and surface heat flux (W/m^2)
type (type_scalar_input), public, target :: I_0, ql
type (type_scalar_input), public, target :: I_0
REALTYPE, public, target :: albedo
type (type_scalar_input), public, target :: heat
REALTYPE, public :: qe,qh
type (type_scalar_input), public, target :: heat, ql_
REALTYPE, public :: qe,qh,ql

! surface stress components (Pa)
REALTYPE, public, target :: tx,ty
Expand Down Expand Up @@ -340,7 +340,7 @@ subroutine init_airsea_nml(namlst)
call tx_%configure(method=momentum_method, path=momentumflux_file, index=1, constant_value=const_tx)
call ty_%configure(method=momentum_method, path=momentumflux_file, index=2, constant_value=const_ty)
call heat%configure(method=heat_method, path=heatflux_file, index=1, scale_factor=shf_factor, constant_value=const_heat)
call ql%configure(method=back_radiation_method, path=back_radiation_file, index=1)
call ql_%configure(method=back_radiation_method, path=back_radiation_file, index=1)
call sst_obs%configure(method=sst_method, path=sst_file, index=1)
call sss%configure(method=sss_method, path=sss_file, index=1)
call precip%configure(method=precip_method, path=precip_file, index=1, scale_factor=precip_factor, constant_value=const_precip)
Expand Down Expand Up @@ -496,7 +496,7 @@ subroutine init_airsea_yaml()
call twig%get(ssuv_method, 'ssuv_method', 'wind treatment', &
options=(/option(0, 'use absolute wind speed'), option(1, 'use wind speed relative to current velocity')/), default=1, display=display_advanced)

call branch%get(ql, 'longwave_radiation', 'longwave radiation', 'W/m^2', &
call branch%get(ql_, 'longwave_radiation', 'longwave radiation', 'W/m^2', &
default=0._rk, method_file=0, method_constant=method_unsupported, &
extra_options=(/option(1, 'Clark'), option(2, 'Hastenrath'), option(3, 'Bignami'), option(4, 'Berliand'), option(5, 'Josey-1'), option(6, 'Josey-2')/), default_method=1, pchild=leaf)
call leaf%get(longwave_type, 'type', 'longwave type from file', &
Expand Down Expand Up @@ -693,9 +693,9 @@ subroutine post_init_airsea(lat,lon)
case default
end select
LEVEL3 'longwave radiation:'
select case (ql%method)
select case (ql_%method)
case(0) ! Read from file instead of calculating
call register_input(ql)
call register_input(ql_)
case(1)
LEVEL4 'using Clark formulation'
case(2)
Expand Down Expand Up @@ -762,10 +762,10 @@ subroutine surface_fluxes(surface_temp,sensible,latent,longwave_radiation)
latent = qe
#if 1
if (qe .lt. _ZERO_) then
STDERR 'Stefan# ',qh/qe
!KB STDERR 'Stefan# ',qh/qe
end if
#endif
longwave_radiation = ql%value
longwave_radiation = ql
return
end subroutine surface_fluxes
!EOC
Expand Down Expand Up @@ -987,8 +987,8 @@ subroutine flux_from_meteo(jul,secs)
cloud1 = cloud2

call humidity(hum_method,hum,airp,tw,ta)
call longwave_radiation(ql%method,longwave_type, &
dlat,tw_k,ta_k,cloud,ql%value)
call longwave_radiation(ql_%method,longwave_type, &
dlat,tw_k,ta_k,cloud,ql_%value,ql)
end if
#if 0
call airsea_fluxes(fluxes_method,rain_impact,calc_evaporation, &
Expand All @@ -997,7 +997,7 @@ subroutine flux_from_meteo(jul,secs)
call airsea_fluxes(fluxes_method, &
tw,ta,u10%value-ssu,v10%value-ssv,precip%value,evap,tx2,ty2,qe,qh)
#endif
h2 = ql%value+qe+qh
h2 = ql+qe+qh
cloud2 = cloud%value

if (init_saved_vars) then
Expand Down Expand Up @@ -1038,11 +1038,11 @@ subroutine flux_from_meteo(jul,secs)
end if

call humidity(hum_method,hum%value,airp%value,tw,ta)
call longwave_radiation(ql%method,longwave_type, &
dlat,tw_k,ta_k,cloud%value,ql%value)
call longwave_radiation(ql_%method,longwave_type, &
dlat,tw_k,ta_k,cloud%value,ql_%value,ql)
call airsea_fluxes(fluxes_method, &
tw,ta,u10%value-ssu,v10%value-ssv,precip%value,evap,tx_%value,ty_%value,qe,qh)
heat%value = (ql%value+qe+qh)
heat%value = (ql+qe+qh)
#endif

w = sqrt((u10%value-ssu)*(u10%value-ssu)+(v10%value-ssv)*(v10%value-ssv))
Expand Down
7 changes: 4 additions & 3 deletions src/airsea/longwave_radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
! !ROUTINE: Calculate the net longwave radiation \label{sec:back-rad}
!
! !INTERFACE:
subroutine longwave_radiation(method,type,dlat,tw,ta,cloud,ql)
subroutine longwave_radiation(method,type,dlat,tw,ta,cloud,qlobs,ql)
!
! !DESCRIPTION:
!
Expand All @@ -28,7 +28,7 @@ subroutine longwave_radiation(method,type,dlat,tw,ta,cloud,ql)
!
! !INPUT PARAMETERS:
integer, intent(in) :: method,type
REALTYPE, intent(in) :: dlat,tw,ta,cloud
REALTYPE, intent(in) :: dlat,tw,ta,cloud,qlobs
!
! !OUTPUT PARAMETERS:
REALTYPE, intent(inout) :: ql
Expand Down Expand Up @@ -79,8 +79,9 @@ subroutine longwave_radiation(method,type,dlat,tw,ta,cloud,ql)
case(from_file)
select case(type)
case(1)
ql=qlobs
case(2)
ql = ql-bolz*emiss*(tw**4)
ql = qlobs-bolz*emiss*(tw**4)
end select
case(clark)
! Clark et al. (1974) formula.
Expand Down
3 changes: 2 additions & 1 deletion src/gotm/register_all_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ subroutine register_airsea_variables(nlev)
call fm%register('I_0', 'W/m2', 'incoming short wave radiation', standard_name='', data0d=I_0%value, category='surface/heat_fluxes')
call fm%register('qh', 'W/m2', 'sensible heat flux', standard_name='', data0d=qh, category='surface/heat_fluxes')
call fm%register('qe', 'W/m2', 'latent heat flux', standard_name='', data0d=qe, category='surface/heat_fluxes')
call fm%register('ql', 'W/m2', 'net longwave radiation', standard_name='', data0d=ql%value, category='surface/heat_fluxes')
call fm%register('ql', 'W/m2', 'net longwave radiation', standard_name='', data0d=ql, category='surface/heat_fluxes')
call fm%register('qlobs', 'W/m2', 'longwave radiation (obs)', standard_name='', data0d=ql_%value, category='surface/heat_fluxes')
call fm%register('heat', 'W/m2', 'net surface heat flux', standard_name='', data0d=heat%value, category='surface/heat_fluxes')
call fm%register('tx', 'm2/s2', 'wind stress (x)', standard_name='', data0d=tx, category='surface')
call fm%register('ty', 'm2/s2', 'wind stress (y)', standard_name='', data0d=ty, category='surface')
Expand Down

0 comments on commit 22dd709

Please sign in to comment.