Changeset 4389 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
- Timestamp:
- Jan 29, 2020 8:22:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r4388 r4389 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Error messages refined for reading ASCII topo file, also reading of topo file revised so that 28 ! statement labels and goto statements are not required any more 29 ! 30 ! 4388 2020-01-28 16:36:55Z raasch 27 31 ! bugfix for error messages while reading ASCII topo file 28 32 ! … … 2509 2513 INTEGER(iwp) :: ii !< running index for IO blocks 2510 2514 INTEGER(iwp) :: id_topo !< NetCDF id of topograhy input file 2515 INTEGER(iwp) :: io_status !< status after reading the ascii topo file 2511 2516 INTEGER(iwp) :: j !< running index along y-direction 2512 2517 INTEGER(iwp) :: num_vars !< number of variables in netcdf input file … … 2685 2690 2686 2691 OPEN( 90, FILE='TOPOGRAPHY_DATA'//TRIM( coupling_char ), & 2687 STATUS='OLD', FORM='FORMATTED', ERR=10 ) 2692 STATUS='OLD', FORM='FORMATTED', IOSTAT=io_status ) 2693 2694 IF ( io_status > 0 ) THEN 2695 message_string = 'file TOPOGRAPHY_DATA'// & 2696 TRIM( coupling_char )// ' does not exist' 2697 CALL message( 'netcdf_data_input_mod', 'PA0208', 1, 2, 0, 6, 0 ) 2698 ENDIF 2699 2688 2700 ! 2689 2701 !-- Read topography PE-wise. Rows are read from nyn to nys, columns … … 2699 2711 ALLOCATE ( buildings_f%var_2d(nys:nyn,nxl:nxr) ) 2700 2712 DO j = nyn, nys, -1 2701 READ( 90, *, ERR=11, END=11 ) & 2713 2714 READ( 90, *, IOSTAT=io_status ) & 2702 2715 ( dum, i = 0, nxl-1 ), & 2703 2716 ( buildings_f%var_2d(j,i), i = nxl, nxr ) 2717 2718 IF ( io_status > 0 ) THEN 2719 WRITE( message_string, '(A,1X,I5,1X,A)' ) 'error reading line', ny-j+1, & 2720 'of file TOPOGRAPHY_DATA'//TRIM( coupling_char ) 2721 CALL message( 'netcdf_data_input_mod', 'PA0209', 2, 2, myid, 6, 0 ) 2722 ELSEIF ( io_status < 0 ) THEN 2723 WRITE( message_string, '(A,1X,I5)' ) 'end of line or file detected for '// & 2724 'file TOPOGRAPHY_DATA'//TRIM( coupling_char )//' at line', ny-j+1 2725 CALL message( 'netcdf_data_input_mod', 'PA0704', 2, 2, myid, 6, 0 ) 2726 ENDIF 2727 2704 2728 ENDDO 2705 2729 2706 GOTO 12 2707 2708 10 message_string = 'file TOPOGRAPHY_DATA'// & 2709 TRIM( coupling_char )// ' does not exist' 2710 CALL message( 'netcdf_data_input_mod', 'PA0208', 1, 2, myid, 6, 0 ) 2711 2712 11 message_string = 'errors in file TOPOGRAPHY_DATA'// & 2713 TRIM( coupling_char ) 2714 CALL message( 'netcdf_data_input_mod', 'PA0209', 2, 2, myid, 6, 0 ) 2715 2716 12 CLOSE( 90 ) 2730 CLOSE( 90 ) 2717 2731 buildings_f%from_file = .TRUE. 2718 2732
Note: See TracChangeset
for help on using the changeset viewer.