Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ subroutine driver_radiation_sw(itimestep,configs,mesh,state,time_lev,diag_physic
swdnt = swdnt_p , swdntc = swdntc_p , swupb = swupb_p , &
swupbc = swupbc_p , swdnb = swdnb_p , swdnbc = swdnbc_p , &
swddir = swddir_p , swddni = swddni_p , swddif = swddif_p , &
julian = curr_julday , &
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
Expand Down
13 changes: 10 additions & 3 deletions src/core_atmosphere/physics/physics_wrf/module_ra_rrtmg_sw.F
Original file line number Diff line number Diff line change
Expand Up @@ -10036,7 +10036,7 @@ subroutine rrtmg_swrad( &
swupt,swuptc,swdnt,swdntc, &
swupb,swupbc,swdnb,swdnbc, &
swupflx, swupflxc, swdnflx, swdnflxc, &
swddir,swddni,swddif, &
swddir,swddni,swddif,julian, &
ids,ide, jds,jde, kds,kde, &
ims,ime, jms,jme, kms,kme, &
its,ite, jts,jte, kts,kte &
Expand All @@ -10054,6 +10054,7 @@ subroutine rrtmg_swrad( &
integer,intent(in):: icloud,cldovrlp,idcor
integer,intent(in):: has_reqc,has_reqi,has_reqs
integer,intent(in),optional:: o3input
real,intent(in):: julian

real,intent(in):: radt,degrad,xtime,declin,solcon,gmt
real,intent(in),dimension(ims:ime,jms:jme):: xlat,xlong
Expand Down Expand Up @@ -10101,6 +10102,7 @@ subroutine rrtmg_swrad( &
integer:: i,j,k,n

real:: coszrs,xt24,tloctm,hrang,xxlat,adjes,scon
real:: da,eot
real:: ro,dz
real:: corr
real:: gliqwp,gicewp,gsnowp,gravmks
Expand Down Expand Up @@ -10197,9 +10199,14 @@ subroutine rrtmg_swrad( &

!--- calculate the cosine of the solar zenith angle at the current time step to determine if the sun is
! above or below the horizon (xt24 is the fractional part of simulation days plus half of radt in
! units of minutes, julian is in days, and radt is in minutes). do not call rrtmg_sw is night-time:
! units of minutes, julian is in days, and radt is in minutes). eot (equation of time) is a correction
! of mean solar time due to the difference between that time and the apparent solar time.
! do not call rrtmg_sw is night-time:
dorrsw = .true.
xt24 = mod(xtime+radt*0.5,1440.)
da=6.2831853071795862*(julian-1.)/365.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can any of these magic number be parameterized?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably - the 6.283... value in line 10206 is 2*pi. I'm not sure on the others, though. I don't know the source for the form of this equation that @weiwangncar used -- Wei, perhaps you know?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clark-evans The number comes from the contributor to WRF, Jose Arias. Will check with Jimy.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clark-evans It looks like the PR in MPAS has some discussion on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding me of that, @weiwangncar! @dustinswales -- what do you think? Maybe we implement 2*pi and add a comment above the equation pointing to the GML reference?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is 2*pi. This addition to the MPAS repo got delayed but will occur. WRF radiation has had it for a while already where we did not implement it directly in the radiation routine but in a separate cosine zenith angle routine.

eot=(0.000075+0.001868*cos(da)-0.032077*sin(da) &
-0.014615*cos(2*da)-0.04089*sin(2*da))*(229.18)
xt24 = mod(xtime+radt*0.5,1440.)+eot
tloctm = gmt + xt24/60. + xlong(i,j)/15.
hrang = 15. * (tloctm-12.) * degrad
xxlat = xlat(i,j) * degrad
Expand Down