From 88838f177144add02d9950ee81892eaac92a2b6f Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 12 Jun 2019 13:36:46 -0600 Subject: [PATCH 1/3] Fix local solar time --- cicecore/cicedynB/general/ice_forcing.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 4baa88fff..0e02d100a 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -2275,8 +2275,10 @@ 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)) solar_time = mod(real(sec,kind=dbl_kind),secday)/c3600 & - + c12*sin(p5*TLON(i,j)) + + TLON(i,j)/(15._dbl_kind*deg2rad) 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??? From 428054dfb0a03ec1a681d1f1b2a8a5c436d70f05 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 13 Jun 2019 09:09:41 -0600 Subject: [PATCH 2/3] Add line for going past 24 --- cicecore/cicedynB/general/ice_forcing.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 0e02d100a..58dcf5b76 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -2279,6 +2279,7 @@ subroutine compute_shortwave(nx_block, ny_block, & ! + c12*sin(p5*TLON(i,j)) solar_time = mod(real(sec,kind=dbl_kind),secday)/c3600 & + TLON(i,j)/(15._dbl_kind*deg2rad) + 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??? From fa4b1a291f8a5c33f347b82df730fee5fff8630f Mon Sep 17 00:00:00 2001 From: David Bailey Date: Thu, 18 Jul 2019 14:23:37 -0600 Subject: [PATCH 3/3] New LST calculation --- cicecore/cicedynB/general/ice_forcing.F90 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 58dcf5b76..2a529c2fe 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -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, & @@ -2260,6 +2260,7 @@ subroutine compute_shortwave(nx_block, ny_block, & sw0 , & secday , & pi , & + lontmp , & deg2rad integer (kind=int_kind) :: & @@ -2277,8 +2278,15 @@ subroutine compute_shortwave(nx_block, ny_block, & 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 & - + TLON(i,j)/(15._dbl_kind*deg2rad) + + 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) &