Changeset 3246
- Timestamp:
- Sep 13, 2018 3:14:50 PM (6 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/chemistry_model_mod.f90
r3241 r3246 27 27 ! ----------------- 28 28 ! $Id$ 29 ! Added error handling for input namelist via parin_fail_message 30 ! 31 ! 3241 2018-09-12 15:02:00Z raasch 29 32 ! +nest_chemistry 30 33 ! … … 867 870 line = ' ' 868 871 DO WHILE ( INDEX( line, '&chemistry_parameters' ) == 0 ) 869 READ ( 11, '(A)', END= 10 ) line872 READ ( 11, '(A)', END=20 ) line 870 873 ENDDO 871 874 BACKSPACE ( 11 ) 872 875 ! 873 876 !-- Read chemistry namelist 874 READ ( 11, chemistry_parameters )877 READ ( 11, chemistry_parameters, ERR = 10, END = 20 ) 875 878 ! 876 879 !-- Enable chemistry model 877 air_chemistry = .TRUE. 878 879 880 10 CONTINUE 880 air_chemistry = .TRUE. 881 GOTO 20 882 883 10 BACKSPACE( 11 ) 884 READ( 11 ,fmt='(A)') line 885 CALL parin_fail_message ( 'chemistry_parameters', line ) 886 887 20 CONTINUE 881 888 882 889 t_steps = my_steps !(todo: Why not directly make t_steps a -
palm/trunk/SOURCE/land_surface_model_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 4994 4997 line = ' ' 4995 4998 DO WHILE ( INDEX( line, '&land_surface_parameters' ) == 0 ) 4996 READ ( 11, '(A)', END=1 0) line4999 READ ( 11, '(A)', END=12 ) line 4997 5000 ENDDO 4998 5001 BACKSPACE ( 11 ) … … 5000 5003 ! 5001 5004 !-- Read user-defined namelist 5002 READ ( 11, land_surface_parameters )5005 READ ( 11, land_surface_parameters, ERR = 10 ) 5003 5006 5004 5007 ! … … 5006 5009 land_surface = .TRUE. 5007 5010 5008 GOTO 12 5011 GOTO 14 5012 5013 10 BACKSPACE( 11 ) 5014 READ( 11 ,fmt='(A)') line 5015 CALL parin_fail_message ( 'land_surface_parameters', line ) 5009 5016 ! 5010 5017 !-- Try to find old namelist 5011 1 0REWIND ( 11 )5018 12 REWIND ( 11 ) 5012 5019 line = ' ' 5013 5020 DO WHILE ( INDEX( line, '&lsm_par' ) == 0 ) 5014 READ ( 11, '(A)', END=1 2) line5021 READ ( 11, '(A)', END=14 ) line 5015 5022 ENDDO 5016 5023 BACKSPACE ( 11 ) … … 5018 5025 ! 5019 5026 !-- Read user-defined namelist 5020 READ ( 11, lsm_par )5027 READ ( 11, lsm_par, ERR = 13, END = 14 ) 5021 5028 5022 5029 message_string = 'namelist lsm_par is deprecated and will be ' // & … … 5028 5035 !-- Set flag that indicates that the land surface model is switched on 5029 5036 land_surface = .TRUE. 5030 5031 5032 12 CONTINUE 5037 5038 GOTO 14 5039 5040 13 BACKSPACE( 11 ) 5041 READ( 11 ,fmt='(A)') line 5042 CALL parin_fail_message ( 'lsm_par', line ) 5043 5044 5045 14 CONTINUE 5033 5046 5034 5047 -
palm/trunk/SOURCE/message.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added SUBROUTINE parin_fail_message for error handling of input namelists 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 288 291 289 292 END SUBROUTINE location_message 293 294 295 !------------------------------------------------------------------------------! 296 ! Description: 297 ! ------------ 298 !> Prints out the given location on stdout 299 !------------------------------------------------------------------------------! 300 301 SUBROUTINE parin_fail_message( location, line ) 302 303 USE control_parameters, & 304 ONLY: message_string 305 306 IMPLICIT NONE 307 308 CHARACTER(LEN=*) :: location !< text to be output on stdout 309 CHARACTER(LEN=*) :: line 310 311 message_string = 'Error(s) in NAMELIST '// TRIM(location) // & 312 '&Reading fails at& '// line 313 CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 ) 314 315 END SUBROUTINE parin_fail_message -
palm/trunk/SOURCE/multi_agent_system_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 3775 3778 ! 3776 3779 !-- Read user-defined namelist 3777 READ ( 11, agent_parameters )3780 READ ( 11, agent_parameters, ERR = 10, END = 20 ) 3778 3781 3779 3782 ! 3780 3783 !-- Set flag that indicates that agents are switched on 3781 3784 agents_active = .TRUE. 3785 GOTO 20 3786 3787 10 BACKSPACE( 11 ) 3788 READ( 11 ,fmt='(A)') line 3789 CALL parin_fail_message ( 'agent_parameters', line ) 3782 3790 3783 3791 20 CONTINUE -
palm/trunk/SOURCE/package_parin.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 301 304 line = ' ' 302 305 DO WHILE ( INDEX( line, '&dvrp_graphics_par' ) == 0 ) 303 READ ( 11, '(A)', END=2 0) line306 READ ( 11, '(A)', END=21 ) line 304 307 ENDDO 305 308 BACKSPACE ( 11 ) … … 307 310 ! 308 311 !-- Read user-defined namelist 309 READ ( 11, dvrp_graphics_par ) 310 311 20 CONTINUE 312 READ ( 11, dvrp_graphics_par, ERR = 20 ) 313 314 GOTO 21 315 20 BACKSPACE( 11 ) 316 READ( 11 ,fmt='(A)') line 317 CALL parin_fail_message ( 'dvrp_graphics_par', line ) 318 319 21 CONTINUE 312 320 #endif 313 321 … … 317 325 line = ' ' 318 326 DO WHILE ( INDEX( line, '&particle_parameters' ) == 0 ) 319 READ ( 11, '(A)', END= 30) line327 READ ( 11, '(A)', END=12 ) line 320 328 ENDDO 321 329 BACKSPACE ( 11 ) … … 323 331 ! 324 332 !-- Read user-defined namelist 325 READ ( 11, particle_parameters )333 READ ( 11, particle_parameters, ERR = 10 ) 326 334 327 335 ! … … 329 337 particle_advection = .TRUE. 330 338 331 GOTO 31 339 GOTO 14 340 341 10 BACKSPACE( 11 ) 342 READ( 11 ,fmt='(A)') line 343 CALL parin_fail_message ( 'particle_parameters', line ) 332 344 333 345 ! 334 346 !-- Try to find particles package (old namelist) 335 30REWIND ( 11 )347 12 REWIND ( 11 ) 336 348 line = ' ' 337 349 DO WHILE ( INDEX( line, '&particles_par' ) == 0 ) 338 READ ( 11, '(A)', END= 31) line350 READ ( 11, '(A)', END=14 ) line 339 351 ENDDO 340 352 BACKSPACE ( 11 ) … … 342 354 ! 343 355 !-- Read user-defined namelist 344 READ ( 11, particles_par )356 READ ( 11, particles_par, ERR = 13, END = 14 ) 345 357 346 358 … … 354 366 particle_advection = .TRUE. 355 367 356 31 CONTINUE 368 GOTO 14 369 370 13 BACKSPACE( 11 ) 371 READ( 11 ,fmt='(A)') line 372 CALL parin_fail_message ( 'particles_par', line ) 373 374 14 CONTINUE 357 375 358 376 END SUBROUTINE package_parin -
palm/trunk/SOURCE/parin.f90
r3240 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3240 2018-09-12 12:04:40Z Giersch 27 30 ! A check that controls the number of user-defined profiles on the restart file 28 31 ! with the one given for the current run has been added. … … 783 786 !-- The namelist "inipar" must be provided in the NAMELIST-file. 784 787 READ ( 11, initialization_parameters, ERR=10, END=11 ) 785 786 GOTO 12 787 788 10 message_string = 'errors in initialization_parameters & or no ' // & 789 'initialization_parameters-namelist ' // & 790 'found (CRAY-machines only)' 791 CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0 ) 788 GOTO 14 789 790 10 BACKSPACE( 11 ) 791 READ( 11 ,fmt='(A)') line 792 CALL parin_fail_message ( 'initialization_parameters', line ) 792 793 793 794 11 REWIND ( 11 ) 794 READ ( 11, inipar, ERR=1 3, END=14)795 READ ( 11, inipar, ERR=12, END=13 ) 795 796 796 797 message_string = 'namelist inipar is deprecated and will be ' // & … … 799 800 CALL message( 'parin', 'PA0017', 0, 1, 0, 6, 0 ) 800 801 801 GOTO 1 2802 GOTO 14 802 803 803 1 3 message_string = 'errors in inipar & or no inipar-namelist ' // &804 'found (CRAY-machines only)'805 CALL message( 'parin', 'PA0271', 1, 2, 0, 6, 0)806 807 1 4message_string = 'no initialization_parameters-namelist found'804 12 BACKSPACE( 11 ) 805 READ( 11 ,fmt='(A)') line 806 CALL parin_fail_message ( 'inipar', line ) 807 808 13 message_string = 'no initialization_parameters-namelist found' 808 809 CALL message( 'parin', 'PA0272', 1, 2, 0, 6, 0 ) 809 810 … … 813 814 !-- can be omitted. In that case default values are used for the 814 815 !-- parameters. 815 1 2line = ' '816 14 line = ' ' 816 817 817 818 REWIND ( 11 ) 818 819 line = ' ' 819 820 DO WHILE ( INDEX( line, '&runtime_parameters' ) == 0 ) 820 READ ( 11, '(A)', END= 20) line821 READ ( 11, '(A)', END=16 ) line 821 822 ENDDO 822 823 BACKSPACE ( 11 ) … … 824 825 ! 825 826 !-- Read namelist 826 READ ( 11, runtime_parameters ) 827 828 GOTO 21 829 830 20 REWIND ( 11 ) 827 READ ( 11, runtime_parameters, ERR = 15 ) 828 GOTO 18 829 830 15 BACKSPACE( 11 ) 831 READ( 11 ,fmt='(A)') line 832 CALL parin_fail_message ( 'runtime_parameters', line ) 833 834 16 REWIND ( 11 ) 831 835 line = ' ' 832 836 DO WHILE ( INDEX( line, '&d3par' ) == 0 ) 833 READ ( 11, '(A)', END= 21) line837 READ ( 11, '(A)', END=18 ) line 834 838 ENDDO 835 839 BACKSPACE ( 11 ) 836 837 840 841 ! 838 842 !-- Read namelist 839 READ ( 11, d3par )840 843 READ ( 11, d3par, ERR = 17, END = 18 ) 844 841 845 message_string = 'namelist d3par is deprecated and will be ' // & 842 846 'removed in near future. &Please use namelist ' // & 843 847 'runtime_parameters instead' 844 848 CALL message( 'parin', 'PA0487', 0, 1, 0, 6, 0 ) 845 846 21 CONTINUE 849 850 GOTO 18 851 852 17 BACKSPACE( 11 ) 853 READ( 11 ,fmt='(A)') line 854 CALL parin_fail_message ( 'd3par', line ) 855 856 18 CONTINUE 847 857 848 858 ! -
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 1021 1024 leaf_scalar_exch_coeff, & 1022 1025 leaf_surface_conc, pch_index 1023 1026 1024 1027 line = ' ' 1025 1028 1026 1029 ! 1027 1030 !-- Try to find radiation model package … … 1029 1032 line = ' ' 1030 1033 DO WHILE ( INDEX( line, '&plant_canopy_parameters' ) == 0 ) 1031 READ ( 11, '(A)', END=10 ) line1032 ENDDO1033 BACKSPACE ( 11 )1034 1035 !1036 !-- Read user-defined namelist1037 READ ( 11, plant_canopy_parameters )1038 1039 !1040 !-- Set flag that indicates that the radiation model is switched on1041 plant_canopy = .TRUE.1042 1043 GOTO 121044 !1045 !-- Try to find old namelist1046 10 REWIND ( 11 )1047 line = ' '1048 DO WHILE ( INDEX( line, '&canopy_par' ) == 0 )1049 1034 READ ( 11, '(A)', END=12 ) line 1050 1035 ENDDO … … 1053 1038 ! 1054 1039 !-- Read user-defined namelist 1055 READ ( 11, canopy_par ) 1040 READ ( 11, plant_canopy_parameters, ERR = 10 ) 1041 1042 ! 1043 !-- Set flag that indicates that the radiation model is switched on 1044 plant_canopy = .TRUE. 1045 1046 GOTO 14 1047 1048 10 BACKSPACE( 11 ) 1049 READ( 11 ,fmt='(A)') line 1050 CALL parin_fail_message ( 'plant_canopy_parameters', line ) 1051 ! 1052 !-- Try to find old namelist 1053 12 REWIND ( 11 ) 1054 line = ' ' 1055 DO WHILE ( INDEX( line, '&canopy_par' ) == 0 ) 1056 READ ( 11, '(A)', END=14 ) line 1057 ENDDO 1058 BACKSPACE ( 11 ) 1059 1060 ! 1061 !-- Read user-defined namelist 1062 READ ( 11, canopy_par, ERR = 13, END = 14 ) 1056 1063 1057 1064 message_string = 'namelist canopy_par is deprecated and will be ' // & … … 1059 1066 'plant_canopy_parameters instead' 1060 1067 CALL message( 'pcm_parin', 'PA0487', 0, 1, 0, 6, 0 ) 1061 1068 1062 1069 ! 1063 1070 !-- Set flag that indicates that the radiation model is switched on 1064 1071 plant_canopy = .TRUE. 1065 1072 1066 12 CONTINUE 1067 1073 GOTO 14 1074 1075 13 BACKSPACE( 11 ) 1076 READ( 11 ,fmt='(A)') line 1077 CALL parin_fail_message ( 'canopy_par', line ) 1078 1079 14 CONTINUE 1080 1068 1081 1069 1082 END SUBROUTINE pcm_parin -
palm/trunk/SOURCE/radiation_model_mod.f90
r3241 r3246 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Added error handling for input namelist via parin_fail_message 31 ! 32 ! 3241 2018-09-12 15:02:00Z raasch 30 33 ! unused variables removed or commented 31 34 ! … … 2787 2790 line = ' ' 2788 2791 DO WHILE ( INDEX( line, '&radiation_parameters' ) == 0 ) 2789 READ ( 11, '(A)', END=10 ) line2790 ENDDO2791 BACKSPACE ( 11 )2792 2793 !2794 !-- Read user-defined namelist2795 READ ( 11, radiation_parameters )2796 2797 !2798 !-- Set flag that indicates that the radiation model is switched on2799 radiation = .TRUE.2800 2801 GOTO 122802 !2803 !-- Try to find old namelist2804 10 REWIND ( 11 )2805 line = ' '2806 DO WHILE ( INDEX( line, '&radiation_par' ) == 0 )2807 2792 READ ( 11, '(A)', END=12 ) line 2808 2793 ENDDO … … 2811 2796 ! 2812 2797 !-- Read user-defined namelist 2813 READ ( 11, radiation_par ) 2814 2798 READ ( 11, radiation_parameters, ERR = 10 ) 2799 2800 ! 2801 !-- Set flag that indicates that the radiation model is switched on 2802 radiation = .TRUE. 2803 2804 GOTO 14 2805 2806 10 BACKSPACE( 11 ) 2807 READ( 11 ,fmt='(A)') line 2808 CALL parin_fail_message ( 'radiation_parameters', line ) 2809 ! 2810 !-- Try to find old namelist 2811 12 REWIND ( 11 ) 2812 line = ' ' 2813 DO WHILE ( INDEX( line, '&radiation_par' ) == 0 ) 2814 READ ( 11, '(A)', END=14 ) line 2815 ENDDO 2816 BACKSPACE ( 11 ) 2817 2818 ! 2819 !-- Read user-defined namelist 2820 READ ( 11, radiation_par, ERR = 13, END = 14 ) 2821 2815 2822 message_string = 'namelist radiation_par is deprecated and will be ' // & 2816 2823 'removed in near future. Please use namelist ' // & … … 2818 2825 CALL message( 'radiation_parin', 'PA0487', 0, 1, 0, 6, 0 ) 2819 2826 2820 2821 2827 ! 2822 2828 !-- Set flag that indicates that the radiation model is switched on … … 2829 2835 ENDIF 2830 2836 2831 12 CONTINUE 2837 GOTO 14 2838 2839 13 BACKSPACE( 11 ) 2840 READ( 11 ,fmt='(A)') line 2841 CALL parin_fail_message ( 'radiation_par', line ) 2842 2843 14 CONTINUE 2832 2844 2833 2845 END SUBROUTINE radiation_parin -
palm/trunk/SOURCE/spectra_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 237 240 line = ' ' 238 241 DO WHILE ( INDEX( line, '&spectra_parameters' ) == 0 ) 239 READ ( 11, '(A)', END=1 0) line242 READ ( 11, '(A)', END=12 ) line 240 243 ENDDO 241 244 BACKSPACE ( 11 ) … … 243 246 ! 244 247 !-- Read namelist 245 READ ( 11, spectra_parameters )248 READ ( 11, spectra_parameters, ERR = 10 ) 246 249 247 250 ! … … 254 257 calculate_spectra = .TRUE. 255 258 256 GOTO 12 259 GOTO 14 260 261 10 BACKSPACE( 11 ) 262 READ( 11 ,fmt='(A)') line 263 CALL parin_fail_message ( 'spectra_parameters', line ) 257 264 ! 258 265 !-- Try to find the old namelist 259 1 0REWIND ( 11 )266 12 REWIND ( 11 ) 260 267 line = ' ' 261 268 DO WHILE ( INDEX( line, '&spectra_par' ) == 0 ) 262 READ ( 11, '(A)', END=1 2) line269 READ ( 11, '(A)', END=14 ) line 263 270 ENDDO 264 271 BACKSPACE ( 11 ) … … 266 273 ! 267 274 !-- Read namelist 268 READ ( 11, spectra_par )275 READ ( 11, spectra_par, ERR = 13, END = 14 ) 269 276 270 277 … … 282 289 calculate_spectra = .TRUE. 283 290 291 GOTO 14 292 293 13 BACKSPACE( 11 ) 294 READ( 11 ,fmt='(A)') line 295 CALL parin_fail_message ( 'spectra_par', line ) 284 296 285 12 CONTINUE 297 298 14 CONTINUE 286 299 287 300 END SUBROUTINE spectra_parin -
palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 967 970 line = ' ' 968 971 DO WHILE ( INDEX( line, '&stg_par' ) == 0 ) 969 READ ( 11, '(A)', END= 10 ) line972 READ ( 11, '(A)', END=20 ) line 970 973 ENDDO 971 974 BACKSPACE ( 11 ) … … 973 976 ! 974 977 !-- Read namelist 975 READ ( 11, stg_par )978 READ ( 11, stg_par, ERR = 10, END = 20 ) 976 979 977 980 ! … … 979 982 !-- on 980 983 syn_turb_gen = .TRUE. 981 982 983 10 CONTINUE 984 GOTO 20 985 986 10 BACKSPACE( 11 ) 987 READ( 11 ,fmt='(A)') line 988 CALL parin_fail_message ( 'stg_par', line ) 989 990 20 CONTINUE 984 991 985 992 END SUBROUTINE stg_parin -
palm/trunk/SOURCE/urban_surface_mod.f90
r3241 r3246 28 28 ! ----------------- 29 29 ! $Id$ 30 ! Added error handling for input namelist via parin_fail_message 31 ! 32 ! 3241 2018-09-12 15:02:00Z raasch 30 33 ! unused variables removed 31 34 ! … … 5349 5352 soil_inner_temperature, & 5350 5353 window_inner_temperature 5354 5355 5356 5351 5357 ! 5352 5358 !-- Try to find urban surface model package … … 5354 5360 line = ' ' 5355 5361 DO WHILE ( INDEX( line, '&urban_surface_parameters' ) == 0 ) 5356 READ ( 11, '(A)', END=10 ) line5357 ENDDO5358 BACKSPACE ( 11 )5359 5360 !5361 !-- Read user-defined namelist5362 READ ( 11, urban_surface_parameters )5363 !5364 !-- Set flag that indicates that the land surface model is switched on5365 urban_surface = .TRUE.5366 5367 GOTO 125368 !5369 !-- Try to find old namelist5370 10 REWIND ( 11 )5371 line = ' '5372 DO WHILE ( INDEX( line, '&urban_surface_par' ) == 0 )5373 5362 READ ( 11, '(A)', END=12 ) line 5374 5363 ENDDO … … 5377 5366 ! 5378 5367 !-- Read user-defined namelist 5379 READ ( 11, urban_surface_par ) 5368 READ ( 11, urban_surface_parameters, ERR = 10 ) 5369 5370 ! 5371 !-- Set flag that indicates that the urban surface model is switched on 5372 urban_surface = .TRUE. 5373 5374 GOTO 14 5375 5376 10 BACKSPACE( 11 ) 5377 READ( 11 ,fmt='(A)') line 5378 CALL parin_fail_message ( 'urban_surface_parameters', line ) 5379 ! 5380 !-- Try to find old namelist 5381 12 REWIND ( 11 ) 5382 line = ' ' 5383 DO WHILE ( INDEX( line, '&urban_surface_par' ) == 0 ) 5384 READ ( 11, '(A)', END=14 ) line 5385 ENDDO 5386 BACKSPACE ( 11 ) 5387 5388 ! 5389 !-- Read user-defined namelist 5390 READ ( 11, urban_surface_par, ERR = 13, END = 14 ) 5380 5391 5381 5392 message_string = 'namelist urban_surface_par is deprecated and will be ' // & 5382 'removed in near future. Please use namelist ' // 5383 'urban_surface_parameters instead' 5393 'removed in near future. Please use namelist ' // & 5394 'urban_surface_parameters instead' 5384 5395 CALL message( 'usm_parin', 'PA0487', 0, 1, 0, 6, 0 ) 5385 ! 5386 !-- Set flag that indicates that the land surface model is switched on 5396 5397 ! 5398 !-- Set flag that indicates that the urban surface model is switched on 5387 5399 urban_surface = .TRUE. 5388 5400 5389 12 CONTINUE 5401 GOTO 14 5402 5403 13 BACKSPACE( 11 ) 5404 READ( 11 ,fmt='(A)') line 5405 CALL parin_fail_message ( 'urban_surface_par', line ) 5406 5407 5408 14 CONTINUE 5390 5409 5391 5410 -
palm/trunk/SOURCE/user_parin.f90
r3240 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3240 2018-09-12 12:04:40Z Giersch 27 30 ! The check that controls the number of user-defined profiles on the restart file 28 31 ! with the one given for the current run has been removed. … … 140 143 line = ' ' 141 144 DO WHILE ( INDEX( line, '&user_parameters' ) == 0 ) 142 READ ( 11, '(A)', END=10 ) line143 ENDDO144 BACKSPACE ( 11 )145 146 !147 !-- Read user-defined namelist148 READ ( 11, user_parameters )149 150 user_defined_namelist_found = .TRUE.151 152 GOTO 12153 154 155 10 REWIND ( 11 )156 157 line = ' '158 DO WHILE ( INDEX( line, '&userpar' ) == 0 )159 145 READ ( 11, '(A)', END=12 ) line 160 146 ENDDO … … 163 149 ! 164 150 !-- Read user-defined namelist 165 READ ( 11, userpar ) 166 167 151 READ ( 11, user_parameters, ERR = 10 ) 152 153 user_defined_namelist_found = .TRUE. 154 155 GOTO 14 156 157 10 BACKSPACE( 11 ) 158 READ( 11 ,fmt='(A)') line 159 CALL parin_fail_message ( 'user_parameters', line ) 160 161 12 REWIND ( 11 ) 162 163 line = ' ' 164 DO WHILE ( INDEX( line, '&userpar' ) == 0 ) 165 READ ( 11, '(A)', END=14 ) line 166 ENDDO 167 BACKSPACE ( 11 ) 168 169 ! 170 !-- Read user-defined namelist 171 READ ( 11, userpar, ERR = 13, END = 14 ) 172 168 173 message_string = 'namelist userpar is deprecated and will be ' // & 169 174 'removed in near future. &Please use namelist ' // & 170 175 'user_parameters instead' 171 176 CALL message( 'user_parin', 'PA0487', 0, 1, 0, 6, 0 ) 172 177 173 178 user_defined_namelist_found = .TRUE. 174 175 176 12 CONTINUE 179 180 GOTO 14 181 182 13 BACKSPACE( 11 ) 183 READ( 11 ,fmt='(A)') line 184 CALL parin_fail_message ( 'userpar', line ) 185 186 14 CONTINUE 177 187 178 188 ! -
palm/trunk/SOURCE/uv_exposure_model_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message and small 28 ! typo bugfix 29 ! 30 ! 3241 2018-09-12 15:02:00Z raasch 27 31 ! unused variables removed 28 32 ! … … 449 453 REWIND ( 11 ) 450 454 line = ' ' 451 DO WHILE ( INDEX( line, '&biomete rology_parameters' ) == 0 )452 READ ( 11, '(A)', END= 10 ) line455 DO WHILE ( INDEX( line, '&biometeorology_parameters' ) == 0 ) 456 READ ( 11, '(A)', END=20 ) line 453 457 ENDDO 454 458 BACKSPACE ( 11 ) … … 456 460 ! 457 461 !-- Read user-defined namelist 458 READ ( 11, biometeorology_parameters )462 READ ( 11, biometeorology_parameters, ERR = 10, END = 20 ) 459 463 460 464 ! … … 462 466 uv_exposure = .TRUE. 463 467 464 465 10 CONTINUE 468 10 BACKSPACE( 11 ) 469 READ( 11 ,fmt='(A)') line 470 CALL parin_fail_message ( 'biometeorology_parameters', line ) 471 472 473 20 CONTINUE 466 474 467 475 -
palm/trunk/SOURCE/virtual_flight_mod.f90
r3241 r3246 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Added error handling for input namelist via parin_fail_message 28 ! 29 ! 3241 2018-09-12 15:02:00Z raasch 27 30 ! unused variables removed 28 31 ! … … 250 253 line = ' ' 251 254 DO WHILE ( INDEX( line, '&virtual_flight_parameters' ) == 0 ) 252 READ ( 11, '(A)', END=10 ) line253 ENDDO254 BACKSPACE ( 11 )255 256 !257 !-- Read namelist258 READ ( 11, virtual_flight_parameters )259 !260 !-- Set switch that virtual flights shall be carried out261 virtual_flight = .TRUE.262 263 GOTO 12264 !265 !-- Try to find the old namelist266 10 REWIND ( 11 )267 line = ' '268 DO WHILE ( INDEX( line, '&flight_par' ) == 0 )269 255 READ ( 11, '(A)', END=12 ) line 270 256 ENDDO … … 273 259 ! 274 260 !-- Read namelist 275 READ ( 11, flight_par ) 261 READ ( 11, virtual_flight_parameters, ERR = 10 ) 262 ! 263 !-- Set switch that virtual flights shall be carried out 264 virtual_flight = .TRUE. 265 266 GOTO 14 267 268 10 BACKSPACE( 11 ) 269 READ( 11 ,fmt='(A)') line 270 CALL parin_fail_message ( 'virtual_flight_parameters', line ) 271 ! 272 !-- Try to find the old namelist 273 12 REWIND ( 11 ) 274 line = ' ' 275 DO WHILE ( INDEX( line, '&flight_par' ) == 0 ) 276 READ ( 11, '(A)', END=14 ) line 277 ENDDO 278 BACKSPACE ( 11 ) 279 280 ! 281 !-- Read namelist 282 READ ( 11, flight_par, ERR = 13, END = 14 ) 276 283 277 284 message_string = 'namelist flight_par is deprecated and will be ' // & … … 283 290 virtual_flight = .TRUE. 284 291 285 12 CONTINUE 292 GOTO 14 293 294 13 BACKSPACE( 11 ) 295 READ( 11 ,fmt='(A)') line 296 CALL parin_fail_message ( 'flight_par', line ) 297 298 14 CONTINUE 286 299 287 300 END SUBROUTINE flight_parin -
palm/trunk/SOURCE/wind_turbine_model_mod.f90
r3241 r3246 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Added error handling for input namelist via parin_fail_message 29 ! 30 ! 3241 2018-09-12 15:02:00Z raasch 28 31 ! unused variables removed 29 32 ! … … 535 538 line = ' ' 536 539 DO WHILE ( INDEX( line, '&wind_turbine_parameters' ) == 0 ) 537 READ ( 11, '(A)', END=10 ) line538 ENDDO539 BACKSPACE ( 11 )540 541 !542 !-- Read user-defined namelist543 READ ( 11, wind_turbine_parameters, IOSTAT=ierrn )544 545 IF ( ierrn < 0 ) THEN546 message_string = 'no wind_turbine_parameters-NAMELIST found: ' // &547 'End of file has reached'548 CALL message( 'wtm_parin', 'PA0460', 1, 2, 0, 6, 0 )549 ELSEIF ( ierrn > 0 ) THEN550 message_string = 'errors in wind_turbine_parameters-NAMELIST: ' // &551 'some variables for steering may not be properly set'552 CALL message( 'wtm_parin', 'PA0466', 1, 2, 0, 6, 0 )553 ENDIF554 555 !556 !-- Set flag that indicates that the wind turbine model is switched on557 wind_turbine = .TRUE.558 559 GOTO 12560 561 !562 !-- Try to find wind turbine model package563 10 REWIND ( 11 )564 line = ' '565 DO WHILE ( INDEX( line, '&wind_turbine_par' ) == 0 )566 540 READ ( 11, '(A)', END=12 ) line 567 541 ENDDO … … 570 544 ! 571 545 !-- Read user-defined namelist 572 READ ( 11, wind_turbine_par, IOSTAT=ierrn ) 573 574 IF ( ierrn < 0 ) THEN 575 message_string = 'no wind_turbine_par-NAMELIST found: ' // & 576 'End of file has reached' 577 CALL message( 'wtm_parin', 'PA0460', 1, 2, 0, 6, 0 ) 578 ELSEIF ( ierrn > 0 ) THEN 579 message_string = 'errors in wind_turbine_par-NAMELIST: ' // & 580 'some variables for steering may not be properly set' 581 CALL message( 'wtm_parin', 'PA0466', 1, 2, 0, 6, 0 ) 582 ENDIF 546 READ ( 11, wind_turbine_parameters, ERR = 10 ) 547 ! 548 !-- Set flag that indicates that the wind turbine model is switched on 549 wind_turbine = .TRUE. 550 551 GOTO 14 552 553 10 BACKSPACE( 11 ) 554 READ( 11 ,fmt='(A)') line 555 CALL parin_fail_message ( 'wind_turbine_parameters', line ) 556 557 ! 558 !-- Try to find wind turbine model package 559 12 REWIND ( 11 ) 560 line = ' ' 561 DO WHILE ( INDEX( line, '&wind_turbine_par' ) == 0 ) 562 READ ( 11, '(A)', END=14 ) line 563 ENDDO 564 BACKSPACE ( 11 ) 565 566 ! 567 !-- Read user-defined namelist 568 READ ( 11, wind_turbine_par, ERR = 13, END = 14 ) 583 569 584 570 message_string = 'namelist wind_tubrine_par is deprecated and will ' // & … … 591 577 wind_turbine = .TRUE. 592 578 593 12 CONTINUE ! TBD Change from continue, mit ierrn machen 579 GOTO 14 580 581 13 BACKSPACE( 11 ) 582 READ( 11 ,fmt='(A)') line 583 CALL parin_fail_message ( 'wind_turbine_par', line ) 584 585 14 CONTINUE ! TBD Change from continue, mit ierrn machen 594 586 595 587
Note: See TracChangeset
for help on using the changeset viewer.