Changeset 1575


Ignore:
Timestamp:
Mar 27, 2015 9:56:27 AM (7 years ago)
Author:
raasch
Message:

optimized multigrid method installed, new parameter seed_follows_topography for particle release, small adjustment in subjob for HLRN

Location:
palm/trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/subjob

    r1548 r1575  
    2323# Current revisions:
    2424# ------------------
    25 #
     25# mpp2-queues added to lccrayh
    2626#
    2727# Former revisions:
     
    417417                 esac;;
    418418        (lccrayh) case  $ndq  in
    419                      (dataq|mpp1q|mpp1testq|smp1q|smp1testq|specialm1q)   error=false;;
     419                     (dataq|mpp1q|mpp1testq|mpp2q|mpp2testq|smp1q|smp1testq|specialm1q)   error=false;;
    420420                     (*)                                     error=true;;
    421421                 esac;;
  • palm/trunk/SOURCE/Makefile

    r1552 r1575  
    2020# Current revisions:
    2121# ------------------
    22 #
     22# +poismg_fast
    2323#
    2424# Former revisions:
     
    220220        init_pegrid.f90 init_pt_anomaly.f90 init_rankine.f90 init_slope.f90 \
    221221        interaction_droplets_ptq.f90 land_surface_model.f90 local_flush.f90 \
    222         local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
     222   local_getenv.f90 local_stop.f90 local_system.f90 local_tremain.f90 \
    223223        local_tremain_ini.f90 lpm.f90 lpm_advec.f90 lpm_boundary_conds.f90 \
    224224        lpm_calc_liquid_water_content.f90 lpm_collision_kernels.f90 \
     
    231231        lpm_write_exchange_statistics.f90 lpm_write_restart_file.f90 \
    232232        ls_forcing.f90 message.f90 microphysics.f90 modules.f90 mod_kinds.f90 \
    233         mod_particle_attributes.f90 netcdf.f90 nudging.f90 \
    234         package_parin.f90 palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 \
    235         poismg.f90 prandtl_fluxes.f90 pres.f90 print_1d.f90 production_e.f90 \
     233        mod_particle_attributes.f90 netcdf.f90 nudging.f90 package_parin.f90 \
     234        palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 poismg.f90 \
     235        poismg_fast.f90 prandtl_fluxes.f90 pres.f90 print_1d.f90 production_e.f90 \
    236236        prognostic_equations.f90 progress_bar.f90 radiation_model.f90 \
    237237        random_function.f90 random_gauss.f90 random_generator_parallel.f90 \
     
    249249        user_data_output_mask.f90 user_define_netcdf_grid.f90 \
    250250        user_dvrp_coltab.f90 user_header.f90 user_init.f90 \
    251         user_init_3d_model.f90 user_init_grid.f90 \
    252         user_init_land_surface.f90 \
     251        user_init_3d_model.f90 user_init_grid.f90 user_init_land_surface.f90 \
    253252        user_init_plant_canopy.f90 user_last_actions.f90 user_lpm_advec.f90 \
    254253        user_lpm_init.f90 user_lpm_set_attributes.f90 user_module.f90 \
     
    413412poisfft.o: modules.o cpulog.o fft_xy.o mod_kinds.o tridia_solver.o
    414413poismg.o: modules.o cpulog.o mod_kinds.o
     414poismg_fast.o: modules.o cpulog.o mod_kinds.o
    415415prandtl_fluxes.o: modules.o mod_kinds.o
    416 pres.o: modules.o cpulog.o mod_kinds.o poisfft.o
     416pres.o: modules.o cpulog.o mod_kinds.o poisfft.o poismg_fast.o
    417417print_1d.o: modules.o cpulog.o mod_kinds.o
    418418production_e.o: modules.o mod_kinds.o wall_fluxes.o
  • palm/trunk/SOURCE/calc_spectra.f90

    r1512 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! adjustments for psolver-queries
    2323!
    2424! Former revisions:
     
    113113!
    114114!-- Reallocate array d in required size
    115     IF ( psolver == 'multigrid' )  THEN
     115    IF ( psolver(1:9) == 'multigrid' )  THEN
    116116       DEALLOCATE( d )
    117117       ALLOCATE( d(nzb+1:nzt,nys:nyn,nxl:nxr) )
  • palm/trunk/SOURCE/check_parameters.f90

    r1574 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! multigrid_fast added as allowed pressure solver
    2323!
    2424! Former revisions:
     
    716716!-- Check whether there are any illegal values
    717717!-- Pressure solver:
    718     IF ( psolver /= 'poisfft'  .AND. &
    719          psolver /= 'sor'  .AND.  psolver /= 'multigrid' )  THEN
     718    IF ( psolver /= 'poisfft'  .AND.  psolver /= 'sor'  .AND.                  &
     719         psolver /= 'multigrid'  .AND.  psolver /= 'multigrid_fast' )  THEN
    720720       message_string = 'unknown solver for perturbation pressure: psolver' // &
    721721                        ' = "' // TRIM( psolver ) // '"'
     
    723723    ENDIF
    724724
    725     IF ( psolver == 'multigrid' )  THEN
     725    IF ( psolver(1:9) == 'multigrid' )  THEN
    726726       IF ( cycle_mg == 'w' )  THEN
    727727          gamma_mg = 2
     
    17151715!-- and tools do not work with non-cyclic boundary conditions.
    17161716    IF ( bc_lr /= 'cyclic'  .OR.  bc_ns /= 'cyclic' )  THEN
    1717        IF ( psolver /= 'multigrid' )  THEN
     1717       IF ( psolver(1:9) /= 'multigrid' )  THEN
    17181718          message_string = 'non-cyclic lateral boundaries do not allow ' // &
    17191719                           'psolver = "' // TRIM( psolver ) // '"'
  • palm/trunk/SOURCE/header.f90

    r1561 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! adjustments for psolver-queries, output of seed_follows_topography
    2323!
    2424! Former revisions:
     
    227227               particles_per_point, pdx, pdy, pdz,  psb, psl, psn, psr, pss,   &
    228228               pst, radius, radius_classes, random_start_position,             &
     229               seed_follows_topography,                                        &
    229230               total_number_of_particles, use_particle_tails,                  &
    230231               use_sgs_for_particles, total_number_of_tails,                   &
     
    424425    ELSEIF ( psolver == 'sor' )  THEN
    425426       WRITE ( io, 112 )  nsor_ini, nsor, omega_sor
    426     ELSEIF ( psolver == 'multigrid' )  THEN
    427        WRITE ( io, 135 )  cycle_mg, maximum_grid_level, ngsrb
     427    ELSEIF ( psolver(1:9) == 'multigrid' )  THEN
     428       WRITE ( io, 135 )  TRIM(psolver), cycle_mg, maximum_grid_level, ngsrb
    428429       IF ( mg_cycles == -1 )  THEN
    429430          WRITE ( io, 140 )  residual_limit
     
    17881789       IF ( use_sgs_for_particles )  WRITE ( io, 488 )  dt_min_part
    17891790       IF ( random_start_position )  WRITE ( io, 481 )
     1791       IF ( seed_follows_topography )  WRITE ( io, 496 )
    17901792       IF ( particles_per_point > 1 )  WRITE ( io, 489 )  particles_per_point
    17911793       WRITE ( io, 495 )  total_number_of_particles
     
    19071909133 FORMAT ('     Precipitation parameterization via Kessler-Scheme')
    19081910134 FORMAT (' --> Additional prognostic equation for a passive scalar')
    1909 135 FORMAT (' --> Solve perturbation pressure via multigrid method (', &
     1911135 FORMAT (' --> Solve perturbation pressure via ',A,' method (', &
    19101912                  A,'-cycle)'/ &
    19111913            '     number of grid levels:                   ',I2/ &
     
    23262328                    F8.2,' s'/)
    23272329495 FORMAT ('       Number of particles in total domain: ',I10/)
     2330496 FORMAT ('       Initial vertical particle positions are interpreted ', &
     2331                    'as relative to the given topography')
    23282332500 FORMAT (//' 1D-Model parameters:'/                           &
    23292333              ' -------------------'//                           &
  • palm/trunk/SOURCE/init_3d_model.f90

    r1552 r1575  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! adjustments for psolver-queries
    2323!
    2424! Former revisions:
     
    356356    IF ( psolver == 'sor' )  THEN
    357357       ALLOCATE( p_loc(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    358     ELSEIF ( psolver == 'multigrid' )  THEN
     358    ELSEIF ( psolver(1:9) == 'multigrid' )  THEN
    359359!
    360360!--    For performance reasons, multigrid is using one ghost layer only
     
    11351135!
    11361136!--    In case of iterative solvers, p must get an initial value
    1137        IF ( psolver == 'multigrid'  .OR.  psolver == 'sor' )  p = 0.0_wp
     1137       IF ( psolver(1:9) == 'multigrid'  .OR.  psolver == 'sor' )  p = 0.0_wp
    11381138
    11391139!
  • palm/trunk/SOURCE/init_grid.f90

    r1558 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! adjustments for psolver-queries
    2323!
    2424! Former revisions:
     
    332332!-- containing with appropriate grid information is created for these
    333333!-- solvers.
    334     IF ( psolver /= 'multigrid' )  THEN
     334    IF ( psolver(1:9) /= 'multigrid' )  THEN
    335335       ALLOCATE( ddzu_pres(1:nzt+1) )
    336336       ddzu_pres = ddzu
     
    341341!-- In case of multigrid method, compute grid lengths and grid factors for the
    342342!-- grid levels
    343     IF ( psolver == 'multigrid' )  THEN
     343    IF ( psolver(1:9) == 'multigrid' )  THEN
    344344
    345345       ALLOCATE( ddx2_mg(maximum_grid_level), ddy2_mg(maximum_grid_level), &
     
    10471047!
    10481048!-- Calculate wall flag arrays for the multigrid method
    1049     IF ( psolver == 'multigrid' )  THEN
     1049    IF ( psolver(1:9) == 'multigrid' )  THEN
    10501050!
    10511051!--    Gridpoint increment of the current level
  • palm/trunk/SOURCE/init_pegrid.f90

    r1566 r1575  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! adjustments for psolver-queries, calculation of ngp_xz added
    2323!
    2424! Former revisions:
     
    761761!-- Calculate number of grid levels necessary for the multigrid poisson solver
    762762!-- as well as the gridpoint indices on each level
    763     IF ( psolver == 'multigrid' )  THEN
     763    IF ( psolver(1:9) == 'multigrid' )  THEN
    764764
    765765!
     
    977977!-- Do these calculations for the model grid and (if necessary) also
    978978!-- for the coarser grid levels used in the multigrid method
    979     ALLOCATE ( ngp_yz(0:maximum_grid_level), type_xz(0:maximum_grid_level),&
    980                type_yz(0:maximum_grid_level) )
     979    ALLOCATE ( ngp_xz(0:maximum_grid_level), ngp_yz(0:maximum_grid_level),     &
     980               type_xz(0:maximum_grid_level), type_yz(0:maximum_grid_level) )
    981981
    982982    nxl_l = nxl; nxr_l = nxr; nys_l = nys; nyn_l = nyn; nzb_l = nzb; nzt_l = nzt
     
    10071007!
    10081008!-- Definition of MPI-datatypes for multigrid method (coarser level grids)
    1009     IF ( psolver == 'multigrid' )  THEN
     1009    IF ( psolver(1:9) == 'multigrid' )  THEN
    10101010!   
    10111011!--    Definition of MPI-datatyoe as above, but only 1 ghost level is used
    10121012       DO  i = maximum_grid_level, 1 , -1
    10131013
     1014          ngp_xz(i) = (nzt_l - nzb_l + 2) * (nxr_l - nxl_l + 3)
    10141015          ngp_yz(i) = (nzt_l - nzb_l + 2) * (nyn_l - nys_l + 3)
    10151016
     
    11291130!
    11301131!-- Allocate wall flag arrays used in the multigrid solver
    1131     IF ( psolver == 'multigrid' )  THEN
     1132    IF ( psolver(1:9) == 'multigrid' )  THEN
    11321133
    11331134       DO  i = maximum_grid_level, 1, -1
  • palm/trunk/SOURCE/lpm_init.f90

    r1360 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! initial vertical particle position is allowed to follow the topography
    2323!
    2424! Former revisions:
     
    101101
    102102    USE indices,                                                               &
    103         ONLY:  nx, nxl, nxlg, nxrg, nxr, ny, nyn, nys, nyng, nysg, nz, nzb, nzt
     103        ONLY:  nx, nxl, nxlg, nxrg, nxr, ny, nyn, nys, nyng, nysg, nz, nzb,    &
     104               nzb_w_inner, nzt
    104105
    105106    USE kinds
     
    126127                prt_count, psb, psl, psn, psr, pss, pst,                       &
    127128                radius, random_start_position, read_particles_from_restartfile,&
    128                 skip_particles_for_tail, sort_count,                           &
     129                seed_follows_topography, skip_particles_for_tail, sort_count,  &
    129130                tail_mask, total_number_of_particles, total_number_of_tails,   &
    130131                use_particle_tails, use_sgs_for_particles,                     &
     
    649650                   pos_x = psl(i)
    650651
    651                   DO WHILE ( pos_x <= psr(i) )
     652            xloop: DO WHILE ( pos_x <= psr(i) )
    652653
    653654                      IF ( pos_x >= ( nxl - 0.5_wp ) * dx  .AND.  &
     
    738739                               tmp_particle%tail_id    = 0
    739740                            ENDIF
     741!
     742!--                         Determine the grid indices of the particle position
    740743                            ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx
    741744                            jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy
    742745                            kp = tmp_particle%z / dz + 1 + offset_ocean_nzt_m1
     746
     747                            IF ( seed_follows_topography )  THEN
     748!
     749!--                            Particle height is given relative to topography
     750                               kp = kp + nzb_w_inner(jp,ip)
     751                               tmp_particle%z = tmp_particle%z + zw(kp)
     752                               IF ( kp > nzt )  THEN
     753                                  pos_x = pos_x + pdx(i)
     754                                  CYCLE xloop
     755                               ENDIF
     756                            ENDIF
    743757
    744758                            local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1
     
    758772                      pos_x = pos_x + pdx(i)
    759773
    760                    ENDDO
     774                   ENDDO xloop
    761775
    762776                ENDIF
  • palm/trunk/SOURCE/mod_particle_attributes.f90

    r1360 r1575  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! +seed_follows_topography
    2323!
    2424! Former revisions:
     
    6969                particle_advection = .FALSE., random_start_position = .FALSE., &
    7070                read_particles_from_restartfile = .TRUE.,                      &
     71                seed_follows_topography = .FALSE.,                             &
    7172                uniform_particles = .TRUE., use_kernel_tables = .FALSE.,       &
    7273                use_particle_tails = .FALSE., use_sgs_for_particles = .FALSE., &
  • palm/trunk/SOURCE/modules.f90

    r1561 r1575  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! +ngp_xz
    2323!
    2424! Former revisions:
     
    13041304
    13051305
    1306     INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  ngp_yz, type_xz, type_yz
     1306    INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  ngp_xz, ngp_yz, type_xz, type_yz
    13071307
    13081308    LOGICAL ::  left_border_pe  = .FALSE., north_border_pe = .FALSE., &
  • palm/trunk/SOURCE/package_parin.f90

    r1554 r1575  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! +seed_follows_topography in particles_par
    2323!
    2424! Former revisions:
     
    129129               psb, psl, psn, psr, pss, pst, radius, radius_classes,           &
    130130               random_start_position, read_particles_from_restartfile,         &
    131                skip_particles_for_tail, use_particle_tails,                    &
    132                use_sgs_for_particles, vertical_particle_advection,             &
    133                write_particle_statistics
     131               seed_follows_topography, skip_particles_for_tail,               &
     132               use_particle_tails, use_sgs_for_particles,                      &
     133               vertical_particle_advection, write_particle_statistics
    134134
    135135    USE plant_canopy_model_mod,                                                &
     
    212212                                  radius_classes, random_start_position,       &
    213213                                  read_particles_from_restartfile,             &
     214                                  seed_follows_topography,                     &
    214215                                  skip_particles_for_tail,                     &
    215216                                  use_particle_tails, use_sgs_for_particles,   &
  • palm/trunk/SOURCE/pres.f90

    r1343 r1575  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! poismg_fast + respective module added, adjustments for psolver-queries
    2323!
    2424! Former revisions:
     
    114114        ONLY:  poisfft
    115115
     116    USE poismg_mod
     117
    116118    USE statistics,                                                            &
    117119        ONLY:  statistic_regions, sums_divnew_l, sums_divold_l, weight_pres,   &
     
    144146!-- Multigrid method expects array d to have one ghost layer.
    145147!--
    146     IF ( psolver == 'multigrid' )  THEN
     148    IF ( psolver(1:9) == 'multigrid' )  THEN
    147149     
    148150       DEALLOCATE( d )
     
    293295    CALL cpu_log( log_point_s(1), 'divergence', 'start' )
    294296
    295     IF ( psolver == 'multigrid' )  THEN
     297    IF ( psolver(1:9) == 'multigrid' )  THEN
    296298       !$OMP PARALLEL DO SCHEDULE( STATIC )
    297299       DO  i = nxl-1, nxr+1
     
    388390!
    389391!-- Compute the pressure perturbation solving the Poisson equation
    390     IF ( psolver(1:7) == 'poisfft' )  THEN
     392    IF ( psolver == 'poisfft' )  THEN
    391393
    392394!
    393395!--    Solve Poisson equation via FFT and solution of tridiagonal matrices
    394        IF ( psolver == 'poisfft' )  THEN
    395 
    396           CALL poisfft( d )
    397 
    398        ENDIF
     396       CALL poisfft( d )
    399397
    400398!
     
    492490       tend = p_loc
    493491
    494     ELSEIF ( psolver == 'multigrid' )  THEN
     492    ELSEIF ( psolver(1:9) == 'multigrid' )  THEN
    495493
    496494!
     
    511509       ENDIF
    512510
    513        CALL poismg( tend )
     511       IF ( psolver == 'multigrid' )  THEN
     512          CALL poismg( tend )
     513       ELSE
     514          CALL poismg_fast( tend )
     515       ENDIF
    514516
    515517       IF ( gathered_size > subdomain_size )  THEN
Note: See TracChangeset for help on using the changeset viewer.