Changeset 1429


Ignore:
Timestamp:
Jul 15, 2014 12:53:45 PM (7 years ago)
Author:
knoop
Message:

Ensemble run capability added to parallel random number generator.

Location:
palm/trunk/SOURCE
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/check_parameters.f90

    r1426 r1429  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! run_description_header exended to provide ensemble_member_nr if specified
    2323!
    2424! Former revisions:
     
    510510    ENDIF       
    511511
    512     WRITE ( run_description_header,                                        &
    513                              '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,A,2X,A,1X,A)' ) &
    514               TRIM( version ), TRIM( revision ), 'run: ',                  &
    515               TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), &
     512    IF ( ensemble_member_nr /= 0 )  THEN
     513       WRITE ( run_description_header,                                         &
     514                  '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,I2.2,2X,A,A,2X,A,1X,A)' )      &
     515              TRIM( version ), TRIM( revision ), 'run: ',                      &
     516              TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ),     &
     517              'en-no: ', ensemble_member_nr,'host: ', TRIM( host ),            &
     518              run_date, run_time
     519    ELSE
     520       WRITE ( run_description_header,                                         &
     521                  '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,A,2X,A,1X,A)' )                &
     522              TRIM( version ), TRIM( revision ), 'run: ',                      &
     523              TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ),     &
    516524              'host: ', TRIM( host ), run_date, run_time
    517 
     525    ENDIF
    518526!
    519527!-- Check the general loop optimization method
  • palm/trunk/SOURCE/header.f90

    r1377 r1429  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! header exended to provide ensemble_member_nr if specified
    2323!
    2424! Former revisions:
     
    327327    ENDIF
    328328#endif
    329     WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr, &
     329    IF ( ensemble_member_nr /= 0 )  THEN
     330       WRITE ( io, 512 )  run_date, run_identifier, run_time, runnr,           &
     331                       ADJUSTR( host_chr ), ensemble_member_nr
     332    ELSE
     333       WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr,           &
    330334                       ADJUSTR( host_chr )
     335    ENDIF
    331336#if defined( __parallel )
    332337    IF ( npex == -1  .AND.  pdims(2) /= 1 )  THEN
     
    21382143511 FORMAT ('        Sedimentation Courant number:                  '/&
    21392144            '                               C_s   = ',F3.1,'        ')
     2145512 FORMAT (/' Date:                 ',A8,6X,'Run:       ',A20/      &
     2146            ' Time:                 ',A8,6X,'Run-No.:   ',I2.2/     &
     2147            ' Run on host:        ',A10,6X,'En-No.:    ',I2.2)
    21402148
    21412149 END SUBROUTINE header
  • palm/trunk/SOURCE/init_3d_model.f90

    r1412 r1429  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Ensemble run capability added to parallel random number generator
    2323!
    2424! Former revisions:
     
    194194    USE indices
    195195
    196     USE lpm_init_mod,                                                              &
     196    USE lpm_init_mod,                                                          &
    197197        ONLY:  lpm_init
    198198   
     
    948948!--    Initialize the random number generators (from numerical recipes)
    949949       CALL random_function_ini
     950       
    950951       IF ( random_generator == 'random-parallel' )  THEN
    951           CALL random_function_ini
    952           !- asigning an ID to every vertical gridpoint column
     952!--       Asigning an ID to every vertical gridpoint column
     953!--       dependig on the ensemble run number.
     954          random_dummy=1
    953955          DO j=0,ny
    954956             DO i=0,nx
    955                 id_random_array(j,i) = 1000000*i + j
     957                id_random_array(j,i) = random_dummy + 1E6 * ( ensemble_member_nr - 1000 )
     958                random_dummy = random_dummy + 1
    956959             END DO
    957960          ENDDO
    958           !- executing the initial ran_parallel
     961!--       Initializing with random_seed_parallel for every vertical
     962!--       gridpoint column.
     963          random_dummy=0
    959964          DO j = nysg, nyng
    960965             DO i = nxlg, nxrg
  • palm/trunk/SOURCE/modules.f90

    r1383 r1429  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! +ensemble_member_nr to prepare the random_generator for ensemble runs
    2323!
    2424! Former revisions:
     
    560560                     do2d_xy_n = 0, do2d_xz_n = 0, do2d_yz_n = 0, do3d_avs_n = 0, &
    561561                     dp_level_ind_b = 0, dvrp_filecount = 0, &
    562                      dz_stretch_level_index, gamma_mg, gathered_size, &
     562                     dz_stretch_level_index, ensemble_member_nr = 0, gamma_mg, gathered_size, &
    563563                     grid_level, ibc_e_b, ibc_p_b, ibc_p_t, &
    564564                     ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, &
  • palm/trunk/SOURCE/parin.f90

    r1403 r1429  
    1919!
    2020! Current revisions:
    21 ! -----------------
    22 !
     21! ------------------
     22! +ensemble_member_nr to prepare the random_generator for ensemble runs
    2323!
    2424! Former revisions:
     
    174174               do2d_at_begin, do3d_at_begin,                                   &
    175175               dp_external, dp_level_b, dp_smooth, dpdxy, drag_coefficient,    &
    176                drizzle, dt, dz, dt_averaging_input, dt_averaging_input_pr,     &
     176               drizzle, dt, dt_averaging_input, dt_averaging_input_pr,         &
    177177               dt_coupling, dt_data_output, dt_data_output_av, dt_disturb,     &
    178178               dt_domask, dt_dopr, dt_dopr_listing, dt_dots, dt_do2d_xy,       &
    179179               dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_max, dt_restart,            &
    180                dt_run_control, dz_max, dz_stretch_factor, dz_stretch_level,    &
    181                end_time, e_init, e_min, fft_method, force_print_header,        &
     180               dt_run_control, dz, dz_max, dz_stretch_factor, dz_stretch_level,&
     181               end_time, ensemble_member_nr, e_init, e_min, fft_method,        &
     182               force_print_header,                                             &
    182183               galilei_transformation, host, humidity, inflow_damping_height,  &
    183184               inflow_damping_width, inflow_disturbance_begin,                 &
     
    261262
    262263    NAMELIST /inipar/  alpha_surface, background_communication, bc_e_b, bc_lr, &
    263                        bc_ns, bc_p_b, bc_p_t, bc_pt_b, bc_pt_t, bc_q_b, &
    264              bc_q_t,bc_s_b, bc_s_t, bc_sa_t, bc_uv_b, bc_uv_t, &
    265              bottom_salinityflux, building_height, building_length_x, &
    266              building_length_y, building_wall_left, building_wall_south, &
    267              call_psolver_at_all_substeps, call_microphysics_at_all_substeps, &
    268              canopy_mode, canyon_height, &
    269              canyon_width_x, canyon_width_y, canyon_wall_left, &
    270              canyon_wall_south, c_sedimentation, cfl_factor, cloud_droplets, &
    271              cloud_physics, cloud_scheme, collective_wait, &
    272              conserve_volume_flow, &
    273              conserve_volume_flow_mode, coupling_start_time, cthf, &
    274              curvature_solution_effects, cycle_mg, damp_level_1d, &
    275              dissipation_1d, & !dissipation_control, &
    276              dp_external, dp_level_b, dp_smooth, dpdxy, drag_coefficient, &
    277              drizzle, dt, dt_pr_1d, dt_run_control_1d, dx, dy, dz, dz_max, &
    278              dz_stretch_factor, dz_stretch_level, e_init, e_min, end_time_1d, &
    279              fft_method, galilei_transformation, humidity, &
    280              inflow_damping_height, inflow_damping_width, &
    281              inflow_disturbance_begin, inflow_disturbance_end, &
    282              initializing_actions, km_constant, lad_surface, &
    283              lad_vertical_gradient, lad_vertical_gradient_level, &
    284              large_scale_forcing, large_scale_subsidence, &
    285              leaf_surface_concentration, limiter_sedimentation, &
    286              loop_optimization, masking_method, mg_cycles, &
    287              mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, &
    288              nc_const, netcdf_precision, neutral, ngsrb, &
    289              nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor, &
    290              passive_scalar, pch_index, phi, plant_canopy, prandtl_layer, &
    291              prandtl_number, precipitation, psolver, pt_damping_factor, &
    292              pt_damping_width, pt_reference, pt_surface, &
    293              pt_surface_initial_change, pt_vertical_gradient, &
    294              pt_vertical_gradient_level, q_surface, q_surface_initial_change, &
    295              q_vertical_gradient, q_vertical_gradient_level, &
    296              radiation, random_generator, random_heatflux, &
     264                       bc_ns, bc_p_b, bc_p_t, bc_pt_b, bc_pt_t, bc_q_b,        &
     265             bc_q_t,bc_s_b, bc_s_t, bc_sa_t, bc_uv_b, bc_uv_t,                 &
     266             bottom_salinityflux, building_height, building_length_x,          &
     267             building_length_y, building_wall_left, building_wall_south,       &
     268             call_psolver_at_all_substeps, call_microphysics_at_all_substeps,  &
     269             canopy_mode, canyon_height,                                       &
     270             canyon_width_x, canyon_width_y, canyon_wall_left,                 &
     271             canyon_wall_south, c_sedimentation, cfl_factor, cloud_droplets,   &
     272             cloud_physics, cloud_scheme, collective_wait,                     &
     273             conserve_volume_flow,                                             &
     274             conserve_volume_flow_mode, coupling_start_time, cthf,             &
     275             curvature_solution_effects, cycle_mg, damp_level_1d,              &
     276             dissipation_1d,                                                   &
     277             dp_external, dp_level_b, dp_smooth, dpdxy, drag_coefficient,      &
     278             drizzle, dt, dt_pr_1d, dt_run_control_1d, dx, dy, dz, dz_max,     &
     279             dz_stretch_factor, dz_stretch_level, end_time_1d,                 &
     280             ensemble_member_nr,                                               &
     281             e_init, e_min, fft_method, galilei_transformation, humidity,      &
     282             inflow_damping_height, inflow_damping_width,                      &
     283             inflow_disturbance_begin, inflow_disturbance_end,                 &
     284             initializing_actions, km_constant, lad_surface,                   &
     285             lad_vertical_gradient, lad_vertical_gradient_level,               &
     286             large_scale_forcing, large_scale_subsidence,                      &
     287             leaf_surface_concentration, limiter_sedimentation,                &
     288             loop_optimization, masking_method, mg_cycles,                     &
     289             mg_switch_to_pe0_level, mixing_length_1d, momentum_advec,         &
     290             nc_const, netcdf_precision, neutral, ngsrb,                       &
     291             nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor,     &
     292             passive_scalar, pch_index, phi, plant_canopy, prandtl_layer,      &
     293             prandtl_number, precipitation, psolver, pt_damping_factor,        &
     294             pt_damping_width, pt_reference, pt_surface,                       &
     295             pt_surface_initial_change, pt_vertical_gradient,                  &
     296             pt_vertical_gradient_level, q_surface, q_surface_initial_change,  &
     297             q_vertical_gradient, q_vertical_gradient_level,                   &
     298             radiation, random_generator, random_heatflux,                     &
    297299             rayleigh_damping_factor, rayleigh_damping_height, recycling_width,&
    298              reference_state, residual_limit, &
    299              rif_max, rif_min, roughness_length, sa_surface, &
    300              sa_vertical_gradient, sa_vertical_gradient_level, scalar_advec, &
    301              scalar_exchange_coefficient, scalar_rayleigh_damping, &
    302              statistic_regions, subs_vertical_gradient, &
     300             reference_state, residual_limit,                                  &
     301             rif_max, rif_min, roughness_length, sa_surface,                   &
     302             sa_vertical_gradient, sa_vertical_gradient_level, scalar_advec,   &
     303             scalar_exchange_coefficient, scalar_rayleigh_damping,             &
     304             statistic_regions, subs_vertical_gradient,                        &
    303305             subs_vertical_gradient_level, surface_heatflux, surface_pressure, &
    304              surface_scalarflux, surface_waterflux, &
    305              s_surface, s_surface_initial_change, s_vertical_gradient, &
    306              s_vertical_gradient_level, timestep_scheme, &
    307              topography, topography_grid_convention, top_heatflux, &
    308              top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
    309              transpose_compute_overlap, turbulence, turbulent_inflow, &
    310              use_subsidence_tendencies, ug_surface, ug_vertical_gradient, &
    311              ug_vertical_gradient_level, use_surface_fluxes, use_cmax, &
    312              use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke, &
    313              uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient, &
    314              vg_vertical_gradient_level, v_bulk, v_profile, ventilation_effect, &
    315              wall_adjustment, wall_heatflux, wall_humidityflux, wall_scalarflux, &
    316              z0h_factor
     306             surface_scalarflux, surface_waterflux,                            &
     307             s_surface, s_surface_initial_change, s_vertical_gradient,         &
     308             s_vertical_gradient_level, timestep_scheme,                       &
     309             topography, topography_grid_convention, top_heatflux,             &
     310             top_momentumflux_u, top_momentumflux_v, top_salinityflux,         &
     311             transpose_compute_overlap, turbulence, turbulent_inflow,          &
     312             use_subsidence_tendencies, ug_surface, ug_vertical_gradient,      &
     313             ug_vertical_gradient_level, use_surface_fluxes, use_cmax,         &
     314             use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke,      &
     315             uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient,  &
     316             vg_vertical_gradient_level, v_bulk, v_profile, ventilation_effect,&
     317             wall_adjustment, wall_heatflux, wall_humidityflux,               &
     318             wall_scalarflux, z0h_factor
    317319     
    318     NAMELIST /d3par/  averaging_interval, averaging_interval_pr, &
    319              cpu_log_barrierwait, create_disturbances, &
    320              cross_profiles, cross_ts_uymax, cross_ts_uymin, &
     320    NAMELIST /d3par/  averaging_interval, averaging_interval_pr,               &
     321             cpu_log_barrierwait, create_disturbances,                         &
     322             cross_profiles, cross_ts_uymax, cross_ts_uymin,                   &
    321323             data_output, data_output_masks,                                   &
    322324             data_output_pr, data_output_2d_on_each_pe, disturbance_amplitude, &
    323              disturbance_energy_limit, disturbance_level_b, &
     325             disturbance_energy_limit, disturbance_level_b,                    &
    324326             disturbance_level_t, do2d_at_begin, do3d_at_begin,                &
    325              dt, dt_averaging_input, dt_averaging_input_pr, &
    326              dt_coupling, dt_data_output, dt_data_output_av, dt_disturb, &
    327              dt_domask, dt_dopr, dt_dopr_listing, dt_dots, dt_do2d_xy, &
    328              dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_max, dt_restart, &
    329              dt_run_control,end_time, force_print_header, mask_scale_x, &
    330              mask_scale_y, mask_scale_z, mask_x, mask_y, mask_z, mask_x_loop, &
     327             dt, dt_averaging_input, dt_averaging_input_pr,                    &
     328             dt_coupling, dt_data_output, dt_data_output_av, dt_disturb,       &
     329             dt_domask, dt_dopr, dt_dopr_listing, dt_dots, dt_do2d_xy,         &
     330             dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_max, dt_restart,              &
     331             dt_run_control,end_time, force_print_header, mask_scale_x,        &
     332             mask_scale_y, mask_scale_z, mask_x, mask_y, mask_z, mask_x_loop,  &
    331333             mask_y_loop, mask_z_loop, netcdf_data_format, normalizing_region, &
    332              npex, npey, nz_do3d, precipitation_amount_interval, &
    333              profile_columns, profile_rows, restart_time, section_xy, &
    334              section_xz, section_yz, skip_time_data_output, &
    335              skip_time_data_output_av, skip_time_dopr, skip_time_do2d_xy, &
    336              skip_time_do2d_xz, skip_time_do2d_yz, skip_time_do3d, &
    337              skip_time_domask, synchronous_exchange, termination_time_needed, &
     334             npex, npey, nz_do3d, precipitation_amount_interval,               &
     335             profile_columns, profile_rows, restart_time, section_xy,          &
     336             section_xz, section_yz, skip_time_data_output,                    &
     337             skip_time_data_output_av, skip_time_dopr, skip_time_do2d_xy,      &
     338             skip_time_do2d_xz, skip_time_do2d_yz, skip_time_do3d,             &
     339             skip_time_domask, synchronous_exchange, termination_time_needed,  &
    338340             z_max_do2d
    339341
    340342
    341     NAMELIST /envpar/  batch_job, host, local_dvrserver_running, &
    342                        maximum_cpu_time_allowed, maximum_parallel_io_streams, &
    343                        revision, return_addres, return_username, &
     343    NAMELIST /envpar/  batch_job, host, local_dvrserver_running,               &
     344                       maximum_cpu_time_allowed, maximum_parallel_io_streams,  &
     345                       revision, return_addres, return_username,               &
    344346                       run_identifier, tasks_per_node, write_binary
    345347
     
    361363!-- system.
    362364!-- First, set the default:
    363     IF ( maximum_parallel_io_streams == -1  .OR. &
     365    IF ( maximum_parallel_io_streams == -1  .OR.                               &
    364366         maximum_parallel_io_streams > numprocs )  THEN
    365367       maximum_parallel_io_streams = numprocs
     
    403405          GOTO 12
    404406
    405  10       message_string = 'errors in \$inipar &or no \$inipar-namelist ' // &
     407 10       message_string = 'errors in \$inipar &or no \$inipar-namelist ' //   &
    406408                           'found (CRAY-machines only)'
    407409          CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 )
     
    456458
    457459             IF ( nx <= 0 )  THEN
    458                 WRITE( message_string, * ) 'no value or wrong value given', &
     460                WRITE( message_string, * ) 'no value or wrong value given',    &
    459461                                           ' for nx: nx=', nx
    460462                CALL message( 'parin', 'PA0273', 1, 2, 0, 6, 0 )
    461463             ENDIF
    462464             IF ( ny <= 0 )  THEN
    463                 WRITE( message_string, * ) 'no value or wrong value given', &
     465                WRITE( message_string, * ) 'no value or wrong value given',    &
    464466                                           ' for ny: ny=', ny
    465467                CALL message( 'parin', 'PA0274', 1, 2, 0, 6, 0 )
    466468             ENDIF
    467469             IF ( nz <= 0 )  THEN
    468                 WRITE( message_string, * ) 'no value or wrong value given', &
     470                WRITE( message_string, * ) 'no value or wrong value given',    &
    469471                                           ' for nz: nz=', nz
    470472                CALL message( 'parin', 'PA0275', 1, 2, 0, 6, 0 )
     
    473475!--          ATTENTION: in case of changes to the following statement please
    474476!--                  also check the allocate statement in routine read_var_list
    475              ALLOCATE( lad(0:nz+1), pt_init(0:nz+1), q_init(0:nz+1),          &
    476                        ref_state(0:nz+1), sa_init(0:nz+1), ug(0:nz+1),        &
    477                        u_init(0:nz+1), v_init(0:nz+1), vg(0:nz+1),            &
    478                        hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions), &
     477             ALLOCATE( lad(0:nz+1), pt_init(0:nz+1), q_init(0:nz+1),           &
     478                       ref_state(0:nz+1), sa_init(0:nz+1), ug(0:nz+1),         &
     479                       u_init(0:nz+1), v_init(0:nz+1), vg(0:nz+1),             &
     480                       hom(0:nz+1,2,pr_palm+max_pr_user,0:statistic_regions),  &
    479481                       hom_sum(0:nz+1,pr_palm+max_pr_user,0:statistic_regions) )
    480482
     
    497499    RETURN
    498500
    499  30 message_string = 'local file ENVPAR not found' // &
     501 30 message_string = 'local file ENVPAR not found' //                          &
    500502                     '&some variables for steering may not be properly set'
    501503    CALL message( 'parin', 'PA0276', 0, 1, 0, 6, 0 )
    502504    RETURN
    503505
    504  31 message_string = 'errors in local file ENVPAR' // &
     506 31 message_string = 'errors in local file ENVPAR' //                          &
    505507                     '&some variables for steering may not be properly set'
    506508    CALL message( 'parin', 'PA0277', 0, 1, 0, 6, 0 )
    507509    RETURN
    508510
    509  32 message_string = 'no envpar-NAMELIST found in local file ENVPAR'  // &
     511 32 message_string = 'no envpar-NAMELIST found in local file ENVPAR'  //       &
    510512                     '&some variables for steering may not be properly set'
    511513    CALL message( 'parin', 'PA0278', 0, 1, 0, 6, 0 )
Note: See TracChangeset for help on using the changeset viewer.