Commit cbad0f19 authored by Espen Sollum's avatar Espen Sollum
Browse files

NetCDF module now gives a more understandable error message if output directory is missing

parent 57c5b2ed
......@@ -48,7 +48,7 @@ module netcdf_output_mod
area,arean,volumen, orooutn
use par_mod, only: dp, maxspec, maxreceptor, nclassunc,&
unitoutrecept,unitoutreceptppt, nxmax
unitoutrecept,unitoutreceptppt, nxmax,unittmp
use com_mod, only: path,length,ldirect,ibdate,ibtime,iedate,ietime, &
numxgrid,numygrid,dxout,dyout,numzgrid, height, &
......@@ -260,6 +260,26 @@ subroutine writeheader_netcdf(lnest)
integer, dimension(5) :: dep_chunksizes
integer :: i,ix,jy
integer :: test_unit
! Check if output directory exists (the netcdf library will
! otherwise give an error which can look confusing).
! *********************************************************************
! open(newunit=test_unit,file=trim(path(2)(1:length(2)))//'test_dir.txt',status='replace',&
! &err=100)
! close (test_unit, status='delete')
close (unittmp, status='delete')
goto 101
100 write(*,FMT='(80("#"))')
write(*,*) 'ERROR: output directory ', trim(path(2)(1:length(2))), ' does not exist&
& (or failed to write there).'
write(*,*) 'EXITING'
101 continue
! Create netcdf file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment