Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Solar Time Computation #323

Merged
merged 7 commits into from
Aug 30, 2019
17 changes: 14 additions & 3 deletions cicecore/cicedynB/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ module ice_forcing
use ice_timers, only: ice_timer_start, ice_timer_stop, timer_readwrite, &
timer_bound
use ice_arrays_column, only: oceanmixed_ice, restore_bgc
use ice_constants, only: c0, c1, c2, c3, c4, c5, c10, c12, c20, &
c180, c365, c1000, c3600
use ice_constants, only: c0, c1, c2, c3, c4, c5, c10, c12, c15, c20, &
c180, c360, c365, c1000, c3600
use ice_constants, only: p001, p01, p1, p25, p5, p6
use ice_constants, only: cm_to_m
use ice_constants, only: field_loc_center, field_type_scalar, &
Expand Down Expand Up @@ -2260,6 +2260,7 @@ subroutine compute_shortwave(nx_block, ny_block, &
sw0 , &
secday , &
pi , &
lontmp , &
deg2rad

integer (kind=int_kind) :: &
Expand All @@ -2275,8 +2276,18 @@ subroutine compute_shortwave(nx_block, ny_block, &
do j=jlo,jhi
do i=ilo,ihi
deg2rad = pi/c180
! solar_time = mod(real(sec,kind=dbl_kind),secday)/c3600 &
! + c12*sin(p5*TLON(i,j))

! Convert longitude to range of -180 to 180 for LST calculation

lontmp = mod(TLON(i,j)/deg2rad,c360)
if (lontmp .gt. c180) lontmp = lontmp - c360
if (lontmp .lt. -c180) lontmp = lontmp + c360

solar_time = mod(real(sec,kind=dbl_kind),secday)/c3600 &
+ c12*sin(p5*TLON(i,j))
+ lontmp/c15
if (solar_time .ge. 24._dbl_kind) solar_time = solar_time - 24._dbl_kind
hour_angle = (c12 - solar_time)*pi/c12
declin = 23.44_dbl_kind*cos((172._dbl_kind-yday) &
* c2*pi/c365)*deg2rad ! use dayyr instead of c365???
Expand Down