Changeset 57a9cce in flexpart.git for flexpart_code/GRIB2FLEXPART.F90
- Timestamp:
- Oct 12, 2016, 2:06:05 PM (8 years ago)
- Branches:
- FPv9.3.1, FPv9.3.2, fp9.3.1-20161214-nc4, grib2nc4_repair
- Children:
- 27b27d1
- Parents:
- e7403c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
flexpart_code/GRIB2FLEXPART.F90
rf155f96 r57a9cce 59 59 !******************************************************* 60 60 #if defined CTBTO 61 print*,'Welcome to GRIB2FLEXPART Version 1.0CTBTO'61 print*,'Welcome to GRIB2FLEXPART Version 9.3.1f CTBTO' 62 62 #else 63 print*,'Welcome to GRIB2FLEXPART Version 1.0'63 print*,'Welcome to GRIB2FLEXPART Version 9.3.1f' 64 64 #endif 65 65 … … 217 217 write (current_time, *) time() 218 218 ! generate tmp file name using PID and timestamp 219 tmp_file_name = "overwritecheck_"//trim(adjustl(pid))//"_"//trim(adjustl(current_time))//".tmp"220 tmp_file_path = trim(dump_path)//"/"//trim(tmp_file_name)219 !! tmp_file_name = "overwritecheck_"//trim(adjustl(pid))//"_"//trim(adjustl(current_time))//".tmp" 220 !! tmp_file_path = trim(dump_path)//"/"//trim(tmp_file_name) 221 221 222 222 ! create tmp file in output directory 223 open(10001, file=trim(tmp_file_path), status="new", action="write", iostat=open_status)223 !! open(10001, file=trim(tmp_file_path), status="new", action="write", iostat=open_status) 224 224 ! check for tmp file 225 if ( open_status /= 0 ) then 226 print *, "Output directory does not exist or is not writeable" 227 stop 'Error: Incorrect arguments' 228 endif 225 !! if ( open_status /= 0 ) then 226 !! print *, "Output directory does not exist or is not writeable" 227 !! print *, "File "//trim(tmp_file_path)//", iostat=",open_status 228 !! print *, "PID: ", pid, getpid() 229 !! print *, "current_time: ", current_time 230 231 !! stop 'Error: Incorrect arguments' 232 !! endif 229 233 230 234 ! generate tmp file name in input directory 231 235 if ( input_is_path == 1) then 232 check_file_path = trim(input_path)//"/"//trim(tmp_file_name) 233 else 234 check_file_path=trim(input_path(:scan(input_path, '/', .TRUE.)))//trim(tmp_file_name) 236 !! check_file_path = trim(input_path)//"/"//trim(tmp_file_name) 237 stop 'Error: Incorrect arguments; input file is path' 238 else 239 if ( scan(input_path, '/') == 0 ) then 240 check_file_path=trim(dump_path)//"/"//trim(input_path) 241 else 242 check_file_path=trim(dump_path)//trim(input_path(scan(input_path, '/', .TRUE.):)) 243 endif 235 244 endif 236 245 !check for file presence 246 print *, "Check if output file "//trim(check_file_path)//" exists ..." 237 247 inquire(file=TRIM(check_file_path), exist=exists) 238 248 ! delete tmp file 239 close(10001, status='DELETE')249 !! close(10001, status='DELETE') 240 250 if ( exists ) then 241 251 overwritecheck = -1 252 print *, "Warning: Output file "//trim(check_file_path)//" exists" 253 stop 'Please remove this file if the output directory is correct' 242 254 endif 243 255
Note: See TracChangeset
for help on using the changeset viewer.