7 !! Reading of the target-topography file (in NetCDF format).
11 !! Copyright 2009-2013 Ralf Greve
15 !! This file is part of SICOPOLIS.
17 !! SICOPOLIS is free software: you can redistribute it and/or modify
18 !! it under the terms of the GNU General Public License as published by
19 !! the Free Software Foundation, either version 3 of the License, or
20 !! (at your option) any later version.
22 !! SICOPOLIS is distributed in the hope that it will be useful,
23 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
24 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 !! GNU General Public License for more details.
27 !! You should have received a copy of the GNU General Public License
28 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 !> Reading of the target-topography file (in NetCDF format).
34 !<------------------------------------------------------------------------------
43 character (len=100),
intent (in) :: target_topo_dat_name
53 integer(i2b),
dimension(0:JMAX,0:IMAX) :: maske_conv
54 real(sp),
dimension(0:JMAX,0:IMAX) :: zs_conv, zb_conv, zl_conv, h_conv
56 integer(i4b) :: ncid, ncv
63 call
check( nf90_open(target_topo_dat_path//
'/'//trim(target_topo_dat_name), &
66 call
check( nf90_inq_varid(ncid,
'maske', ncv) )
67 call
check( nf90_get_var(ncid, ncv, maske_conv) )
69 call
check( nf90_inq_varid(ncid,
'zs', ncv) )
70 call
check( nf90_get_var(ncid, ncv, zs_conv) )
72 call
check( nf90_inq_varid(ncid,
'zb', ncv) )
73 call
check( nf90_get_var(ncid, ncv, zb_conv) )
75 call
check( nf90_inq_varid(ncid,
'zl', ncv) )
76 call
check( nf90_get_var(ncid, ncv, zl_conv) )
78 call
check( nf90_inq_varid(ncid,
'H', ncv) )
79 call
check( nf90_get_var(ncid, ncv, h_conv) )
81 call
check( nf90_close(ncid) )
87 maske_target(j,i) = maske_conv(j,i)
88 zs_target(j,i) =
real(zs_conv(j,i),dp)
89 zb_target(j,i) =
real(zb_conv(j,i),dp)
90 zl_target(j,i) =
real(zl_conv(j,i),dp)
91 h_target(j,i) =
real(H_conv(j,i), dp)
98 !> NetCDF error capturing.
99 !<------------------------------------------------------------------------------
101 integer(i4b),
intent (in) :: status
102 if(status /= nf90_noerr)
then
103 write(6,
'(a)') trim(nf90_strerror(status))
104 stop
' read_target_topo_nc: Stopped due to netcdf error!'