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

introduced new module date_and_time_mod

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.