Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Error while making changes in subroutine of module_sf_bem.F

I wanted to add a new term in this parameterization.

subroutine hsfluxpv(nz,n,bl,bw,albr,rs,swddif,emr,rl,tr,tair,sigma,hspv,eppv,pv_frac_roof,uout,vout,tpv,dt)
!
implicit none
!
! Input variables
!
integer,intent(in) :: nz !Maximum number of vertical levels in the urban grid
real,intent(in) :: bl !Building length [m]
real,intent(in) :: bw !Building width [m]
real,intent(in) :: albr !albedo of the roof (ext.)
real,intent(in) :: emr !emissivity of the roof (ext.)
real,intent(in) :: rs !external short wave radiation [W/m2]
real,intent(in) :: rl !external long wave radiation [W/m2]
real,intent(in) :: tr !roof surface temperature [K]
real,intent(in) :: pv_frac_roof ! fraction of PV []
real,intent(in) :: sigma !Stefan-Boltzmann constant [W/m2.K4]
real,intent(in),dimension(1:nz) :: tair !external temperature [K]
integer,intent(in) :: n !number of floors in the building
real,intent(in), dimension(1:nz) :: uout
real,intent(in), dimension(1:nz) :: vout
real,intent(in) :: dt
real,intent(in) :: swddif

! Output variables
!
real,intent(inout) :: hspv ! Sensible heat flux from the PV panels to the atmosphere [W/m2]
real,intent(inout) :: eppv ! Electricity production from PV panels [W]
real,intent(inout) :: tpv !Temperature of the PV panels [K]
!
! Local variables
!
real,parameter :: albpv=0.11 ! albedo of the PV panels
real,parameter :: empv_down=0.95 ! emissivity of the PV panels
real,parameter :: empv_up=0.79
real, parameter :: T_amb=25
real, parameter :: tiltangle=0.
real, parameter :: a=3.8
real, parameter :: b=6.9

real, parameter :: r1=2330.
real, parameter :: r2=1200.
real, parameter :: r3=3000.
real, parameter :: c1=677.
real, parameter :: c2=1250.
real, parameter :: c3=500.
real, parameter :: d1=0.0003
real, parameter :: d2=0.0005
real, parameter :: d3=0.003
real, parameter :: F12=1.
real :: lwuppv !Long-wave emitted by the PV panels to the sky [W/m2]
real :: lwdwr !Long-wave incoming radiation on the roof [W/m2]
real :: lwupr !Long-wave coming up from the roof intercepted by the PV panels [W/m2]
real :: enerpv !Energy produced by PV panels [W/m2]
real :: hc
real :: sw_d
real :: lw_d
real :: lwpv_out
real :: tpv_new
real :: hdown
real :: hup
real :: deltat
real :: uroof
real :: hrad
real :: Cm
real :: hf
Cm=r1*c1*d1+r2*c2*d2+r3*c3*d3
hrad=sigma/((1-empv_down)/empv_down+1/F12+(1-emr)/emr)
uroof=(uout(n+1)**2+vout(n+1)**2)**0.5

deltat=tpv-tair(n+1)
hf=2.5*(40./100.*uroof)**(0.5)
hc=9.842*abs(deltat)**(1./3.)/(7.283-abs(cos(tiltangle)))
hup=sqrt(hc**2.+(hf)**2.)
hc=1.810*abs(deltat)**(1./3.)/(1.382+abs(cos(tiltangle)))
hdown=sqrt(hc**2.+(hf)**2.)
enerpv=effpv*rs*min(1.,1.-0.005*(tpv-(T_amb+273.15)))
sw_d=(1-albpv)*(rs)
lw_d=empv_up*rl
lwpv_out=empv_up*sigma*tpv**4.
lwupr=hrad*(tr**4-tpv**4.)
hspv=(hup+hdown)*(tpv-tair(n+1))
tpv=tpv+(sw_d+lw_d-lwpv_out+lwupr-hspv-enerpv)/Cm*dt
eppv=enerpv*pv_frac_roof*bl*bw
return
end subroutine hsfluxpv

I get compilation error when i add new terms in call hsfluxpv and calculation in this. can anyone guide how we can achieve this. or do we need to add variables in other files too ?
 
Top