Changeset 2544 for palm/trunk/SOURCE


Ignore:
Timestamp:
Oct 13, 2017 6:09:32 PM (7 years ago)
Author:
maronga
Message:

introduced new module date_and_time_mod

Location:
palm/trunk/SOURCE
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r2371 r2544  
    2525# -----------------
    2626# $Id$
     27# Added date_and_time_mod
     28#
     29# 2371 2017-08-24 13:01:17Z kanani
    2730# Corrected dependencies for vertical_nesting_mod
    2831#
     
    370373        data_output_ptseries.f90 data_output_spectra.f90 data_output_flight.f90\
    371374        data_output_tseries.f90 data_output_2d.f90 data_output_3d.f90 \
     375        date_and_time_mod.f90 \
    372376        diffusion_e.f90 diffusion_s.f90 diffusion_u.f90 diffusion_v.f90 \
    373377        diffusion_w.f90 diffusivities.f90 disturb_field.f90 \
     
    497501data_output_3d.o: modules.o cpulog_mod.o mod_kinds.o mod_particle_attributes.o \
    498502   netcdf_interface_mod.o land_surface_model_mod.o urban_surface_mod.o
     503date_and_time_mod.o: modules.o mod_kinds.o
    499504diffusion_e.o: modules.o mod_kinds.o microphysics_mod.o \
    500505   mod_particle_attributes.o surface_mod.o
     
    514519                   large_scale_forcing_nudging_mod.o netcdf_interface_mod.o radiation_model_mod.o surface_mod.o
    515520global_min_max.o: modules.o mod_kinds.o
    516 header.o: modules.o cpulog_mod.o mod_kinds.o large_scale_forcing_nudging_mod.o netcdf_interface_mod.o \
     521header.o: modules.o cpulog_mod.o mod_kinds.o date_and_time_mod.o large_scale_forcing_nudging_mod.o netcdf_interface_mod.o \
    517522   land_surface_model_mod.o microphysics_mod.o model_1d_mod.o plant_canopy_model_mod.o pmc_handle_communicator_mod.o \
    518523   pmc_interface_mod.o radiation_model_mod.o spectra_mod.o subsidence_mod.o surface_mod.o virtual_flight_mod.o
     
    583588palm.o: modules.o cpulog_mod.o land_surface_model_mod.o mod_kinds.o \
    584589        pmc_interface_mod.o surface_layer_fluxes_mod.o
    585 parin.o: modules.o cpulog_mod.o land_surface_model_mod.o mod_kinds.o model_1d_mod.o netcdf_interface_mod.o \
     590parin.o: modules.o cpulog_mod.o date_and_time_mod.o land_surface_model_mod.o mod_kinds.o model_1d_mod.o netcdf_interface_mod.o \
    586591   plant_canopy_model_mod.o pmc_interface_mod.o progress_bar_mod.o spectra_mod.o \
    587592   synthetic_turbulence_generator_mod.o radiation_model_mod.o microphysics_mod.o \
     
    613618        subsidence_mod.o surface_mod.o user_actions.o wind_turbine_model_mod.o
    614619progress_bar_mod.o: modules.o mod_kinds.o
    615 radiation_model_mod.o: modules.o mod_particle_attributes.o microphysics_mod.o surface_mod.o
     620radiation_model_mod.o: modules.o mod_particle_attributes.o date_and_time_mod.o microphysics_mod.o surface_mod.o
    616621random_function_mod.o: mod_kinds.o
    617622random_gauss.o: mod_kinds.o random_function_mod.o random_generator_parallel_mod.o
     
    645650        surface_layer_fluxes_mod.o surface_mod.o \
    646651        urban_surface_mod.o vertical_nesting_mod.o virtual_flight_mod.o wind_turbine_model_mod.o
    647 time_integration_spinup.o: cpulog_mod.o modules.o land_surface_model_mod.o mod_kinds.o radiation_model_mod.o surface_layer_fluxes_mod.o urban_surface_mod.o
     652time_integration_spinup.o: cpulog_mod.o modules.o date_and_time_mod.o land_surface_model_mod.o mod_kinds.o radiation_model_mod.o surface_layer_fluxes_mod.o urban_surface_mod.o
    648653time_to_string.o: mod_kinds.o
    649654timestep.o: modules.o cpulog_mod.o mod_kinds.o microphysics_mod.o \
     
    652657transpose.o: modules.o cpulog_mod.o mod_kinds.o
    653658tridia_solver_mod.o: modules.o mod_kinds.o
    654 urban_surface_mod.o: modules.o mod_kinds.o radiation_model_mod.o plant_canopy_model_mod.o surface_mod.o
     659urban_surface_mod.o: modules.o mod_kinds.o date_and_time_mod.o radiation_model_mod.o plant_canopy_model_mod.o surface_mod.o
    655660user_3d_data_averaging.o: modules.o mod_kinds.o user_module.o
    656661user_actions.o: modules.o cpulog_mod.o mod_kinds.o user_module.o
  • palm/trunk/SOURCE/header.f90

    r2339 r2544  
    2525! -----------------
    2626! $Id$
     27! Moved initial day of year and time to inipar.
     28!
     29! 2339 2017-08-07 13:55:26Z gronemeier
    2730! corrected timestamp in header
    2831!
     
    333336    USE cpulog,                                                                &
    334337        ONLY:  log_point_s
    335        
     338           
     339    USE date_and_time_mod,                                                     &
     340        ONLY:  day_of_year_init, time_utc_init
     341
    336342    USE dvrp_variables,                                                        &
    337343        ONLY:  use_seperate_pe_for_dvrp_output
     
    17461752    WRITE ( io, 410 )  phi, omega, f, fs
    17471753
     1754 !
     1755!-- Geostrophic parameters
     1756    WRITE ( io, 456 )  day_of_year_init, time_utc_init
     1757   
    17481758!
    17491759!-- Other quantities
     
    22532263454 FORMAT ('    TKE is not allowed to fall below ',E9.2,' (m/s)**2')
    22542264455 FORMAT ('    initial TKE is prescribed as ',E9.2,' (m/s)**2')
     2265456 FORMAT ('    Day of the year at model start :   day_init = ',I3             &
     2266            /'    UTC time at model start        :   time_utc_init = ',F7.1' s')
    22552267470 FORMAT (//' Actions during the simulation:'/ &
    22562268              ' -----------------------------'/)
  • palm/trunk/SOURCE/parin.f90

    r2397 r2544  
    2525! -----------------
    2626! $Id$
     27! Moved day_of_year_init and time_utc_init to inipar.
     28!
     29! 2397 2017-09-04 16:22:48Z suehring
    2730! Enable initialization of 3d model by user in the child domain.
    2831!
     
    301304               vg
    302305
     306    USE date_and_time_mod,                                                     &
     307        ONLY:  day_of_year_init, time_utc_init
     308               
    303309    USE plant_canopy_model_mod,                                                &
    304310         ONLY: pcm_parin 
     
    393399             cycle_mg, damp_level_1d,                                          &
    394400             data_output_during_spinup,                                        &
     401             day_of_year_init,                                                 &
    395402             dissipation_1d,                                                   &
    396403             dp_external, dp_level_b, dp_smooth, dpdxy, dry_aerosol_radius,    &
     
    427434             surface_scalarflux, surface_waterflux,                            &
    428435             s_surface, s_surface_initial_change, s_vertical_gradient,         &
    429              s_vertical_gradient_level, timestep_scheme,                       &
     436             s_vertical_gradient_level, time_utc_init, timestep_scheme,        &
    430437             topography, topography_grid_convention, top_heatflux,             &
    431438             top_momentumflux_u, top_momentumflux_v, top_salinityflux,         &
  • palm/trunk/SOURCE/radiation_model_mod.f90

    r2512 r2544  
    2525! -----------------
    2626! $Id$
     27! Moved date and time quantitis to separate module date_and_time_mod
     28!
     29! 2512 2017-10-04 08:26:59Z raasch
    2730! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny
    2831! no output of ghost layer data
     
    183186               surface_pressure, time_since_reference_point
    184187
     188    USE date_and_time_mod,                                                     &
     189        ONLY:  calc_date_and_time, d_hours_day, d_seconds_hour, day_of_year,   &
     190               time_utc
     191
    185192    USE indices,                                                               &
    186193        ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
     
    262269
    263270    INTEGER(iwp) :: albedo_type  = 9999999, & !< Albedo surface type
    264                     day,                    & !< current day of the year
    265                     day_init     = 172,     & !< day of the year at model start (21/06)
    266271                    dots_rad     = 0          !< starting index for timeseries output
    267272
     
    276281
    277282
    278     REAL(wp), PARAMETER :: d_seconds_hour  = 0.000277777777778_wp,  & !< inverse of seconds per hour (1/3600)
    279                            d_hours_day    = 0.0416666666667_wp,     & !< inverse of hours per day (1/24)
    280                            sigma_sb       = 5.67037321E-8_wp,       & !< Stefan-Boltzmann constant
     283    REAL(wp), PARAMETER :: sigma_sb       = 5.67037321E-8_wp,       & !< Stefan-Boltzmann constant
    281284                           solar_constant = 1368.0_wp                 !< solar constant at top of atmosphere
    282285
     
    297300                skip_time_do_radiation = 0.0_wp, & !< Radiation model is not called before this time
    298301                sky_trans,                       & !< sky transmissivity
    299                 time_radiation = 0.0_wp,         & !< time since last call of radiation code
    300                 time_utc,                        & !< current time in UTC
    301                 time_utc_init = 43200.0_wp         !< UTC time at model start (noon)
     302                time_radiation = 0.0_wp            !< time since last call of radiation code
     303
    302304
    303305    REAL(wp), DIMENSION(0:0) ::  zenith,         & !< cosine of solar zenith angle
     
    562564           rad_sw_in_av, rad_sw_out, rad_sw_out_av, rad_sw_cs_hr,              &
    563565           rad_sw_cs_hr_av, rad_sw_hr, rad_sw_hr_av, sigma_sb,                 &
    564            skip_time_do_radiation, time_radiation, unscheduled_radiation_calls,&
    565            zenith, calc_zenith, sun_direction, sun_dir_lat, sun_dir_lon,       &
    566            day_init, time_utc_init
     566           skip_time_do_radiation, solar_constant, time_radiation,             &
     567           unscheduled_radiation_calls, zenith, calc_zenith, sun_direction,    &
     568           sun_dir_lat, sun_dir_lon
    567569
    568570
     
    13601362       IF ( radiation .AND. radiation_scheme /= 'constant' )  THEN
    13611363          WRITE ( io, 1 )  lambda
    1362           WRITE ( io, 2 )  day_init, time_utc_init
    13631364       ENDIF
    13641365
     
    13671368
    13681369 1 FORMAT ('    Geograph. longitude            :   lambda = ',F4.1,' degr')
    1369  2 FORMAT ('    Day of the year at model start :   day_init = ',I3             &
    1370             /'    UTC time at model start        :   time_utc_init = ',F7.1' s')
    13711370 3 FORMAT (//' Radiation model information:'/                                  &
    13721371              ' ----------------------------'/)
     
    14011400       NAMELIST /radiation_par/   albedo, albedo_type, albedo_lw_dir,          &
    14021401                                  albedo_lw_dif, albedo_sw_dir, albedo_sw_dif, &
    1403                                   constant_albedo, day_init, dt_radiation,     &
     1402                                  constant_albedo, dt_radiation,               &
    14041403                                  lambda, lw_radiation, net_radiation,         &
    14051404                                  radiation_scheme, skip_time_do_radiation,    &
    1406                                   sw_radiation, time_utc_init,                 &
    1407                                   unscheduled_radiation_calls
     1405                                  sw_radiation, unscheduled_radiation_calls
    14081406       
    14091407       line = ' '
     
    16301628               rrtm_ch4vmr     , rrtm_n2ovmr  , rrtm_o2vmr , rrtm_asdir(:,j,i),&
    16311629               rrtm_asdif(:,j,i), rrtm_aldir(:,j,i), rrtm_aldif(:,j,i), zenith,&
    1632                0.0_wp          , day          , solar_constant,   rrtm_inflgsw,&
     1630               0.0_wp          , day_of_year  , solar_constant,   rrtm_inflgsw,&
    16331631               rrtm_iceflgsw   , rrtm_liqflgsw, rrtm_cldfr , rrtm_sw_taucld   ,&
    16341632               rrtm_sw_ssacld  , rrtm_sw_asmcld, rrtm_sw_fsfcld, rrtm_cicewp  ,&
     
    16931691!--    Calculate current day and time based on the initial values and simulation
    16941692!--    time
    1695        day = day_init + INT(FLOOR( (time_utc_init + time_since_reference_point)&
    1696                                / 86400.0_wp ), KIND=iwp)
    1697        time_utc = MOD((time_utc_init + time_since_reference_point), 86400.0_wp)
    1698 
     1693       CALL calc_date_and_time
    16991694
    17001695!
    17011696!--    Calculate solar declination and hour angle   
    1702        declination = ASIN( decl_1 * SIN(decl_2 * REAL(day, KIND=wp) - decl_3) )
     1697       declination = ASIN( decl_1 * SIN(decl_2 * REAL(day_of_year, KIND=wp) - decl_3) )
    17031698       hour_angle  = 2.0_wp * pi * (time_utc / 86400.0_wp) + lon - pi
    17041699
  • palm/trunk/SOURCE/time_integration_spinup.f90

    r2299 r2544  
    2525! -----------------
    2626! $Id$
     27! Date and time quantities are now read from date_and_time_mod
     28!
     29! 2299 2017-06-29 10:14:38Z maronga
    2730! Call of soil model adjusted to avoid prognostic equation for soil moisture
    2831! during spinup.
     
    6770        ONLY:  cpu_log, log_point, log_point_s
    6871
     72    USE date_and_time_mod,                                                     &
     73        ONLY: day_of_year_init, time_utc_init
     74
    6975    USE indices,                                                               &
    7076        ONLY:  nbgp, nzb, nzt, nysg, nyng, nxlg, nxrg
     
    8187    USE radiation_model_mod,                                                   &
    8288        ONLY:  dt_radiation, force_radiation_call, radiation,                  &
    83                radiation_control, rad_sw_in, time_radiation, time_utc_init
     89               radiation_control, rad_sw_in, time_radiation 
    8490
    8591    USE statistics,                                                            &
     
    425431
    426432       USE constants,                                                          &
    427            ONLY:  pi
    428        
     433       ONLY:  pi
     434     
    429435       USE kinds
    430436
    431437       USE radiation_model_mod,                                                &
    432            ONLY:  day_init, decl_1, decl_2, decl_3, lat, lon
     438           ONLY:  decl_1, decl_2, decl_3, lat, lon
    433439
    434440       IMPLICIT NONE
     
    446452!--    time
    447453
    448        day = day_init + INT(FLOOR( local_time / 86400.0_wp ), KIND=iwp)
     454       day = day_of_year_init + INT(FLOOR( local_time / 86400.0_wp ), KIND=iwp)
    449455       time_utc = MOD(local_time, 86400.0_wp)
    450456
  • palm/trunk/SOURCE/urban_surface_mod.f90

    r2516 r2544  
    2626! -----------------
    2727! $Id$
     28! Date and time quantities are now read from date_and_time_mod. Solar constant is
     29! read from radiation_model_mod
     30!
     31! 2516 2017-10-04 11:03:04Z suehring
    2832! Remove tabs
    2933!
     
    171175        ONLY:  cpu_log, log_point, log_point_s
    172176     
     177    USE date_and_time_mod,                                                     &
     178        ONLY:  d_seconds_year, day_of_year_init, time_utc_init
     179   
    173180    USE grid_variables,                                                        &
    174181        ONLY:  dx, dy, ddx, ddy, ddx2, ddy2
     
    189196   
    190197    USE radiation_model_mod,                                                   &
    191         ONLY:  radiation, calc_zenith, zenith, day_init, time_utc_init,        &
     198        ONLY:  radiation, calc_zenith, zenith,                                 &
    192199               rad_net, rad_sw_in, rad_lw_in, rad_sw_out, rad_lw_out,          &
    193                sigma_sb, sun_direction, sun_dir_lat, sun_dir_lon,              &
    194                force_radiation_call
     200               sigma_sb, solar_constant, sun_direction, sun_dir_lat,           &
     201               sun_dir_lon, force_radiation_call
    195202
    196203    USE statistics,                                                            &
     
    17571764    SUBROUTINE usm_calc_diffusion_radiation
    17581765   
    1759         REAL(wp), PARAMETER                          ::  sol_const = 1367.0_wp   !< solar conbstant
    17601766        REAL(wp), PARAMETER                          :: lowest_solarUp = 0.1_wp  !< limit the sun elevation to protect stability of the calculation
    17611767        INTEGER(iwp)                                 :: i, j
    1762         REAL(wp), PARAMETER                          ::  year_seconds = 86400._wp * 365._wp
    17631768        REAL(wp)                                     ::  year_angle              !< angle
    17641769        REAL(wp)                                     ::  etr                     !< extraterestrial radiation
     
    17701775       
    17711776!--     Calculate current day and time based on the initial values and simulation time
    1772         year_angle = ((day_init*86400) + time_utc_init+time_since_reference_point) &
    1773                        / year_seconds * 2.0_wp * pi
    1774        
    1775         etr = sol_const * (1.00011_wp +                                            &
    1776                           0.034221_wp * cos(year_angle) +                          &
    1777                           0.001280_wp * sin(year_angle) +                          &
    1778                           0.000719_wp * cos(2.0_wp * year_angle) +                 &
     1777        year_angle = ( (day_of_year_init * 86400) + time_utc_init              &
     1778                        + time_since_reference_point )  * d_seconds_year       &
     1779                        * 2.0_wp * pi
     1780       
     1781        etr = solar_constant * (1.00011_wp +                                   &
     1782                          0.034221_wp * cos(year_angle) +                      &
     1783                          0.001280_wp * sin(year_angle) +                      &
     1784                          0.000719_wp * cos(2.0_wp * year_angle) +             &
    17791785                          0.000077_wp * sin(2.0_wp * year_angle))
    17801786       
Note: See TracChangeset for help on using the changeset viewer.