Skip to content
Snippets Groups Projects
Commit 36262173 authored by Sebastien Masson's avatar Sebastien Masson
Browse files

Merge branch '90-compile-bench-without-any-netcdf-library' into 'main'

Resolve "compile BENCH without any NetCDF library"

Closes #90

See merge request nemo/nemo!138
parents e1517928 3e235636
No related branches found
No related tags found
No related merge requests found
Showing
with 2611 additions and 89 deletions
......@@ -49,7 +49,7 @@
%FFLAGS %FCFLAGS
%LD mpif90
%LDFLAGS
%FPPFLAGS -P -C -traditional
%FPPFLAGS -P -traditional
%AR ar
%ARFLAGS rs
%MK make
......
......@@ -48,7 +48,7 @@
%FFLAGS %FCFLAGS
%LD ftn
%LDFLAGS
%FPPFLAGS -P -C -traditional
%FPPFLAGS -P -traditional
%AR ar
%ARFLAGS rs
%MK gmake
......
......@@ -20,7 +20,7 @@
%FCFLAGS -r8 -O3 -traceback -openmp
%FFLAGS -r8 -O3 -traceback -openmp
%LD ifort
%FPPFLAGS -P -C -traditional
%FPPFLAGS -P -traditional
%LDFLAGS
%AR ar
%ARFLAGS -r
......
......@@ -21,7 +21,7 @@
%FFLAGS %FCFLAGS
%LD pgf90
%LDFLAGS
%FPPFLAGS -P -C -traditional
%FPPFLAGS -P -traditional
%AR ar
%ARFLAGS -rs
%MK gmake
......
......@@ -20,7 +20,7 @@
%FFLAGS %FCFLAGS
%LD scorep-mpiifort
%LDFLAGS -lstdc++
%FPPFLAGS -P -C -traditional -std=c99
%FPPFLAGS -P -traditional -std=c99
%AR ar
%ARFLAGS rs
%MK gmake
......
! Description:
!
! Input Parameters:
! None.
!
! Output Parameters:
! Many public constants are defined in "netcdf_constants.f90". The names follow
! the Fortran 77 names, with nf90_ used as a prefix instead of nf_77.
! Functions are made accessable through PUBLIC:: statements in "netcdf_visibility.f90".
! Only the functions listed in this file are available in the interface.
!
! References and Credits:
! Written by
! Robert Pincus
! Cooperative Institue for Meteorological Satellite Studies
! University of Wisconsin - Madison
! 1225 W. Dayton St.
! Madison, Wisconsin 53706
! Robert.Pincus@ssec.wisc.edu
!
! Design Notes:
! Module elements are private by default.
! Many functions have optional arguments. In order to keep the interface easy to use,
! we've reordered the arguments (relative to the F77 interface) in some functions.
! The external datatype of attributes is the same as the internal type.
! By default, data is read from or put into the lowest part of the netCDF array with stride 1.
! We've made heavy use of overloading, especially in the variable put and get routines.
! A single function exists for putting all variables; a single function exists for getting
! variables.
! Text variables must be treated somewhat differently. When a character variable is defined, the
! fastest-varying index (first index in Fortran) must be the maxiumu length of the character
! string. N dimensional arrays of strings passed to the put or get functions are written/read
! from dimensions 2:N+1. The number of values along the first dimension is determined by the
! length of the argument character string.
!
module netcdf
use typesizes, only: OneByteInt, TwoByteInt, FourByteInt, EightByteInt, &
FourByteReal, EightByteReal
implicit none
private
! as of version 4.4, the following are merged:
! - netcdf_constants.f90 and netcdf4_constants.f90
!
! Update the dependencies in the Makefile.am when modifying the list of
! included files.
#include "netcdf_constants.h90"
#include "netcdf_overloads.h90"
#include "netcdf_visibility.h90"
contains
#include "netcdf_file.h90"
#include "netcdf3_file.h90"
#include "netcdf_dims.h90"
#include "netcdf_attributes.h90"
#include "netcdf_variables.h90"
#include "netcdf_text_variables.h90"
#include "netcdf_expanded_subset.h90"
#include "netcdf_get_nd_expanded.h90"
#include "netcdf_eightbyte_subset.h90"
end module netcdf
! This is part of the netCDF F90 API, or. Copyright 2006 UCAR. See COPYRIGHT file
! for details.
! This file contains the netcdf-3 file open and create functions.
! $Id: netcdf4_constants.f90,v 1.14 2010/05/25 13:53:00 ed Exp $
! -------
function nf90_open(path, mode, ncid, chunksize)
character (len = *), intent(in ) :: path
integer, intent(in ) :: mode
integer, intent( out) :: ncid
integer, optional, intent(inout) :: chunksize
integer :: nf90_open
nf90_open = -1
end function nf90_open
! -------
function nf90_create(path, cmode, ncid, initialsize, chunksize)
character (len = *), intent(in ) :: path
integer, intent(in ) :: cmode
integer, intent( out) :: ncid
integer, optional, intent(in ) :: initialsize
integer, optional, intent(inout) :: chunksize
integer :: nf90_create
nf90_create = -1
end function nf90_create
!
! Attribute routines:
!
! -------
function nf90_copy_att(ncid_in, varid_in, name, ncid_out, varid_out)
integer, intent( in) :: ncid_in, varid_in
character (len = *), intent( in) :: name
integer, intent( in) :: ncid_out, varid_out
integer :: nf90_copy_att
nf90_copy_att = -1
end function nf90_copy_att
! -------
function nf90_rename_att(ncid, varid, curname, newname)
integer, intent( in) :: ncid, varid
character (len = *), intent( in) :: curname, newname
integer :: nf90_rename_att
nf90_rename_att = -1
end function nf90_rename_att
! -------
function nf90_del_att(ncid, varid, name)
integer, intent( in) :: ncid, varid
character (len = *), intent( in) :: name
integer :: nf90_del_att
nf90_del_att = -1
end function nf90_del_att
! -------
! Attribute inquiry functions
! -------
function nf90_inq_attname(ncid, varid, attnum, name)
integer, intent( in) :: ncid, varid, attnum
character (len = *), intent(out) :: name
integer :: nf90_inq_attname
nf90_inq_attname = -1
end function nf90_inq_attname
! -------
function nf90_inquire_attribute(ncid, varid, name, xtype, len, attnum)
integer, intent( in) :: ncid, varid
character (len = *), intent( in) :: name
integer, intent(out), optional :: xtype, len, attnum
integer :: nf90_inquire_attribute
nf90_inquire_attribute = -1
end function nf90_inquire_attribute
! -------
! Put and get functions; these will get overloaded
! -------
! Text
! -------
function nf90_put_att_text(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
character(len = *), intent( in) :: values
integer :: nf90_put_att_text
nf90_put_att_text = -1
end function nf90_put_att_text
! -------
function nf90_get_att_text(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
character(len = *), intent(out) :: values
integer :: nf90_get_att_text
nf90_get_att_text = -1
end function nf90_get_att_text
! -------
! Integer attributes
! -------
function nf90_put_att_OneByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = OneByteInt), dimension(:), intent( in) :: values
integer :: nf90_put_att_OneByteInt
nf90_put_att_OneByteInt = -1
end function nf90_put_att_OneByteInt
! -------
function nf90_put_att_one_OneByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = OneByteInt), intent( in) :: values
integer :: nf90_put_att_one_OneByteInt
nf90_put_att_one_OneByteInt = -1
end function nf90_put_att_one_OneByteInt
! -------
function nf90_get_att_OneByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = OneByteInt), dimension(:), intent(out) :: values
integer :: nf90_get_att_OneByteInt
nf90_get_att_OneByteInt = -1
end function nf90_get_att_OneByteInt
! -------
function nf90_get_att_one_OneByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = OneByteInt), intent(out) :: values
integer :: nf90_get_att_one_OneByteInt
nf90_get_att_one_OneByteInt = -1
end function nf90_get_att_one_OneByteInt
! -------
function nf90_put_att_TwoByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = TwoByteInt), dimension(:), intent( in) :: values
integer :: nf90_put_att_TwoByteInt
nf90_put_att_TwoByteInt = -1
end function nf90_put_att_TwoByteInt
! -------
function nf90_put_att_one_TwoByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = TwoByteInt), intent( in) :: values
integer :: nf90_put_att_one_TwoByteInt
nf90_put_att_one_TwoByteInt = -1
end function nf90_put_att_one_TwoByteInt
! -------
function nf90_get_att_TwoByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = TwoByteInt), dimension(:), intent(out) :: values
integer :: nf90_get_att_TwoByteInt
nf90_get_att_TwoByteInt = -1
end function nf90_get_att_TwoByteInt
! -------
function nf90_get_att_one_TwoByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = TwoByteInt), intent(out) :: values
integer :: nf90_get_att_one_TwoByteInt
nf90_get_att_one_TwoByteInt = -1
end function nf90_get_att_one_TwoByteInt
! -------
function nf90_put_att_FourByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = FourByteInt), dimension(:), intent( in) :: values
integer :: nf90_put_att_FourByteInt
nf90_put_att_FourByteInt = -1
end function nf90_put_att_FourByteInt
! -------
function nf90_put_att_one_FourByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = FourByteInt), intent( in) :: values
integer :: nf90_put_att_one_FourByteInt
nf90_put_att_one_FourByteInt = -1
end function nf90_put_att_one_FourByteInt
! -------
function nf90_get_att_FourByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = FourByteInt), dimension(:), intent(out) :: values
integer :: nf90_get_att_FourByteInt
nf90_get_att_FourByteInt = -1
end function nf90_get_att_FourByteInt
! -------
function nf90_get_att_one_FourByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = FourByteInt), intent(out) :: values
integer :: nf90_get_att_one_FourByteInt
nf90_get_att_one_FourByteInt = -1
end function nf90_get_att_one_FourByteInt
! -------
function nf90_put_att_EightByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = EightByteInt), dimension(:), intent( in) :: values
integer :: nf90_put_att_EightByteInt
nf90_put_att_EightByteInt = -1
end function nf90_put_att_EightByteInt
! -------
function nf90_put_att_one_EightByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = EightByteInt), intent( in) :: values
integer :: nf90_put_att_one_EightByteInt
nf90_put_att_one_EightByteInt = -1
end function nf90_put_att_one_EightByteInt
! -------
function nf90_get_att_EightByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = EightByteInt), dimension(:), intent(out) :: values
integer :: nf90_get_att_EightByteInt
nf90_get_att_EightByteInt = -1
end function nf90_get_att_EightByteInt
! -------
function nf90_get_att_one_EightByteInt(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
integer (kind = EightByteInt), intent(out) :: values
integer :: nf90_get_att_one_EightByteInt
nf90_get_att_one_EightByteInt = -1
end function nf90_get_att_one_EightByteInt
! -------
! Real attributes
! -------
function nf90_put_att_FourByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = FourByteReal), dimension(:), intent( in) :: values
integer :: nf90_put_att_FourByteReal
nf90_put_att_FourByteReal = -1
end function nf90_put_att_FourByteReal
! -------
function nf90_put_att_one_FourByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = FourByteReal), intent( in) :: values
integer :: nf90_put_att_one_FourByteReal
nf90_put_att_one_FourByteReal = -1
end function nf90_put_att_one_FourByteReal
! -------
function nf90_get_att_FourByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = FourByteReal), dimension(:), intent(out) :: values
integer :: nf90_get_att_FourByteReal
nf90_get_att_FourByteReal = -1
end function nf90_get_att_FourByteReal
! -------
function nf90_get_att_one_FourByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = FourByteReal), intent(out) :: values
integer :: nf90_get_att_one_FourByteReal
nf90_get_att_one_FourByteReal = -1
end function nf90_get_att_one_FourByteReal
! -------
function nf90_put_att_EightByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = EightByteReal), dimension(:), intent( in) :: values
integer :: nf90_put_att_EightByteReal
nf90_put_att_EightByteReal = -1
end function nf90_put_att_EightByteReal
! -------
function nf90_put_att_one_EightByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = EightByteReal), intent( in) :: values
integer :: nf90_put_att_one_EightByteReal
nf90_put_att_one_EightByteReal = -1
end function nf90_put_att_one_EightByteReal
! -------
function nf90_get_att_EightByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = EightByteReal), dimension(:), intent(out) :: values
integer :: nf90_get_att_EightByteReal
nf90_get_att_EightByteReal = -1
end function nf90_get_att_EightByteReal
! -------
function nf90_get_att_one_EightByteReal(ncid, varid, name, values)
integer, intent( in) :: ncid, varid
character(len = *), intent( in) :: name
real (kind = EightByteReal), intent(out) :: values
integer :: nf90_get_att_one_EightByteReal
nf90_get_att_one_EightByteReal = -1
end function nf90_get_att_one_EightByteReal
! -------
!
! external netcdf data types:
!
integer, parameter, public :: &
nf90_byte = 1, &
nf90_int1 = nf90_byte, &
nf90_char = 2, &
nf90_short = 3, &
nf90_int2 = nf90_short, &
nf90_int = 4, &
nf90_int4 = nf90_int, &
nf90_float = 5, &
nf90_real = nf90_float, &
nf90_real4 = nf90_float, &
nf90_double = 6, &
nf90_real8 = nf90_double
!
! default fill values:
!
character (len = 1), parameter, public :: &
nf90_fill_char = achar(0)
integer (kind = OneByteInt), parameter, public :: &
nf90_fill_byte = -127, &
nf90_fill_int1 = nf90_fill_byte
integer (kind = TwoByteInt), parameter, public :: &
nf90_fill_short = -32767, &
nf90_fill_int2 = nf90_fill_short
integer (kind = FourByteInt), parameter, public :: &
nf90_fill_int = -2147483647
real (kind = FourByteReal), parameter, public :: &
nf90_fill_float = 9.9692099683868690e+36, &
nf90_fill_real = nf90_fill_float, &
nf90_fill_real4 = nf90_fill_float
real (kind = EightByteReal), parameter, public :: &
nf90_fill_double = 9.9692099683868690e+36, &
nf90_fill_real8 = nf90_fill_double
!
! mode flags for opening and creating a netcdf dataset:
!
integer, parameter, public :: &
nf90_nowrite = 0, &
nf90_write = 1, &
nf90_clobber = 0, &
nf90_noclobber = 4, &
nf90_fill = 0, &
nf90_nofill = 256, &
nf90_64bit_offset = 512, &
nf90_64bit_data = 32, &
nf90_cdf5 = nf90_64bit_data, &
nf90_lock = 1024, &
nf90_share = 2048, &
nf90_diskless = 8, &
nf90_mmap = 16
integer, parameter, public :: &
nf90_sizehint_default = 0, &
nf90_align_chunk = -1
!
! size argument for defining an unlimited dimension:
!
integer, parameter, public :: nf90_unlimited = 0
!
! global attribute id:
!
integer, parameter, public :: nf90_global = 0
!
! implementation limits:
!
integer, parameter, public :: &
nf90_max_dims = 1024, &
nf90_max_attrs = 8192, &
nf90_max_vars = 8192, &
nf90_max_name = 256, &
nf90_max_var_dims = 1024
!
! error codes:
!
integer, parameter, public :: &
nf90_noerr = 0, & ! No Error
nf90_ebadid = -33, & ! Not a valid ID
nf90_eexist = -35, & ! netcdf file exists && NF90_NOCLOBBER
nf90_einval = -36, & ! Invalid Argument
nf90_eperm = -37, & ! Write to read only
nf90_enotindefine = -38, & ! Operation not allowed in data mode
nf90_eindefine = -39, & ! Operation not allowed in define mode
nf90_einvalcoords = -40, & ! Index exceeds dimension bound
nf90_emaxdims = -41, & ! nf90_max_dims exceeded
nf90_enameinuse = -42, & ! String match to name in use
nf90_enotatt = -43, & ! Attribute not found
nf90_emaxatts = -44, & ! nf90_max_attrs exceeded
nf90_ebadtype = -45, & ! Not a netcdf data type
nf90_ebaddim = -46, & ! Invalid dimension id or name
nf90_eunlimpos = -47, & ! nf90_unlimited in the wrong index
nf90_emaxvars = -48, & ! nf90_max_vars exceeded
nf90_enotvar = -49, & ! The variable ID is invalid for the specified netCDF dataset.
nf90_eglobal = -50, & ! Action prohibited on nf90_global varid
nf90_enotnc = -51, & ! Not a netcdf file
nf90_ests = -52, & ! In Fortran, string too short
nf90_emaxname = -53, & ! nf90_max_name exceeded
nf90_eunlimit = -54, & ! nf90_unlimited size already in use
nf90_enorecvars = -55, & ! nc_rec op when there are no record vars
nf90_echar = -56, & ! Attempt to convert between text & numbers
nf90_eedge = -57, & ! Start+count exceeds dimension bound
nf90_estride = -58, & ! Illegal stride
nf90_ebadname = -59, & ! Attribute or variable name contains illegal characters
nf90_erange = -60, & ! Math result not representable
nf90_enomem = -61, & ! Memory allocation (malloc) failure
nf90_evarsize = -62, & ! One or more variable sizes violate format constraints
nf90_edimsize = -63, & ! Invalid dimension size
nf90_etrunc = -64, & ! File likely truncated or possibly corrupted
nf90_eaxistype = -65 ! Unknown axis type.
!
! more error codes for DAP
!
integer, parameter, public :: &
nf90_edap = -66, & ! Generic DAP error
nf90_ecurl = -67, & ! Generic libcurl error
nf90_eio = -68, & ! Generic IO error
nf90_enodata = -69, & ! Attempt to access variable with no data
nf90_edapsvc = -70, & ! DAP server error
nf90_edas = -71, & ! Malformed or inaccessible DAS
nf90_edds = -72, & ! Malformed or inaccessible DDS
nf90_edatadds = -73, & ! Malformed or inaccessible DATADDS
nf90_edapurl = -74, & ! Malformed DAP URL
nf90_edapconstraint = -75, & ! Malformed DAP Constrain
nf90_etranslation = -76, & ! Untranslatable construct
nf904_first_error = -100
!
! error codes for netCDF-4
!
integer, parameter, public :: &
nf90_ehdferr = -101, & ! Error at HDF5 layer.
nf90_ecantread = -102, & ! Can't read.
nf90_ecantwrite = -103, & ! Can't write.
nf90_ecantcreate = -104, & ! Can't create.
nf90_efilemeta = -105, & ! Problem with file metadata.
nf90_edimmeta = -106, & ! Problem with dimension metadata.
nf90_eattmeta = -107, & ! Problem with attribute metadata.
nf90_evarmeta = -108, & ! Problem with variable metadata.
nf90_enocompound = -109, & ! Not a compound type.
nf90_eattexists = -110, & ! Attribute already exists.
nf90_enotnc4 = -111, & ! Attempting netcdf-4 operation on netcdf-3 file.
nf90_estrictnc3 = -112, & ! Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
nf90_enotnc3 = -113, & ! Attempting netcdf-3 operation on netcdf-4 file.
nf90_enopar = -114, & ! Parallel operation on file opened for non-parallel access.
nf90_eparinit = -115, & ! Error initializing for parallel access.
nf90_ebadgrpid = -116, & ! Bad group ID.
nf90_ebadtypid = -117, & ! Bad type ID.
nf90_etypdefined = -118, & ! Type has already been defined and may not be edited.
nf90_ebadfield = -119, & ! Bad field ID.
nf90_ebadclass = -120, & ! Bad class.
nf90_emaptype = -121, & ! Mapped access for atomic types only.
nf90_elatefill = -122, & ! Attempt to define fill value when data already exists.
nf90_elatedef = -123, & ! Attempt to define var properties, like deflate, after enddef.
nf90_edimscale = -124, & ! Probem with HDF5 dimscales.
nf90_enogrp = -125, & ! No group found.
nf90_estorage = -126, & ! Can't specify both contiguous and chunking.
nf90_ebadchunk = -127, & ! Bad chunksize.
nf90_enotbuilt = -128, & ! Attempt to use feature that was not turned on when netCDF was built.
nf90_ediskless = -129, & ! Error in using diskless access.
nf90_ecantextend = -130, & ! Attempt to extend dataset during ind. I/O operation.
nf90_empi = -131, & ! MPI operation failed.
nf90_efilter = -132, & ! Filter operation failed.
nf90_ercfile = -133, & ! RC file failure
nf90_enullpad = -134, & ! Header Bytes not Null-Byte padded
nf90_einmemory = -135, & ! In-memory file error
nf90_enofilter = -136, & ! Filter not defined on variable.
nf90_enczarr = -137, & ! Error at NCZarr layer.
nf90_es3 = -138, & ! Generic S3 error
nf90_eempty = -139, & ! Attempt to read empty NCZarr map key
nf90_eobject = -140, & ! Some object exists when it should not
nf90_enoobject = -141, & ! Some object not found
nf90_eplugin = -142, & ! Unclassified failure in accessing a dynamically loaded plugin>
nf904_last_error = -142
!
! error handling modes:
!
integer, parameter, public :: &
nf90_fatal = 1, &
nf90_verbose = 2
!
! format version numbers:
!
integer, parameter, public :: &
nf90_format_classic = 1, &
nf90_format_64bit = 2, &
nf90_format_64bit_offset = nf90_format_64bit, &
nf90_format_64bit_data = 5, &
nf90_format_cdf5 = nf90_format_64bit_data, &
nf90_format_netcdf4 = 3, &
nf90_format_netcdf4_classic = 4
! extra data types:
integer, parameter, public :: &
nf90_ubyte = 7, &
nf90_ushort = 8, &
nf90_uint = 9, &
nf90_int64 = 10, &
nf90_uint64 = 11, &
nf90_string = 12, &
nf90_vlen = 13, &
nf90_opaque = 14, &
nf90_enum = 15, &
nf90_compound = 16
! extra default fill values:
integer (kind = TwoByteInt), parameter, public :: &
nf90_fill_ubyte = 255, &
nf90_fill_uint1 = nf90_fill_ubyte
integer (kind = FourByteInt), parameter, public :: &
nf90_fill_ushort = 65535, &
nf90_fill_uint2 = nf90_fill_ushort
integer (kind = EightByteInt), parameter, public :: &
nf90_fill_uint = 4294967295_EightByteInt
! Extra file create mode flags.
integer, parameter, public :: &
nf90_netcdf4 = 4096, &
nf90_hdf5 = 4096, & ! deprecated
nf90_classic_model = 256
! Flags for parallel access.
integer, parameter, public :: nf90_independent = 0, nf90_collective = 1
! Flags for parallel I/O.
integer, parameter, public :: nf90_mpiio = 8192, nf90_mpiposix = 16384, &
nf90_pnetcdf = 32768
! Extra variable flags.
integer, parameter, public :: &
nf90_chunk_seq = 0, &
nf90_chunk_sub = 1, &
nf90_chunk_sizes = 2, &
nf90_endian_native = 0, &
nf90_endian_little = 1, &
nf90_endian_big = 2, &
nf90_chunked = 0, &
nf90_notcontiguous = 0, &
nf90_contiguous = 1, &
nf90_compact = 2, &
nf90_nochecksum = 0, &
nf90_fletcher32 = 1, &
nf90_noshuffle = 0, &
nf90_shuffle = 1, &
nf90_szip_ec_option_mask = 4, &
nf90_szip_nn_option_mask = 32, &
nf90_noquantize = 0, &
nf90_quantize_bitgroom = 1
! This is the position of NC_NETCDF4 in cmode, counting from the
! right, starting (uncharacteristically for fortran) at 0. It's needed
! for the BTEST function calls.
integer, parameter, private :: NETCDF4_BIT = 12
!
! Dimension routines:
!
! -----------
function nf90_def_dim(ncid, name, len, dimid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent( in) :: len
integer, intent(out) :: dimid
integer :: nf90_def_dim
nf90_def_dim = -1
end function nf90_def_dim
! -----------
function nf90_inq_dimid(ncid, name, dimid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent(out) :: dimid
integer :: nf90_inq_dimid
nf90_inq_dimid = -1
end function nf90_inq_dimid
! -----------
function nf90_rename_dim(ncid, dimid, name)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent( in) :: dimid
integer :: nf90_rename_dim
nf90_rename_dim = -1
end function nf90_rename_dim
! -----------
function nf90_inquire_dimension(ncid, dimid, name, len)
integer, intent( in) :: ncid, dimid
character (len = *), optional, intent(out) :: name
integer, optional, intent(out) :: len
integer :: nf90_inquire_dimension
nf90_inquire_dimension = -1
end function nf90_inquire_dimension
! -----------
function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_1D_EightByteInt
nf90_put_var_1D_EightByteInt = -1
end function nf90_put_var_1D_EightByteInt
function nf90_put_var_2D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_2D_EightByteInt
nf90_put_var_2D_EightByteInt = -1
end function nf90_put_var_2D_EightByteInt
function nf90_put_var_3D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_3D_EightByteInt
nf90_put_var_3D_EightByteInt = -1
end function nf90_put_var_3D_EightByteInt
function nf90_put_var_4D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_4D_EightByteInt
nf90_put_var_4D_EightByteInt = -1
end function nf90_put_var_4D_EightByteInt
function nf90_put_var_5D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_5D_EightByteInt
nf90_put_var_5D_EightByteInt = -1
end function nf90_put_var_5D_EightByteInt
function nf90_put_var_6D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_6D_EightByteInt
nf90_put_var_6D_EightByteInt = -1
end function nf90_put_var_6D_EightByteInt
function nf90_put_var_7D_EightByteInt(ncid, varid, values, start, count, stride, map)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), dimension(:, :, :, :, :, :, :), &
intent( in) :: values
integer, dimension(:), optional, intent( in) :: start, count, stride, map
integer :: nf90_put_var_7D_EightByteInt
nf90_put_var_7D_EightByteInt = -1
end function nf90_put_var_7D_EightByteInt
function nf90_put_var_EightByteInt(ncid, varid, values, start)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), intent( in) :: values
integer, dimension(:), optional, intent( in) :: start
integer :: nf90_put_var_EightByteInt
nf90_put_var_EightByteInt = -1
end function nf90_put_var_EightByteInt
function nf90_get_var_EightByteInt(ncid, varid, values, start)
integer, intent( in) :: ncid, varid
integer (kind = EightByteInt), intent(out) :: values
integer, dimension(:), optional, intent( in) :: start
integer :: nf90_get_var_EightByteInt
nf90_get_var_EightByteInt = -1
end function nf90_get_var_EightByteInt
This diff is collapsed.
! This is part of the netCDF F90 API, or. Copyright 2006 UCAR. See COPYRIGHT file
! for details.
! This file contains the netcdf file functions that are shared by
! netcdf-3 and netcdf-4.
! Ed Hartnett, 2010
! -------
function nf90_inq_libvers()
character(len = 80) :: nf90_inq_libvers
nf90_inq_libvers = ""
end function nf90_inq_libvers
! -------
function nf90_strerror(ncerr)
integer, intent( in) :: ncerr
character(len = 80) :: nf90_strerror
nf90_strerror = ""
end function nf90_strerror
! -------
!
! File level control routines:
!
function nf90_inq_base_pe(ncid, pe)
integer, intent( in) :: ncid
integer, intent(out) :: pe
integer :: nf90_inq_base_pe
nf90_inq_base_pe = -1
end function nf90_inq_base_pe
! -------
function nf90_set_base_pe(ncid, pe)
integer, intent( in) :: ncid, pe
integer :: nf90_set_base_pe
nf90_set_base_pe = -1
end function nf90_set_base_pe
! -------
function nf90_create_mp(path, cmode, initalsz, basepe, chunksizehint, ncid)
character (len = *), intent( in) :: path
integer, intent( in) :: cmode, initalsz, basepe, chunksizehint
integer, intent(out) :: ncid
integer :: nf90_create_mp
nf90_create_mp = -1
end function nf90_create_mp
! -------
function nf90_open_mp(path, mode, basepe, chunksizeint, ncid)
character (len = *), intent( in) :: path
integer, intent( in) :: mode, basepe, chunksizeint
integer, intent(out) :: ncid
integer :: nf90_open_mp
nf90_open_mp = -1
end function nf90_open_mp
! -------
function nf90_set_fill(ncid, fillmode, old_mode)
integer, intent( in) :: ncid, fillmode
integer, intent(out) :: old_mode
integer :: nf90_set_fill
nf90_set_fill = -1
end function nf90_set_fill
! -------
function nf90_redef(ncid)
integer, intent( in) :: ncid
integer :: nf90_redef
nf90_redef = -1
end function nf90_redef
! -------
function nf90_enddef(ncid, h_minfree, v_align, v_minfree, r_align)
integer, intent( in) :: ncid
integer, optional, intent( in) :: h_minfree, v_align, v_minfree, r_align
integer :: nf90_enddef
nf90_enddef = -1
end function nf90_enddef
! -------
function nf90_sync(ncid)
integer, intent( in) :: ncid
integer :: nf90_sync
nf90_sync = -1
end function nf90_sync
! -------
function nf90_abort(ncid)
integer, intent( in) :: ncid
integer :: nf90_abort
nf90_abort = -1
end function nf90_abort
! -------
function nf90_close(ncid)
integer, intent( in) :: ncid
integer :: nf90_close
nf90_close = -1
end function nf90_close
! -------
function nf90_delete(name)
character(len = *), intent( in) :: name
integer :: nf90_delete
nf90_delete = -1
end function nf90_delete
!
! A single file level inquiry routine
!
function nf90_inquire(ncid, nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum)
integer, intent( in) :: ncid
integer, optional, intent(out) :: nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum
integer :: nf90_inquire
nf90_inquire = -1
end function nf90_inquire
function nf90_inq_path(ncid, pathlen, path)
integer, intent(in) :: ncid
integer, intent(inout) :: pathlen
character(len = *), intent(inout) :: path
integer :: nf90_inq_path
nf90_inq_path = -1
end function nf90_inq_path
function nf90_inq_format(ncid, format_type)
integer, intent(in) :: ncid
integer, intent(out) :: format_type
integer :: nf90_inq_format
nf90_inq_format = -1
end function nf90_inq_format
function nf90_get_var_1D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_OneByteInt = -1
end function nf90_get_var_1D_OneByteInt
function nf90_get_var_2D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_OneByteInt = -1
end function nf90_get_var_2D_OneByteInt
function nf90_get_var_3D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_3D_OneByteInt = -1
end function nf90_get_var_3D_OneByteInt
function nf90_get_var_4D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_OneByteInt = -1
end function nf90_get_var_4D_OneByteInt
function nf90_get_var_5D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_OneByteInt = -1
end function nf90_get_var_5D_OneByteInt
function nf90_get_var_6D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_OneByteInt = -1
end function nf90_get_var_6D_OneByteInt
function nf90_get_var_7D_OneByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_OneByteInt
integer, intent(in) :: ncid, varid
integer(c_int8_t), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_7D_OneByteInt = -1
end function nf90_get_var_7D_OneByteInt
function nf90_get_var_1D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_TwoByteInt = -1
end function nf90_get_var_1D_TwoByteInt
function nf90_get_var_2D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_TwoByteInt = -1
end function nf90_get_var_2D_TwoByteInt
function nf90_get_var_3D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_3D_TwoByteInt = -1
end function nf90_get_var_3D_TwoByteInt
function nf90_get_var_4D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_TwoByteInt = -1
end function nf90_get_var_4D_TwoByteInt
function nf90_get_var_5D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_TwoByteInt = -1
end function nf90_get_var_5D_TwoByteInt
function nf90_get_var_6D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_TwoByteInt = -1
end function nf90_get_var_6D_TwoByteInt
function nf90_get_var_7D_TwoByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_TwoByteInt
integer, intent(in) :: ncid, varid
integer(c_int16_t), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_7D_TwoByteInt = -1
end function nf90_get_var_7D_TwoByteInt
function nf90_get_var_1D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_FourByteInt = -1
end function nf90_get_var_1D_FourByteInt
function nf90_get_var_2D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_FourByteInt = -1
end function nf90_get_var_2D_FourByteInt
function nf90_get_var_3D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_3D_FourByteInt = -1
end function nf90_get_var_3D_FourByteInt
function nf90_get_var_4D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_FourByteInt = -1
end function nf90_get_var_4D_FourByteInt
function nf90_get_var_5D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_FourByteInt = -1
end function nf90_get_var_5D_FourByteInt
function nf90_get_var_6D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_FourByteInt = -1
end function nf90_get_var_6D_FourByteInt
function nf90_get_var_7D_FourByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_FourByteInt
integer, intent(in) :: ncid, varid
integer(c_int32_t), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_7D_FourByteInt = -1
end function nf90_get_var_7D_FourByteInt
function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_EightByteInt = -1
end function nf90_get_var_1D_EightByteInt
function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_EightByteInt = -1
end function nf90_get_var_2D_EightByteInt
function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:,:), intent(out) :: values
INTEGER, DIMENSION(:), OPTIONAL, INTENT(in) :: start, count, stride, map
nf90_get_var_3D_EightByteInt = -1
end function nf90_get_var_3D_EightByteInt
function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_EightByteInt = -1
end function nf90_get_var_4D_EightByteInt
function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_EightByteInt = -1
end function nf90_get_var_5D_EightByteInt
function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_EightByteInt = -1
end function nf90_get_var_6D_EightByteInt
function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_EightByteInt
integer, intent(in) :: ncid, varid
integer(c_int64_t), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_7D_EightByteInt = -1
end function nf90_get_var_7D_EightByteInt
function nf90_get_var_1D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_FourByteReal = -1
end function nf90_get_var_1D_FourByteReal
function nf90_get_var_2D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_FourByteReal = -1
end function nf90_get_var_2D_FourByteReal
function nf90_get_var_3D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_3D_FourByteReal = -1
end function nf90_get_var_3D_FourByteReal
function nf90_get_var_4D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_FourByteReal = -1
end function nf90_get_var_4D_FourByteReal
function nf90_get_var_5D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_FourByteReal = -1
end function nf90_get_var_5D_FourByteReal
function nf90_get_var_6D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_FourByteReal = -1
end function nf90_get_var_6D_FourByteReal
function nf90_get_var_7D_FourByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_FourByteReal
integer, intent(in) :: ncid, varid
real(c_float), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
INTEGER, DIMENSION(:), OPTIONAL, INTENT(in) :: start, count, stride, map
nf90_get_var_7D_FourByteReal = -1
end function nf90_get_var_7D_FourByteReal
function nf90_get_var_1D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_1D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_1D_EightByteReal = -1
end function nf90_get_var_1D_EightByteReal
function nf90_get_var_2D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_2D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_2D_EightByteReal = -1
end function nf90_get_var_2D_EightByteReal
function nf90_get_var_3D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_3D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_3D_EightByteReal = -1
end function nf90_get_var_3D_EightByteReal
function nf90_get_var_4D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_4D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_4D_EightByteReal = -1
end function nf90_get_var_4D_EightByteReal
function nf90_get_var_5D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_5D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_5D_EightByteReal = -1
end function nf90_get_var_5D_EightByteReal
function nf90_get_var_6D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_6D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_6D_EightByteReal = -1
end function nf90_get_var_6D_EightByteReal
function nf90_get_var_7D_EightByteReal(ncid, varid, values, start, count, stride, map)
use, intrinsic :: iso_c_binding
implicit none
integer :: nf90_get_var_7D_EightByteReal
integer, intent(in) :: ncid, varid
real(c_double), target, dimension(:,:,:,:,:,:,:), intent(out) :: values
integer, dimension(:), optional, intent(in) :: start, count, stride, map
nf90_get_var_7D_EightByteReal = -1
end function nf90_get_var_7D_EightByteReal
! Overloaded variable functions
interface nf90_def_var
module procedure nf90_def_var_Scalar, nf90_def_var_oneDim, nf90_def_var_ManyDims
end interface ! nf90_def_var
! Overloaded attribute functions
interface nf90_put_att
module procedure nf90_put_att_text, &
nf90_put_att_OneByteInt, nf90_put_att_TwoByteInt, &
nf90_put_att_FourByteInt, nf90_put_att_EightByteInt, &
nf90_put_att_FourByteReal, nf90_put_att_EightByteReal
module procedure nf90_put_att_one_OneByteInt, nf90_put_att_one_TwoByteInt, &
nf90_put_att_one_FourByteInt, nf90_put_att_one_EightByteInt, &
nf90_put_att_one_FourByteReal, nf90_put_att_one_EightByteReal
end interface !nf90_put_att
interface nf90_get_att
module procedure nf90_get_att_text, &
nf90_get_att_OneByteInt, nf90_get_att_TwoByteInt, &
nf90_get_att_FourByteInt, nf90_get_att_EightByteInt, &
nf90_get_att_FourByteReal, nf90_get_att_EightByteReal
module procedure nf90_get_att_one_OneByteInt, nf90_get_att_one_TwoByteInt, &
nf90_get_att_one_FourByteInt, nf90_get_att_one_EightByteInt, &
nf90_get_att_one_FourByteReal, nf90_get_att_one_EightByteReal
end interface ! nf90_get_att
! Overloaded variable functions
interface nf90_put_var
module procedure nf90_put_var_text, &
nf90_put_var_OneByteInt, nf90_put_var_TwoByteInt, &
nf90_put_var_FourByteInt, nf90_put_var_EightByteInt, &
nf90_put_var_FourByteReal, nf90_put_var_EightByteReal
module procedure nf90_put_var_1D_text, &
nf90_put_var_1D_OneByteInt, nf90_put_var_1D_TwoByteInt, &
nf90_put_var_1D_FourByteInt, nf90_put_var_1D_EightByteInt, &
nf90_put_var_1D_FourByteReal, nf90_put_var_1D_EightByteReal
module procedure nf90_put_var_2D_text, &
nf90_put_var_2D_OneByteInt, nf90_put_var_2D_TwoByteInt, &
nf90_put_var_2D_FourByteInt, nf90_put_var_2D_EightByteInt, &
nf90_put_var_2D_FourByteReal, nf90_put_var_2D_EightByteReal
module procedure nf90_put_var_3D_text, &
nf90_put_var_3D_OneByteInt, nf90_put_var_3D_TwoByteInt, &
nf90_put_var_3D_FourByteInt, nf90_put_var_3D_EightByteInt, &
nf90_put_var_3D_FourByteReal, nf90_put_var_3D_EightByteReal
module procedure nf90_put_var_4D_text, &
nf90_put_var_4D_OneByteInt, nf90_put_var_4D_TwoByteInt, &
nf90_put_var_4D_FourByteInt, nf90_put_var_4D_EightByteInt, &
nf90_put_var_4D_FourByteReal, nf90_put_var_4D_EightByteReal
module procedure nf90_put_var_5D_text, &
nf90_put_var_5D_OneByteInt, nf90_put_var_5D_TwoByteInt, &
nf90_put_var_5D_FourByteInt, nf90_put_var_5D_EightByteInt, &
nf90_put_var_5D_FourByteReal, nf90_put_var_5D_EightByteReal
module procedure nf90_put_var_6D_text, &
nf90_put_var_6D_OneByteInt, nf90_put_var_6D_TwoByteInt, &
nf90_put_var_6D_FourByteInt, nf90_put_var_6D_EightByteInt, &
nf90_put_var_6D_FourByteReal, nf90_put_var_6D_EightByteReal
module procedure nf90_put_var_7D_text, &
nf90_put_var_7D_OneByteInt, nf90_put_var_7D_TwoByteInt, &
nf90_put_var_7D_FourByteInt, nf90_put_var_7D_EightByteInt, &
nf90_put_var_7D_FourByteReal, nf90_put_var_7D_EightByteReal
end interface ! nf90_put_var
interface nf90_get_var
module procedure nf90_get_var_text, &
nf90_get_var_OneByteInt, nf90_get_var_TwoByteInt, &
nf90_get_var_FourByteInt, nf90_get_var_EightByteInt, &
nf90_get_var_FourByteReal, nf90_get_var_EightByteReal
module procedure nf90_get_var_1D_text, &
nf90_get_var_1D_OneByteInt, nf90_get_var_1D_TwoByteInt, &
nf90_get_var_1D_FourByteInt, nf90_get_var_1D_EightByteInt, &
nf90_get_var_1D_FourByteReal, nf90_get_var_1D_EightByteReal
module procedure nf90_get_var_2D_text, &
nf90_get_var_2D_OneByteInt, nf90_get_var_2D_TwoByteInt, &
nf90_get_var_2D_FourByteInt, nf90_get_var_2D_EightByteInt, &
nf90_get_var_2D_FourByteReal, nf90_get_var_2D_EightByteReal
module procedure nf90_get_var_3D_text, &
nf90_get_var_3D_OneByteInt, nf90_get_var_3D_TwoByteInt, &
nf90_get_var_3D_FourByteInt, nf90_get_var_3D_EightByteInt, &
nf90_get_var_3D_FourByteReal, nf90_get_var_3D_EightByteReal
module procedure nf90_get_var_4D_text, &
nf90_get_var_4D_OneByteInt, nf90_get_var_4D_TwoByteInt, &
nf90_get_var_4D_FourByteInt, nf90_get_var_4D_EightByteInt, &
nf90_get_var_4D_FourByteReal, nf90_get_var_4D_EightByteReal
module procedure nf90_get_var_5D_text, &
nf90_get_var_5D_OneByteInt, nf90_get_var_5D_TwoByteInt, &
nf90_get_var_5D_FourByteInt, nf90_get_var_5D_EightByteInt, &
nf90_get_var_5D_FourByteReal, nf90_get_var_5D_EightByteReal
module procedure nf90_get_var_6D_text, &
nf90_get_var_6D_OneByteInt, nf90_get_var_6D_TwoByteInt, &
nf90_get_var_6D_FourByteInt, nf90_get_var_6D_EightByteInt, &
nf90_get_var_6D_FourByteReal, nf90_get_var_6D_EightByteReal
module procedure nf90_get_var_7D_text, &
nf90_get_var_7D_OneByteInt, nf90_get_var_7D_TwoByteInt, &
nf90_get_var_7D_FourByteInt, nf90_get_var_7D_EightByteInt, &
nf90_get_var_7D_FourByteReal, nf90_get_var_7D_EightByteReal
end interface ! nf90_get_var
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
nf90_put_var_text = -1
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
nf90_get_var_text = -1
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
nf90_put_var_1D_text = -1
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
nf90_put_var_2D_text = -1
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
nf90_put_var_3D_text = -1
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
nf90_put_var_4D_text = -1
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
nf90_put_var_5D_text = -1
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
nf90_put_var_6D_text = -1
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
nf90_put_var_7D_text = -1
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
nf90_get_var_1D_text = -1
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
nf90_get_var_2D_text = -1
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
nf90_get_var_3D_text = -1
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
nf90_get_var_4D_text = -1
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
nf90_get_var_5D_text = -1
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
nf90_get_var_6D_text = -1
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
nf90_get_var_7D_text = -1
end function nf90_get_var_7D_text
! -----
! Variable definitions and inquiry
! -----
function nf90_def_var_Scalar(ncid, name, xtype, varid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent( in) :: xtype
integer, intent(out) :: varid
integer :: nf90_def_var_Scalar
nf90_def_var_Scalar = -1
end function nf90_def_var_Scalar
! -----
function nf90_def_var_oneDim(ncid, name, xtype, dimids, varid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent( in) :: xtype
integer, intent( in) :: dimids
integer, intent(out) :: varid
INTEGER :: nf90_def_var_oneDim
nf90_def_var_oneDim = -1
end function nf90_def_var_oneDim
! -----
function nf90_def_var_ManyDims(ncid, name, xtype, dimids, varid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent( in) :: xtype
integer, dimension(:), intent( in) :: dimids
integer, intent(out) :: varid
integer :: nf90_def_var_ManyDims
nf90_def_var_ManyDims = -1
end function nf90_def_var_ManyDims
! -----
function nf90_inq_varid(ncid, name, varid)
integer, intent( in) :: ncid
character (len = *), intent( in) :: name
integer, intent(out) :: varid
integer :: nf90_inq_varid
nf90_inq_varid = -1
end function nf90_inq_varid
! -----
function nf90_inquire_variable(ncid, varid, name, xtype, ndims, dimids, nAtts)
integer, intent( in) :: ncid, varid
character (len = *), optional, intent(out) :: name
integer, optional, intent(out) :: xtype, ndims
integer, dimension(:), optional, intent(out) :: dimids
integer, optional, intent(out) :: nAtts
integer :: nf90_inquire_variable
nf90_inquire_variable = -1
end function nf90_inquire_variable
! -----
function nf90_rename_var(ncid, varid, newname)
integer, intent( in) :: ncid, varid
character (len = *), intent( in) :: newname
integer :: nf90_rename_var
nf90_rename_var = -1
end function nf90_rename_var
! -----
! Library version, error string
public :: nf90_inq_libvers, nf90_strerror
! Control routines
public :: nf90_create, nf90_open, nf90_set_base_pe, nf90_inq_base_pe, &
nf90_set_fill, nf90_redef, nf90_enddef, &
nf90_create_mp, nf90_open_mp, &
nf90_sync, nf90_abort, nf90_close, nf90_delete
! File level inquiry
public :: nf90_inquire, nf90_inq_path, nf90_inq_format
! Dimension routines
public :: nf90_def_dim, nf90_inq_dimid, nf90_rename_dim, nf90_inquire_dimension
! attribute routines
public :: nf90_copy_att, nf90_rename_att, nf90_del_att, nf90_inq_attname, &
nf90_inquire_attribute
! overloaded functions
public :: nf90_put_att, nf90_get_att
! Variable routines
public :: nf90_def_var, nf90_inq_varid, nf90_rename_var, nf90_inquire_variable
! overloaded functions
public :: nf90_put_var, nf90_get_var
! Description:
! Provide named kind parameters for use in declarations of real and integer
! variables with specific byte sizes (i.e. one, two, four, and eight byte
! integers; four and eight byte reals). The parameters can then be used
! in (KIND = XX) modifiers in declarations.
! A single function (byteSizesOK()) is provided to ensure that the selected
! kind parameters are correct.
!
! Input Parameters:
! None.
!
! Output Parameters:
! Public parameters, fixed at compile time:
! OneByteInt, TwoByteInt, FourByteInt, EightByteInt
! FourByteReal, EightByteRadl
!
! References and Credits:
! Written by
! Robert Pincus
! Cooperative Institue for Meteorological Satellite Studies
! University of Wisconsin - Madison
! 1225 W. Dayton St.
! Madison, Wisconsin 53706
! Robert.Pincus@ssec.wisc.edu
!
! Design Notes:
! Fortran 90 doesn't allow one to check the number of bytes in a real variable;
! we check only that four byte and eight byte reals have different kind parameters.
!
module typesizes
implicit none
public
integer, parameter :: OneByteInt = selected_int_kind(2), &
TwoByteInt = selected_int_kind(4), &
FourByteInt = selected_int_kind(9), &
EightByteInt = selected_int_kind(18)
integer, parameter :: &
FourByteReal = selected_real_kind(P = 6, R = 37), &
EightByteReal = selected_real_kind(P = 13, R = 307)
contains
logical function byteSizesOK()
! Users may call this function once to ensure that the kind parameters
! the module defines are available with the current compiler.
! We can't ensure that the two REAL kinds are actually four and
! eight bytes long, but we can ensure that they are distinct.
! Early Fortran 90 compilers would sometimes report incorrect results for
! the bit_size intrinsic, but I haven't seen this in a long time.
! Local variables
integer (kind = OneByteInt) :: One
integer (kind = TwoByteInt) :: Two
integer (kind = FourByteInt) :: Four
integer (kind = EightByteInt) :: Eight
if (bit_size( One) == 8 .and. bit_size( Two) == 16 .and. &
bit_size(Four) == 32 .and. bit_size( Eight) == 64 .and. &
FourByteReal > 0 .and. EightByteReal > 0 .and. &
FourByteReal /= EightByteReal) then
byteSizesOK = .true.
else
byteSizesOK = .false.
end if
end function byteSizesOK
end module typeSizes
......@@ -40,7 +40,6 @@ set -o posix
# - REF_CONF : reference configuration to build the new one from
# - CMP_NAM : compiler name
# - NBR_PRC : number of processes used to compile
# - RMT_CONF : unsupported (external) configuration to build the new one from
# - NEM_SUBDIR : NEMO subdirectory used (specified)
#
# Locally defined :
......@@ -87,6 +86,8 @@ set -o posix
x_d=''; x_h=''; x_n=''; x_r=''; x_c='';
x_u=''; x_a=''; x_m=''; x_t=''; x_b='';
x_j='1'; x_e='none'; x_s='src'; x_v='1'
x_nocdf=0
x_name=''
##- Local variables ---
b_n=$(basename ${0})
......@@ -95,15 +96,19 @@ MAIN_DIR=$(cd $(dirname "$0"); pwd)
MAIN_DIR=${MAIN_DIR%/sette*}
MAIN_DIR=${MAIN_DIR%/tools*}
MAIN_DIR=${MAIN_DIR%/cfgs*}
MAIN_DIR=${MAIN_DIR%/tests*}
MAIN_DIR=${MAIN_DIR%/ext*}
MAIN_DIR=${MAIN_DIR%/arch*}
export MAIN_DIR
#
export CONFIG_DIR=${MAIN_DIR}/cfgs
export TESTS_DIR=${MAIN_DIR}/tests
export TOOLS_DIR=${MAIN_DIR}/tools
export COMPIL_DIR=${MAIN_DIR}/mk
export NEMO_DIR=${MAIN_DIR}/${x_s}
export AGRIFUSE='10'
list_key='0'; chk_key='1'
list_add_key=''; list_del_key='';
list_add_key=''; list_def_key=''; list_del_key=''
conf_file=ref_cfgs.txt
#-
#- FCM and functions location ---
......@@ -111,74 +116,120 @@ export PATH=${MAIN_DIR}/ext/FCM/bin:$PATH
#-
#- Choice of the options ---
while getopts :hd:n:r:u:a:m:j:e:s:v:t:k:b option; do
case $option in
('h') cat <<EOF
## Get clean, clean_config options
while [ ${#1} -gt 0 ]; do
case "$1" in
-h|--help) cat <<EOF
Usage:
------
./makenemo -[aru] CONFIG -m ARCH [-[dehjntv] ...] [{list_key,clean,clean_config}]
[{add_key,del_key} ...]
./makenemo -[arn] CONFIG -m ARCH [-[...] ...] [{list_key,clean,clean_config}]
Mandatory
-m Computing architecture (./arch), FCM file describing the compilation settings
-m, --mach, --machine, --arch <machine_name>
Computing architecture, will use the file arch_<machine_name>.fcm located in ./arch (sub)directory(ies)
and one of the following option (use 'all' arg to list available items)
-n, --name <config_name>
Name of the configuration to compile
-r Reference configuration (./cfgs), proven with long-term support
-a Academic test case (./tests), ready-to-use configuration with no support over time
-u Scripted remote configuration (see ./tests/rmt_cfgs.txt)
and, if -n defines a new configuration, one of the following option (use 'all' arg to list available items):
-r, --ref <ref_config_name>
To specify which reference configuration (./cfgs) must be used to buit the new configuration
-a, --test <test_config_name>
To specify which academic test case (./tests) must be used to buit the new configuration
Optional
-d New set of sub-components (subfolders from ./src directory)
-b Compile Nemo in debug mode (if %DEBUG_FCFLAGS is defined in arch file)
-e Path for alter patch location (default: 'MY_SRC' in configuration folder)
-h Print this help
-j Number of processes to compile (0: dry run with no build)
-n Name for new configuration
-s Path for alter source location (default: 'src' root directory)
-t Path for alter build location (default: 'BLD' in configuration folder)
-v Level of verbosity ([0-3])
--add_key, key_add, add_key "<list of keys>"
list of cpp keys to be added in cpp_<config_name>.fcm file
-b, --dbg, --debug
add it to compile in debug mode
-d, --dirs, --comp <sub-components>
New set of sub-components (subfolders from ./src directory) to be used
--def_key, key_def, def_key "<list of keys>"
list of all cpp keys to be defined in cpp_<config_name>.fcm file
--del_key, key_del, del_key "<list of keys>"
list of cpp keys to be deleted in cpp_<config_name>.fcm file
-e, --my_srcpath, --my_src_path, --MY_SRCpath, --MY_SRC_path <path>
Path for alter patch location (default: 'MY_SRC' in configuration folder)
-h, --help
Print this help
-j, --jobs <nb_job>
Number of processes to compile (0: dry run with no build)
-k, --chkkey <O/1>
Set to 0 to bypass the check of the cpp keys (takes time at the beginning of makenemo).
Default is 1
--nonc, --nocdf, --nonetcdf, --no_nc, --no_cdf, --no_netcdf
Compile without the NetCDF Library
-s, --srcpath, --src_path <path>
Path for alter source location (default: 'src' root directory)
-t, --bldpath, --bld_path, --BLDpath, --BLD_path <path>
Path for alter build location (default: 'BLD' in configuration folder)
-v, --verbose <0/1/2/3>
Level of verbosity ([0-3])
Examples
¤ Configuration creation
Build : ./makenemo -[aru] ... [...]
Copy : ./makenemo -n ... -[aru] ... [...]
Build : ./makenemo -[ar] ... [...]
Copy : ./makenemo -n ... -[ar] ... [...]
¤ Configuration management
List CPP keys : ./makenemo -n ... list_key
Add-Remove keys: ./makenemo -n ... add_key '...' del_key '...'
Fresh start : ./makenemo -n ... clean
Removal : ./makenemo -n ... clean_config
EOF
exit 0 ;;
('b') x_b="True" ;; ('n') x_n=${OPTARG};; ('r') x_r=${OPTARG};; ('u') x_u=${OPTARG};;
('a') x_a=${OPTARG};; ('m') x_m=${OPTARG};; ('j') x_j=${OPTARG};; ('t') x_t=${OPTARG};;
('e') x_e=(${OPTARG});; ('s') x_s=${OPTARG};; ('v') x_v=${OPTARG};; ('d') x_d=${OPTARG};;
('k') chk_key=${OPTARG} ;;
(':') echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; exit 2 ;;
('?') echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; exit 2 ;;
esac
done
shift $(($OPTIND-1));
## Get clean, clean_config options
while [ ${#1} -gt 0 ]; do
case "$1" in
'clean' ) x_c="--$1" ;;
'clean_config') . ${COMPIL_DIR}/Fclean_config.sh; exit ;;
## Checking if argument has anything other than whitespace
'add_key' ) [[ ! "$2" =~ ^\ +$ ]] && list_add_key=$2; shift;;
'del_key' ) [[ ! "$2" =~ ^\ +$ ]] && list_del_key=$2; shift;;
'list_key' ) list_key='1' ;;
'*' ) echo " \"$1\" BAD OPTION"; exit 2 ;;
esac
shift
EOF
exit 0 ;;
-b|--dbg|--debug)
x_b="True" ;;
-d|--dirs|--comp)
x_d=${2} ; shift ;;
-n|--name)
x_name=${2} ; shift ;;
-r|--ref)
x_r=${2} ; shift ;;
-a|--academic|--test)
x_a=${2} ; shift ;;
-m|--mach|--machine|--arch)
x_m=${2} ; shift ;;
-j) x_j=${2} ; shift ;;
-t|--bldpath|--bld_path|--BLDpath|--BLD_path)
x_t=${2} ; shift ;;
-e|--my_srcpath|--my_src_path|--MY_SRCpath|--MY_SRC_path)
x_e=${2} ; shift ;;
-s|--srcpath|--src_path)
x_s=${2} ; shift ;;
-v|--verbose)
x_v=${2} ; shift ;;
-k|--chkkey)
chk_key=${2} ; shift ;;
--nonc|--nocdf|--nonetcdf|--no_nc|--no_cdf|--no_netcdf)
x_nocdf=1 ;;
--clean|clean)
x_c="--$1" ;;
--clean_config|clean_config)
. ${COMPIL_DIR}/Fclean_config.sh; exit ;;
## Checking if argument has anything other than whitespace
--add_key|--key_add|add_key ) [[ ! "$2" =~ ^\ +$ ]] && list_add_key=$2; shift;;
--def_key|--key_def|def_key ) [[ ! "$2" =~ ^\ +$ ]] && list_def_key=$2; shift;;
--del_key|--key_del|del_key ) [[ ! "$2" =~ ^\ +$ ]] && list_del_key=$2; shift;;
--list_key|list_key ) list_key='1' ;;
'*' ) echo " \"$1\" BAD OPTION"; exit 2 ;;
':') echo ${b_n}" : -"${1}" option : missing value" 1>&2; exit 2 ;;
'?') echo ${b_n}" : -"${1}" option : not supported" 1>&2; exit 2 ;;
esac
shift
done
if [ -n "$x_name" ] # is the configuration existing in cfgs or tests? or is it a new conf?
then
incfg=$( find $CONFIG_DIR -type d -name $x_name | wc -l ) # this configuration exists in CONFIG_DIR
intst=$( find $TESTS_DIR -type d -name $x_name | wc -l ) # this configuration exists in TESTS_DIR
[[ $incfg -eq 0 && $intst -eq 0 ]] && x_n=$x_name # this is a new configuration -> dedine/overwrite x_n
[[ $incfg -eq 1 && -z "$x_r" ]] && x_r=$x_name # this is a reference configuration -> dedine/overwrite x_r
[[ $intst -eq 1 && -z "$x_a" ]] && x_a=$x_name # this is a test configuration -> dedine/overwrite x_a
fi
export NEW_CONF=${x_n}
NBR_PRC=${x_j}
......@@ -186,7 +237,6 @@ CMP_NAM=${x_m}
NEM_SUBDIR=${x_d}
REF_CONF=${x_r}
DEMO_CONF=${x_a}
RMT_CONF=${x_u}
TML_CONF=${REF_CONF}
export NEMO_DIR=${MAIN_DIR}/${x_s}
NEMO_DBG=${x_b}
......@@ -195,14 +245,14 @@ NEMO_DBG=${x_b}
## No ref. cfg, demo case, nor remote cfg selected
if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" && -z "${RMT_CONF}" ]]; then
if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" ]]; then
## Reuse last configuration compiled if any (existing 'work_cfgs.txt')
# if [[ $( find ./cfgs ./tests -name work_cfgs.txt ) ]]; then
# CONFIG_DIR=${MAIN_DIR}/$( ls -rt */work_cfgs.txt | awk -F/ 'END{ print $1}' )
# TML_CONF=$( tail -1 ${CONFIG_DIR}/work_cfgs.txt | awk '{ print $1 }' )
# else
## No ${REF_CONF}, ${DEMO_CONF}, ${RMT_CONF} nor ${NEM_SUBDIR} and 1st compilation => exit
## No ${REF_CONF}, ${DEMO_CONF} nor ${NEM_SUBDIR} and 1st compilation => exit
# echo -e "\033[0;33m\nNo previous build found!"
echo -e "\033[0;31m\nAt least a reference configuration ('-r'), a test case ('-a'), "
echo -e "a remote configuration ('-u') has to be choosen!!!\033[0m"
......@@ -214,7 +264,7 @@ if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" && -z "${RMT_CONF}" ]]; then
else
## 'all' arg: list all available configurations
if [[ "${REF_CONF}" == 'all' || "${DEMO_CONF}" == 'all' || "${RMT_CONF}" == 'all' ]]; then
if [[ "${REF_CONF}" == 'all' || "${DEMO_CONF}" == 'all' ]]; then
${COMPIL_DIR}/Flist_cfgs.sh
exit 2
## Probably useless but who knows?
......@@ -225,27 +275,8 @@ else
exit 2
fi
## Remote cfg
if [ -n "${RMT_CONF}" ]; then
conf_file=rmt_cfgs.txt; CONFIG_DIR=${MAIN_DIR}/tests;
if [[ ! $( grep ${RMT_CONF} ${CONFIG_DIR}/${conf_file} ) ]]; then
echo -e "\033[0;31m\nThe reference configuration ('-r'), test case ('-a') or "
echo -e "remote configuration ('-u') selected is not available!!!"
echo -e "Check the option used and the available items in .txt files\033[0m"
${COMPIL_DIR}/Flist_cfgs.sh
exit 2
fi
## Little tricky this one
for word in $( grep ${RMT_CONF} ${CONFIG_DIR}/${conf_file} ); do
words[${#words[@]}]=$word
done
TML_CONF=${words[2]}; NEM_SUBDIR=${words[4]}; URL=${words[6]}
## Demo case
elif [ -n "${DEMO_CONF}" ]; then
if [ -n "${DEMO_CONF}" ]; then
conf_file=demo_cfgs.txt; CONFIG_DIR=${MAIN_DIR}/tests; TML_CONF=${DEMO_CONF}
fi
......@@ -281,13 +312,17 @@ export NEM_SUBDIR="${NEM_SUBDIR}" NEW_CONF="${NEW_CONF}"
## Save new configuration with sub-components set in work_cfgs.txt
[ -f ${CONFIG_DIR}/work_cfgs.txt ] && sed -i "/${NEW_CONF} /d" ${CONFIG_DIR}/work_cfgs.txt
echo ${NEW_CONF} "${NEM_SUBDIR}" \
>> ${CONFIG_DIR}/work_cfgs.txt
echo ${NEW_CONF} "${NEM_SUBDIR}" >> ${CONFIG_DIR}/work_cfgs.txt
cd ${CONFIG_DIR}
printf "\nYou are installing a new configuration %s from %s " ${NEW_CONF} ${TML_CONF}
printf "with sub-components: %s\n" "${NEM_SUBDIR}"
if [ -n "${NEW_CONF}" ]
then
echo
printf "\nYou are installing a new configuration %s from %s " ${NEW_CONF} ${TML_CONF}
printf "with sub-components: %s\n" "${NEM_SUBDIR}"
echo
fi
## Create new config even in existing one (mkdir with -p option, cp with -n)
${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${TML_CONF}
......@@ -295,9 +330,6 @@ ${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${TML_CONF}
## create EXP00 if needed
[ ! -d ${CONFIG_DIR}/${NEW_CONF}/EXP00 ] && \cp -R -n ${CONFIG_DIR}/${NEW_CONF}/EXPREF ${CONFIG_DIR}/${NEW_CONF}/EXP00
## Get online script file for remote cfg
[ -n "${RMT_CONF}" ] && ${COMPIL_DIR}/Ffetch_extdir.sh ${NEW_CONF} $URL
#- Create the WORK ---
#- Clean links and librairies ---
#- Creating the good links, at first on OCE ---
......@@ -319,6 +351,7 @@ fi
#- At this stage new configuration has been added, we add or remove keys
[ ! -z "${list_add_key}" ] && { . ${COMPIL_DIR}/Fadd_keys.sh ${NEW_CONF} add_key ${list_add_key}; }
[ ! -z "${list_def_key}" ] && { . ${COMPIL_DIR}/Fdef_keys.sh ${NEW_CONF} def_key ${list_def_key}; }
[ ! -z "${list_del_key}" ] && { . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key}; }
#- check that all keys are really existing...
......@@ -349,7 +382,7 @@ fi
#- At this stage the configuration has beeen chosen
#- We coose the default light file
export USEBLD=bldxag.cfg
[ $x_nocdf -eq 1 ] && export USEBLD=bldxagxcdf.cfg || export USEBLD=bldxag.cfg
#- We look after agrif
grep key_agrif ${COMPIL_DIR}/cpp.fcm && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/}
......@@ -386,7 +419,7 @@ if [ "${NBR_PRC}" -gt 0 ]; then
echo 'Cleaning in '${NEW_CONF}' the building folders'
for dir in AGRIFLIB BLD EXP00 LONG NEMOFILES REPRO_* SHORT WORK; do
for dir in AGRIFLIB BLD LONG NEMOFILES REPRO_* SHORT WORK; do
rm -rf ${NEMO_TDIR}/${NEW_CONF}/$dir
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment