33 public :: atmos_solarins_insolation
35 interface atmos_solarins_insolation
38 end interface atmos_solarins_insolation
59 real(RP),
private :: obliquity
60 real(RP),
private :: e
61 real(RP),
private :: omega
62 real(RP),
private :: lambda_m0
64 integer,
private,
parameter :: year_ref = 1950
65 integer,
private :: ve_date(6)
66 data ve_date / 1950, 3, 21, 0, 0, 0 /
68 real(RP),
private,
parameter :: obliquity_ref = 23.320556_rp
69 real(RP),
private,
parameter :: psi_bar = 50.439273_rp
70 real(RP),
private,
parameter :: zeta = 3.392506_rp
73 integer,
private,
parameter :: nobliq = 47
74 real(RP),
private :: obliq_amp (nobliq)
75 real(RP),
private :: obliq_rate (nobliq)
76 real(RP),
private :: obliq_phase(nobliq)
225 integer,
private,
parameter :: neclip = 19
226 real(RP),
private :: eclip_amp (neclip)
227 real(RP),
private :: eclip_rate (neclip)
228 real(RP),
private :: eclip_phase(neclip)
293 integer,
private,
parameter :: nprece = 78
294 real(RP),
private :: prece_amp (nprece)
295 real(RP),
private :: prece_rate (nprece)
296 real(RP),
private :: prece_phase(nprece)
538 real(RP),
private :: arcsec2d, arcsec2r
556 integer,
intent(in) :: iyear
558 namelist / param_atmos_solarins / &
573 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[SOLARINS] / Categ[ATMOS SHARE] / Origin[SCALElib]' 581 read(
io_fid_conf,nml=param_atmos_solarins,iostat=ierr)
583 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 584 elseif( ierr > 0 )
then 585 write(*,*)
'xxx Not appropriate names in namelist PARAM_ATMOS_SOLARINS. Check!' 590 arcsec2d = 1.0_rp / (60.0_rp*60.0_rp)
601 dyear =
real( year-year_ref, kind=
rp )
605 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'*** Solar insolation parameters ***' 606 if(
io_l )
write(
io_fid_log,
'(1x,A,I7)')
'*** Reference year : ', year_ref
607 if(
io_l )
write(
io_fid_log,
'(1x,A,I7)')
'*** Current year : ', iyear
608 if(
io_l )
write(
io_fid_log,
'(1x,A,I7)')
'*** Difference from ref. : ', int(dyear)
612 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.7)')
'*** Eccentricity : ', e
614 if(
io_l )
write(
io_fid_log,
'(1x,A,F12.7)')
'*** Longitude at the vernal equinox [deg] : ', lambda_m0 /
const_d2r 643 integer,
intent(in) :: iyear
650 real(RP) :: perih_psi
651 real(RP) :: perih_omega
653 real(RP) :: temp, beta, ecosomg_mod
658 dyear =
real( iyear-year_ref, kind=
rp )
663 temp = temp + obliq_amp(i)*arcsec2d * cos( obliq_rate(i)*arcsec2r*dyear + obliq_phase(i)*
const_d2r )
665 obliquity = ( obliquity_ref + temp ) *
const_d2r 671 esinomg = esinomg + eclip_amp(i) * sin( eclip_rate(i)*arcsec2r*dyear + eclip_phase(i)*
const_d2r )
672 ecosomg = ecosomg + eclip_amp(i) * cos( eclip_rate(i)*arcsec2r*dyear + eclip_phase(i)*
const_d2r )
674 e = sqrt( esinomg*esinomg + ecosomg*ecosomg )
677 if ( ecosomg == 0.0_rp )
then 678 ecosomg_mod = 1.e-30_rp
680 ecosomg_mod = ecosomg
682 perih_pi = atan(esinomg/ecosomg_mod) + pi * ( 0.5_rp - sign(0.5_rp, ecosomg) )
711 temp = temp + prece_amp(i)*arcsec2d * sin( prece_rate(i)*arcsec2r*dyear + prece_phase(i)*
const_d2r )
713 perih_psi = psi_bar * arcsec2d * dyear + zeta + temp
716 perih_omega = perih_pi + perih_psi
719 if ( perih_omega + 180.0_rp < 0.0_rp )
then 720 perih_omega = perih_omega + 360.0_rp
721 elseif( perih_omega + 180.0_rp >= 360.0_rp )
then 722 perih_omega = perih_omega - 360.0_rp
729 omega = ( perih_omega + 180.0_rp ) *
const_d2r 731 beta = sqrt( 1.0_rp - e*e )
734 lambda_m0 = 2.0_rp * ( ( 1.0_rp/2.0_rp*e + 1.0_rp/8.0_rp*e*e*e ) * ( 1.0_rp + beta ) * sin( omega) &
735 - ( 1.0_rp/4.0_rp*e*e ) * ( 1.0_rp/2.0_rp + beta ) * sin(2.0_rp*omega) &
736 + ( 1.0_rp/8.0_rp*e*e*e ) * ( 1.0_rp/3.0_rp + beta ) * sin(3.0_rp*omega) )
762 real(RP),
intent(out) :: solins
763 real(RP),
intent(out) :: cosSZA
764 real(RP),
intent(out) :: Re_factor
765 real(RP),
intent(in) :: real_lon
766 real(RP),
intent(in) :: real_lat
767 integer,
intent(in) :: now_date(6)
768 integer,
intent(in) :: offset_year
777 real(RP) :: sinDEC, cosDEC
778 real(RP) :: hourangle
780 integer :: absday, absday_ve
781 real(DP) :: DayOfYear, abssec
792 date(:) = now_date(:)
824 lambda_m = lambda_m0 + 2.0_rp * pi *
real(absday-absday_ve,kind=RP) / DayOfYear
826 nu = lambda_m - omega
830 + ( 2.0_rp*e - 1.0_rp/ 4.0_rp*e*e*e ) * sin( nu ) &
831 + ( 5.0_rp/ 4.0_rp*e*e ) * sin( 2.0_rp*nu ) &
832 + ( 13.0_rp/12.0_rp*e*e*e ) * sin( 3.0_rp*nu )
835 sindec = sin(lambda) * sin(obliquity)
836 cosdec = sqrt( 1.0_rp - sindec*sindec )
839 hourangle = lon + 2.0_rp * pi * abssec / (24.0_rp*60.0_rp*60.0_rp)
842 cossza = sin(lat)*sindec - cos(lat)*cosdec*cos(hourangle)
846 + 2.0_rp*e * cos( nu ) &
847 + 0.5_rp*e*e * cos( 2.0_rp*nu ) &
849 + 4.0_rp*e*e*e * cos( 3.0_rp*nu )
878 real(RP),
intent(out) :: solins (IA,JA)
879 real(RP),
intent(out) :: cosSZA (IA,JA)
880 real(RP),
intent(in) :: real_lon(IA,JA)
881 real(RP),
intent(in) :: real_lat(IA,JA)
882 integer,
intent(in) :: now_date(6)
883 integer,
intent(in) :: offset_year
885 real(RP) :: lon(IA,JA)
886 real(RP) :: lat(IA,JA)
892 real(RP) :: sinDEC, cosDEC
893 real(RP) :: hourangle(IA,JA)
895 integer :: absday, absday_ve
896 real(DP) :: DayOfYear, abssec
898 real(RP) :: Re_factor
903 lon(:,:) = real_lon(:,:)
904 lat(:,:) = real_lat(:,:)
910 date(:) = now_date(:)
942 lambda_m = lambda_m0 + 2.0_rp * pi *
real(absday-absday_ve,kind=RP) / DayOfYear
944 nu = lambda_m - omega
948 + 2.0_rp*e * cos( nu ) &
949 + 0.5_rp*e*e * cos( 2.0_rp*nu ) &
951 + 4.0_rp*e*e*e * cos( 3.0_rp*nu )
955 + ( 2.0_rp*e - 1.0_rp/ 4.0_rp*e*e*e ) * sin( nu ) &
956 + ( 5.0_rp/ 4.0_rp*e*e ) * sin( 2.0_rp*nu ) &
957 + ( 13.0_rp/12.0_rp*e*e*e ) * sin( 3.0_rp*nu )
960 sindec = sin(lambda) * sin(obliquity)
961 cosdec = sqrt( 1.0_rp - sindec*sindec )
966 hourangle(i,j) = lon(i,j) + 2.0_rp * pi * abssec / (24.0_rp*60.0_rp*60.0_rp)
973 cossza(i,j) = sin(lat(i,j))*sindec - cos(lat(i,j))*cosdec*cos(hourangle(i,j))
integer, public is
start point of inner domain: x, local
integer, parameter, public i_month
[index] month
integer, parameter, public i_year
[index] year
integer, public je
end point of inner domain: y, local
real(rp), public atmos_solarins_constant
subroutine, public prc_mpistop
Abort MPI.
subroutine, public calendar_ymd2absday(absday, gyear, gmonth, gday, oyear)
Convert from gregorian date to absolute day, DAY 0 is AD1/1/1.
real(rp), public real_basepoint_lat
position of base point in real world [rad,-pi,pi]
logical, public io_l
output log or not? (this process)
logical, public atmos_solarins_fixeddate
real(rp), public const_d2r
degree to radian
real(rp), public atmos_solarins_lat
subroutine, public atmos_solarins_orbit(iyear)
setup solar incidence module
logical, public atmos_solarins_fixedlatlon
logical, public io_nml
output log or not? (for namelist, this process)
subroutine atmos_solarins_insolation_2d(solins, cosSZA, real_lon, real_lat, now_date, offset_year)
calc factor of Earths solar insolation
subroutine, public atmos_solarins_setup(iyear)
setup solar incidence module
integer, parameter, public i_min
[index] minute
integer, public js
start point of inner domain: y, local
integer, parameter, public i_sec
[index] second
integer, parameter, public i_hour
[index] hour
integer, parameter, public i_day
[index] day
real(rp), public atmos_solarins_lon
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
subroutine atmos_solarins_insolation_0d(solins, cosSZA, Re_factor, real_lon, real_lat, now_date, offset_year)
calc factor of Earths solar insolation
real(rp), public const_pi
pi
integer, public io_fid_conf
Config file ID.
integer, dimension(6), public atmos_solarins_date
subroutine, public calendar_getdayofyear(DayOfYear, iyear)
Get day of year.
subroutine, public calendar_hms2abssec(abssec, hour, minute, second, subsec)
Hour, minute, second, subsecond -> absolute second.
integer, public io_fid_log
Log file ID.
integer, parameter, public rp
integer, public io_fid_nml
Log file ID (only for output namelist)
real(rp), public real_basepoint_lon
position of base point in real world [rad,0-2pi]