#include "dtypes.h" !=================================================== ! DO NOT EDIT THIS FILE, it was generated using /glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/genf90/genf90.pl ! Any changes you make to this file may be lost !=================================================== #define __PIO_FILE__ "pionfatt_mod.F90" !> !! @file !! $Revision$ !! $LastChangedDate$ !! @brief NetCDF attribute interface to PIO !< module pionfatt_mod use pio_kinds, only : r4, r8, i4 use pio_types, only : iotype_netcdf, iotype_pnetcdf, pio_noerr use pio_types, only : pio_iotype_netcdf4p, pio_iotype_netcdf4c use pio_types, only : file_desc_t, var_desc_t, iosystem_desc_t use pio_kinds, only : pio_offset use pio_support, only : piodie, checkmpireturn, debug, debugasync use pio_utils, only : check_netcdf, bad_iotype #ifdef _NETCDF use netcdf ! _EXTERNAL #endif #ifdef USE_PNETCDF_MOD use pnetcdf #endif implicit none #ifdef _PNETCDF #ifndef USE_PNETCDF_MOD # include /* _EXTERNAL */ #endif #endif include 'mpif.h' ! _EXTERNAL !> !! @private !< public :: put_att # 36 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" interface put_att module procedure put_att_text, put_att_desc_text module procedure put_att_real, put_att_desc_real module procedure put_att_double, put_att_desc_double module procedure put_att_int, put_att_desc_int ! TYPE real,int,double module procedure put_att_1d_real, put_att_desc_1d_real ! TYPE real,int,double module procedure put_att_1d_int, put_att_desc_1d_int ! TYPE real,int,double module procedure put_att_1d_double, put_att_desc_1d_double end interface !> !! @private !< public :: get_att # 47 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" interface get_att module procedure get_att_text, get_att_desc_text module procedure get_att_real, get_att_desc_real module procedure get_att_double, get_att_desc_double module procedure get_att_int, get_att_desc_int ! TYPE real,int,double module procedure get_att_1d_real, get_att_desc_1d_real ! TYPE real,int,double module procedure get_att_1d_int, get_att_desc_1d_int ! TYPE real,int,double module procedure get_att_1d_double, get_att_desc_1d_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' # 67 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 80 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_text (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name character(len=*), intent(in) :: value type(iosystem_desc_t), pointer :: ios #if (100 != TYPETEXT) #ifdef DEBUG character(len=*) :: chkval #endif #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_text' integer :: iotype, mpierr, msg, itype integer :: clen=1, nlen iotype = File%iotype ierr=PIO_noerr #if (100 == TYPETEXT) clen = len_trim(value) #else clen = 1 #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 100 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen=len_trim(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (100 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_CHARACTER, ios%compmaster, ios%my_comm, mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #if (100 == TYPETEXT) ierr= nfmpi_put_att_text (File%fh,varid,name,int(clen,kind=PIO_OFFSET),value) #else #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_CHARACTER, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG #ifdef USE_PNETCDF_MOD ierr =nf90mpi_put_att (File%fh,varid,name,value) #else ierr= nfmpi_put_att_text (File%fh,varid,name, nf_text , int(clen,kind=PIO_OFFSET),value) #endif #endif #endif #ifdef _NETCDF ! case(iotype_netcdf,PIO_iotype_netcdf4c,PIO_iotype_netcdf4p) case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then if(debug) print *,__FILE__,__LINE__,name,value ierr=nf90_put_att(File%fh,varid,name,value) endif case(PIO_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 171 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_text # 80 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_real (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name real(r4), intent(in) :: value type(iosystem_desc_t), pointer :: ios #if (101 != TYPETEXT) #ifdef DEBUG real(r4) :: chkval #endif #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_real' integer :: iotype, mpierr, msg, itype integer :: clen=1, nlen iotype = File%iotype ierr=PIO_noerr #if (101 == TYPETEXT) clen = len_trim(value) #else clen = 1 #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 101 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen=len_trim(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (101 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_REAL4, ios%compmaster, ios%my_comm, mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #if (101 == TYPETEXT) ierr= nfmpi_put_att_text (File%fh,varid,name,int(clen,kind=PIO_OFFSET),value) #else #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_REAL4, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG #ifdef USE_PNETCDF_MOD ierr =nf90mpi_put_att (File%fh,varid,name,value) #else ierr= nfmpi_put_att_real (File%fh,varid,name, nf_real , int(clen,kind=PIO_OFFSET),value) #endif #endif #endif #ifdef _NETCDF ! case(iotype_netcdf,PIO_iotype_netcdf4c,PIO_iotype_netcdf4p) case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then if(debug) print *,__FILE__,__LINE__,name,value ierr=nf90_put_att(File%fh,varid,name,value) endif case(PIO_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 171 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_real # 80 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_double (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name real(r8), intent(in) :: value type(iosystem_desc_t), pointer :: ios #if (102 != TYPETEXT) #ifdef DEBUG real(r8) :: chkval #endif #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_double' integer :: iotype, mpierr, msg, itype integer :: clen=1, nlen iotype = File%iotype ierr=PIO_noerr #if (102 == TYPETEXT) clen = len_trim(value) #else clen = 1 #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 102 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen=len_trim(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (102 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_REAL8, ios%compmaster, ios%my_comm, mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #if (102 == TYPETEXT) ierr= nfmpi_put_att_text (File%fh,varid,name,int(clen,kind=PIO_OFFSET),value) #else #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_REAL8, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG #ifdef USE_PNETCDF_MOD ierr =nf90mpi_put_att (File%fh,varid,name,value) #else ierr= nfmpi_put_att_double (File%fh,varid,name, nf_double , int(clen,kind=PIO_OFFSET),value) #endif #endif #endif #ifdef _NETCDF ! case(iotype_netcdf,PIO_iotype_netcdf4c,PIO_iotype_netcdf4p) case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then if(debug) print *,__FILE__,__LINE__,name,value ierr=nf90_put_att(File%fh,varid,name,value) endif case(PIO_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 171 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_double # 80 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_int (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name integer(i4), intent(in) :: value type(iosystem_desc_t), pointer :: ios #if (103 != TYPETEXT) #ifdef DEBUG integer(i4) :: chkval #endif #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_int' integer :: iotype, mpierr, msg, itype integer :: clen=1, nlen iotype = File%iotype ierr=PIO_noerr #if (103 == TYPETEXT) clen = len_trim(value) #else clen = 1 #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 103 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen=len_trim(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (103 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_INTEGER, ios%compmaster, ios%my_comm, mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #if (103 == TYPETEXT) ierr= nfmpi_put_att_text (File%fh,varid,name,int(clen,kind=PIO_OFFSET),value) #else #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_INTEGER, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG #ifdef USE_PNETCDF_MOD ierr =nf90mpi_put_att (File%fh,varid,name,value) #else ierr= nfmpi_put_att_int (File%fh,varid,name, nf_int , int(clen,kind=PIO_OFFSET),value) #endif #endif #endif #ifdef _NETCDF ! case(iotype_netcdf,PIO_iotype_netcdf4c,PIO_iotype_netcdf4p) case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then if(debug) print *,__FILE__,__LINE__,name,value ierr=nf90_put_att(File%fh,varid,name,value) endif case(PIO_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 171 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_int ! 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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 186 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_1d_real (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt_1D type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name real(r4), intent(in) :: value(:) type(iosystem_desc_t), pointer :: ios #ifdef DEBUG real(r4) :: chkval #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_1d_real' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 101 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if call mpi_barrier(ios%union_comm, mpierr) if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_REAL4, ios%compmaster, ios%my_comm, mpierr) end if if(Debug.or.DebugAsync) print *,__PIO_FILE__,__LINE__,clen,value if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_REAL4, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG ierr= nfmpi_put_att_real (File%fh,varid,name, nf_real , int(clen,kind=PIO_OFFSET),value) #endif #ifdef _NETCDF case(iotype_netcdf, PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_put_att(File%fh,varid,name,value) endif case(pio_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 263 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_1d_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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 186 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_1d_double (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt_1D type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name real(r8), intent(in) :: value(:) type(iosystem_desc_t), pointer :: ios #ifdef DEBUG real(r8) :: chkval #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_1d_double' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 102 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if call mpi_barrier(ios%union_comm, mpierr) if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_REAL8, ios%compmaster, ios%my_comm, mpierr) end if if(Debug.or.DebugAsync) print *,__PIO_FILE__,__LINE__,clen,value if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_REAL8, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG ierr= nfmpi_put_att_double (File%fh,varid,name, nf_double , int(clen,kind=PIO_OFFSET),value) #endif #ifdef _NETCDF case(iotype_netcdf, PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_put_att(File%fh,varid,name,value) endif case(pio_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 263 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_1d_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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 186 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_1d_int (File, varid, name, value) result(ierr) use pio_msg_mod, only : pio_msg_putatt_1D type (File_desc_t), intent(inout) , target :: File integer, intent(in) :: varid character(len=*), intent(in) :: name integer(i4), intent(in) :: value(:) type(iosystem_desc_t), pointer :: ios #ifdef DEBUG integer(i4) :: chkval #endif !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::put_att_1d_int' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_PUTATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 103 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if call mpi_barrier(ios%union_comm, mpierr) if(ios%async_interface) then call MPI_BCAST(value, clen, MPI_INTEGER, ios%compmaster, ios%my_comm, mpierr) end if if(Debug.or.DebugAsync) print *,__PIO_FILE__,__LINE__,clen,value if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) #ifdef DEBUG print *, __PIO_FILE__,__LINE__,value call MPI_ALLREDUCE(value, chkval, 1, MPI_INTEGER, MPI_MAX ,Ios%io_comm, mpierr) call CheckMPIReturn(subName, mpierr) if(chkval /= value) then print *,__PIO_FILE__,__LINE__,chkval,value, mpierr call piodie(__PIO_FILE__,__LINE__,'attributes do not match') end if #endif #undef DEBUG ierr= nfmpi_put_att_int (File%fh,varid,name, nf_int , int(clen,kind=PIO_OFFSET),value) #endif #ifdef _NETCDF case(iotype_netcdf, PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_put_att(File%fh,varid,name,value) endif case(pio_iotype_netcdf4p) ierr=nf90_put_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) # 263 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_1d_int !> !! @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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 276 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_text (File,varDesc,name,value) 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(in) :: value ierr = put_att_text (File,varDesc%varid,name,value) # 285 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_desc_text # 276 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_real (File,varDesc,name,value) 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) :: value ierr = put_att_real (File,varDesc%varid,name,value) # 285 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_desc_real # 276 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_double (File,varDesc,name,value) 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) :: value ierr = put_att_double (File,varDesc%varid,name,value) # 285 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_desc_double # 276 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_int (File,varDesc,name,value) 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) :: value ierr = put_att_int (File,varDesc%varid,name,value) # 285 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 299 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_1d_real (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::put_att_desc_1d_real' ierr = put_att_1d_real (File,varDesc%varid,name,value) # 310 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_desc_1d_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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 299 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_1d_int (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::put_att_desc_1d_int' ierr = put_att_1d_int (File,varDesc%varid,name,value) # 310 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_att_desc_1d_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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 299 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function put_att_desc_1d_double (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::put_att_desc_1d_double' ierr = put_att_1d_double (File,varDesc%varid,name,value) # 310 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function put_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 varDesc @copydoc var_desc_t !! @param name : name of the attribute to get !! @param value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 324 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_text (File,varDesc,name,value) 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) :: value character(len=*), parameter :: subName=modName//'::get_att_desc_text' ierr = get_att_text (File,varDesc%varid,name,value) # 335 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_text # 324 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_real (File,varDesc,name,value) 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) :: value character(len=*), parameter :: subName=modName//'::get_att_desc_real' ierr = get_att_real (File,varDesc%varid,name,value) # 335 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_real # 324 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_double (File,varDesc,name,value) 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) :: value character(len=*), parameter :: subName=modName//'::get_att_desc_double' ierr = get_att_double (File,varDesc%varid,name,value) # 335 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_double # 324 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_int (File,varDesc,name,value) 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) :: value character(len=*), parameter :: subName=modName//'::get_att_desc_int' ierr = get_att_int (File,varDesc%varid,name,value) # 335 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_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 varDesc @copydoc var_desc_t !! @param name : name of the attribute to get !! @param value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 349 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_1d_real (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::get_att_desc_1d_real' ierr = get_att_1d_real (File,varDesc%varid,name,value) # 360 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_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 varDesc @copydoc var_desc_t !! @param name : name of the attribute to get !! @param value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 349 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_1d_int (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::get_att_desc_1d_int' ierr = get_att_1d_int (File,varDesc%varid,name,value) # 360 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_desc_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 varDesc @copydoc var_desc_t !! @param name : name of the attribute to get !! @param value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 349 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_desc_1d_double (File,varDesc,name,value) 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) :: value(:) character(len=*), parameter :: subName=modName//'::get_att_desc_1d_double' ierr = get_att_1d_double (File,varDesc%varid,name,value) # 360 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 373 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_text (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name character(len=*), intent(out) :: value type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_text' integer :: iotype, mpierr, msg integer :: clen=1, itype, nlen iotype = File%iotype ierr=PIO_noerr #if (100 == TYPETEXT) clen = len(value) value = ' ' #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 100 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (100 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_text (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_CHARACTER ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_CHARACTER,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 440 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_text # 373 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_real (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name real(r4), intent(out) :: value type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_real' integer :: iotype, mpierr, msg integer :: clen=1, itype, nlen iotype = File%iotype ierr=PIO_noerr #if (101 == TYPETEXT) clen = len(value) value = ' ' #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 101 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (101 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_real (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_REAL4 ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_REAL4,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 440 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_real # 373 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_double (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name real(r8), intent(out) :: value type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_double' integer :: iotype, mpierr, msg integer :: clen=1, itype, nlen iotype = File%iotype ierr=PIO_noerr #if (102 == TYPETEXT) clen = len(value) value = ' ' #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 102 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (102 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_double (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_REAL8 ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_REAL8,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 440 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_double # 373 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_int (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name integer(i4), intent(out) :: value type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_int' integer :: iotype, mpierr, msg integer :: clen=1, itype, nlen iotype = File%iotype ierr=PIO_noerr #if (103 == TYPETEXT) clen = len(value) value = ' ' #endif ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 103 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) #if (103 == TYPETEXT) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) #endif end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_int (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_INTEGER ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_INTEGER,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 440 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 454 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_1d_real (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt_1d type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name real(r4), intent(out) :: value(:) type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_1d_real' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 101 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_real (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_REAL4 ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_REAL4,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 520 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 454 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_1d_int (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt_1d type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name integer(i4), intent(out) :: value(:) type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_1d_int' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 103 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_int (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_INTEGER ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_INTEGER,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 520 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/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 value : The value for the netcdf attribute !! @retval ierr @copydoc error_return !< # 454 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" integer function get_att_1d_double (File,varid,name,value) result(ierr) use pio_msg_mod, only : pio_msg_getatt_1d type (File_desc_t), intent(in) , target :: File integer(i4), intent(in) :: varid character(len=*), intent(in) :: name real(r8), intent(out) :: value(:) type(iosystem_desc_t), pointer :: ios !------------------ ! Local variables !------------------ character(len=*), parameter :: subName=modName//'::get_att_1d_double' integer :: iotype, mpierr, msg integer :: clen, itype, nlen iotype = File%iotype ierr=PIO_noerr clen = size(value) ios => file%iosystem if(ios%async_interface .and. .not. ios%ioproc ) then msg=PIO_MSG_GETATT_1D if(ios%comp_rank==0) call mpi_send(msg, 1, mpi_integer, ios%ioroot, 1, ios%union_comm, ierr) call MPI_BCAST(file%fh,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(varid,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) itype = 102 call MPI_BCAST(itype,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) nlen = len(name) call MPI_BCAST(nlen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(name,nlen,MPI_CHARACTER,ios%CompMaster, ios%my_comm , mpierr) call MPI_BCAST(clen,1,MPI_INTEGER,ios%CompMaster, ios%my_comm , mpierr) end if if(Ios%IOproc) then select case(iotype) #ifdef _PNETCDF case(iotype_pnetcdf) ierr= nfmpi_get_att_double (File%fh,varid,name,value) #endif #ifdef _NETCDF case(iotype_netcdf,PIO_iotype_netcdf4c) if (Ios%io_rank==0) then ierr=nf90_get_att(File%fh,varid,name,value) endif if(Ios%num_tasks==Ios%num_iotasks) then call MPI_BCAST(value,clen ,MPI_REAL8 ,0,Ios%IO_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if case(PIO_iotype_netcdf4p) ierr=nf90_get_att(File%fh,varid,name,value) #endif case default call bad_iotype(iotype,__PIO_FILE__,__LINE__) end select endif call check_netcdf(File, ierr,__PIO_FILE__,__LINE__) if(ios%async_interface .or. ios%num_tasks>ios%num_iotasks) then call MPI_BCAST(value, clen, MPI_REAL8,Ios%iomaster,Ios%my_comm, mpierr) call CheckMPIReturn(subName, mpierr) end if # 520 "/glade/p/work/hannay/cesm_tags/cesm1_5_beta06_all_combined_cime_beta06exp_01/cime/externals/pio1/pio/pionfatt_mod.F90.in" end function get_att_1d_double end module pionfatt_mod