Changeset 1210
- Timestamp:
- Aug 14, 2013 10:58:20 AM (11 years ago)
- Location:
- palm/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mbuild
r1197 r1210 22 22 # Current revisions: 23 23 # ------------------ 24 # adjustments for CSC Helsinki (lccrayf)24 # fftw support added 25 25 # 26 26 # Former revisions: 27 27 # ----------------- 28 28 # $Id$ 29 # 30 # 1197 2013-07-04 06:19:45Z raasch 31 # adjustments for CSC Helsinki (lccrayf) 29 32 # 30 33 # 1099 2013-02-10 01:47:43Z raasch … … 450 453 fi 451 454 455 fftw_inc="" 456 fftw_lib="" 452 457 modules="" 453 458 netcdf_inc="" … … 705 710 706 711 707 # NETCDF-OPTIONEN ERMITTELN712 # get netCDF options 708 713 line="" 709 714 grep "$remote_host_string" $config_file | grep "%netcdf_inc" > $tmp_mbuild … … 738 743 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 739 744 netcdf_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 745 fi 746 747 done < $tmp_mbuild 748 749 750 751 # get fftw options 752 line="" 753 grep "$remote_host_string" $config_file | grep "%fftw_inc" > $tmp_mbuild 754 while read line1 755 do 756 757 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 758 then 759 line="$line1" 760 fi 761 762 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 763 then 764 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 765 fftw_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 766 fi 767 768 done < $tmp_mbuild 769 770 line="" 771 grep "$remote_host_string" $config_file | grep "%fftw_lib" > $tmp_mbuild 772 while read line1 773 do 774 775 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 776 then 777 line="$line1" 778 fi 779 780 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 781 then 782 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 783 fftw_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 740 784 fi 741 785 … … 785 829 found=true 786 830 787 # NETCDF-INCLUDEVERZEICHNIS HINZUFUEGEN788 compiler_options="$compiler_options $netcdf_inc "831 # add include paths for netCDF and fftw 832 compiler_options="$compiler_options $netcdf_inc $fftw_inc" 789 833 fi 790 834 … … 857 901 found=true 858 902 859 # NETCDF-LIBRARY HINZUFUEGEN860 loader_options="$loader_options $netcdf_lib "903 # add netCDF- and fftw-library 904 loader_options="$loader_options $netcdf_lib $fftw_lib" 861 905 fi 862 906 … … 1303 1347 echo " *** execute \"make\" on local host" 1304 1348 1349 echo "make $make_options PROG=$mainprog F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$loader_options" 2>&1 | tee ${remote_host}_last_make_protokoll" 1305 1350 make $make_options PROG=$mainprog F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$loader_options" 2>&1 | tee ${remote_host}_last_make_protokoll 1306 1351 -
palm/trunk/SCRIPTS/mrun
r1203 r1210 22 22 # Current revisions: 23 23 # ------------------ 24 # 24 # fftw support added 25 25 # 26 26 # Former revisions: … … 143 143 executable="" 144 144 execution_error=false 145 fftw_inc="" 146 fftw_lib="" 147 fftw_support=false 145 148 fimm=false 146 149 fname=test … … 1917 1920 1918 1921 # COMPILE- UND LINK-OPTIONEN BESTIMMEN 1919 fopts="$fopts $netcdf_inc $ dvr_inc"1920 lopts="$lopts $netcdf_lib $ dvr_lib"1922 fopts="$fopts $netcdf_inc $fftw_inc $dvr_inc" 1923 lopts="$lopts $netcdf_lib $fftw_lib $dvr_lib" 1921 1924 ROPTS="$ropts" 1922 1925 # if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lckyoto || $host = lcsgih || $host = lcsgib || $host = lctit || $host = lcfimm || $host = lcflow || $host = lcxe6 || $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb || $host ) && -n $numprocs ]] -
palm/trunk/SOURCE/Makefile
r1132 r1210 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # object file list replaced by one line statement 23 23 # 24 24 # Former revisions: … … 121 121 PROG = palm 122 122 123 RCS =advec_s_bc.f90 advec_s_pw.f90 advec_s_up.f90 advec_ws.f90 \123 SOURCES = advec_s_bc.f90 advec_s_pw.f90 advec_s_up.f90 advec_ws.f90 \ 124 124 advec_u_pw.f90 advec_u_up.f90 advec_v_pw.f90 advec_v_up.f90 \ 125 125 advec_w_pw.f90 advec_w_up.f90 average_3d_data.f90 boundary_conds.f90 \ … … 175 175 write_3d_binary.f90 write_compressed.f90 write_var_list.f90 176 176 177 OBJS = advec_s_bc.o advec_s_pw.o advec_s_up.o advec_u_pw.o advec_u_up.o \ 178 advec_ws.o advec_v_pw.o advec_v_up.o advec_w_pw.o advec_w_up.o \ 179 average_3d_data.o boundary_conds.o buoyancy.o \ 180 calc_liquid_water_content.o calc_precipitation.o calc_radiation.o \ 181 calc_spectra.o check_for_restart.o check_open.o check_parameters.o \ 182 close_file.o compute_vpt.o coriolis.o cpu_log.o cpu_statistics.o \ 183 cuda_fft_interfaces.o data_log.o data_output_dvrp.o data_output_mask.o \ 184 data_output_profiles.o data_output_ptseries.o \ 185 data_output_spectra.o data_output_tseries.o data_output_2d.o \ 186 data_output_3d.o diffusion_e.o diffusion_s.o diffusion_u.o \ 187 diffusion_v.o diffusion_w.o diffusivities.o disturb_field.o \ 188 disturb_heatflux.o eqn_state_seawater.o exchange_horiz.o \ 189 exchange_horiz_2d.o fft_xy.o flow_statistics.o global_min_max.o \ 190 header.o impact_of_latent_heat.o inflow_turbulence.o init_1d_model.o \ 191 init_3d_model.o init_advec.o init_cloud_physics.o init_coupling.o \ 192 init_dvrp.o init_grid.o init_masks.o init_ocean.o init_pegrid.o \ 193 init_pt_anomaly.o init_rankine.o init_slope.o \ 194 interaction_droplets_ptq.o local_flush.o local_getenv.o local_stop.o \ 195 local_system.o local_tremain.o local_tremain_ini.o lpm.o lpm_advec.o \ 196 lpm_boundary_conds.o lpm_calc_liquid_water_content.o \ 197 lpm_collision_kernels.o lpm_data_output_particles.o \ 198 lpm_droplet_collision.o lpm_droplet_condensation.o \ 199 lpm_exchange_horiz.o lpm_extend_particle_array.o lpm_extend_tails.o \ 200 lpm_extend_tail_array.o lpm_init.o lpm_init_sgs_tke.o \ 201 lpm_pack_arrays.o lpm_read_restart_file.o lpm_release_set.o \ 202 lpm_set_attributes.o lpm_sort_arrays.o lpm_write_exchange_statistics.o \ 203 lpm_write_restart_file.o message.o microphysics.o modules.o netcdf.o \ 204 package_parin.o palm.o parin.o plant_canopy_model.o poisfft.o \ 205 poisfft_hybrid.o poismg.o prandtl_fluxes.o pres.o print_1d.o \ 206 production_e.o prognostic_equations.o random_function.o random_gauss.o \ 207 read_3d_binary.o read_var_list.o run_control.o \ 208 set_slicer_attributes_dvrp.o singleton.o sor.o \ 209 subsidence.o sum_up_3d_data.o surface_coupler.o \ 210 swap_timelevel.o temperton_fft.o time_integration.o time_to_string.o \ 211 timestep.o timestep_scheme_steering.o transpose.o \ 212 user_3d_data_averaging.o user_actions.o user_additional_routines.o \ 213 user_check_data_output.o user_check_data_output_pr.o \ 214 user_check_parameters.o user_data_output_2d.o user_data_output_3d.o \ 215 user_data_output_mask.o user_data_output_dvrp.o \ 216 user_define_netcdf_grid.o user_dvrp_coltab.o user_header.o \ 217 user_init.o user_init_3d_model.o user_init_grid.o \ 218 user_init_plant_canopy.o user_last_actions.o user_lpm_advec.o \ 219 user_lpm_init.o user_lpm_set_attributes.o user_module.o user_parin.o \ 220 user_read_restart_data.o user_spectra.o user_statistics.o \ 221 wall_fluxes.o write_3d_binary.o write_compressed.o write_var_list.o 177 OBJS=$(SOURCES:.f90=.o) 222 178 223 179 CC = cc -
palm/trunk/SOURCE/check_parameters.f90
r1182 r1210 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! check for fftw 23 23 ! 24 24 ! Former revisions: … … 707 707 IF ( fft_method /= 'singleton-algorithm' .AND. & 708 708 fft_method /= 'temperton-algorithm' .AND. & 709 fft_method /= 'fftw' .AND. & 709 710 fft_method /= 'system-specific' ) THEN 710 711 message_string = 'unknown fft-algorithm: fft_method = "' // & -
palm/trunk/SOURCE/fft_xy.f90
r1167 r1210 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! fftw added 23 23 ! 24 24 ! Former revisions: … … 82 82 #if defined( __cuda_fft ) 83 83 USE ISO_C_BINDING 84 #elif defined( __fftw ) 85 USE, INTRINSIC :: ISO_C_BINDING 84 86 #endif 85 87 USE precision_kind … … 113 115 INTEGER(C_INT), SAVE :: plan_xf, plan_xi, plan_yf, plan_yi 114 116 INTEGER, SAVE :: total_points_x_transpo, total_points_y_transpo 117 #elif defined( __fftw ) 118 INCLUDE 'fftw3.f03' 119 INTEGER(KIND=C_INT) :: nx_c, ny_c 120 COMPLEX(KIND=C_DOUBLE_COMPLEX), DIMENSION(:), ALLOCATABLE, SAVE :: x_out, y_out 121 REAL(KIND=C_DOUBLE), DIMENSION(:), ALLOCATABLE, SAVE :: x_in, y_in 122 TYPE(C_PTR), SAVE :: plan_xf, plan_xi, plan_yf, plan_yi 115 123 #endif 116 124 … … 244 252 CALL set99( trigs_y, ifax_y, ny+1 ) 245 253 254 ELSEIF ( fft_method == 'fftw' ) THEN 255 ! 256 !-- FFTW 257 #if defined( __fftw ) 258 nx_c = nx+1 259 ny_c = ny+1 260 ALLOCATE( x_in(0:nx+2), y_in(0:ny+2), x_out(0:(nx+1)/2), & 261 y_out(0:(ny+1)/2) ) 262 plan_xf = FFTW_PLAN_DFT_R2C_1D( nx_c, x_in, x_out, FFTW_ESTIMATE ) 263 plan_xi = FFTW_PLAN_DFT_C2R_1D( nx_c, x_out, x_in, FFTW_ESTIMATE ) 264 plan_yf = FFTW_PLAN_DFT_R2C_1D( ny_c, y_in, y_out, FFTW_ESTIMATE ) 265 plan_yi = FFTW_PLAN_DFT_C2R_1D( ny_c, y_out, y_in, FFTW_ESTIMATE ) 266 #else 267 message_string = 'preprocessor switch for fftw is missing' 268 CALL message( 'fft_init', 'PA0080', 1, 2, 0, 6, 0 ) 269 #endif 270 246 271 ELSEIF ( fft_method == 'singleton-algorithm' ) THEN 247 272 … … 413 438 ENDIF 414 439 440 ELSEIF ( fft_method == 'fftw' ) THEN 441 442 #if defined( __fftw ) 443 IF ( forward_fft ) THEN 444 445 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 446 !$OMP DO 447 DO k = nzb_x, nzt_x 448 DO j = nys_x, nyn_x 449 450 x_in(0:nx) = ar(0:nx,j,k) 451 CALL FFTW_EXECUTE_DFT_R2C( plan_xf, x_in, x_out ) 452 453 DO i = 0, (nx+1)/2 454 ar(i,j,k) = REAL( x_out(i) ) / ( nx+1 ) 455 ENDDO 456 DO i = 1, (nx+1)/2 - 1 457 ar(nx+1-i,j,k) = AIMAG( x_out(i) ) / ( nx+1 ) 458 ENDDO 459 460 ENDDO 461 ENDDO 462 !$OMP END PARALLEL 463 464 ELSE 465 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 466 !$OMP DO 467 DO k = nzb_x, nzt_x 468 DO j = nys_x, nyn_x 469 470 x_out(0) = CMPLX( ar(0,j,k), 0.0 ) 471 DO i = 1, (nx+1)/2 - 1 472 x_out(i) = CMPLX( ar(i,j,k), ar(nx+1-i,j,k) ) 473 ENDDO 474 x_out((nx+1)/2) = CMPLX( ar((nx+1)/2,j,k), 0.0 ) 475 476 CALL FFTW_EXECUTE_DFT_C2R( plan_xi, x_out, x_in) 477 ar(0:nx,j,k) = x_in(0:nx) 478 479 ENDDO 480 ENDDO 481 !$OMP END PARALLEL 482 483 ENDIF 484 #endif 485 415 486 ELSEIF ( fft_method == 'system-specific' ) THEN 416 487 … … 924 995 ENDIF 925 996 997 ELSEIF ( fft_method == 'fftw' ) THEN 998 999 #if defined( __fftw ) 1000 IF ( forward_fft ) THEN 1001 1002 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 1003 !$OMP DO 1004 DO k = nzb_y, nzt_y 1005 DO i = nxl_y, nxr_y 1006 1007 y_in(0:ny) = ar(0:ny,i,k) 1008 CALL FFTW_EXECUTE_DFT_R2C( plan_yf, y_in, y_out ) 1009 1010 DO j = 0, (ny+1)/2 1011 ar(j,i,k) = REAL( y_out(j) ) /(ny+1) 1012 ENDDO 1013 DO j = 1, (ny+1)/2 - 1 1014 ar(ny+1-j,i,k) = AIMAG( y_out(j) ) /(ny+1) 1015 ENDDO 1016 1017 ENDDO 1018 ENDDO 1019 !$OMP END PARALLEL 1020 1021 ELSE 1022 1023 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 1024 !$OMP DO 1025 DO k = nzb_y, nzt_y 1026 DO i = nxl_y, nxr_y 1027 1028 y_out(0) = CMPLX( ar(0,i,k), 0.0 ) 1029 DO j = 1, (ny+1)/2 - 1 1030 y_out(j) = CMPLX( ar(j,i,k), ar(ny+1-j,i,k) ) 1031 ENDDO 1032 y_out((ny+1)/2) = CMPLX( ar((ny+1)/2,i,k), 0.0 ) 1033 1034 CALL FFTW_EXECUTE_DFT_C2R( plan_yi, y_out, y_in ) 1035 ar(0:ny,i,k) = y_in(0:ny) 1036 1037 ENDDO 1038 ENDDO 1039 !$OMP END PARALLEL 1040 1041 ENDIF 1042 #endif 1043 926 1044 ELSEIF ( fft_method == 'system-specific' ) THEN 927 1045
Note: See TracChangeset
for help on using the changeset viewer.