Changeset 4680 for palm/trunk/SOURCE
- Timestamp:
- Sep 16, 2020 10:20:34 AM (4 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_3d_model.f90
r4671 r4680 24 24 ! ----------------- 25 25 ! $Id$ 26 ! Add option to fix date or time of the simulation 27 ! 28 ! 4671 2020-09-09 20:27:58Z pavelkrc 26 29 ! Implementation of downward facing USM and LSM surfaces 27 30 ! … … 198 201 199 202 USE palm_date_time_mod, & 200 ONLY: set_reference_date_time203 ONLY: init_date_time 201 204 202 205 USE pegrid … … 292 295 ! 293 296 !-- Set reference date-time 294 CALL set_reference_date_time( date_time_str=origin_date_time ) 297 CALL init_date_time( date_time_str=origin_date_time, & 298 use_fixed_date=use_fixed_date, & 299 use_fixed_time=use_fixed_time ) 295 300 296 301 IF ( debug_output ) CALL debug_message( 'allocating arrays', 'start' ) -
palm/trunk/SOURCE/modules.f90
r4658 r4680 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add option to fix date or time of the simulation 28 ! 29 ! 4658 2020-08-28 18:15:50Z suehring 27 30 ! Change default value of dt_spinup 28 31 ! 29 32 ! 4629 2020-07-29 09:37:56Z raasch 30 33 ! support for MPI Fortran77 interface (mpif.h) removed 31 ! 34 ! 32 35 ! 4581 2020-06-29 08:49:58Z suehring 33 36 ! +sums_wschs_ws_l … … 848 851 LOGICAL :: urban_surface = .FALSE. !< use urban surface model? 849 852 LOGICAL :: use_cmax = .TRUE. !< namelist parameter 853 LOGICAL :: use_fixed_date = .FALSE. !< date of simulation does not change (namelist parameter) 854 LOGICAL :: use_fixed_time = .FALSE. !< time of simulation does not change (namelist parameter) 850 855 LOGICAL :: use_free_convection_scaling = .FALSE. !< namelist parameter to switch on free convection velocity scale in calculation of horizontal wind speed (surface_layer_fluxes) 851 856 LOGICAL :: use_initial_profile_as_reference = .FALSE. !< use of initial profiles as reference state? -
palm/trunk/SOURCE/palm_date_time_mod.f90
r4360 r4680 1 1 !> @file palm_date_time_mod.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 ! version. 9 ! 10 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY 11 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 ! 14 ! You should have received a copy of the GNU General Public License along with 15 ! PALM. If not, see <http://www.gnu.org/licenses/>. 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 8 ! 9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 12 ! 13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: 21 20 ! ------------------ 22 ! 23 ! 21 ! 22 ! 24 23 ! Former revisions: 25 24 ! ----------------- 26 25 ! $Id$ 26 ! Add option to fix date and time; renamed set_reference_date_time to init_date_time 27 ! 28 ! 4360 2020-01-07 11:25:50Z suehring 27 29 ! Add days of northward- and southward equinox 28 ! 30 ! 29 31 ! 4227 2019-09-10 18:04:34Z gronemeier 30 32 ! Complete rework of module date_and_time_mod: … … 48 50 !> 49 51 !> @todo Consider leap seconds 50 !> @note Time_zone only supports full-hour time zones, i.e., time zones like 51 !> Australian CentralStandard Time (UTC+9.5) are not possible52 !------------------------------------------------------------------------------ !52 !> @note Time_zone only supports full-hour time zones, i.e., time zones like Australian Central 53 !> Standard Time (UTC+9.5) are not possible 54 !--------------------------------------------------------------------------------------------------! 53 55 MODULE palm_date_time_mod 54 56 55 USE control_parameters, &57 USE control_parameters, & 56 58 ONLY: message_string 57 59 … … 68 70 INTEGER(iwp), PARAMETER :: months_per_year = 12_iwp !< months in a year 69 71 ! 70 !-- Definition of mean northward and southward equinox (summer and winter half year) 71 !-- in days of year. For simplicity, March 21 and September 21 is assumed. 72 INTEGER(iwp), PARAMETER :: northward_equinox = 80_iwp 73 INTEGER(iwp), PARAMETER :: southward_equinox = 264_iwp 72 !-- Day of year of the mean northward and southward equinox (summer and winter half year) 73 INTEGER(iwp), PARAMETER :: northward_equinox = 80_iwp !< Mar 21 (leap year: Mar 20) 74 INTEGER(iwp), PARAMETER :: southward_equinox = 264_iwp !< Sep 21 (leap year: Sep 20) 74 75 75 76 REAL(wp), PARAMETER :: seconds_per_minute = 60.0_wp !< seconds in a minute … … 124 125 ! 125 126 !-- Variable Declaration 127 LOGICAL :: date_is_fixed = .FALSE. !< if true, date is fixed (time can still change) 126 128 LOGICAL :: reference_date_time_is_set = .FALSE. !< true if reference_date_time is set 129 LOGICAL :: time_is_fixed = .FALSE. !< if true, time does not change at all 127 130 128 131 TYPE(date_time_type) :: reference_date_time !< reference date-time … … 133 136 ! 134 137 !-- Set reference date and time 135 INTERFACE set_reference_date_time136 MODULE PROCEDURE set_reference_date_time137 END INTERFACE set_reference_date_time138 INTERFACE init_date_time 139 MODULE PROCEDURE init_date_time 140 END INTERFACE init_date_time 138 141 ! 139 142 !-- Return date and time information … … 145 148 PUBLIC & 146 149 get_date_time, & 147 set_reference_date_time150 init_date_time 148 151 ! 149 152 !-- Public variables … … 167 170 ! Description: 168 171 ! ------------ 169 !> Set reference date-time. 172 !> Initialize date-time setting by defining a global reference date-time and choosing a variable or 173 !> fixed date. 170 174 !> Only a single call is allowed to this routine during execution. 171 175 !--------------------------------------------------------------------------------------------------! 172 SUBROUTINE set_reference_date_time( date_time_str)176 SUBROUTINE init_date_time( date_time_str, use_fixed_date, use_fixed_time ) 173 177 174 178 CHARACTER(LEN=date_time_str_len), INTENT(IN) :: date_time_str !< string containing date-time information 175 179 180 LOGICAL, INTENT(IN), OPTIONAL :: use_fixed_date !< flag to fix date 181 LOGICAL, INTENT(IN), OPTIONAL :: use_fixed_time !< flag to fix time 176 182 ! 177 183 !-- Check if date and time are already set … … 179 185 !> @note This error should never be observed by a user. 180 186 !> It can only appear if the code was modified. 181 WRITE( message_string, * ) 'Multiple calls to set_reference_date_time detected.&' // &182 'Th e reference date-time must be set onlyonce.'183 CALL message( ' set_reference_date_time', 'PA0680', 2, 2, 0, 6, 0 )187 WRITE( message_string, * ) 'Multiple calls to init_date_time detected.&' // & 188 'This routine must not be called more than once.' 189 CALL message( 'init_date_time', 'PA0680', 2, 2, 0, 6, 0 ) 184 190 RETURN 185 191 … … 190 196 reference_date_time_is_set = .TRUE. 191 197 192 ENDIF 193 194 END SUBROUTINE set_reference_date_time 198 IF ( PRESENT( use_fixed_date ) ) date_is_fixed = use_fixed_date 199 IF ( PRESENT( use_fixed_time ) ) time_is_fixed = use_fixed_time 200 201 ENDIF 202 203 END SUBROUTINE init_date_time 195 204 196 205 … … 201 210 !> An alternative reference date-time string can be specified via 'reference_date_time_str'. 202 211 !> Call to this routine is only possible if a reference time is either specified in the call itself 203 !> via 'reference_date_time_str' or previously set by calling routine ' set_reference_date_time'.212 !> via 'reference_date_time_str' or previously set by calling routine 'init_date_time'. 204 213 !--------------------------------------------------------------------------------------------------! 205 214 SUBROUTINE get_date_time( time_since_reference, reference_date_time_str, & … … 241 250 'Returning date-time information is not possible. ' // & 242 251 'Either specify reference_date_time_str ' // & 243 'or set a reference via set_reference_date_time.'252 'or set a reference via init_date_time.' 244 253 CALL message( 'get_date_time', 'PA0677', 2, 2, 0, 6, 0 ) 245 254 RETURN … … 252 261 internal_reference_date_time = reference_date_time 253 262 ENDIF 254 ! 255 !-- Add time to reference time 256 date_time = add_date_time( time_since_reference, internal_reference_date_time ) 263 264 IF ( time_is_fixed ) THEN 265 ! 266 !-- If time shall not change, set new time to reference time 267 date_time = internal_reference_date_time 268 ELSE 269 ! 270 !-- Add time to reference time 271 date_time = add_date_time( time_since_reference, internal_reference_date_time ) 272 ! 273 !-- If date shall be fixed, revert it to the reference date if changed 274 IF ( date_is_fixed ) THEN 275 IF ( date_time%year /= internal_reference_date_time%year .OR. & 276 get_day_of_year( date_time ) /= get_day_of_year( internal_reference_date_time ) ) & 277 THEN 278 279 date_time%year = internal_reference_date_time%year 280 date_time%month = internal_reference_date_time%month 281 date_time%day = internal_reference_date_time%day 282 283 date_time = update_leapyear_setting( date_time ) 284 285 date_time%second_of_year = get_second_of_year( date_time ) 286 287 ENDIF 288 ENDIF 289 ENDIF 257 290 ! 258 291 !-- Set requested return values -
palm/trunk/SOURCE/parin.f90
r4565 r4680 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add option to fix date or time of the simulation 28 ! 29 ! 4565 2020-06-15 08:30:38Z oliver.maas 27 30 ! added pt_surface_heating_rate 28 ! 31 ! 29 32 ! 4564 2020-06-12 14:03:36Z raasch 30 33 ! Vertical nesting method of Huq et al. (2019) removed 31 ! 34 ! 32 35 ! 4536 2020-05-17 17:24:13Z raasch 33 36 ! bugfix for restart data format query 34 ! 37 ! 35 38 ! 4505 2020-04-20 15:37:15Z schwenkel 36 39 ! Add flag for saturation check 37 ! 40 ! 38 41 ! 4495 2020-04-13 20:11:20Z raasch 39 42 ! restart data handling with MPI-IO added 40 ! 43 ! 41 44 ! 4360 2020-01-07 11:25:50Z suehring 42 45 ! removed recycling_yshift 43 ! 46 ! 44 47 ! 4227 2019-09-10 18:04:34Z gronemeier 45 48 ! implement new palm_date_time_mod 46 ! 49 ! 47 50 ! 4146 2019-08-07 07:47:36Z gronemeier 48 51 ! added rotation_angle to initialization_parameters 49 ! 52 ! 50 53 ! 4191 2019-08-27 15:45:07Z gronemeier 51 54 ! bugfix: add recycling_method_for_thermodynamic_quantities to inipar namelist 52 ! 55 ! 53 56 ! 4183 2019-08-23 07:33:16Z oliver.maas 54 57 ! replaced recycle_absolute_quantities by recycling_method_for_thermodynamic_quantities 55 ! 58 ! 56 59 ! 4182 2019-08-22 15:20:23Z scharf 57 60 ! Corrected "Former revisions" section 58 ! 61 ! 59 62 ! 4176 2019-08-20 14:10:41Z oliver.maas 60 63 ! added recycle_absolute_quantities to initialization_parameters namelist 61 ! 64 ! 62 65 ! 4173 2019-08-20 12:04:06Z gronemeier 63 66 ! add vdi_internal_controls 64 ! 67 ! 65 68 ! 4131 2019-08-02 11:06:18Z monakurppa 66 69 ! Allocate hom and hom_sum to allow profile output for salsa variables. 67 ! 70 ! 68 71 ! 4079 2019-07-09 18:04:41Z suehring 69 72 ! +monotonic_limiter_z 70 ! 73 ! 71 74 ! 4022 2019-06-12 11:52:39Z suehring 72 75 ! Change default top boundary condition for pressure to Neumann in offline 73 76 ! nesting case 74 ! 77 ! 75 78 ! 4017 2019-06-06 12:16:46Z schwenkel 76 79 ! Introduce alternative switch for debug output during timestepping 77 ! 80 ! 78 81 ! 3885 2019-04-11 11:29:34Z kanani 79 ! Changes related to global restructuring of location messages and introduction 82 ! Changes related to global restructuring of location messages and introduction 80 83 ! of additional debug messages 81 ! 84 ! 82 85 ! 3806 2019-03-21 12:45:50Z raasch 83 86 ! additional check for lateral boundary conditions added 84 ! 87 ! 85 88 ! 3747 2019-02-16 15:15:23Z gronemeier 86 89 ! removed setting of parameter region 87 ! 90 ! 88 91 ! 3746 2019-02-16 12:41:27Z gronemeier 89 92 ! Removed most_method 90 ! 93 ! 91 94 ! 3649 2019-01-02 16:52:21Z suehring 92 95 ! Delete debug-print statements … … 103 106 !------------------------------------------------------------------------------! 104 107 SUBROUTINE parin 105 108 106 109 107 110 USE arrays_3d, & … … 156 159 IMPLICIT NONE 157 160 158 CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file 161 CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file 159 162 160 163 INTEGER(iwp) :: global_id !< process id with respect to MPI_COMM_WORLD … … 224 227 turbulent_inflow, turbulent_outflow, & 225 228 use_subsidence_tendencies, ug_surface, ug_vertical_gradient, & 229 use_fixed_date, use_fixed_time, & 226 230 use_free_convection_scaling, & 227 231 ug_vertical_gradient_level, use_surface_fluxes, use_cmax, & … … 298 302 ug_vertical_gradient_level, use_surface_fluxes, use_cmax, & 299 303 use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke, & 304 use_fixed_date, use_fixed_time, & 300 305 use_free_convection_scaling, & 301 306 uv_heights, u_bulk, u_profile, vdi_checks, & … … 304 309 wall_adjustment, wall_heatflux, wall_humidityflux, & 305 310 wall_scalarflux, y_shift, zeta_max, zeta_min, z0h_factor 306 311 307 312 NAMELIST /d3par/ averaging_interval, averaging_interval_pr, & 308 313 cpu_log_barrierwait, create_disturbances, & … … 418 423 io_blocks = global_procs / maximum_parallel_io_streams 419 424 io_group = MOD( global_id+1, io_blocks ) 420 425 421 426 CALL location_message( 'reading NAMELIST parameters from PARIN', 'start' ) 422 427 ! … … 434 439 READ ( 11, initialization_parameters, ERR=10, END=11 ) 435 440 GOTO 14 436 441 437 442 10 BACKSPACE( 11 ) 438 443 READ( 11 , '(A)') line … … 441 446 11 REWIND ( 11 ) 442 447 READ ( 11, inipar, ERR=12, END=13 ) 443 448 444 449 message_string = 'namelist inipar is deprecated and will be ' // & 445 450 'removed in near future. & Please use namelist ' // & 446 451 'initialization_parameters instead' 447 452 CALL message( 'parin', 'PA0017', 0, 1, 0, 6, 0 ) 448 453 449 454 GOTO 14 450 455 451 456 12 BACKSPACE( 11 ) 452 457 READ( 11 , '(A)') line … … 458 463 ! 459 464 !-- Try to read runtime parameters given by the user for this run 460 !-- (namelist "runtime_parameters"). The namelist "runtime_parmeters" 461 !-- can be omitted. In that case default values are used for the 465 !-- (namelist "runtime_parameters"). The namelist "runtime_parmeters" 466 !-- can be omitted. In that case default values are used for the 462 467 !-- parameters. 463 468 14 line = ' ' … … 533 538 !-- In case of a restart run, the number of user-defined profiles on 534 539 !-- the restart file (already stored in max_pr_user) has to match the 535 !-- one given for the current run. max_pr_user_tmp is calculated in 540 !-- one given for the current run. max_pr_user_tmp is calculated in 536 541 !-- user_parin and max_pr_user is read in via rrd_global. 537 542 IF ( max_pr_user /= max_pr_user_tmp ) THEN … … 566 571 567 572 ! 568 !-- In case of nested runs, explicitly set nesting boundary conditions. 573 !-- In case of nested runs, explicitly set nesting boundary conditions. 569 574 !-- This will overwrite the user settings and basic defaults. 570 575 !-- bc_lr and bc_ns always need to be cyclic for vertical nesting. … … 584 589 bc_s_t = 'nested' 585 590 bc_cs_t = 'nested' 586 bc_p_t = 'neumann' 591 bc_p_t = 'neumann' 587 592 ENDIF 588 593 ! 589 !-- For other nesting modes only set boundary conditions for 594 !-- For other nesting modes only set boundary conditions for 590 595 !-- nested domains. 591 ELSE 596 ELSE 592 597 IF ( child_domain ) THEN 593 598 bc_lr = 'nested' … … 616 621 ENDIF 617 622 618 ! 623 ! 619 624 !-- In case of nested runs, make sure that initializing_actions = 620 !-- 'set_constant_profiles' even though the constant-profiles 621 !-- initializations for the prognostic variables will be overwritten 622 !-- by pmci_child_initialize and pmci_parent_initialize. This is, 623 !-- however, important e.g. to make sure that diagnostic variables 625 !-- 'set_constant_profiles' even though the constant-profiles 626 !-- initializations for the prognostic variables will be overwritten 627 !-- by pmci_child_initialize and pmci_parent_initialize. This is, 628 !-- however, important e.g. to make sure that diagnostic variables 624 629 !-- are set properly. An exception is made in case of restart runs and 625 630 !-- if user decides to do everything by its own. … … 631 636 TRIM( initializing_actions ) // ' has been ' // & 632 637 'changed to set_constant_profiles in child ' // & 633 'domain.' 638 'domain.' 634 639 CALL message( 'parin', 'PA0492', 0, 0, 0, 6, 0 ) 635 640 636 641 initializing_actions = 'set_constant_profiles' 637 ENDIF 642 ENDIF 638 643 ! 639 644 !-- Check validity of lateral boundary conditions. This has to be done
Note: See TracChangeset
for help on using the changeset viewer.