[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20000406: Fortran-90 compilation problem under Digital Unix
- Subject: 20000406: Fortran-90 compilation problem under Digital Unix
- Date: Thu, 06 Apr 2000 14:51:44 -0600
Claire,
> To: address@hidden
> From: Claire Granier <address@hidden>
> Subject: Netcdf for fortran 90
> Organization: .
> Keywords: 200004051946.NAA02571
In the above message, you wrote:
> I have just tried to download the experimental Fortran 90
> sources for netcdf. I tried to build the fortran 90 interface
> using the Makefile provided with the package. When I do that,
> I get several errors during the compilation:
>
> f90 -c -O netcdf.f90
> f90: Error: netcdf_text_variables.f90, line 57: A symbol must be a defined
> parameter in this context. [COUNTER]
> localCount (:numDims+1) = (/ len(values(1)), (size(values, counter),
> counter = 1, numDims) /)
> ----------------------------------------------------------------^
...
Try the enclosed replacement for file "netcdf_text_variables.f90".
Regards,
Steve Emmerson <http://www.unidata.ucar.edu>
--------Begin netcdf_text_variables.f90
function nf90_put_var_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_text
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride
! Set local arguments to default values
localStart (:) = 1
localCount (1) = len_trim(values); localCount (2:) = 1
localStride(:) = 1
if(present(start)) localStart (:size(start) ) = start(:)
if(present(count)) localCount (:size(count) ) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
nf90_put_var_text = nf_put_vars_text(ncid, varid, localStart, localCount,
localStride, trim(values))
end function nf90_put_var_text
function nf90_get_var_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_text
integer, dimension(nf90_max_var_dims) :: localIndex, textDimIDs
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride
integer :: counter, stringLength
! Set local arguments to default values
localStart (:) = 1
localCount (1) = len(values); localCount (2:) = 1
localStride(:) = 1
if(present(start)) localStart (:size(start) ) = start(:)
if(present(count)) localCount (:size(count) ) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
nf90_get_var_text = nf_get_vars_text(ncid, varid, localStart, localCount,
localStride, values)
end function nf90_get_var_text
function nf90_put_var_1D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_1D_text
integer, parameter :: numDims = 1
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_1D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_1D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_1D_text
function nf90_put_var_2D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_2D_text
integer, parameter :: numDims = 2
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_2D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_2D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_2D_text
function nf90_put_var_3D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_3D_text
integer, parameter :: numDims = 3
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_3D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_3D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_3D_text
function nf90_put_var_4D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_4D_text
integer, parameter :: numDims = 4
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_4D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_4D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_4D_text
function nf90_put_var_5D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_5D_text
integer, parameter :: numDims = 5
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_5D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_5D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_5D_text
function nf90_put_var_6D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_6D_text
integer, parameter :: numDims = 6
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1)), shape(values)
/)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_6D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_6D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_6D_text
function nf90_put_var_7D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_7D_text
integer, parameter :: numDims = 7
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1, 1)),
shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_put_var_7D_text = &
nf_put_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_put_var_7D_text = &
nf_put_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_put_var_7D_text
function nf90_get_var_1D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_1D_text
integer, parameter :: numDims = 1
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_1D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_1D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_1D_text
function nf90_get_var_2D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_2D_text
integer, parameter :: numDims = 2
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_2D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_2D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_2D_text
function nf90_get_var_3D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_3D_text
integer, parameter :: numDims = 3
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_3D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_3D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_3D_text
function nf90_get_var_4D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_4D_text
integer, parameter :: numDims = 4
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_4D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_4D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_4D_text
function nf90_get_var_5D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_5D_text
integer, parameter :: numDims = 5
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1)), shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_5D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_5D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_5D_text
function nf90_get_var_6D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_6D_text
integer, parameter :: numDims = 6
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1)), shape(values)
/)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_6D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_6D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_6D_text
function nf90_get_var_7D_text(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
character (len = *), dimension(:, :, :, :, :, :, :), &
intent(out) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_get_var_7D_text
integer, parameter :: numDims = 7
integer, dimension(nf90_max_var_dims) :: localStart, localCount,
localStride, localMap
integer :: counter
! Set local arguments to default values
localStart (: ) = 1
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1, 1)),
shape(values) /)
localCount (numDims+2:) = 0
localStride(: ) = 1
localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter =
1, numDims - 1) /)
if(present(start)) localStart (:size(start)) = start(:)
if(present(count)) localCount (:size(count)) = count(:)
if(present(stride)) localStride(:size(stride)) = stride(:)
if(present(map)) then
localMap (:size(map)) = map(:)
nf90_get_var_7D_text = &
nf_get_varm_text(ncid, varid, localStart, localCount, localStride,
localMap, values)
else
nf90_get_var_7D_text = &
nf_get_vars_text(ncid, varid, localStart, localCount, localStride,
values)
end if
end function nf90_get_var_7D_text