diff --git a/Makefile.am b/Makefile.am index 6c15f45f04f..5fac0f9fcd0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,6 @@ if BUILD_DOCS DOC = doc endif -SUBDIRS = src tests examples ${DOC} +SUBDIRS = src tests examples ${DOC} scripts EXTRA_DIST = CMakeLists.txt set_flags.am diff --git a/configure.ac b/configure.ac index 714b186cccc..2cada4a2e42 100644 --- a/configure.ac +++ b/configure.ac @@ -211,7 +211,7 @@ fi AM_CONDITIONAL([HAVE_PAPI], [test "x$have_papi" = xyes]) AC_CONFIG_FILES(src/flib/piodarray.F90:src/flib/piodarray.F90.in2) -AC_CONFIG_FILES(src/flib/pionfatt_mod.F90:src/flib/pionfatt_mod.F90.in2) +#AC_CONFIG_FILES(src/flib/pionfatt_mod.F90:src/flib/pionfatt_mod.F90.in2) AC_CONFIG_FILES(src/flib/pionfget_mod.F90:src/flib/pionfget_mod.F90.in2) AC_CONFIG_FILES(src/flib/pionfput_mod.F90:src/flib/pionfput_mod.F90.in2) @@ -236,4 +236,5 @@ AC_OUTPUT(Makefile tests/performance/Makefile doc/Makefile examples/Makefile - examples/c/Makefile) + examples/c/Makefile + scripts/Makefile) diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 00000000000..9e65f382902 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,6 @@ +# This is part of PIO. It handles the scripts directory which has some +# useful scripts. + +# Ed Hartnett 5/17/19 + +EXTRA_DIST = prune_decomps.pl genf90.pl diff --git a/scripts/genf90.pl b/scripts/genf90.pl new file mode 100755 index 00000000000..ec7d0dba28b --- /dev/null +++ b/scripts/genf90.pl @@ -0,0 +1,387 @@ +#!/usr/bin/env perl +use strict; +my $outfile; +# Beginning with F90, Fortran has strict typing of variables based on "TKR" +# (type, kind, and rank). In many cases we want to write subroutines that +# provide the same functionality for different variable types and ranks. In +# order to do this without cut-and-paste duplication of code, we create a +# template file with the extension ".F90.in", which can be parsed by this script +# to generate F90 code for all of the desired specific types. +# +# Keywords are delimited by curly brackets: {} +# +# {TYPE} and {DIMS} are used to generate the specific subroutine names from the +# generic template +# {TYPE} : Variable type name; implemented types are character, 4 or 8 byte real, +# and 4 or 8 byte integer. +# allowed values: text, real, double, int, long, logical +# default values: text, real, double, int +# {VTYPE} : Used to generate variable declarations to match the specific type. +# if {TYPE}=double then {VTYPE} is "real(r8)" +# {ITYPE}, {ITYPENAME} : Used to generate CPP statements for the specific type. +# {MPITYPE} : Used to generate MPI types corresponding to the specific type. +# +# {DIMS} : Rank of arrays, "0" for scalar. +# allowed values: 0-7 +# default values : 0-5 +# {DIMSTR} : Generates the parenthesis and colons used for a variable +# declaration of {DIMS} dimensions. +# if {DIMS}=3 then {DIMSTR} is (:,:,:) +# {REPEAT} : Repeats an expression for each number from 1 to {DIMS}, with each +# iteration separated by commas. +# {REPEAT: foo(#, bar)} +# expands to this: +# foo(1, bar), foo(2, bar), foo(3, bar), ... + +# defaults +my @types = qw(text real double int); +my $vtype = {'text' => 'character(len=*)', + 'real' => 'real(r4)', + 'double' => 'real(r8)', + 'int' => 'integer(i4)', + 'long' => 'integer(i8)', + 'logical' => 'logical' }; +my $itype = {'text' => 100, + 'real' => 101, + 'double' => 102, + 'int' => 103, + 'long' => 104, + 'logical' => 105}; +my $itypename = {'text' => 'TYPETEXT', + 'real' => 'TYPEREAL', + 'double' => 'TYPEDOUBLE', + 'int' => 'TYPEINT', + 'long' => 'TYPELONG', + 'logical' => 'TYPELOGICAL'}; +my $mpitype = {'text' => 'MPI_CHARACTER', + 'real' => 'MPI_REAL4', + 'double' => 'MPI_REAL8', + 'int' => 'MPI_INTEGER'}; +# Netcdf C datatypes +my $nctype = {'text' => 'text', + 'real' => 'float', + 'double' => 'double', + 'int' => 'int'}; +# C interoperability types +my $ctype = {'text' => 'character(C_CHAR)', + 'real' => 'real(C_FLOAT)', + 'double' => 'real(C_DOUBLE)', + 'int' => 'integer(C_INT)'}; + + + +my @dims =(0..5); + +my $write_dtypes = "no"; +# begin + +foreach(@ARGV){ + my $infile = $_; + usage() unless($infile =~ /(.*.F90).in/); + $outfile = $1; + open(F,"$infile") || die "$0 Could not open $infile to read"; + my @parsetext; + my $cnt=0; + foreach(){ + $cnt++; + if(/^\s*contains/i){ + push(@parsetext,"# $cnt \"$infile\"\n"); + } + if(/^\s*interface/i){ + push(@parsetext,"# $cnt \"$infile\"\n"); + } + if(/^[^!]*subroutine/i){ + push(@parsetext,"# $cnt \"$infile\"\n"); + } + if(/^[^!]*function/i){ + push(@parsetext,"# $cnt \"$infile\"\n"); + } + + push(@parsetext,$_); + } + + close(F); + + my $end; + my $contains=0; + my $in_type_block=0; + my @unit; + my $unitcnt=0; + my $date = localtime(); + my $preamble = +"!=================================================== +! DO NOT EDIT THIS FILE, it was generated using $0 +! Any changes you make to this file may be lost +!===================================================\n"; + my @output ; + push(@output,$preamble); + + my $line; + my $dimmodifier; + my $typemodifier; + my $itypeflag; + my $block; + my $block_type; + my $cppunit; + foreach $line (@parsetext){ +# skip parser comments + next if($line =~ /\s*!pl/); + + $itypeflag=1 if($line =~ /{ITYPE}/); + $itypeflag=1 if($line =~ /TYPETEXT/); + $itypeflag=1 if($line =~ /TYPEREAL/); + $itypeflag=1 if($line =~ /TYPEDOUBLE/); + $itypeflag=1 if($line =~ /TYPEINT/); + $itypeflag=1 if($line =~ /TYPELONG/); + + + if($contains==0){ + if($line=~/\s*!\s*DIMS\s+[\d,]+!*/){ + $dimmodifier=$line; + next; + } + if($line=~/\s*!\s*TYPE\s+[^!]+!*$/){ + $typemodifier=$line; + next; + } + if ((defined $typemodifier or defined $dimmodifier) + and not defined $block and $line=~/^\s*#[^{]*$/) { + push(@output, $line); + next; + } + # Figure out the bounds of a type statement. + # Type blocks start with "type," "type foo" or "type::" but not + # "type(". + $in_type_block=1 if($line=~/^\s*type\s*[,:[:alpha:]]/i); + $in_type_block=0 if($line=~/^\s*end\s*type/i); + if(not defined $block) { + if ($line=~/^\s*type[^[:alnum:]_].*(\{TYPE\}|\{DIMS\})/i or + $line=~/^[^!]*(function|subroutine).*(\{TYPE\}|\{DIMS\})/i) { + $block=$line; + next; + } + if ($line=~/^\s*interface.*(\{TYPE\}|\{DIMS\})/i) { + $block_type="interface"; + $block=$line; + next; + } + } + if(not defined $block_type and + ($line=~/^\s*end\s+type\s+.*(\{TYPE\}|\{DIMS\})/i or + $line=~/^\s*end\s+(function|subroutine)\s+.*(\{TYPE\}|\{DIMS\})/i)){ + + $line = $block.$line; + undef $block; + } + if ($line=~/^\s*end\s*interface/i and + defined $block) { + $line = $block.$line; + undef $block; + undef $block_type; + } + if(defined $block){ + $block = $block.$line; + next; + } + if(defined $dimmodifier){ + $line = $dimmodifier.$line; + undef $dimmodifier; + } + if(defined $typemodifier){ + $line = $typemodifier.$line; + undef $typemodifier; + } + + push(@output, buildout($line)); + if(($line =~ /^\s*contains\s*!*/i && ! $in_type_block) or + ($line =~ /^\s*!\s*Not a module/i)){ + $contains=1; + next; + } + } + if($line=~/^\s*end module\s*/){ + $end = $line; + last; + } + + if($contains==1){ + # first parse into functions or subroutines + if($cppunit || !(defined($unit[$unitcnt]))){ + # Make cpp lines and blanks between routines units. + if($line =~ /^\s*\#(?!\s[[:digit:]]+)/ || $line =~/^\s*$/ || $line=~/^\s*!(?!\s*(TYPE|DIMS))/){ + push(@{$unit[$unitcnt]},$line); + $cppunit=1; + next; + } else { + $cppunit=0; + $unitcnt++; + } + } + + + push(@{$unit[$unitcnt]},$line); + if ($line=~/^\s*interface/i) { + $block_type="interface"; + $block=$line; + } + if ($line=~/^\s*end\s*interface/i) { + undef $block_type; + undef $block; + } + unless(defined $block){ + if($line =~ /\s*end function/i or $line =~ /\s*end subroutine/i){ + $unitcnt++; + } + } + } + } + my $i; + + + for($i=0;$i<$unitcnt;$i++){ + if(defined($unit[$i])){ + my $func = join('',@{$unit[$i]}); + push(@output, buildout($func)); + } + } + push(@output,@{$unit[$#unit]}) if($unitcnt==$#unit); + push(@output, $end); + if($itypeflag==1){ + my $str; + $str.="#include \"dtypes.h\"\n"; + $write_dtypes = "yes"; + print $str; + } + print @output; + writedtypes() if(!(-e "dtypes.h") && $write_dtypes == "yes"); + + +} + + +sub usage{ + die("$0 Expected input filename of the form .*.F90.in"); +} + +sub build_repeatstr{ + my($dims) = @_; + # Create regex to repeat expression DIMS times. + my $repeatstr; + for(my $i=1;$i<=$dims;$i++){ + $repeatstr .="\$\{1\}$i\$\{2\},&\n"; + } + if(defined $repeatstr){ + $repeatstr="\"$repeatstr"; + chop $repeatstr; + chop $repeatstr; + chop $repeatstr; + $repeatstr.="\""; + }else{ + $repeatstr=''; + } +} + +sub writedtypes{ + open(F,">dtypes.h"); + print F +"#define TYPETEXT 100 +#define TYPEREAL 101 +#define TYPEDOUBLE 102 +#define TYPEINT 103 +#define TYPELONG 104 +#define TYPELOGICAL 105 +"; + close(F); +} + +sub buildout{ + my ($func) = @_; + + my $outstr; + my(@ldims, @ltypes); + + if($func=~/\s*!\s*DIMS\s+([\d,]+)\s*/){ + @ldims = split(/,/,$1); + }else{ + @ldims = @dims; + } + if($func=~/\s*!\s*TYPE\s+([^!\s]+)\s*/){ + @ltypes = split(/,/,$1); +# print ">$func<>@ltypes<\n"; + }else{ + @ltypes = @types; + } + + + if(($func =~ /{TYPE}/ && $func =~ /{DIMS}/) ){ + my ($type, $dims); + foreach $type (@ltypes){ + foreach $dims (@ldims){ + my $dimstr; + for(my $i=1;$i<=$dims;$i++){ + $dimstr .=':,'; + } + if(defined $dimstr){ + $dimstr="($dimstr"; + chop $dimstr; + $dimstr.=')'; + }else{ + $dimstr=''; + } + + my $repeatstr = build_repeatstr($dims); + + my $str = $func; + $str =~ s/{TYPE}/$type/g; + $str =~ s/{VTYPE}/$vtype->{$type}/g; + $str =~ s/{ITYPE}/$itype->{$type}/g; + $str =~ s/{MPITYPE}/$mpitype->{$type}/g; + $str =~ s/{NCTYPE}/$nctype->{$type}/g; + $str =~ s/{CTYPE}/$ctype->{$type}/g; + $str =~ s/{DIMS}/$dims/g; + $str =~ s/{DIMSTR}/$dimstr/g; + $str =~ s/{REPEAT:([^#}]*)#([^#}]*)}/$repeatstr/eeg; + $outstr .= $str; + } + } + }elsif($func =~ /{DIMS}/){ + my $dims; + foreach $dims (@ldims){ + my $dimstr; + for(my $i=1;$i<=$dims;$i++){ + $dimstr .=':,'; + } + if(defined $dimstr){ + $dimstr="($dimstr"; + chop $dimstr; + $dimstr.=')'; + }else{ + $dimstr=''; + } + + my $repeatstr = build_repeatstr($dims); + + my $str = $func; + $str =~ s/{DIMS}/$dims/g; + $str =~ s/{DIMSTR}/$dimstr/g; + $str =~ s/{REPEAT:([^#}]*)#([^#}]*)}/$repeatstr/eeg; + $outstr .= $str; + } + }elsif($func =~ /{TYPE}/){ + my ($type); + foreach $type (@ltypes){ + my $str = $func; + $str =~ s/{TYPE}/$type/g; + $str =~ s/{VTYPE}/$vtype->{$type}/g; + $str =~ s/{ITYPE}/$itype->{$type}/g; + $str =~ s/{MPITYPE}/$mpitype->{$type}/g; + $str =~ s/{NCTYPE}/$nctype->{$type}/g; + $str =~ s/{CTYPE}/$ctype->{$type}/g; + $outstr.=$str; + } + }else{ + $outstr=$func; + } + + return $outstr; +} diff --git a/src/flib/Makefile.am b/src/flib/Makefile.am index c44ae5aa0a0..9a9e13ae183 100644 --- a/src/flib/Makefile.am +++ b/src/flib/Makefile.am @@ -38,18 +38,26 @@ libpionfput_la_SOURCES = pionfput_mod.F90 libpiolib_mod_la_SOURCES = piolib_mod.F90 libpio_la_SOURCES = pio.F90 +# These F90 files are generated from .F90.in files, using the script +# genf90.pl. +pionfatt_mod.F90: ${top_srcdir}/src/flib/pionfatt_mod.F90.in + ${top_srcdir}/scripts/genf90.pl $< > $@ + # Each mod file depends on the .o file. pio_kinds.mod: pio_kinds.$(OBJEXT) pio_types.mod: pio_types.$(OBJEXT) pio_support.mod: pio_support.$(OBJEXT) pio_nf.mod: pio_nf.$(OBJEXT) piodarray.mod: piodarray.$(OBJEXT) -pionfatt_mod.mod: pionfatt_mod.$(OBJEXT) +pionfatt_mod.mod: pionfatt_mod.F90 pionfatt_mod.$(OBJEXT) pionfget_mod.mod: pionfget_mod.$(OBJEXT) pionfput_mod.mod: pionfput_mod.$(OBJEXT) piolib_mod.mod: piolib_mod.$(OBJEXT) pio.mod: pio.$(OBJEXT) +# Some mod files depend on other mod files. +pio.$(OBJEXT): pio_kinds.mod piolib_mod.mod pio_types.mod piodarray.mod pio_nf.mod pionfatt_mod.mod pionfget_mod.mod pionfput_mod.mod pio_support.mod + # Mod files are built and then installed as headers. MODFILES = pio_kinds.mod pio_types.mod pio_support.mod pio_nf.mod \ piodarray.mod pionfatt_mod.mod pionfget_mod.mod pionfput_mod.mod \ @@ -59,4 +67,5 @@ include_HEADERS = $(MODFILES) CLEANFILES = *.mod -EXTRA_DIST = CMakeLists.txt +EXTRA_DIST = CMakeLists.txt piodarray.F90.in pionfatt_mod.F90.in \ +pionfget_mod.F90.in pionfput_mod.F90.in diff --git a/src/flib/pionfatt_mod.F90.in2 b/src/flib/pionfatt_mod.F90.in2 deleted file mode 100644 index bb68372e3f5..00000000000 --- a/src/flib/pionfatt_mod.F90.in2 +++ /dev/null @@ -1,1009 +0,0 @@ -!=================================================== -! DO NOT EDIT THIS FILE, it was generated using genf90/src/genf90/genf90.pl -! Any changes you make to this file may be lost -!=================================================== -#define __PIO_FILE__ "pionfatt_mod.F90" -!> -!! @file -!! @brief NetCDF attribute interface to PIO -!< -module pionfatt_mod - use pio_kinds, only : r4, r8, i4, pio_offset_kind - use pio_types - use pio_support, only : replace_c_null - use iso_c_binding - implicit none - - - !> - !! @private - !< - public :: put_att -# 18 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface put_att - module procedure put_att_id_text, put_att_desc_text, put_att_vid_text - module procedure put_att_id_real, put_att_desc_real, put_att_vid_real - module procedure put_att_id_double, put_att_desc_double, put_att_vid_double - module procedure put_att_id_int, put_att_desc_int, put_att_vid_int - ! TYPE real,int,double - module procedure put_att_1d_id_real - ! TYPE real,int,double - module procedure put_att_1d_id_int - ! TYPE real,int,double - module procedure put_att_1d_id_double - ! TYPE real,int,double - module procedure put_att_1d_desc_real - ! TYPE real,int,double - module procedure put_att_1d_desc_int - ! TYPE real,int,double - module procedure put_att_1d_desc_double - ! TYPE real,int,double - module procedure put_att_1d_vid_real - ! TYPE real,int,double - module procedure put_att_1d_vid_int - ! TYPE real,int,double - module procedure put_att_1d_vid_double - end interface - - - !> - !! @private - !< - public :: get_att -# 33 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface get_att - module procedure get_att_text, get_att_desc_text, get_att_id_text - module procedure get_att_real, get_att_desc_real, get_att_id_real - module procedure get_att_double, get_att_desc_double, get_att_id_double - module procedure get_att_int, get_att_desc_int, get_att_id_int - ! TYPE real,int,double - module procedure get_att_1d_real, get_att_desc_1d_real, get_att_1d_id_real - ! TYPE real,int,double - module procedure get_att_1d_int, get_att_desc_1d_int, get_att_1d_id_int - ! TYPE real,int,double - module procedure get_att_1d_double, get_att_desc_1d_double, get_att_1d_id_double - end interface - - !> - !! @public - !! @defgroup PIO_put_att PIO_put_att - !! @brief Writes an netcdf attribute to a file - !< - !> - !! @public - !! @defgroup PIO_get_att PIO_get_att - !! @brief Reads an netcdf attribute from a file - !< - - private :: modName - character(len=*), parameter :: modName='pionfatt_mod' -# 52 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface - !> @brief Write a netCDF text attribute. -# 54 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_put_att_text (ncid, varid, name, len, op) & - bind(C,name="PIOc_put_att_text") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - integer(C_SIZE_T), value :: len - character(C_char) :: op -# 62 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_put_att_text - end interface -# 64 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 65 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_get_att_text (ncid, varid, name, op) & - bind(C,name="PIOc_get_att_text") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - character(C_char) :: op(*) -# 72 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_get_att_text - end interface - - -# 76 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 77 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_put_att_int (ncid, varid, name, xtype, len, op) & - bind(C,name="PIOc_put_att_int") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - integer(C_INT), value :: xtype - integer(C_SIZE_T), value :: len - integer(C_INT) :: op -# 86 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_put_att_int - end interface -# 88 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 89 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_put_att_float (ncid, varid, name, xtype, len, op) & - bind(C,name="PIOc_put_att_float") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - integer(C_INT), value :: xtype - integer(C_SIZE_T), value :: len - real(C_FLOAT) :: op -# 98 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_put_att_float - end interface -# 100 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 101 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_put_att_double (ncid, varid, name, xtype, len, op) & - bind(C,name="PIOc_put_att_double") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - integer(C_INT), value :: xtype - integer(C_SIZE_T), value :: len - real(C_DOUBLE) :: op -# 110 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_put_att_double - end interface - - -# 114 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 115 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_get_att_int (ncid, varid, name, op) & - bind(C,name="PIOc_get_att_int") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - integer(C_INT), intent(out) :: op -# 122 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_get_att_int - end interface - -# 125 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 126 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_get_att_float (ncid, varid, name, op) & - bind(C,name="PIOc_get_att_float") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - real(C_FLOAT), intent(out) :: op -# 133 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_get_att_float - end interface - -# 136 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - interface -# 137 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer(C_INT) function PIOc_get_att_double (ncid, varid, name, op) & - bind(C,name="PIOc_get_att_double") - use iso_c_binding - integer(C_INT), value :: ncid - integer(C_INT), value :: varid - character(C_CHAR) :: name(*) - real(C_DOUBLE), intent(out) :: op -# 144 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function PIOc_get_att_double - end interface - - -# 148 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" -contains - - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to add - !! @param var : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 161 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_desc_text (File, vdesc, name, values) result(ierr) - type (File_desc_t), intent(in) :: File - type(var_desc_t), intent(in) :: vdesc - character(len=*), intent(in) :: name - character(len=*), intent(in) :: values - - ierr = put_att_id_text (File%fh,vdesc%varid,name,values) - -# 169 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_desc_text -# 161 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_desc_real (File, vdesc, name, values) result(ierr) - type (File_desc_t), intent(in) :: File - type(var_desc_t), intent(in) :: vdesc - character(len=*), intent(in) :: name - real(r4), intent(in) :: values - - ierr = put_att_id_real (File%fh,vdesc%varid,name,values) - -# 169 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_desc_real -# 161 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_desc_double (File, vdesc, name, values) result(ierr) - type (File_desc_t), intent(in) :: File - type(var_desc_t), intent(in) :: vdesc - character(len=*), intent(in) :: name - real(r8), intent(in) :: values - - ierr = put_att_id_double (File%fh,vdesc%varid,name,values) - -# 169 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_desc_double -# 161 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_desc_int (File, vdesc, name, values) result(ierr) - type (File_desc_t), intent(in) :: File - type(var_desc_t), intent(in) :: vdesc - character(len=*), intent(in) :: name - integer(i4), intent(in) :: values - - ierr = put_att_id_int (File%fh,vdesc%varid,name,values) - -# 169 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_desc_int -# 170 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_vid_text (File, varid, name, value) result(ierr) - type (File_desc_t), intent(in) :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(in) :: value - - ierr = put_att_id_text (File%fh,varid,name,value) - -# 178 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_vid_text -# 170 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_vid_real (File, varid, name, value) result(ierr) - type (File_desc_t), intent(in) :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(in) :: value - - ierr = put_att_id_real (File%fh,varid,name,value) - -# 178 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_vid_real -# 170 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_vid_double (File, varid, name, value) result(ierr) - type (File_desc_t), intent(in) :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(in) :: value - - ierr = put_att_id_double (File%fh,varid,name,value) - -# 178 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_vid_double -# 170 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_vid_int (File, varid, name, value) result(ierr) - type (File_desc_t), intent(in) :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(in) :: value - - ierr = put_att_id_int (File%fh,varid,name,value) - -# 178 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_vid_int - ! TYPE int,real,double -# 180 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_id_int (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(in) :: values - - - ierr = PIOc_put_att_int (ncid,varid-1,trim(name)//C_NULL_CHAR, PIO_int, 1_C_SIZE_T, values) - -# 190 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_id_int - ! TYPE int,real,double -# 180 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_id_real (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(in) :: values - - - ierr = PIOc_put_att_float (ncid,varid-1,trim(name)//C_NULL_CHAR, PIO_real, 1_C_SIZE_T, values) - -# 190 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_id_real - ! TYPE int,real,double -# 180 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_id_double (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(in) :: values - - - ierr = PIOc_put_att_double (ncid,varid-1,trim(name)//C_NULL_CHAR, PIO_double, 1_C_SIZE_T, values) - -# 190 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_id_double -# 191 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_id_text (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(in) :: values - character(c_char), allocatable :: cvar(:) - integer(C_SIZE_T) :: clen - integer :: i - - clen = len_trim(values) - allocate(cvar(clen+1)) - cvar = C_NULL_CHAR - do i=1,clen - cvar(i) = values(i:i) - end do - ierr = PIOc_put_att_text (ncid,varid-1,trim(name)//C_NULL_CHAR, clen, cvar(1)) - deallocate(cvar) -# 209 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_id_text - -# 211 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_text (ncid, varid, name, value) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(in) :: value(:) - character, allocatable :: nvalue(:) - integer :: slen, alen, i, j, k - - slen = len(value(1)) - alen = size(value) - allocate(nvalue(slen*alen)) - - do i=1,alen - j= len_trim(value(i)) - do k=1,j - nvalue(k+(i-1)*slen) = value(i)(k:k) - end do - nvalue(j+1+(i-1)*slen) = C_NULL_CHAR - end do - ierr = put_att_1d_id_text_internal (ncid, varid, name, slen*alen, nvalue) - - deallocate(nvalue) - -# 235 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_text - - -# 238 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_text_internal (ncid, varid, name, arrlen, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer, intent(in) :: arrlen - character(len=*), intent(in) :: values(arrlen) - integer :: vallen - - - ierr = PIOc_put_att_text (ncid,varid-1,trim(name)//C_NULL_CHAR, int(arrlen,C_SIZE_T),values(1)) - - -# 251 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_text_internal - - - -# 255 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_id_text (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(out) :: values - - values = ' ' - ierr = PIOc_get_att_text (ncid,varid-1,trim(name)//C_NULL_CHAR, values) - call replace_c_null(values) -# 265 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_id_text - - ! TYPE real,double,int - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to add - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 280 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_real (ncid, varid, name, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(in) :: values(:) - integer(PIO_OFFSET_KIND) :: len - - len = size(values) - ierr = put_att_1d_id_internal_real (ncid, varid, name, len, values) - -# 290 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_real - ! TYPE real,double,int - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to add - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 280 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_double (ncid, varid, name, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(in) :: values(:) - integer(PIO_OFFSET_KIND) :: len - - len = size(values) - ierr = put_att_1d_id_internal_double (ncid, varid, name, len, values) - -# 290 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_double - ! TYPE real,double,int - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to add - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 280 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_int (ncid, varid, name, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(in) :: values(:) - integer(PIO_OFFSET_KIND) :: len - - len = size(values) - ierr = put_att_1d_id_internal_int (ncid, varid, name, len, values) - -# 290 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_int - - ! TYPE real,double,int -# 293 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_internal_real (ncid, varid, name, len, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - integer(PIO_OFFSET_KIND), intent(in) :: len - character(len=*), intent(in) :: name - real(r4), intent(in), target :: values(*) - - - ierr = PIOc_put_att_float (ncid, varid-1, trim(name)//C_NULL_CHAR, PIO_real , len, values(1)) - -# 303 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_internal_real - ! TYPE real,double,int -# 293 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_internal_double (ncid, varid, name, len, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - integer(PIO_OFFSET_KIND), intent(in) :: len - character(len=*), intent(in) :: name - real(r8), intent(in), target :: values(*) - - - ierr = PIOc_put_att_double (ncid, varid-1, trim(name)//C_NULL_CHAR, PIO_double , len, values(1)) - -# 303 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_internal_double - ! TYPE real,double,int -# 293 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_id_internal_int (ncid, varid, name, len, values) result(ierr) - integer, intent(in) :: ncid - integer, intent(in) :: varid - integer(PIO_OFFSET_KIND), intent(in) :: len - character(len=*), intent(in) :: name - integer(i4), intent(in), target :: values(*) - - - ierr = PIOc_put_att_int (ncid, varid-1, trim(name)//C_NULL_CHAR, PIO_int , len, values(1)) - -# 303 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_id_internal_int - - - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varDesc @copydoc var_desc_t - !! @param name : name of the attribute to add - !! @param var : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 318 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_desc_real (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r4), intent(in) :: values(:) - - ierr = put_att_1d_id_real (File%fh,varDesc%varid,name,values) - -# 327 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_desc_real - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varDesc @copydoc var_desc_t - !! @param name : name of the attribute to add - !! @param var : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 318 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_desc_int (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - integer(i4), intent(in) :: values(:) - - ierr = put_att_1d_id_int (File%fh,varDesc%varid,name,values) - -# 327 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_desc_int - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_put_att - !! @brief Writes an netcdf attribute to a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varDesc @copydoc var_desc_t - !! @param name : name of the attribute to add - !! @param var : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 318 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_desc_double (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r8), intent(in) :: values(:) - - ierr = put_att_1d_id_double (File%fh,varDesc%varid,name,values) - -# 327 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_desc_double - -# 329 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_vid_text (File,varid,name,value) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(in) :: value(:) - - ierr = put_att_1d_id_text (File%fh,varid,name,value) - -# 338 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_vid_text -# 329 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_vid_real (File,varid,name,value) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(in) :: value(:) - - ierr = put_att_1d_id_real (File%fh,varid,name,value) - -# 338 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_vid_real -# 329 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_vid_double (File,varid,name,value) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(in) :: value(:) - - ierr = put_att_1d_id_double (File%fh,varid,name,value) - -# 338 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_vid_double -# 329 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function put_att_1d_vid_int (File,varid,name,value) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(in) :: value(:) - - ierr = put_att_1d_id_int (File%fh,varid,name,value) - -# 338 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function put_att_1d_vid_int - - - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varDesc @copydoc var_desc_t - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 352 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_text (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - character(len=*), intent(out) :: values - - ierr = get_att_text (File,varDesc%varid,name,values) - -# 361 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_text -# 352 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_real (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r4), intent(out) :: values - - ierr = get_att_real (File,varDesc%varid,name,values) - -# 361 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_real -# 352 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_double (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r8), intent(out) :: values - - ierr = get_att_double (File,varDesc%varid,name,values) - -# 361 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_double -# 352 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_int (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - integer(i4), intent(out) :: values - - ierr = get_att_int (File,varDesc%varid,name,values) - -# 361 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_int - - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varDesc @copydoc var_desc_t - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< - ! TYPE int,real,double -# 375 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_1d_int (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - integer(i4), intent(out) :: values(:) - - character(len=*), parameter :: subName=modName//'::get_att_desc_1d_int' - - ierr = get_att_1d_id_int (File%fh,varDesc%varid,name,values) - -# 386 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_1d_int - ! TYPE int,real,double -# 375 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_1d_real (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r4), intent(out) :: values(:) - - character(len=*), parameter :: subName=modName//'::get_att_desc_1d_real' - - ierr = get_att_1d_id_real (File%fh,varDesc%varid,name,values) - -# 386 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_1d_real - ! TYPE int,real,double -# 375 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_desc_1d_double (File,varDesc,name,values) result(ierr) - - type (File_desc_t), intent(inout) , target :: File - type (VAR_desc_t), intent(in) :: varDesc - character(len=*), intent(in) :: name - real(r8), intent(out) :: values(:) - - character(len=*), parameter :: subName=modName//'::get_att_desc_1d_double' - - ierr = get_att_1d_id_double (File%fh,varDesc%varid,name,values) - -# 386 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_desc_1d_double - - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< - ! TYPE int,real,double -# 400 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_id_int (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(out), target :: values - - - ierr = PIOc_get_att_int (ncid,varid-1,trim(name)//C_NULL_CHAR, values) - -# 410 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_id_int - ! TYPE int,real,double -# 400 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_id_real (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(out), target :: values - - - ierr = PIOc_get_att_float (ncid,varid-1,trim(name)//C_NULL_CHAR, values) - -# 410 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_id_real - ! TYPE int,real,double -# 400 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_id_double (ncid, varid, name, values) result(ierr) - use iso_c_binding - integer, intent(in) :: ncid - integer, intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(out), target :: values - - - ierr = PIOc_get_att_double (ncid,varid-1,trim(name)//C_NULL_CHAR, values) - -# 410 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_id_double - - - -# 414 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_text (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - character(len=*), intent(out) :: values - - - ierr = get_att_id_text (file%fh, varid, name, values) - - -# 424 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_text -# 414 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_real (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(out) :: values - - - ierr = get_att_id_real (file%fh, varid, name, values) - - -# 424 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_real -# 414 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_double (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(out) :: values - - - ierr = get_att_id_double (file%fh, varid, name, values) - - -# 424 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_double -# 414 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_int (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(out) :: values - - - ierr = get_att_id_int (file%fh, varid, name, values) - - -# 424 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_int - - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 438 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_real (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(out) :: values(:) - - ierr = get_att_1d_id_real (file%fh, varid, name, values) - -# 446 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_real - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 438 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_int (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(out) :: values(:) - - ierr = get_att_1d_id_int (file%fh, varid, name, values) - -# 446 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_int - ! TYPE real,int,double - !> - !! @public - !! @ingroup PIO_get_att - !! @brief Reads an netcdf attribute from a file - !! @details - !! @param File @copydoc file_desc_t - !! @param varid : The netcdf variable identifier - !! @param name : name of the attribute to get - !! @param values : The value for the netcdf attribute - !! @retval ierr @copydoc error_return - !< -# 438 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_double (File,varid,name,values) result(ierr) - type (File_desc_t), intent(in) , target :: File - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(out) :: values(:) - - ierr = get_att_1d_id_double (file%fh, varid, name, values) - -# 446 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_double - - - ! TYPE real,int,double -# 450 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_id_real (ncid,varid,name,values) result(ierr) - integer, intent(in) :: ncid - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r4), intent(out) , target :: values(*) - - ierr = PIOc_get_att_float (ncid, varid-1, trim(name)//C_NULL_CHAR, values(1)) - - -# 459 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_id_real - ! TYPE real,int,double -# 450 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_id_int (ncid,varid,name,values) result(ierr) - integer, intent(in) :: ncid - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - integer(i4), intent(out) , target :: values(*) - - ierr = PIOc_get_att_int (ncid, varid-1, trim(name)//C_NULL_CHAR, values(1)) - - -# 459 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_id_int - ! TYPE real,int,double -# 450 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - integer function get_att_1d_id_double (ncid,varid,name,values) result(ierr) - integer, intent(in) :: ncid - integer(i4), intent(in) :: varid - character(len=*), intent(in) :: name - real(r8), intent(out) , target :: values(*) - - ierr = PIOc_get_att_double (ncid, varid-1, trim(name)//C_NULL_CHAR, values(1)) - - -# 459 "/home/ed/tmp/ParallelIO/src/flib/pionfatt_mod.F90.in" - end function get_att_1d_id_double - - -end module pionfatt_mod