Changeset 4227 for palm/trunk/SOURCE/time_integration_spinup.f90
- Timestamp:
- Sep 10, 2019 6:04:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/time_integration_spinup.f90
r4182 r4227 25 25 ! ----------------- 26 26 ! $Id$ 27 ! implement new palm_date_time_mod 28 ! 29 ! 4223 2019-09-10 09:20:47Z gronemeier 27 30 ! Corrected "Former revisions" section 28 31 ! … … 79 82 ONLY: cpu_log, log_point_s 80 83 81 USE date_and_time_mod, &82 ONLY: day_of_year_init, time_utc_init83 84 84 USE indices, & 85 85 ONLY: nbgp, nzb, nzt, nysg, nyng, nxlg, nxrg 86 86 87 88 87 USE land_surface_model_mod, & 89 88 ONLY: lsm_energy_balance, lsm_soil_model, lsm_swap_timelevel 89 90 90 USE pegrid 91 91 … … 94 94 95 95 USE kinds 96 97 USE palm_date_time_mod, & 98 ONLY: get_date_time, seconds_per_hour 96 99 97 100 USE radiation_model_mod, & … … 132 135 133 136 INTEGER(iwp) :: current_timestep_number_spinup = 0 !< number if timestep during spinup 137 INTEGER(iwp) :: day_of_year !< day of the year 134 138 135 139 LOGICAL :: run_control_header_spinup = .FALSE. !< flag parameter for steering whether the header information must be output 136 140 137 REAL(wp) :: pt_spinup !< temporary storage of temperature 138 REAL(wp) :: dt_save !< temporary storage for time step 141 REAL(wp) :: pt_spinup !< temporary storage of temperature 142 REAL(wp) :: dt_save !< temporary storage for time step 143 REAL(wp) :: second_of_day !< second of the day 139 144 140 145 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: pt_save !< temporary storage of temperature … … 234 239 !-- shifted by one hour to simulate a lag between air temperature and 235 240 !-- incoming radiation 241 CALL get_date_time( simulated_time - spinup_time - seconds_per_hour, & 242 day_of_year=day_of_year, & 243 second_of_day=second_of_day ) 244 236 245 pt_spinup = spinup_pt_mean + spinup_pt_amplitude & 237 * solar_angle (time_utc_init + time_since_reference_point - 3600.0)246 * solar_angle(day_of_year, second_of_day) 238 247 239 248 ! … … 546 555 !-- Returns the cosine of the solar zenith angle at a given time. This routine 547 556 !-- is similar to that for calculation zenith (see radiation_model_mod.f90) 548 FUNCTION solar_angle( local_time ) 557 !> @todo Load function calc_zenith of radiation model instead of 558 !> rewrite the function here. 559 FUNCTION solar_angle( day_of_year, second_of_day ) 549 560 550 561 USE basic_constants_and_equations_mod, & … … 559 570 560 571 561 REAL(wp) :: solar_angle !< cosine of the solar zenith angle 562 563 REAL(wp) :: day !< day of the year 564 REAL(wp) :: declination !< solar declination angle 565 REAL(wp) :: hour_angle !< solar hour angle 566 REAL(wp) :: time_utc !< current time in UTC 567 REAL(wp), INTENT(IN) :: local_time 568 ! 569 !-- Calculate current day and time based on the initial values and simulation 570 !-- time 571 572 day = day_of_year_init + INT(FLOOR( local_time / 86400.0_wp ), KIND=iwp) 573 time_utc = MOD(local_time, 86400.0_wp) 574 575 572 INTEGER(iwp), INTENT(IN) :: day_of_year !< day of the year 573 574 REAL(wp) :: declination !< solar declination angle 575 REAL(wp) :: hour_angle !< solar hour angle 576 REAL(wp), INTENT(IN) :: second_of_day !< current time of the day in UTC 577 REAL(wp) :: solar_angle !< cosine of the solar zenith angle 576 578 ! 577 579 !-- Calculate solar declination and hour angle 578 declination = ASIN( decl_1 * SIN(decl_2 * REAL(day , KIND=wp) - decl_3) )579 hour_angle = 2.0_wp * pi * ( time_utc/ 86400.0_wp) + lon - pi580 declination = ASIN( decl_1 * SIN(decl_2 * REAL(day_of_year, KIND=wp) - decl_3) ) 581 hour_angle = 2.0_wp * pi * (second_of_day / 86400.0_wp) + lon - pi 580 582 581 583 ! … … 584 586 * COS(hour_angle) 585 587 586 587 588 END FUNCTION solar_angle 588 589
Note: See TracChangeset
for help on using the changeset viewer.