39#ifdef SINGLE_PRECISION
46#ifdef SINGLE_PRECISION
83#ifdef SINGLE_PRECISION
133#ifdef CHECK_OPEN_FILES
134 logical :: Ldebug_ncid = .true.
136 logical :: ldebug_ncid = .false.
190 integer,
parameter ::
nf_fout = nf90_real
195 integer,
parameter ::
nf_frst = nf90_double
197#ifdef DOUBLE_PRECISION
200 integer,
parameter ::
nf_type = nf90_real
213#if defined HDF5 || defined PARALLEL_IO
216 integer ::
cmode = nf90_64bit_offset
259 & VarName, VarID)
RESULT (foundit)
281 integer,
intent(in) :: ng, model, ncid
283 character (len=*),
intent(in) ::
varname
285 integer,
intent(out) :: varid
293#if !defined PARALLEL_IO && defined DISTRIBUTE
295 integer,
dimension(3) :: ibuffer
298 character (len=*),
parameter :: myfile = &
299 & __FILE__//
", netcdf_find_var"
309 status=nf90_inq_varid(ncid, trim(
varname), varid)
312#if !defined PARALLEL_IO && defined DISTRIBUTE
321 IF (status.eq.nf90_noerr)
THEN
369 integer,
intent(in) :: ng, model
370 integer,
intent(in),
optional :: ncid
372 character (len=*),
intent(in) :: ncname
373 character (len=*),
intent(in),
optional :: dimname
375 integer,
intent(out),
optional :: dimsize
376 integer,
intent(out),
optional :: dimid
382 integer :: my_ncid, i, j, status
383 integer :: myid, myvalue
385#if !defined PARALLEL_IO && defined DISTRIBUTE
386 integer,
dimension(5) :: ibuffer
389 character (len=*),
parameter :: myfile = &
390 & __FILE__//
", netcdf_get_dim"
414 IF (.not.
PRESENT(ncid))
THEN
415 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
430 IF ((status.eq.nf90_noerr).and.(
n_dim.le.
mdims))
THEN
431#if !defined PARALLEL_IO && defined DISTRIBUTE
443 status=nf90_inquire_dimension(my_ncid,
dim_id(i), &
445 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
454#if !defined PARALLEL_IO && defined DISTRIBUTE
465 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
473#if !defined PARALLEL_IO && defined DISTRIBUTE
495 IF (
PRESENT(dimname))
THEN
497 IF (trim(
dim_name(i)).eq.trim(dimname))
THEN
504 IF (
PRESENT(dimsize))
THEN
507 IF (
PRESENT(dimid))
THEN
511 WRITE (
stdout,40) trim(dimname), trim(ncname)
520 IF (.not.
PRESENT(ncid))
THEN
524 10
FORMAT (/,
' NETCDF_GET_DIM - error while reading dimension ID:', &
525 & 2x,i3,/,18x,
'in input file:',2x,a,/,18x,
'call from:', &
527 20
FORMAT (/,
' NETCDF_GET_DIM - too small dimension parameter,',a, &
528 & 2i5,/,18x,
'change file mod_netcdf.F and recompile')
529 30
FORMAT (/,
' NETCDF_GET_DIM - unable to inquire about contents', &
530 &
' of input NetCDF file:',2x,a,/,18x,
'call from:',2x,a)
531 40
FORMAT (/,
' NETCDF_GET_DIM - requested dimension: ',a,/18x, &
532 &
'not found in input file:',2x,a,/,18x,
'call from:',2x,a)
570 integer,
intent(in) :: ng, model
571 integer,
intent(in),
optional :: ncid
573 character (len=*),
intent(in) :: ncname
579 character (len=*),
parameter :: myfile = &
580 & __FILE__//
", netcdf_check_dim"
586 IF (.not.
PRESENT(ncid))
THEN
599 SELECT CASE (trim(adjustl(
dim_name(i))))
691#ifndef RBL4DVAR_FCT_SENSITIVITY
692# ifdef ADJUST_BOUNDARY
702# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
716 10
FORMAT (/,
' NETCDF_CHECK_DIM - inconsistent size of dimension: ', &
717 & a,2x,2i5,/,20x,
'in file: ',a)
763 integer,
intent(in) :: ng, model
764 integer,
intent(in),
optional :: ncid
766 character (len=*),
intent(in) :: ncname
770 integer :: idmod, npts, i, ib, ic, j, j1, j2, status
773 real(
r8),
parameter :: roundoff = 1.0e-7_r8
775 real(
r8) :: fvars, fvarv(50), varval
777 character (len=80) :: text
779 character (len=*),
parameter :: myfile = &
780 & __FILE__//
", netcdf_check_var"
789 IF ((model.lt.1).or.(model.gt.4))
THEN
797 IF (.not.
PRESENT(ncid))
THEN
810 SELECT CASE (trim(adjustl(
var_name(i))))
814 IF (.not.
PRESENT(ncid))
THEN
832 IF (.not.
PRESENT(ncid))
THEN
850 IF (.not.
PRESENT(ncid))
THEN
860 IF (abs(
hc(ng)-fvars).gt.roundoff)
THEN
868 IF (.not.
PRESENT(ncid))
THEN
878 IF (abs(
theta_s(ng)-fvars).gt.roundoff)
THEN
886 IF (.not.
PRESENT(ncid))
THEN
896 IF (abs(
theta_b(ng)-fvars).gt.roundoff)
THEN
904 IF (.not.
PRESENT(ncid))
THEN
914 IF (abs(
tcline(ng)-fvars).gt.roundoff)
THEN
924 IF ((model.eq.5).or.(model.eq.10).or.(model.eq.11))
THEN
926 & .and.(model.eq.5).and.(
nsa.eq.2))
THEN
928# ifdef ADJUST_BOUNDARY
930 & .and.(model.eq.10))
THEN
933# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
935 & .and.(model.eq.11))
THEN
941 IF (.not.
PRESENT(ncid))
THEN
950 & __line__, myfile))
RETURN
952 IF (abs(varval-fvars).gt.roundoff)
THEN
960# ifdef WEAK_CONSTRAINT
963 IF (.not.
PRESENT(ncid))
THEN
972 & __line__, myfile))
RETURN
974 IF (abs(
hgamma(2)-fvars).gt.roundoff)
THEN
983# ifdef ADJUST_BOUNDARY
985 IF (model.eq.10)
THEN
986 IF (.not.
PRESENT(ncid))
THEN
995 & __line__, myfile))
RETURN
997 IF (abs(
hgamma(3)-fvars).gt.roundoff)
THEN
1006# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
1008 IF (model.eq.11)
THEN
1009 IF (.not.
PRESENT(ncid))
THEN
1018 & __line__, myfile))
RETURN
1020 IF (abs(
hgamma(4)-fvars).gt.roundoff)
THEN
1031 IF ((model.eq.5).or.(model.eq.10))
THEN
1033 & .and.(model.eq.5).and.(
nsa.eq.2))
THEN
1035# ifdef ADJUST_BOUNDARY
1037 & .and.(model.eq.10))
THEN
1043 IF (.not.
PRESENT(ncid))
THEN
1052 & __line__, myfile))
RETURN
1054 IF (abs(fvars-varval).gt.roundoff)
THEN
1062# ifdef WEAK_CONSTRAINT
1064 IF (model.eq.5)
THEN
1065 IF (.not.
PRESENT(ncid))
THEN
1074 & __line__, myfile))
RETURN
1076 IF (abs(fvars-
vgamma(2)).gt.roundoff)
THEN
1085# ifdef ADJUST_BOUNDARY
1087 IF (model.eq.5)
THEN
1088 IF (.not.
PRESENT(ncid))
THEN
1097 & __line__, myfile))
RETURN
1099 IF (abs(fvars-
vgamma(3)).gt.roundoff)
THEN
1110 IF ((model.eq.5).or.(model.eq.11))
THEN
1111 npts=ubound(
hdecay,dim=2)
1112 IF (.not.
PRESENT(ncid))
THEN
1115 & start = (/1/), total = (/npts/))
1120 & start = (/1/), total = (/npts/))
1124 & __line__, myfile))
RETURN
1126 IF (model.eq.5)
THEN
1133 ELSE IF (model.eq.11)
THEN
1143 IF (abs(
hdecay(1,j,ng)-fvarv(j)).gt.roundoff)
THEN
1157 IF ((model.eq.5).or.(model.eq.11))
THEN
1158 npts=ubound(
vdecay,dim=2)
1159 IF (.not.
PRESENT(ncid))
THEN
1162 & start = (/1/), total = (/npts/))
1167 & start = (/1/), total = (/npts/))
1170 & __line__, myfile))
RETURN
1172 IF (model.eq.5)
THEN
1175 ELSE IF (model.eq.11)
THEN
1181 IF (abs(
vdecay(1,j,ng)-fvarv(j)).gt.roundoff)
THEN
1194# ifdef WEAK_CONSTRAINT
1196 IF ((model.eq.5).and.(
nsa.eq.2))
THEN
1197 npts=ubound(
hdecay,dim=2)
1198 IF (.not.
PRESENT(ncid))
THEN
1201 & start = (/1/), total = (/npts/))
1206 & start = (/1/), total = (/npts/))
1209 & __line__, myfile))
RETURN
1218 IF (abs(
hdecay(
nsa,j,ng)-fvarv(j)).gt.roundoff)
THEN
1232 IF ((model.eq.5).and.(
nsa.eq.2))
THEN
1233 npts=ubound(
vdecay,dim=2)
1234 IF (.not.
PRESENT(ncid))
THEN
1237 & start = (/1/), total = (/npts/))
1242 & start = (/1/), total = (/npts/))
1245 & __line__, myfile))
RETURN
1251 IF (abs(
vdecay(
nsa,j,ng)-fvarv(j)).gt.roundoff)
THEN
1265# ifdef ADJUST_BOUNDARY
1267 IF (model.eq.10)
THEN
1273 IF (.not.
PRESENT(ncid))
THEN
1276 & start = (/1,1/), &
1277 & total = (/npts,4/))
1282 & start = (/1,1/), &
1283 & total = (/npts,4/))
1286 & __line__, myfile))
RETURN
1295 IF (
lobc(ib,j,ng))
THEN
1296 WRITE (text,
"(a,'(',i1,',',a,')')") &
1299 IF (abs(
hdecayb(j,ib,ng)-fvarv(ic)).gt. &
1314 IF (model.eq.10)
THEN
1316 IF (.not.
PRESENT(ncid))
THEN
1319 & start = (/1,1/), &
1320 & total = (/npts,4/))
1325 & start = (/1,1/), &
1326 & total = (/npts,4/))
1329 & __line__, myfile))
RETURN
1338 IF (
lobc(ib,j,ng))
THEN
1339 WRITE (text,
"(a,'(',i1,',',a,')')") &
1342 IF (abs(
vdecayb(j,ib,ng)-fvarv(ic)).gt. &
1361 10
FORMAT (/,
' NETCDF_CHECK_VAR - inconsistent value of variable: ', &
1362 & a,2x,2i5,/,20x,
'in file: ',a)
1363 20
FORMAT (/,
' NETCDF_CHECK_VAR - inconsistent value of variable: ', &
1364 & a,2x,2(1pe14.6),/,20x,
'in file: ',a)
1370 & SearchVar, VarID, nVarDim, nVarAtt)
1430 integer,
intent(in) :: ng, model
1432 character (len=*),
intent(in) :: ncname
1433 character (len=*),
intent(in),
optional :: myvarname
1435 logical,
intent(out),
optional :: searchvar
1437 integer,
intent(in),
optional :: ncid
1439 integer,
intent(out),
optional :: varid
1440 integer,
intent(out),
optional :: nvardim
1441 integer,
intent(out),
optional :: nvaratt
1445 logical :: foundit, writeerror
1447 integer :: i, j, status
1448 integer :: att_id, my_alen, my_atype, my_id, my_ncid
1450#if !defined PARALLEL_IO && defined DISTRIBUTE
1451 integer,
dimension(5) :: ibuffer
1454 real(
r4) :: my_afloat
1455 real(
r8) :: my_adouble
1457 character (len=1024) :: text
1459 character (len=*),
parameter :: myfile = &
1460 & __FILE__//
", netcdf_inq_var"
1501 IF (.not.
PRESENT(ncid))
THEN
1502 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
1512 IF ((status.eq.nf90_noerr).and.(
n_var.le.
mvars))
THEN
1513#if !defined PARALLEL_IO && defined DISTRIBUTE
1525 status=nf90_inquire_dimension(my_ncid,
dim_id(i), &
1527 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
1536#if !defined PARALLEL_IO && defined DISTRIBUTE
1546 status=nf90_inq_attname(my_ncid, nf90_global, att_id, &
1548 IF (status.eq.nf90_noerr)
THEN
1549 status=nf90_inquire_attribute(my_ncid, nf90_global, &
1553 IF (status.ne.nf90_noerr)
THEN
1555 & nf90_strerror(status)
1562 & nf90_strerror(status)
1572 IF (status.eq.nf90_noerr)
THEN
1576 status=nf90_inquire_variable(my_ncid,
var_id(i), &
1580 IF (status.eq.nf90_noerr)
THEN
1582 status=nf90_inq_attname(my_ncid,
var_id(i), j, &
1584 IF (status.eq.nf90_noerr)
THEN
1585 IF (trim(
var_aname(j)).eq.
'water_points'.and. &
1592 & nf90_strerror(status)
1601 & nf90_strerror(status)
1613 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
1621#if !defined PARALLEL_IO && defined DISTRIBUTE
1652 IF (
PRESENT(myvarname))
THEN
1672 IF (trim(
var_name(i)).eq.trim(myvarname))
THEN
1684 IF (
PRESENT(varid))
THEN
1687 IF (
PRESENT(nvardim))
THEN
1690 IF (
PRESENT(nvaratt))
THEN
1700 status=nf90_inquire_dimension(my_ncid,
var_dids(i), &
1702 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
1703 WRITE (
stdout,50) i, trim(myvarname), trim(ncname), &
1705 & nf90_strerror(status)
1711 IF (status.eq.nf90_noerr)
THEN
1713 status=nf90_inq_attname(my_ncid, my_id, i,
var_aname(i))
1714 IF (status.eq.nf90_noerr)
THEN
1715 status=nf90_inquire_attribute(my_ncid, my_id, &
1717 & xtype = my_atype, &
1719 IF (status.eq.nf90_noerr)
THEN
1720 IF ((my_alen.eq.1).and. &
1721 & (my_atype.eq.nf90_int))
THEN
1722 status=nf90_get_att(my_ncid, my_id, &
1725 IF (founderror(status, nf90_noerr, &
1726 & __line__, myfile))
THEN
1727 WRITE (
stdout,60)
'integer', &
1729 & trim(myvarname), &
1732 & nf90_strerror(status)
1737 ELSE IF ((my_alen.eq.1).and. &
1738 & (my_atype.eq.nf90_float))
THEN
1739 status=nf90_get_att(my_ncid, my_id, &
1742 IF (founderror(status, nf90_noerr, &
1743 & __line__, myfile))
THEN
1744 WRITE (
stdout,60)
'float', &
1746 & trim(myvarname), &
1749 & nf90_strerror(status)
1754#ifdef SINGLE_PRECISION
1759 ELSE IF ((my_alen.eq.1).and. &
1760 & (my_atype.eq.nf90_double))
THEN
1761 status=nf90_get_att(my_ncid, my_id, &
1764 IF (founderror(status, nf90_noerr, &
1765 & __line__, myfile))
THEN
1766 WRITE (
stdout,60)
'float', &
1768 & trim(myvarname), &
1771 & nf90_strerror(status)
1776#ifdef SINGLE_PRECISION
1781 ELSE IF (my_atype.eq.nf90_char)
THEN
1782 status=nf90_get_att(my_ncid, my_id, &
1785 IF (founderror(status, nf90_noerr, &
1786 & __line__, myfile))
THEN
1787 WRITE (
stdout,60)
'string', &
1789 & trim(myvarname), &
1792 & nf90_strerror(status)
1800 WRITE (
stdout,10) i, trim(myvarname), trim(ncname), &
1802 & nf90_strerror(status)
1808 WRITE (
stdout,70) i, trim(myvarname), trim(ncname), &
1818#if !defined PARALLEL_IO && defined DISTRIBUTE
1843 IF (
PRESENT(searchvar))
THEN
1849 IF (.not.foundit.and.writeerror)
THEN
1861 IF (.not.
PRESENT(ncid))
THEN
1862 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
1865 5
FORMAT (/,
' NETCDF_INQ_VAR - error while inquiring global', &
1866 &
' attribute: ',i2.2,/,18x,
'in input file:',2x,a, &
1867 & /,18x,
'call from:',2x,a,/,18x,a)
1868 10
FORMAT (/,
' NETCDF_INQ_VAR - error while inquiring attribute ', &
1869 & i1,
' for variable: ',a,/,18x,
'in input file:',2x,a, &
1870 & /,18x,
'call from:',2x,a,/18x,a)
1871 20
FORMAT (/,
' NETCDF_INQ_VAR - error while inquiring variable ID:', &
1872 & 2x,i3,/,18x,
'in input file:',2x,a,/,18x,
'call from:', &
1874 30
FORMAT (/,
' NETCDF_INQ_VAR - too small dimension parameter, ',a, &
1875 & 2i5,/,18x,
'change file mod_netcdf.F and recompile')
1876 40
FORMAT (/,
' NETCDF_INQ_VAR - unable to inquire about contents', &
1877 &
' of input NetCDF file:',2x,a,/,18x,
'call from:',2x,a, &
1879 50
FORMAT (/,
' NETCDF_INQ_VAR - error while inquiring dimension ', &
1880 & i1,
' for variable:',2x,a,/,18x,
'in input file:',2x,a, &
1881 & /,18x,
'call from:',2x,a,/,18x,a)
1882 60
FORMAT (/,
' NETCDF_INQ_VAR - error while reading ',a, &
1883 &
' attribute:',1x,a,
' for variable ',a,/,18x, &
1884 &
'in input file:',2x,a,/,18x,
'call from:',2x,a,/,18x,a)
1885 70
FORMAT (/,
' NETCDF_INQ_VAR - unable to inquire name of ', &
1886 &
'attribute ',i1,
' for variable ',a,/,18x, &
1887 &
'in input file:',2x,a,/,18x,
'call from:',2x,a,/,18x,a)
1888 80
FORMAT (/,
' NETCDF_INQ_VAR - requested variable:',2x,a,/18x, &
1889 &
'not found in input file:',2x,a,/,18x,
'call from:',2x,a, &
1918 integer,
intent(in) :: ng, model, ncid
1920 character (len=*),
intent(in) :: ncname
1921 character (len=*),
intent(in) :: myvarname
1923 integer,
intent(out) :: varid
1928#if !defined PARALLEL_IO && defined DISTRIBUTE
1929 integer,
dimension(3) :: ibuffer
1932 character (len=*),
parameter :: myfile = &
1933 & __FILE__//
", netcdf_inq_varid"
1940 status=nf90_inq_varid(ncid, trim(myvarname), varid)
1941 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
1942 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
1949#if !defined PARALLEL_IO && defined DISTRIBUTE
1959 10
FORMAT (/,
' NETCDF_INQ_VARID - error while inquiring ID for ', &
1960 &
'variable:',2x,a,/,20x,
'in input file:',2x,a,/, &
1961 & 20x,
'call from:',2x,a,/,20x,a)
1966#ifdef SINGLE_PRECISION
1969 & AttName, AttValue, foundit, ncid)
1995 integer,
intent(in) :: ng, model, varid
1997 integer,
intent(in),
optional :: ncid
1999 character (len=*),
intent(in) :: ncname
2000 character (len=*),
intent(in) :: AttName(:)
2002 logical,
intent(out) :: foundit(:)
2004 real(dp),
intent(out) :: AttValue(:)
2008 integer :: i, j, my_natts, my_ncid, natts, status
2010# if !defined PARALLEL_IO && defined DISTRIBUTE
2012 real(dp),
allocatable :: rbuffer(:)
2015 character (len=40) :: my_Aname
2016 character (len=40) :: my_Vname
2018 character (len=*),
parameter :: MyFile = &
2019 & __FILE__//
", netcdf_get_fatt"
2027 natts=ubound(attname, dim=1)
2032# if !defined PARALLEL_IO && defined DISTRIBUTE
2033 IF (.not.
allocated(rbuffer))
THEN
2034 allocate ( rbuffer(2*natts+1) )
2040 IF (.not.
PRESENT(ncid))
THEN
2041 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
2050 IF (varid.eq.nf90_global)
THEN
2051 status=nf90_inquire(my_ncid, &
2052 & nattributes = my_natts)
2054 status=nf90_inquire_variable(my_ncid, varid, &
2055 & name = my_vname, &
2058 IF (status.eq.nf90_noerr)
THEN
2060 status=nf90_inq_attname(my_ncid, varid, j, my_aname)
2061 IF (status.eq.nf90_noerr)
THEN
2063 IF (trim(my_aname).eq.trim(attname(i)))
THEN
2064 status=nf90_get_att(my_ncid, varid, trim(attname(i)), &
2066 IF (founderror(status, nf90_noerr, &
2067 & __line__, myfile))
THEN
2072 & nf90_strerror(status)
2085 & nf90_strerror(status)
2091# if !defined PARALLEL_IO && defined DISTRIBUTE
2095 rbuffer(i)=attvalue(i)
2096 IF (foundit(i))
THEN
2097 rbuffer(i+natts)=1.0_dp
2100 rbuffer(2*natts+1)=real(
ioerror, dp)
2106 & nf90_strerror(status)
2112# if !defined PARALLEL_IO && defined DISTRIBUTE
2121 attvalue(i)=rbuffer(i)
2122 IF (rbuffer(i+natts).gt.0.0_dp)
THEN
2126 ioerror=int(rbuffer(2*natts+1))
2127 IF (
allocated(rbuffer))
THEN
2128 deallocate (rbuffer)
2135 IF (.not.
PRESENT(ncid))
THEN
2136 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
2139 10
FORMAT (/,
' NETCDF_GET_FATT_DP - error while reading attribute:', &
2140 & 1x,a,
'for variable',1x,a,/,22x,
'in input file:',2x,a,/, &
2141 & 22x,
'call from:',2x,a,/,22x,a)
2142 20
FORMAT (/,
' NETCDF_GET_FATT_DP - error while inquiring ', &
2143 &
'attribute: ',i2.2,
'for variable',1x,a,/,22x, &
2144 &
'in input file:',2x,a,/,19x,
'call from:',2x,a,/,19x,a)
2145 30
FORMAT (/,
' NETCDF_GET_FATT_DP - error while inquiring number of',&
2146 &
' attributes for variable:',1x,a,/,22x,
'in input file:', &
2147 & 2x,a,/,22x,
'call from:',2x,a,/,22x,a)
2154 & AttValue, foundit, ncid)
2180 integer,
intent(in) :: ng, model, varid
2182 integer,
intent(in),
optional :: ncid
2184 character (len=*),
intent(in) :: ncname
2185 character (len=*),
intent(in) :: AttName(:)
2187 logical,
intent(out) :: foundit(:)
2189 real(r8),
intent(out) :: AttValue(:)
2193 integer :: i, j, my_natts, my_ncid, natts, status
2195#if !defined PARALLEL_IO && defined DISTRIBUTE
2197 real(r8),
allocatable :: rbuffer(:)
2200 character (len=40) :: my_Aname
2201 character (len=40) :: my_Vname
2203 character (len=*),
parameter :: MyFile = &
2204 & __FILE__//
", netcdf_get_fatt_r8"
2212 natts=ubound(attname, dim=1)
2217#if !defined PARALLEL_IO && defined DISTRIBUTE
2218 IF (.not.
allocated(rbuffer))
THEN
2219 allocate ( rbuffer(2*natts+1) )
2225 IF (.not.
PRESENT(ncid))
THEN
2226 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
2235 IF (varid.eq.nf90_global)
THEN
2236 status=nf90_inquire(my_ncid, &
2237 & nattributes = my_natts)
2239 status=nf90_inquire_variable(my_ncid, varid, &
2240 & name = my_vname, &
2243 IF (status.eq.nf90_noerr)
THEN
2245 status=nf90_inq_attname(my_ncid, varid, j, my_aname)
2246 IF (status.eq.nf90_noerr)
THEN
2248 IF (trim(my_aname).eq.trim(attname(i)))
THEN
2249 status=nf90_get_att(my_ncid, varid, trim(attname(i)), &
2251 IF (founderror(status, nf90_noerr, &
2252 & __line__, myfile))
THEN
2257 & nf90_strerror(status)
2270 & nf90_strerror(status)
2276#if !defined PARALLEL_IO && defined DISTRIBUTE
2280 rbuffer(i)=attvalue(i)
2281 IF (foundit(i))
THEN
2282 rbuffer(i+natts)=1.0_r8
2285 rbuffer(2*natts+1)=real(
ioerror, r8)
2291 & nf90_strerror(status)
2297#if !defined PARALLEL_IO && defined DISTRIBUTE
2306 attvalue(i)=rbuffer(i)
2307 IF (rbuffer(i+natts).gt.0.0_r8)
THEN
2311 ioerror=int(rbuffer(2*natts+1))
2312 IF (
allocated(rbuffer))
THEN
2313 deallocate (rbuffer)
2320 IF (.not.
PRESENT(ncid))
THEN
2321 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
2324 10
FORMAT (/,
' NETCDF_GET_FATT_R8 - error while reading attribute:', &
2325 & 1x,a,
'for variable',1x,a,/,22x,
'in input file:',2x,a,/, &
2326 & 22x,
'call from:',2x,a,/,22x,a)
2327 20
FORMAT (/,
' NETCDF_GET_FATT_R8 - error while inquiring ', &
2328 &
'attribute: ',i2.2,
'for variable',1x,a,/,22x, &
2329 &
'in input file:',2x,a,/,19x,
'call from:',2x,a,/,19x,a)
2330 30
FORMAT (/,
' NETCDF_GET_FATT_R8 - error while inquiring number of',&
2331 &
' attributes for variable:',1x,a,/,22x,
'in input file:', &
2332 & 2x,a,/,22x,
'call from:',2x,a,/,22x,a)
2338 & AttValue, foundit, ncid)
2364 integer,
intent(in) :: ng, model, varid
2366 integer,
intent(in),
optional :: ncid
2368 character (len=*),
intent(in) :: ncname
2369 character (len=*),
intent(in) :: attname(:)
2371 logical,
intent(out) :: foundit(:)
2373 character (len=*),
intent(out) :: attvalue(:)
2377 integer :: i, j, my_natts, my_ncid, natts, status
2379#if !defined PARALLEL_IO && defined DISTRIBUTE
2380 integer,
allocatable :: ibuffer(:)
2383 character (len=40) :: my_aname
2384 character (len=40) :: my_vname
2386 character (len=*),
parameter :: myfile = &
2387 & __FILE__//
", netcdf_get_satt"
2395 natts=ubound(attname, dim=1)
2400#if !defined PARALLEL_IO && defined DISTRIBUTE
2401 IF (.not.
allocated(ibuffer))
THEN
2402 allocate ( ibuffer(natts+1) )
2408 IF (.not.
PRESENT(ncid))
THEN
2409 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
2418 IF (varid.eq.nf90_global)
THEN
2419 status=nf90_inquire(my_ncid, &
2420 & nattributes = my_natts)
2422 status=nf90_inquire_variable(my_ncid, varid, &
2423 & name = my_vname, &
2426 IF (status.eq.nf90_noerr)
THEN
2428 status=nf90_inq_attname(my_ncid, varid, j, my_aname)
2429 IF (status.eq.nf90_noerr)
THEN
2431 IF (trim(my_aname).eq.trim(attname(i)))
THEN
2432 status=nf90_get_att(my_ncid, varid, trim(attname(i)), &
2434 IF (founderror(status, nf90_noerr, &
2435 & __line__, myfile))
THEN
2440 & nf90_strerror(status)
2453 & nf90_strerror(status)
2459#if !defined PARALLEL_IO && defined DISTRIBUTE
2463 IF (foundit(i))
THEN
2473 & nf90_strerror(status)
2479#if !defined PARALLEL_IO && defined DISTRIBUTE
2488 IF (ibuffer(i).gt.0)
THEN
2495 IF (
allocated(ibuffer))
THEN
2496 deallocate (ibuffer)
2502 IF (.not.
PRESENT(ncid))
THEN
2503 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
2506 10
FORMAT (/,
' NETCDF_GET_SATT - error while reading attribute:', &
2507 & 1x,a,
'for variable',1x,a,/,19x,
'in input file:',2x,a,/, &
2508 & 19x,
'call from:',2x,a,/,19x,a)
2509 20
FORMAT (/,
' NETCDF_GET_SATT - error while inquiring attribute:', &
2510 & 1x,i2.2,
'for variable',1x,a,/,19x,
'in input file:',2x,a, &
2511 & /,19x,
'call from:',2x,a,/,19x,a)
2512 30
FORMAT (/,
' NETCDF_GET_SATT - error while inquiring number of ', &
2513 &
'attributes for variable:',1x,a,/,19x,
'in input file:', &
2514 & 2x,a,/,19x,
'call from:',2x,a,/19x,a)
2519#ifdef SINGLE_PRECISION
2522 & ncid, start, total, broadcast, &
2562 logical,
intent(in),
optional :: broadcast
2564 integer,
intent(in) :: ng, model
2566 integer,
intent(in),
optional :: ncid
2567 integer,
intent(in),
optional :: start(:)
2568 integer,
intent(in),
optional :: total(:)
2570 character (len=*),
intent(in) :: ncname
2571 character (len=*),
intent(in) :: myVarName
2573 real(dp),
intent(out),
optional :: min_val
2574 real(dp),
intent(out),
optional :: max_val
2576 real(dp),
intent(out) :: A
2580# if !defined PARALLEL_IO && defined DISTRIBUTE
2581 logical :: DoBroadcast
2585 integer :: my_ncid, status, varid
2587# if !defined PARALLEL_IO && defined DISTRIBUTE
2588 integer,
dimension(2) :: ibuffer
2591 real(dp),
dimension(1) :: my_A
2593 character (len=*),
parameter :: MyFile = &
2594 & __FILE__//
", netcdf_get_fvar_0dp"
2602 IF (.not.
PRESENT(ncid))
THEN
2603 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
2609# if !defined PARALLEL_IO && defined DISTRIBUTE
2614 IF (.not.
PRESENT(broadcast))
THEN
2617 dobroadcast=broadcast
2624 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
2625 IF (status.eq.nf90_noerr)
THEN
2626 IF (
PRESENT(start).and.
PRESENT(total))
THEN
2627 status=nf90_get_var(my_ncid, varid, my_a, start, total)
2630 status=nf90_get_var(my_ncid, varid, a)
2632 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
2633 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
2639 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
2646# if !defined PARALLEL_IO && defined DISTRIBUTE
2664 IF (
PRESENT(min_val))
THEN
2667 IF (
PRESENT(max_val))
THEN
2673 IF (.not.
PRESENT(ncid))
THEN
2674 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
2677 10
FORMAT (/,
' NETCDF_GET_FVAR_0DP - error while reading variable:', &
2678 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
2680 20
FORMAT (/,
' NETCDF_GET_FVAR_0DP - error while inquiring ID for ', &
2681 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
2682 &
'call from:',2x,a,/,23x,a)
2688 & ncid, start, total, broadcast, &
2729 logical,
intent(in),
optional :: broadcast
2731 integer,
intent(in) :: ng, model
2733 integer,
intent(in),
optional :: ncid
2734 integer,
intent(in),
optional :: start(:)
2735 integer,
intent(in),
optional :: total(:)
2737 character (len=*),
intent(in) :: ncname
2738 character (len=*),
intent(in) :: myVarName
2740 real(dp),
intent(out),
optional :: min_val
2741 real(dp),
intent(out),
optional :: max_val
2743 real(dp),
intent(out) :: A(:)
2747# if !defined PARALLEL_IO && defined DISTRIBUTE
2748 logical :: DoBroadcast
2750 logical,
dimension(3) :: foundit
2752 integer :: i, my_ncid, status, varid
2754 integer,
dimension(1) :: Asize
2755# if !defined PARALLEL_IO && defined DISTRIBUTE
2756 integer,
dimension(2) :: ibuffer
2759 real(dp) :: Afactor, Aoffset, Aspval
2761 real(dp),
parameter :: Aepsilon = 1.0e-8_dp
2763 real(dp),
dimension(3) :: AttValue
2765 character (len=12),
dimension(3) :: AttName
2767 character (len=*),
parameter :: MyFile = &
2768 & __FILE__//
", netcdf_get_fvar_1dp"
2774 IF (
PRESENT(start).and.
PRESENT(total))
THEN
2777 asize(1)=asize(1)*total(i)
2780 asize(1)=ubound(a, dim=1)
2785 IF (.not.
PRESENT(ncid))
THEN
2786 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
2792# if !defined PARALLEL_IO && defined DISTRIBUTE
2797 IF (.not.
PRESENT(broadcast))
THEN
2800 dobroadcast=broadcast
2807 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
2808 IF (status.eq.nf90_noerr)
THEN
2809 IF (
PRESENT(start).and.
PRESENT(total))
THEN
2810 status=nf90_get_var(my_ncid, varid, a, start, total)
2812 status=nf90_get_var(my_ncid, varid, a)
2814 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
2815 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
2821 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
2828# if !defined PARALLEL_IO && defined DISTRIBUTE
2855 attname(1)=
'scale_factor'
2856 attname(2)=
'add_offset '
2857 attname(3)=
'_FillValue '
2860 & attvalue, foundit, &
2864 IF (.not.foundit(1))
THEN
2870 IF (.not.foundit(2))
THEN
2876 IF (.not.foundit(3))
THEN
2883 IF ((foundit(3).and.(abs(a(i)-aspval).lt.aepsilon)).or. &
2884 & (.not.foundit(3).and.(abs(a(i)).ge.abs(aspval))))
THEN
2889 IF (foundit(1))
THEN
2895 IF (foundit(2))
THEN
2904 IF (
PRESENT(min_val))
THEN
2907 IF (
PRESENT(max_val))
THEN
2913 IF (.not.
PRESENT(ncid))
THEN
2914 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
2917 10
FORMAT (/,
' NETCDF_GET_FVAR_1DP - error while reading variable:', &
2918 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
2920 20
FORMAT (/,
' NETCDF_GET_FVAR_1DP - error while inquiring ID for ', &
2921 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
2922 &
'call from:',2x,a,/,23x,a)
2928 & ncid, start, total, broadcast, &
2970 logical,
intent(in),
optional :: broadcast
2972 integer,
intent(in) :: ng, model
2974 integer,
intent(in),
optional :: ncid
2975 integer,
intent(in),
optional :: start(:)
2976 integer,
intent(in),
optional :: total(:)
2978 character (len=*),
intent(in) :: ncname
2979 character (len=*),
intent(in) :: myVarName
2981 real(dp),
intent(out),
optional :: min_val
2982 real(dp),
intent(out),
optional :: max_val
2984 real(dp),
intent(out) :: A(:,:)
2988# if !defined PARALLEL_IO && defined DISTRIBUTE
2989 logical :: Dobroadcast
2991 logical,
dimension(3) :: foundit
2993 integer :: i, j, my_ncid, status, varid
2995 integer,
dimension(2) :: Asize
2997# if !defined PARALLEL_IO && defined DISTRIBUTE
2998 integer,
dimension(2) :: ibuffer
3001 real(dp) :: Afactor, Aoffset, Aspval
3003 real(dp),
parameter :: Aepsilon = 1.0e-8_r8
3005 real(dp),
dimension(3) :: AttValue
3007 character (len=12),
dimension(3) :: AttName
3009 character (len=*),
parameter :: MyFile = &
3010 & __FILE__//
", netcdf_get_fvar_2dp"
3016 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3020 asize(1)=ubound(a, dim=1)
3021 asize(2)=ubound(a, dim=2)
3026 IF (.not.
PRESENT(ncid))
THEN
3027 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
3033# if !defined PARALLEL_IO && defined DISTRIBUTE
3038 IF (.not.
PRESENT(broadcast))
THEN
3041 dobroadcast=broadcast
3048 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
3049 IF (status.eq.nf90_noerr)
THEN
3050 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3051 status=nf90_get_var(my_ncid, varid, a, start, total)
3053 status=nf90_get_var(my_ncid, varid, a)
3055 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
3056 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
3062 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
3064 & nf90_strerror(status)
3070# if !defined PARALLEL_IO && defined DISTRIBUTE
3097 attname(1)=
'scale_factor'
3098 attname(2)=
'add_offset '
3099 attname(3)=
'_FillValue '
3102 & attvalue, foundit, &
3106 IF (.not.foundit(1))
THEN
3112 IF (.not.foundit(2))
THEN
3118 IF (.not.foundit(3))
THEN
3126 IF ((foundit(3).and.(abs(a(i,j)-aspval).lt.aepsilon)).or. &
3127 & (.not.foundit(3).and.(abs(a(i,j)).ge.abs(aspval))))
THEN
3133 IF (foundit(1))
THEN
3136 a(i,j)=afactor*a(i,j)
3141 IF (foundit(2))
THEN
3144 a(i,j)=a(i,j)+aoffset
3152 IF (
PRESENT(min_val))
THEN
3155 IF (
PRESENT(max_val))
THEN
3161 IF (.not.
PRESENT(ncid))
THEN
3162 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
3165 10
FORMAT (/,
' NETCDF_GET_FVAR_2DP - error while reading variable:', &
3166 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
3168 20
FORMAT (/,
' NETCDF_GET_FVAR_2DP - error while inquiring ID for ', &
3169 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
3170 &
'call from:',2x,a,/,23x,a)
3176 & ncid, start, total, broadcast, &
3215 logical,
intent(in),
optional :: broadcast
3217 integer,
intent(in) :: ng, model
3219 integer,
intent(in),
optional :: ncid
3220 integer,
intent(in),
optional :: start(:)
3221 integer,
intent(in),
optional :: total(:)
3223 character (len=*),
intent(in) :: ncname
3224 character (len=*),
intent(in) :: myVarName
3226 real(dp),
intent(out),
optional :: min_val
3227 real(dp),
intent(out),
optional :: max_val
3229 real(dp),
intent(out) :: A(:,:,:)
3233# if !defined PARALLEL_IO && defined DISTRIBUTE
3234 logical :: DoBroadcast
3236 logical,
dimension(3) :: foundit
3238 integer :: i, j, k, my_ncid, status, varid
3240 integer,
dimension(3) :: Asize
3242# if !defined PARALLEL_IO && defined DISTRIBUTE
3243 integer,
dimension(2) :: ibuffer
3246 real(dp) :: Afactor, Aoffset, Aspval
3248 real(dp),
parameter :: Aepsilon = 1.0e-8_r8
3250 real(dp),
dimension(3) :: AttValue
3252 character (len=12),
dimension(3) :: AttName
3254 character (len=*),
parameter :: MyFile = &
3255 & __FILE__//
", netcdf_get_fvar_3dp"
3261 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3266 asize(1)=ubound(a, dim=1)
3267 asize(2)=ubound(a, dim=2)
3268 asize(3)=ubound(a, dim=3)
3273 IF (.not.
PRESENT(ncid))
THEN
3274 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
3280# if !defined PARALLEL_IO && defined DISTRIBUTE
3285 IF (.not.
PRESENT(broadcast))
THEN
3288 dobroadcast=broadcast
3295 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
3296 IF (status.eq.nf90_noerr)
THEN
3297 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3298 status=nf90_get_var(my_ncid, varid, a, start, total)
3300 status=nf90_get_var(my_ncid, varid, a)
3302 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
3303 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
3309 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
3316# if !defined PARALLEL_IO && defined DISTRIBUTE
3343 attname(1)=
'scale_factor'
3344 attname(2)=
'add_offset '
3345 attname(3)=
'_FillValue '
3348 & attvalue, foundit, &
3352 IF (.not.foundit(1))
THEN
3358 IF (.not.foundit(2))
THEN
3364 IF (.not.foundit(3))
THEN
3373 IF ((foundit(3).and. &
3374 & (abs(a(i,j,k)-aspval).lt.aepsilon)).or. &
3375 & (.not.foundit(3).and. &
3376 & (abs(a(i,j,k)).ge.abs(aspval))))
THEN
3383 IF (foundit(1))
THEN
3387 a(i,j,k)=afactor*a(i,j,k)
3393 IF (foundit(2))
THEN
3397 a(i,j,k)=a(i,j,k)+aoffset
3406 IF (
PRESENT(min_val))
THEN
3409 IF (
PRESENT(max_val))
THEN
3415 IF (.not.
PRESENT(ncid))
THEN
3416 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
3419 10
FORMAT (/,
' NETCDF_GET_FVAR_3DP - error while reading variable:', &
3420 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
3422 20
FORMAT (/,
' NETCDF_GET_FVAR_3DP - error while inquiring ID for ', &
3423 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
3424 &
'call from:',2x,a,/,23x,a)
3431 & ncid, start, total, broadcast, &
3471 logical,
intent(in),
optional :: broadcast
3473 integer,
intent(in) :: ng, model
3475 integer,
intent(in),
optional :: ncid
3476 integer,
intent(in),
optional :: start(:)
3477 integer,
intent(in),
optional :: total(:)
3479 character (len=*),
intent(in) :: ncname
3480 character (len=*),
intent(in) :: myVarName
3482 real(r8),
intent(out),
optional :: min_val
3483 real(r8),
intent(out),
optional :: max_val
3485 real(r8),
intent(out) :: A
3489#if !defined PARALLEL_IO && defined DISTRIBUTE
3490 logical :: DoBroadcast
3494 integer :: my_ncid, status, varid
3496#if !defined PARALLEL_IO && defined DISTRIBUTE
3497 integer,
dimension(2) :: ibuffer
3500 real(r8),
dimension(1) :: my_A
3502 character (len=*),
parameter :: MyFile = &
3503 & __FILE__//
", netcdf_get_fvar_0d"
3511 IF (.not.
PRESENT(ncid))
THEN
3512 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
3518#if !defined PARALLEL_IO && defined DISTRIBUTE
3523 IF (.not.
PRESENT(broadcast))
THEN
3526 dobroadcast=broadcast
3533 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
3534 IF (status.eq.nf90_noerr)
THEN
3535 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3536 status=nf90_get_var(my_ncid, varid, my_a, start, total)
3539 status=nf90_get_var(my_ncid, varid, a)
3541 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
3542 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
3548 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
3555#if !defined PARALLEL_IO && defined DISTRIBUTE
3573 IF (
PRESENT(min_val))
THEN
3576 IF (
PRESENT(max_val))
THEN
3582 IF (.not.
PRESENT(ncid))
THEN
3583 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
3586 10
FORMAT (/,
' NETCDF_GET_FVAR_0D - error while reading variable:', &
3587 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
3589 20
FORMAT (/,
' NETCDF_GET_FVAR_0D - error while inquiring ID for ', &
3590 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
3591 &
'call from:',2x,a,/,22x,a)
3597 & ncid, start, total, broadcast, &
3638 logical,
intent(in),
optional :: broadcast
3640 integer,
intent(in) :: ng, model
3642 integer,
intent(in),
optional :: ncid
3643 integer,
intent(in),
optional :: start(:)
3644 integer,
intent(in),
optional :: total(:)
3646 character (len=*),
intent(in) :: ncname
3647 character (len=*),
intent(in) :: myVarName
3649 real(r8),
intent(out),
optional :: min_val
3650 real(r8),
intent(out),
optional :: max_val
3652 real(r8),
intent(out) :: A(:)
3656#if !defined PARALLEL_IO && defined DISTRIBUTE
3657 logical :: DoBroadcast
3659 logical,
dimension(3) :: foundit
3661 integer :: i, my_ncid, status, varid
3663 integer,
dimension(1) :: Asize
3664#if !defined PARALLEL_IO && defined DISTRIBUTE
3665 integer,
dimension(2) :: ibuffer
3668 real(r8) :: Afactor, Aoffset, Aspval
3670 real(r8),
parameter :: Aepsilon = 1.0e-8_r8
3672 real(r8),
dimension(3) :: AttValue
3674 character (len=12),
dimension(3) :: AttName
3676 character (len=*),
parameter :: MyFile = &
3677 & __FILE__//
", netcdf_get_fvar_1d"
3683 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3686 asize(1)=asize(1)*total(i)
3689 asize(1)=ubound(a, dim=1)
3694 IF (.not.
PRESENT(ncid))
THEN
3695 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
3701#if !defined PARALLEL_IO && defined DISTRIBUTE
3706 IF (.not.
PRESENT(broadcast))
THEN
3709 dobroadcast=broadcast
3716 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
3717 IF (status.eq.nf90_noerr)
THEN
3718 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3719 status=nf90_get_var(my_ncid, varid, a, start, total)
3721 status=nf90_get_var(my_ncid, varid, a)
3723 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
3724 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
3730 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
3737#if !defined PARALLEL_IO && defined DISTRIBUTE
3764 attname(1)=
'scale_factor'
3765 attname(2)=
'add_offset '
3766 attname(3)=
'_FillValue '
3769 & attvalue, foundit, &
3773 IF (.not.foundit(1))
THEN
3779 IF (.not.foundit(2))
THEN
3785 IF (.not.foundit(3))
THEN
3792 IF ((foundit(3).and.(abs(a(i)-aspval).lt.aepsilon)).or. &
3793 & (.not.foundit(3).and.(abs(a(i)).ge.abs(aspval))))
THEN
3798 IF (foundit(1))
THEN
3804 IF (foundit(2))
THEN
3813 IF (
PRESENT(min_val))
THEN
3816 IF (
PRESENT(max_val))
THEN
3822 IF (.not.
PRESENT(ncid))
THEN
3823 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
3826 10
FORMAT (/,
' NETCDF_GET_FVAR_1D - error while reading variable:', &
3827 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
3829 20
FORMAT (/,
' NETCDF_GET_FVAR_1D - error while inquiring ID for ', &
3830 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
3831 &
'call from:',2x,a,/,22x,a)
3837 & ncid, start, total, broadcast, &
3879 logical,
intent(in),
optional :: broadcast
3881 integer,
intent(in) :: ng, model
3883 integer,
intent(in),
optional :: ncid
3884 integer,
intent(in),
optional :: start(:)
3885 integer,
intent(in),
optional :: total(:)
3887 character (len=*),
intent(in) :: ncname
3888 character (len=*),
intent(in) :: myVarName
3890 real(r8),
intent(out),
optional :: min_val
3891 real(r8),
intent(out),
optional :: max_val
3893 real(r8),
intent(out) :: A(:,:)
3897#if !defined PARALLEL_IO && defined DISTRIBUTE
3898 logical :: Dobroadcast
3900 logical,
dimension(3) :: foundit
3902 integer :: i, j, my_ncid, status, varid
3904 integer,
dimension(2) :: Asize
3906#if !defined PARALLEL_IO && defined DISTRIBUTE
3907 integer,
dimension(2) :: ibuffer
3910 real(r8) :: Afactor, Aoffset, Aspval
3912 real(r8),
parameter :: Aepsilon = 1.0e-8_r8
3914 real(r8),
dimension(3) :: AttValue
3916 character (len=12),
dimension(3) :: AttName
3918 character (len=*),
parameter :: MyFile = &
3919 & __FILE__//
", netcdf_get_fvar_2d"
3925 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3929 asize(1)=ubound(a, dim=1)
3930 asize(2)=ubound(a, dim=2)
3935 IF (.not.
PRESENT(ncid))
THEN
3936 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
3942#if !defined PARALLEL_IO && defined DISTRIBUTE
3947 IF (.not.
PRESENT(broadcast))
THEN
3950 dobroadcast=broadcast
3957 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
3958 IF (status.eq.nf90_noerr)
THEN
3959 IF (
PRESENT(start).and.
PRESENT(total))
THEN
3960 status=nf90_get_var(my_ncid, varid, a, start, total)
3962 status=nf90_get_var(my_ncid, varid, a)
3964 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
3965 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
3971 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
3973 & nf90_strerror(status)
3979#if !defined PARALLEL_IO && defined DISTRIBUTE
4006 attname(1)=
'scale_factor'
4007 attname(2)=
'add_offset '
4008 attname(3)=
'_FillValue '
4011 & attvalue, foundit, &
4015 IF (.not.foundit(1))
THEN
4021 IF (.not.foundit(2))
THEN
4027 IF (.not.foundit(3))
THEN
4035 IF ((foundit(3).and.(abs(a(i,j)-aspval).lt.aepsilon)).or. &
4036 & (.not.foundit(3).and.(abs(a(i,j)).ge.abs(aspval))))
THEN
4042 IF (foundit(1))
THEN
4045 a(i,j)=afactor*a(i,j)
4050 IF (foundit(2))
THEN
4053 a(i,j)=a(i,j)+aoffset
4061 IF (
PRESENT(min_val))
THEN
4064 IF (
PRESENT(max_val))
THEN
4070 IF (.not.
PRESENT(ncid))
THEN
4071 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
4074 10
FORMAT (/,
' NETCDF_GET_FVAR_2D - error while reading variable:', &
4075 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
4077 20
FORMAT (/,
' NETCDF_GET_FVAR_2D - error while inquiring ID for ', &
4078 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4079 &
'call from:',2x,a,/,22x,a)
4085 & ncid, start, total, broadcast, &
4124 logical,
intent(in),
optional :: broadcast
4126 integer,
intent(in) :: ng, model
4128 integer,
intent(in),
optional :: ncid
4129 integer,
intent(in),
optional :: start(:)
4130 integer,
intent(in),
optional :: total(:)
4132 character (len=*),
intent(in) :: ncname
4133 character (len=*),
intent(in) :: myVarName
4135 real(r8),
intent(out),
optional :: min_val
4136 real(r8),
intent(out),
optional :: max_val
4138 real(r8),
intent(out) :: A(:,:,:)
4142#if !defined PARALLEL_IO && defined DISTRIBUTE
4143 logical :: DoBroadcast
4145 logical,
dimension(3) :: foundit
4147 integer :: i, j, k, my_ncid, status, varid
4149 integer,
dimension(3) :: Asize
4151#if !defined PARALLEL_IO && defined DISTRIBUTE
4152 integer,
dimension(2) :: ibuffer
4155 real(r8) :: Afactor, Aoffset, Aspval
4157 real(r8),
parameter :: Aepsilon = 1.0e-8_r8
4159 real(r8),
dimension(3) :: AttValue
4161 character (len=12),
dimension(3) :: AttName
4163 character (len=*),
parameter :: MyFile = &
4164 & __FILE__//
", netcdf_get_fvar_3d"
4170 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4175 asize(1)=ubound(a, dim=1)
4176 asize(2)=ubound(a, dim=2)
4177 asize(3)=ubound(a, dim=3)
4182 IF (.not.
PRESENT(ncid))
THEN
4183 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
4189#if !defined PARALLEL_IO && defined DISTRIBUTE
4194 IF (.not.
PRESENT(broadcast))
THEN
4197 dobroadcast=broadcast
4204 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
4205 IF (status.eq.nf90_noerr)
THEN
4206 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4207 status=nf90_get_var(my_ncid, varid, a, start, total)
4209 status=nf90_get_var(my_ncid, varid, a)
4211 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
4212 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
4218 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
4225#if !defined PARALLEL_IO && defined DISTRIBUTE
4252 attname(1)=
'scale_factor'
4253 attname(2)=
'add_offset '
4254 attname(3)=
'_FillValue '
4257 & attvalue, foundit, &
4261 IF (.not.foundit(1))
THEN
4267 IF (.not.foundit(2))
THEN
4273 IF (.not.foundit(3))
THEN
4282 IF ((foundit(3).and. &
4283 & (abs(a(i,j,k)-aspval).lt.aepsilon)).or. &
4284 & (.not.foundit(3).and. &
4285 & (abs(a(i,j,k)).ge.abs(aspval))))
THEN
4292 IF (foundit(1))
THEN
4296 a(i,j,k)=afactor*a(i,j,k)
4302 IF (foundit(2))
THEN
4306 a(i,j,k)=a(i,j,k)+aoffset
4315 IF (
PRESENT(min_val))
THEN
4318 IF (
PRESENT(max_val))
THEN
4324 IF (.not.
PRESENT(ncid))
THEN
4325 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
4328 10
FORMAT (/,
' NETCDF_GET_FVAR_3D - error while reading variable:', &
4329 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
4331 20
FORMAT (/,
' NETCDF_GET_FVAR_3D - error while inquiring ID for ', &
4332 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4333 &
'call from:',2x,a,/,22x,a)
4339 & ncid, start, total, broadcast, &
4378 logical,
intent(in),
optional :: broadcast
4380 integer,
intent(in) :: ng, model
4382 integer,
intent(in),
optional :: ncid
4383 integer,
intent(in),
optional :: start(:)
4384 integer,
intent(in),
optional :: total(:)
4386 character (len=*),
intent(in) :: ncname
4387 character (len=*),
intent(in) :: myVarName
4389 real(r8),
intent(out),
optional :: min_val
4390 real(r8),
intent(out),
optional :: max_val
4392 real(r8),
intent(out) :: A(:,:,:,:)
4396#if !defined PARALLEL_IO && defined DISTRIBUTE
4397 logical :: DoBroadcast
4399 logical,
dimension(3) :: foundit
4401 integer :: i, j, k, l, my_ncid, status, varid
4403 integer,
dimension(4) :: Asize
4405#if !defined PARALLEL_IO && defined DISTRIBUTE
4406 integer,
dimension(2) :: ibuffer
4409 real(r8) :: Afactor, Aoffset, Aspval
4411 real(r8),
parameter :: Aepsilon = 1.0e-8_r8
4413 real(r8),
dimension(3) :: AttValue
4415 character (len=12),
dimension(3) :: AttName
4417 character (len=*),
parameter :: MyFile = &
4418 & __FILE__//
", netcdf_get_fvar_4d"
4424 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4430 asize(1)=ubound(a, dim=1)
4431 asize(2)=ubound(a, dim=2)
4432 asize(3)=ubound(a, dim=3)
4433 asize(4)=ubound(a, dim=4)
4438 IF (.not.
PRESENT(ncid))
THEN
4439 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
4445#if !defined PARALLEL_IO && defined DISTRIBUTE
4450 IF (.not.
PRESENT(broadcast))
THEN
4453 dobroadcast=broadcast
4460 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
4461 IF (status.eq.nf90_noerr)
THEN
4462 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4463 status=nf90_get_var(my_ncid, varid, a, start, total)
4465 status=nf90_get_var(my_ncid, varid, a)
4467 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
4468 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
4474 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
4481#if !defined PARALLEL_IO && defined DISTRIBUTE
4508 attname(1)=
'scale_factor'
4509 attname(2)=
'add_offset '
4510 attname(3)=
'_FillValue '
4513 & attvalue, foundit, &
4517 IF (.not.foundit(1))
THEN
4523 IF (.not.foundit(2))
THEN
4529 IF (.not.foundit(3))
THEN
4539 IF ((foundit(3).and. &
4540 & (abs(a(i,j,k,l)-aspval).lt.aepsilon)).or. &
4541 & (.not.foundit(3).and. &
4542 & (abs(a(i,j,k,l)).ge.abs(aspval))))
THEN
4550 IF (foundit(1))
THEN
4555 a(i,j,k,l)=afactor*a(i,j,k,l)
4562 IF (foundit(2))
THEN
4567 a(i,j,k,l)=a(i,j,k,l)+aoffset
4577 IF (
PRESENT(min_val))
THEN
4580 IF (
PRESENT(max_val))
THEN
4586 IF (.not.
PRESENT(ncid))
THEN
4587 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
4590 10
FORMAT (/,
' NETCDF_GET_FVAR_4D - error while reading variable:', &
4591 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
4593 20
FORMAT (/,
' NETCDF_GET_FVAR_4D - error while inquiring ID for ', &
4594 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4595 &
'call from:',2x,a,/,22x,a)
4601 & ncid, start, total)
4636 integer,
intent(in) :: ng, model
4638 integer,
intent(in),
optional :: ncid
4639 integer,
intent(in),
optional :: start(:)
4640 integer,
intent(in),
optional :: total(:)
4642 character (len=*),
intent(in) :: ncname
4643 character (len=*),
intent(in) :: myVarName
4645 logical,
intent(out) :: A
4649 integer :: my_ncid, my_type, status, varid
4652 integer,
dimension(1) :: my_AI
4654#if !defined PARALLEL_IO && defined DISTRIBUTE
4655 integer,
dimension(2) :: ibuffer
4658 character (len=1) :: Achar
4660 character (len=*),
parameter :: MyFile = &
4661 & __FILE__//
", netcdf_get_lvar_0d"
4669 IF (.not.
PRESENT(ncid))
THEN
4670 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
4679 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
4680 IF (status.eq.nf90_noerr)
THEN
4681 status=nf90_inquire_variable(my_ncid, varid, &
4683 IF (status.eq.nf90_noerr)
THEN
4684 IF (my_type.eq.nf90_int)
THEN
4685 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4686 status=nf90_get_var(my_ncid, varid, my_ai, start, total)
4689 status=nf90_get_var(my_ncid, varid, ai)
4691 IF (status.eq.nf90_noerr)
THEN
4698 ELSE IF (my_type.eq.nf90_char)
THEN
4699 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4700 status=nf90_get_var(my_ncid, varid, achar, start, total)
4702 status=nf90_get_var(my_ncid, varid, achar)
4704 IF (status.eq.nf90_noerr)
THEN
4706 IF ((achar.eq.
't').or.(achar.eq.
'T'))
THEN
4711 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
4712 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
4718 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
4724 WRITE (
stdout,30) trim(myvarname), trim(ncname), &
4731#if !defined PARALLEL_IO && defined DISTRIBUTE
4747 IF (.not.
PRESENT(ncid))
THEN
4748 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
4751 10
FORMAT (/,
' NETCDF_GET_LVAR_0D - error while reading variable:', &
4752 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
4754 20
FORMAT (/,
' NETCDF_GET_LVAR_0D - error while inquiring type for ',&
4755 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4756 &
'call from:',2x,a,/,22x,a)
4757 30
FORMAT (/,
' NETCDF_GET_LVAR_0D - error while inquiring ID for ', &
4758 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4759 &
'call from:',2x,a,/,22x,a)
4765 & ncid, start, total)
4801 integer,
intent(in) :: ng, model
4803 integer,
intent(in),
optional :: ncid
4804 integer,
intent(in),
optional :: start(:)
4805 integer,
intent(in),
optional :: total(:)
4807 character (len=*),
intent(in) :: ncname
4808 character (len=*),
intent(in) :: myVarName
4810 logical,
intent(out) :: A(:)
4814 integer :: i, my_ncid, my_type, status, varid
4816 integer,
dimension(SIZE(A,1)) :: AI
4818#if !defined PARALLEL_IO && defined DISTRIBUTE
4819 integer,
dimension(2) :: ibuffer
4822 character (len=1),
dimension(SIZE(A,1)) :: Achar
4824 character (len=*),
parameter :: MyFile = &
4825 & __FILE__//
", netcdf_get_lvar_1d"
4833 IF (.not.
PRESENT(ncid))
THEN
4834 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
4843 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
4844 IF (status.eq.nf90_noerr)
THEN
4845 status=nf90_inquire_variable(my_ncid, varid, &
4847 IF (status.eq.nf90_noerr)
THEN
4848 IF (my_type.eq.nf90_int)
THEN
4849 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4850 status=nf90_get_var(my_ncid, varid, ai, start, total)
4852 status=nf90_get_var(my_ncid, varid, ai)
4854 IF (status.eq.nf90_noerr)
THEN
4856 IF (ai(i).eq.0)
THEN
4863 ELSE IF (my_type.eq.nf90_char)
THEN
4864 IF (
PRESENT(start).and.
PRESENT(total))
THEN
4865 status=nf90_get_var(my_ncid, varid, achar, start, total)
4867 status=nf90_get_var(my_ncid, varid, achar)
4869 IF (status.eq.nf90_noerr)
THEN
4872 IF ((achar(i).eq.
't').or.(achar(i).eq.
'T'))
THEN
4878 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
4879 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
4885 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
4891 WRITE (
stdout,30) trim(myvarname), trim(ncname), &
4898#if !defined PARALLEL_IO && defined DISTRIBUTE
4914 IF (.not.
PRESENT(ncid))
THEN
4915 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
4918 10
FORMAT (/,
' NETCDF_GET_LVAR_1D - error while reading variable:', &
4919 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
4921 20
FORMAT (/,
' NETCDF_GET_LVAR_1D - error while inquiring type for ',&
4922 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4923 &
'call from:',2x,a,/,22x,a)
4924 30
FORMAT (/,
' NETCDF_GET_LVAR_1D - error while inquiring ID for ', &
4925 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
4926 &
'call from:',2x,a,/,22x,a)
4932 & ncid, start, total)
4965 integer,
intent(in) :: ng, model
4967 integer,
intent(in),
optional :: ncid
4968 integer,
intent(in),
optional :: start(:)
4969 integer,
intent(in),
optional :: total(:)
4971 character (len=*),
intent(in) :: ncname
4972 character (len=*),
intent(in) :: myVarName
4974 integer,
intent(out) :: A
4978 integer :: my_ncid, status, varid
4980 integer,
dimension(1) :: my_A
4982#if !defined PARALLEL_IO && defined DISTRIBUTE
4983 integer,
dimension(2) :: ibuffer
4986 character (len=*),
parameter :: MyFile = &
4987 & __FILE__//
", netcdf_get_ivar_0d"
4995 IF (.not.
PRESENT(ncid))
THEN
4996 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5005 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5006 IF (status.eq.nf90_noerr)
THEN
5007 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5008 status=nf90_get_var(my_ncid, varid, my_a, start, total)
5011 status=nf90_get_var(my_ncid, varid, a)
5013 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5014 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5020 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5027#if !defined PARALLEL_IO && defined DISTRIBUTE
5043 IF (.not.
PRESENT(ncid))
THEN
5044 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5047 10
FORMAT (/,
' NETCDF_GET_IVAR_0D - error while reading variable:', &
5048 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5050 20
FORMAT (/,
' NETCDF_GET_IVAR_0D - error while inquiring ID for ', &
5051 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5052 &
'call from:',2x,a,/,22x,a)
5058 & ncid, start, total)
5092 integer,
intent(in) :: ng, model
5094 integer,
intent(in),
optional :: ncid
5095 integer,
intent(in),
optional :: start(:)
5096 integer,
intent(in),
optional :: total(:)
5098 character (len=*),
intent(in) :: ncname
5099 character (len=*),
intent(in) :: myVarName
5101 integer,
intent(out) :: A(:)
5105 integer :: my_ncid, status, varid
5107#if !defined PARALLEL_IO && defined DISTRIBUTE
5108 integer,
dimension(2) :: ibuffer
5111 character (len=*),
parameter :: MyFile = &
5112 & __FILE__//
", netcdf_get_ivar_1d"
5120 IF (.not.
PRESENT(ncid))
THEN
5121 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5130 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5131 IF (status.eq.nf90_noerr)
THEN
5132 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5133 status=nf90_get_var(my_ncid, varid, a, start, total)
5135 status=nf90_get_var(my_ncid, varid, a)
5137 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5138 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5144 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5151#if !defined PARALLEL_IO && defined DISTRIBUTE
5167 IF (.not.
PRESENT(ncid))
THEN
5168 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5171 10
FORMAT (/,
' NETCDF_GET_IVAR_1D - error while reading variable:', &
5172 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5174 20
FORMAT (/,
' NETCDF_GET_IVAR_1D - error while inquiring ID for ', &
5175 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5176 &
'call from:',2x,a,/22x,a)
5182 & ncid, start, total)
5217 integer,
intent(in) :: ng, model
5219 integer,
intent(in),
optional :: ncid
5220 integer,
intent(in),
optional :: start(:)
5221 integer,
intent(in),
optional :: total(:)
5223 character (len=*),
intent(in) :: ncname
5224 character (len=*),
intent(in) :: myVarName
5226 integer,
intent(out) :: A(:,:)
5230 integer :: my_ncid, status, varid
5232#if !defined PARALLEL_IO && defined DISTRIBUTE
5233 integer,
dimension(2) :: ibuffer
5236 character (len=*),
parameter :: MyFile = &
5237 & __FILE__//
", netcdf_get_ivar_2d"
5245 IF (.not.
PRESENT(ncid))
THEN
5246 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5255 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5256 IF (status.eq.nf90_noerr)
THEN
5257 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5258 status=nf90_get_var(my_ncid, varid, a, start, total)
5260 status=nf90_get_var(my_ncid, varid, a)
5262 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5263 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5269 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5276#if !defined PARALLEL_IO && defined DISTRIBUTE
5292 IF (.not.
PRESENT(ncid))
THEN
5293 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5296 10
FORMAT (/,
' NETCDF_GET_IVAR_2D - error while reading variable:', &
5297 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5299 20
FORMAT (/,
' NETCDF_GET_IVAR_2D - error while inquiring ID for ', &
5300 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5301 &
'call from:',2x,a,/,22x,a)
5307 & ncid, start, total)
5350 integer,
intent(in) :: ng, model
5352 integer,
intent(in),
optional :: ncid
5353 integer,
intent(in),
optional :: start(:)
5354 integer,
intent(in),
optional :: total(:)
5356 character (len=*),
intent(in) :: ncname
5357 character (len=*),
intent(in) :: myVarName
5359 character (len=*),
intent(out) :: A
5363 integer :: my_ncid, status, varid
5365#if !defined PARALLEL_IO && defined DISTRIBUTE
5366 integer,
dimension(2) :: ibuffer
5369 character (len=LEN(A)),
dimension(1) :: my_A
5371 character (len=*),
parameter :: MyFile = &
5372 & __FILE__//
", netcdf_get_svar_0d"
5380 IF (.not.
PRESENT(ncid))
THEN
5381 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5390 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5391 IF (status.eq.nf90_noerr)
THEN
5392 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5393 status=nf90_get_var(my_ncid, varid, my_a, start, total)
5396 status=nf90_get_var(my_ncid, varid, a)
5398 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5399 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5405 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5412#if !defined PARALLEL_IO && defined DISTRIBUTE
5428 IF (.not.
PRESENT(ncid))
THEN
5429 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5432 10
FORMAT (/,
' NETCDF_GET_SVAR_0D - error while reading variable:', &
5433 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5435 20
FORMAT (/,
' NETCDF_GET_SVAR_0D - error while inquiring ID for ', &
5436 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5437 &
'call from:',2x,a,/,22x,a)
5443 & ncid, start, total)
5482 integer,
intent(in) :: ng, model
5484 integer,
intent(in),
optional :: ncid
5485 integer,
intent(in),
optional :: start(:)
5486 integer,
intent(in),
optional :: total(:)
5488 character (len=*),
intent(in) :: ncname
5489 character (len=*),
intent(in) :: myVarName
5491 character (len=*),
intent(out) :: A(:)
5495 integer :: my_ncid, status, varid
5497#if !defined PARALLEL_IO && defined DISTRIBUTE
5498 integer,
dimension(2) :: ibuffer
5501 character (len=*),
parameter :: MyFile = &
5502 & __FILE__//
", netcdf_get_svar_1d"
5510 IF (.not.
PRESENT(ncid))
THEN
5511 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5520 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5521 IF (status.eq.nf90_noerr)
THEN
5522 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5523 status=nf90_get_var(my_ncid, varid, a, start, total)
5525 status=nf90_get_var(my_ncid, varid, a)
5527 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5528 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5534 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5541#if !defined PARALLEL_IO && defined DISTRIBUTE
5557 IF (.not.
PRESENT(ncid))
THEN
5558 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5561 10
FORMAT (/,
' NETCDF_GET_SVAR_1D - error while reading variable:', &
5562 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5564 20
FORMAT (/,
' NETCDF_GET_SVAR_1D - error while inquiring ID for ', &
5565 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5566 &
'call from:',2x,a,/,22x,a)
5572 & ncid, start, total)
5611 integer,
intent(in) :: ng, model
5613 integer,
intent(in),
optional :: ncid
5614 integer,
intent(in),
optional :: start(:)
5615 integer,
intent(in),
optional :: total(:)
5617 character (len=*),
intent(in) :: ncname
5618 character (len=*),
intent(in) :: myVarName
5620 character (len=*),
intent(out) :: A(:,:)
5624 integer :: my_ncid, status, varid
5626#if !defined PARALLEL_IO && defined DISTRIBUTE
5627 integer,
dimension(2) :: ibuffer
5630 character (len=*),
parameter :: MyFile = &
5631 & __FILE__//
", netcdf_get_svar_2d"
5639 IF (.not.
PRESENT(ncid))
THEN
5640 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5649 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5650 IF (status.eq.nf90_noerr)
THEN
5651 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5652 status=nf90_get_var(my_ncid, varid, a, start, total)
5654 status=nf90_get_var(my_ncid, varid, a)
5656 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5657 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5663 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5670#if !defined PARALLEL_IO && defined DISTRIBUTE
5686 IF (.not.
PRESENT(ncid))
THEN
5687 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5690 10
FORMAT (/,
' NETCDF_GET_SVAR_2D - error while reading variable:', &
5691 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5693 20
FORMAT (/,
' NETCDF_GET_SVAR_2D - error while inquiring ID for ', &
5694 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5695 &
'call from:',2x,a,/,22x,a)
5701 & ncid, start, total)
5740 integer,
intent(in) :: ng, model
5742 integer,
intent(in),
optional :: ncid
5743 integer,
intent(in),
optional :: start(:)
5744 integer,
intent(in),
optional :: total(:)
5746 character (len=*),
intent(in) :: ncname
5747 character (len=*),
intent(in) :: myVarName
5749 character (len=*),
intent(out) :: A(:,:,:)
5753 integer :: my_ncid, status, varid
5755#if !defined PARALLEL_IO && defined DISTRIBUTE
5756 integer,
dimension(2) :: ibuffer
5759 character (len=*),
parameter :: MyFile = &
5760 & __FILE__//
", netcdf_get_svar_3d"
5768 IF (.not.
PRESENT(ncid))
THEN
5769 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5778 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5779 IF (status.eq.nf90_noerr)
THEN
5780 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5781 status=nf90_get_var(my_ncid, varid, a, start, total)
5783 status=nf90_get_var(my_ncid, varid, a)
5785 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
5786 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5792 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5799#if !defined PARALLEL_IO && defined DISTRIBUTE
5815 IF (.not.
PRESENT(ncid))
THEN
5816 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
5819 10
FORMAT (/,
' NETCDF_GET_SVAR_3D - error while reading variable:', &
5820 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
5822 20
FORMAT (/,
' NETCDF_GET_SVAR_3D - error while inquiring ID for ', &
5823 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
5824 &
'call from:',2x,a,/,22x,a)
5831 & ncid, start, total, &
5876 integer,
intent(in) :: ng, model
5878 integer,
intent(in),
optional :: ncid
5879 integer,
intent(in),
optional :: start(:)
5880 integer,
intent(in),
optional :: total(:)
5882 character (len=*),
intent(in) :: ncname
5883 character (len=*),
intent(in) :: myVarName
5885 real(dp),
intent(in) :: Rdate(2)
5887 real(dp),
intent(out),
optional :: min_val
5888 real(dp),
intent(out),
optional :: max_val
5890 real(dp),
intent(out) :: A
5894 logical :: JulianOffset = .false.
5895 logical :: Ldebug = .false.
5897 logical,
dimension(1) :: got_units
5898 logical,
dimension(2) :: foundit
5900 integer :: ind, lstr, my_ncid, status, varid
5901 integer :: year, month, day, hour, minutes
5903#if !defined PARALLEL_IO && defined DISTRIBUTE
5904 integer,
dimension(2) :: ibuffer
5906 real(dp) :: Afactor, Aoffset, my_Rdate(2), seconds
5907 real(dp) :: dnum_old, dnum_new, scale
5909 real(dp),
dimension(1) :: my_A
5910 real(r8),
dimension(2) :: AttValue
5912 character (len=12) :: AttName(2)
5913 character (len=22) :: dstr_old, dstr_new
5914 character (len=40) :: UnitsAtt(1), UnitsValue(1)
5915 character (len=40) :: Units, Ustring
5917 character (len=*),
parameter :: MyFile = &
5918 & __FILE__//
", netcdf_get_time_0d"
5926 IF (.not.
PRESENT(ncid))
THEN
5927 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
5936 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
5937 IF (status.eq.nf90_noerr)
THEN
5938 IF (
PRESENT(start).and.
PRESENT(total))
THEN
5939 status=nf90_get_var(my_ncid, varid, my_a, start, total)
5942 status=nf90_get_var(my_ncid, varid, a)
5944 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
5945 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
5951 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
5958#if !defined PARALLEL_IO && defined DISTRIBUTE
5985 attname(1)=
'scale_factor'
5986 attname(2)=
'add_offset '
5989 & attvalue, foundit, &
5993 IF (.not.foundit(1))
THEN
5996 afactor=real(attvalue(1),dp)
5999 IF (.not.foundit(2))
THEN
6002 aoffset=real(attvalue(2),dp)
6005 IF (foundit(1))
THEN
6009 IF (foundit(2))
THEN
6011 IF (
time_ref.eq.-2) julianoffset=.true.
6022 & unitsvalue, got_units, &
6026 IF (got_units(1))
THEN
6028 lstr=len_trim(units)
6029 ind=index(units,
'since')
6031 CALL time_units (trim(units), year, month, day, hour, &
6033 CALL datenum (my_rdate, year, month, day, hour, minutes, &
6035 IF (rdate(1).ne.my_rdate(1))
THEN
6036 ustring=units(1:ind-2)
6037 SELECT CASE (trim(ustring))
6038 CASE (
'second',
'seconds')
6040 IF (julianoffset)
THEN
6043 dnum_old=my_rdate(2)+a
6045 CALL datestr (dnum_old, .false., dstr_old)
6047 IF (julianoffset)
THEN
6050 a=(my_rdate(2)+a)-rdate(2)
6054 CALL datestr (dnum_new, .false., dstr_new)
6056 CASE (
'hour',
'hours')
6059 IF (julianoffset)
THEN
6062 dnum_old=my_rdate(2)+a*scale
6064 CALL datestr (dnum_old, .false., dstr_old)
6067 IF (julianoffset)
THEN
6070 a=(my_rdate(1)*scale+a)-rdate(1)*scale
6074 dnum_new=rdate(2)+a*scale
6075 CALL datestr (dnum_new, .false., dstr_new)
6077 CASE (
'day',
'days')
6079 IF (julianoffset)
THEN
6082 dnum_old=my_rdate(1)+a
6084 CALL datestr (dnum_old, .true., dstr_old)
6086 IF (julianoffset)
THEN
6089 a=(my_rdate(1)+a)-rdate(1)
6093 CALL datestr (dnum_new, .true., dstr_new)
6105 IF (
PRESENT(min_val))
THEN
6108 IF (
PRESENT(max_val))
THEN
6114 IF (.not.
PRESENT(ncid))
THEN
6115 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6118 10
FORMAT (/,
' NETCDF_GET_TIME_0D - error while reading variable:', &
6119 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
6121 20
FORMAT (/,
' NETCDF_GET_TIME_0D - error while inquiring ID for ', &
6122 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
6123 &
'call from:',2x,a,/,22x,a)
6130 & ncid, start, total, &
6176 integer,
intent(in) :: ng, model
6178 integer,
intent(in),
optional :: ncid
6179 integer,
intent(in),
optional :: start(:)
6180 integer,
intent(in),
optional :: total(:)
6182 character (len=*),
intent(in) :: ncname
6183 character (len=*),
intent(in) :: myVarName
6185 real(dp),
intent(in) :: Rdate(2)
6187 real(dp),
intent(out),
optional :: min_val
6188 real(dp),
intent(out),
optional :: max_val
6190 real(dp),
intent(out) :: A(:)
6194 logical :: JulianOffset = .false.
6195 logical :: Ldebug = .false.
6197 logical,
dimension(1) :: got_units
6198 logical,
dimension(2) :: foundit
6200 integer :: i, ind, lstr, my_ncid, status, varid
6201 integer :: year, month, day, hour, minutes
6203 integer,
dimension(1) :: Asize
6204#if !defined PARALLEL_IO && defined DISTRIBUTE
6205 integer,
dimension(2) :: ibuffer
6208 real(dp) :: Afactor, Aoffset, my_Rdate(2), seconds
6209 real(dp) :: dnum_old, dnum_new, scale
6211 real(r8),
dimension(2) :: AttValue
6213 character (len=12) :: AttName(2)
6214 character (len=22) :: dstr_old, dstr_new
6215 character (len=40) :: UnitsAtt(1), UnitsValue(1)
6216 character (len=40) :: Units, Ustring
6218 character (len=*),
parameter :: MyFile = &
6219 & __FILE__//
", netcdf_get_time_1d"
6225 IF (
PRESENT(start).and.
PRESENT(total))
THEN
6228 asize(1)=asize(1)*total(i)
6231 asize(1)=ubound(a, dim=1)
6236 IF (.not.
PRESENT(ncid))
THEN
6237 CALL netcdf_open (ng, model, trim(ncname), 0, my_ncid)
6246 status=nf90_inq_varid(my_ncid, trim(myvarname), varid)
6247 IF (status.eq.nf90_noerr)
THEN
6248 IF (
PRESENT(start).and.
PRESENT(total))
THEN
6249 status=nf90_get_var(my_ncid, varid, a, start, total)
6251 status=nf90_get_var(my_ncid, varid, a)
6253 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
6254 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
6260 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
6267#if !defined PARALLEL_IO && defined DISTRIBUTE
6294 attname(1)=
'scale_factor'
6295 attname(2)=
'add_offset '
6298 & attvalue, foundit, &
6302 IF (.not.foundit(1))
THEN
6305 afactor=real(attvalue(1),dp)
6308 IF (.not.foundit(2))
THEN
6311 aoffset=real(attvalue(2),dp)
6314 IF (foundit(1))
THEN
6320 IF (foundit(2))
THEN
6324 IF (
time_ref.eq.-2) julianoffset=.true.
6334 & unitsvalue, got_units, &
6338 IF (got_units(1))
THEN
6340 lstr=len_trim(units)
6341 ind=index(units,
'since')
6343 CALL time_units (trim(units), year, month, day, hour, &
6345 CALL datenum (my_rdate, year, month, day, hour, minutes, &
6347 IF (rdate(1).ne.my_rdate(1))
THEN
6348 ustring=units(1:ind-2)
6349 SELECT CASE (trim(ustring))
6350 CASE (
'second',
'seconds')
6352 IF (julianoffset)
THEN
6355 dnum_old=my_rdate(2)+a(1)
6357 CALL datestr (dnum_old, .false., dstr_old)
6359 IF (julianoffset)
THEN
6365 a(i)=(my_rdate(2)+a(i))-rdate(2)
6369 dnum_new=rdate(2)+a(1)
6370 CALL datestr (dnum_new, .false., dstr_new)
6372 CASE (
'hour',
'hours')
6375 IF (julianoffset)
THEN
6378 dnum_old=my_rdate(2)+a(1)*scale
6380 CALL datestr (dnum_old, .false., dstr_old)
6383 IF (julianoffset)
THEN
6385 a(i)=a(i)-rdate(1)*scale
6389 a(i)=(my_rdate(1)*scale+a(i))-rdate(1)*scale
6394 dnum_new=rdate(2)+a(1)*scale
6395 CALL datestr (dnum_new, .false., dstr_new)
6397 CASE (
'day',
'days')
6399 IF (julianoffset)
THEN
6402 dnum_old=my_rdate(1)+a(1)
6404 CALL datestr (dnum_old, .true., dstr_old)
6406 IF (julianoffset)
THEN
6412 a(i)=(my_rdate(1)+a(i))-rdate(1)
6416 dnum_new=rdate(1)+a(1)
6417 CALL datestr (dnum_new, .true., dstr_new)
6427 IF (
PRESENT(min_val))
THEN
6430 IF (
PRESENT(max_val))
THEN
6436 IF (.not.
PRESENT(ncid))
THEN
6437 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6440 10
FORMAT (/,
' NETCDF_GET_TIME_1D - error while reading variable:', &
6441 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
6443 20
FORMAT (/,
' NETCDF_GET_TIME_1D - error while inquiring ID for ', &
6444 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
6445 &
'call from:',2x,a,/,22x,a)
6450#ifdef SINGLE_PRECISION
6453 & start, total, ncid, varid)
6486 integer,
intent(in) :: ng, model
6488 integer,
intent(in) :: start(:), total(:)
6490 integer,
intent(in),
optional :: ncid, varid
6492 real(dp),
intent(in) :: A
6494 character (len=*),
intent(in) :: ncname
6495 character (len=*),
intent(in) :: myVarName
6499 integer :: my_ncid, my_varid, status
6501# if !defined PARALLEL_IO && defined DISTRIBUTE
6502 integer,
dimension(2) :: ibuffer
6505 real(dp),
dimension(1) :: my_A
6507 character (len=*),
parameter :: MyFile = &
6508 & __FILE__//
", netcdf_put_fvar_0dp"
6516 IF (.not.
PRESENT(ncid))
THEN
6517 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
6526 IF (.not.
PRESENT(varid))
THEN
6527 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
6528 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6529 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
6541 IF ((start(1).eq.0).and.(total(1).eq.0))
THEN
6542 status=nf90_put_var(my_ncid, my_varid, a)
6545 status=nf90_put_var(my_ncid, my_varid, my_a, start, total)
6547 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6548 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
6556# if !defined PARALLEL_IO && defined DISTRIBUTE
6569 IF (.not.
PRESENT(ncid))
THEN
6570 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6573 10
FORMAT (/,
' NETCDF_PUT_FVAR_0DP - error while inquiring ID for ', &
6574 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
6575 &
'call from:',2x,a,/,23x,a)
6576 20
FORMAT (/,
' NETCDF_PUT_FVAR_0DP - error while writing variable:', &
6577 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
6584 & start, total, ncid, varid)
6617 integer,
intent(in) :: ng, model
6619 integer,
intent(in) :: start(:), total(:)
6621 integer,
intent(in),
optional :: ncid, varid
6623 real(dp),
intent(in) :: A(:)
6625 character (len=*),
intent(in) :: ncname
6626 character (len=*),
intent(in) :: myVarName
6630 integer :: my_ncid, my_varid, status
6632# if !defined PARALLEL_IO && defined DISTRIBUTE
6633 integer,
dimension(2) :: ibuffer
6636 character (len=*),
parameter :: MyFile = &
6637 & __FILE__//
", netcdf_put_fvar_1dp"
6645 IF (.not.
PRESENT(ncid))
THEN
6646 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
6655 IF (.not.
PRESENT(varid))
THEN
6656 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
6657 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6658 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
6670 status=nf90_put_var(my_ncid, my_varid, a, start, total)
6671 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6672 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
6680# if !defined PARALLEL_IO && defined DISTRIBUTE
6693 IF (.not.
PRESENT(ncid))
THEN
6694 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6697 10
FORMAT (/,
' NETCDF_PUT_FVAR_1DP - error while inquiring ID for ', &
6698 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,23x, &
6699 &
'call from:',2x,a,/,23x,a)
6700 20
FORMAT (/,
' NETCDF_PUT_FVAR_1DP - error while writing variable:', &
6701 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
6708 & start, total, ncid, varid)
6741 integer,
intent(in) :: ng, model
6743 integer,
intent(in) :: start(:), total(:)
6745 integer,
intent(in),
optional :: ncid, varid
6747 real(dp),
intent(in) :: A(:,:)
6749 character (len=*),
intent(in) :: ncname
6750 character (len=*),
intent(in) :: myVarName
6754 integer :: my_ncid, my_varid, status
6756# if !defined PARALLEL_IO && defined DISTRIBUTE
6757 integer,
dimension(2) :: ibuffer
6760 character (len=*),
parameter :: MyFile = &
6761 & __FILE__//
", netcdf_put_fvar_2dp"
6769 IF (.not.
PRESENT(ncid))
THEN
6770 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
6779 IF (.not.
PRESENT(varid))
THEN
6780 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
6781 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6782 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
6794 status=nf90_put_var(my_ncid, my_varid, a, start, total)
6795 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6796 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
6804# if !defined PARALLEL_IO && defined DISTRIBUTE
6817 IF (.not.
PRESENT(ncid))
THEN
6818 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6821 10
FORMAT (/,
' NETCDF_PUT_FVAR_2DP - error while inquiring ID for ', &
6822 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,22x, &
6823 &
'call from:',2x,a,/23x,a)
6824 20
FORMAT (/,
' NETCDF_PUT_FVAR_2DP - error while writing variable:', &
6825 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
6832 & start, total, ncid, varid)
6865 integer,
intent(in) :: ng, model
6867 integer,
intent(in) :: start(:), total(:)
6869 integer,
intent(in),
optional :: ncid, varid
6871 real(dp),
intent(in) :: A(:,:,:)
6873 character (len=*),
intent(in) :: ncname
6874 character (len=*),
intent(in) :: myVarName
6878 integer :: my_ncid, my_varid, status
6880# if !defined PARALLEL_IO && defined DISTRIBUTE
6881 integer,
dimension(2) :: ibuffer
6884 character (len=*),
parameter :: MyFile = &
6885 & __FILE__//
", netcdf_put_fvar_3dp"
6893 IF (.not.
PRESENT(ncid))
THEN
6894 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
6903 IF (.not.
PRESENT(varid))
THEN
6904 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
6905 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6906 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
6918 status=nf90_put_var(my_ncid, my_varid, a, start, total)
6919 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
6920 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
6928# if !defined PARALLEL_IO && defined DISTRIBUTE
6941 IF (.not.
PRESENT(ncid))
THEN
6942 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
6945 10
FORMAT (/,
' NETCDF_PUT_FVAR_3DP - error while inquiring ID for ', &
6946 &
'variable:',2x,a,/,23x,
'in input file:',2x,a,/,22x, &
6947 &
'call from:',2x,a,/,23x,a)
6948 20
FORMAT (/,
' NETCDF_PUT_FVAR_3DP - error while writing variable:', &
6949 & 2x,a,/,23x,
'in input file:',2x,a,/,23x,
'call from:',2x,a, &
6957 & start, total, ncid, varid)
6990 integer,
intent(in) :: ng, model
6992 integer,
intent(in) :: start(:), total(:)
6994 integer,
intent(in),
optional :: ncid, varid
6996 real(r8),
intent(in) :: A
6998 character (len=*),
intent(in) :: ncname
6999 character (len=*),
intent(in) :: myVarName
7003 integer :: my_ncid, my_varid, status
7005#if !defined PARALLEL_IO && defined DISTRIBUTE
7006 integer,
dimension(2) :: ibuffer
7009 real(r8),
dimension(1) :: my_A
7011 character (len=*),
parameter :: MyFile = &
7012 & __FILE__//
", netcdf_put_fvar_0d"
7020 IF (.not.
PRESENT(ncid))
THEN
7021 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7030 IF (.not.
PRESENT(varid))
THEN
7031 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7032 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7033 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7045 IF ((start(1).eq.0).and.(total(1).eq.0))
THEN
7046 status=nf90_put_var(my_ncid, my_varid, a)
7049 status=nf90_put_var(my_ncid, my_varid, my_a, start, total)
7051 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7052 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7060#if !defined PARALLEL_IO && defined DISTRIBUTE
7073 IF (.not.
PRESENT(ncid))
THEN
7074 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7077 10
FORMAT (/,
' NETCDF_PUT_FVAR_0D - error while inquiring ID for ', &
7078 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7079 &
'call from:',2x,a,/,22x,a)
7080 20
FORMAT (/,
' NETCDF_PUT_FVAR_0D - error while writing variable:', &
7081 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7088 & start, total, ncid, varid)
7121 integer,
intent(in) :: ng, model
7123 integer,
intent(in) :: start(:), total(:)
7125 integer,
intent(in),
optional :: ncid, varid
7127 real(r8),
intent(in) :: A(:)
7129 character (len=*),
intent(in) :: ncname
7130 character (len=*),
intent(in) :: myVarName
7134 integer :: my_ncid, my_varid, status
7136#if !defined PARALLEL_IO && defined DISTRIBUTE
7137 integer,
dimension(2) :: ibuffer
7140 character (len=*),
parameter :: MyFile = &
7141 & __FILE__//
", netcdf_put_fvar_1d"
7149 IF (.not.
PRESENT(ncid))
THEN
7150 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7159 IF (.not.
PRESENT(varid))
THEN
7160 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7161 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7162 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7174 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7175 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7176 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7184#if !defined PARALLEL_IO && defined DISTRIBUTE
7197 IF (.not.
PRESENT(ncid))
THEN
7198 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7201 10
FORMAT (/,
' NETCDF_PUT_FVAR_1D - error while inquiring ID for ', &
7202 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7203 &
'call from:',2x,a,/,22x,a)
7204 20
FORMAT (/,
' NETCDF_PUT_FVAR_1D - error while writing variable:', &
7205 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7212 & start, total, ncid, varid)
7245 integer,
intent(in) :: ng, model
7247 integer,
intent(in) :: start(:), total(:)
7249 integer,
intent(in),
optional :: ncid, varid
7251 real(r8),
intent(in) :: A(:,:)
7253 character (len=*),
intent(in) :: ncname
7254 character (len=*),
intent(in) :: myVarName
7258 integer :: my_ncid, my_varid, status
7260#if !defined PARALLEL_IO && defined DISTRIBUTE
7261 integer,
dimension(2) :: ibuffer
7264 character (len=*),
parameter :: MyFile = &
7265 & __FILE__//
", netcdf_put_fvar_2d"
7273 IF (.not.
PRESENT(ncid))
THEN
7274 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7283 IF (.not.
PRESENT(varid))
THEN
7284 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7285 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7286 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7298 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7299 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7300 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7308#if !defined PARALLEL_IO && defined DISTRIBUTE
7321 IF (.not.
PRESENT(ncid))
THEN
7322 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7325 10
FORMAT (/,
' NETCDF_PUT_FVAR_2D - error while inquiring ID for ', &
7326 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7327 &
'call from:',2x,a,/,22x,a)
7328 20
FORMAT (/,
' NETCDF_PUT_FVAR_2D - error while writing variable:', &
7329 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7336 & start, total, ncid, varid)
7369 integer,
intent(in) :: ng, model
7371 integer,
intent(in) :: start(:), total(:)
7373 integer,
intent(in),
optional :: ncid, varid
7375 real(r8),
intent(in) :: A(:,:,:)
7377 character (len=*),
intent(in) :: ncname
7378 character (len=*),
intent(in) :: myVarName
7382 integer :: my_ncid, my_varid, status
7384#if !defined PARALLEL_IO && defined DISTRIBUTE
7385 integer,
dimension(2) :: ibuffer
7388 character (len=*),
parameter :: MyFile = &
7389 & __FILE__//
", netcdf_put_fvar_3d"
7397 IF (.not.
PRESENT(ncid))
THEN
7398 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7407 IF (.not.
PRESENT(varid))
THEN
7408 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7409 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7410 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7422 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7423 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7424 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7432#if !defined PARALLEL_IO && defined DISTRIBUTE
7445 IF (.not.
PRESENT(ncid))
THEN
7446 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7449 10
FORMAT (/,
' NETCDF_PUT_FVAR_3D - error while inquiring ID for ', &
7450 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7451 &
'call from:',2x,a,/,22x,a)
7452 20
FORMAT (/,
' NETCDF_PUT_FVAR_3D - error while writing variable:', &
7453 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7460 & start, total, ncid, varid)
7493 integer,
intent(in) :: ng, model
7495 integer,
intent(in) :: start(:), total(:)
7497 integer,
intent(in),
optional :: ncid, varid
7499 real(r8),
intent(in) :: A(:,:,:,:)
7501 character (len=*),
intent(in) :: ncname
7502 character (len=*),
intent(in) :: myVarName
7506 integer :: my_ncid, my_varid, status
7508#if !defined PARALLEL_IO && defined DISTRIBUTE
7509 integer,
dimension(2) :: ibuffer
7512 character (len=*),
parameter :: MyFile = &
7513 & __FILE__//
", netcdf_put_fvar_4d"
7521 IF (.not.
PRESENT(ncid))
THEN
7522 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7531 IF (.not.
PRESENT(varid))
THEN
7532 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7533 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7534 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7546 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7547 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7548 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7556#if !defined PARALLEL_IO && defined DISTRIBUTE
7569 IF (.not.
PRESENT(ncid))
THEN
7570 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7573 10
FORMAT (/,
' NETCDF_PUT_FVAR_4D - error while inquiring ID for ', &
7574 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7575 &
'call from:',2x,a,/,22x,a)
7576 20
FORMAT (/,
' NETCDF_PUT_FVAR_4D - error while writing variable:', &
7577 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7584 & start, total, ncid, varid)
7617 integer,
intent(in) :: ng, model
7619 integer,
intent(in) :: start(:), total(:)
7621 integer,
intent(in),
optional :: ncid, varid
7623 integer,
intent(in) :: A
7625 character (len=*),
intent(in) :: ncname
7626 character (len=*),
intent(in) :: myVarName
7630 integer :: my_ncid, my_varid, status
7632 integer,
dimension(1) :: my_A
7634#if !defined PARALLEL_IO && defined DISTRIBUTE
7635 integer,
dimension(2) :: ibuffer
7638 character (len=*),
parameter :: MyFile = &
7639 & __FILE__//
", netcdf_put_ivar_0d"
7647 IF (.not.
PRESENT(ncid))
THEN
7648 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7657 IF (.not.
PRESENT(varid))
THEN
7658 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7659 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7660 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7672 IF ((start(1).eq.0).and.(total(1).eq.0))
THEN
7673 status=nf90_put_var(my_ncid, my_varid, a)
7676 status=nf90_put_var(my_ncid, my_varid, my_a, start, total)
7678 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7679 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7687#if !defined PARALLEL_IO && defined DISTRIBUTE
7700 IF (.not.
PRESENT(ncid))
THEN
7701 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7704 10
FORMAT (/,
' NETCDF_PUT_IVAR_0D - error while inquiring ID for ', &
7705 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7706 &
'call from:',2x,a,/,22x,a)
7707 20
FORMAT (/,
' NETCDF_PUT_IVAR_0D - error while writing variable:', &
7708 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7715 & start, total, ncid, varid)
7748 integer,
intent(in) :: ng, model
7750 integer,
intent(in) :: start(:), total(:)
7752 integer,
intent(in),
optional :: ncid, varid
7754 integer,
intent(in) :: A(:)
7756 character (len=*),
intent(in) :: ncname
7757 character (len=*),
intent(in) :: myVarName
7761 integer :: my_ncid, my_varid, status
7763#if !defined PARALLEL_IO && defined DISTRIBUTE
7764 integer,
dimension(2) :: ibuffer
7767 character (len=*),
parameter :: MyFile = &
7768 & __FILE__//
", netcdf_put_ivar_1d"
7776 IF (.not.
PRESENT(ncid))
THEN
7777 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7786 IF (.not.
PRESENT(varid))
THEN
7787 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7788 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7789 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7801 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7802 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7803 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7811#if !defined PARALLEL_IO && defined DISTRIBUTE
7824 IF (.not.
PRESENT(ncid))
THEN
7825 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7828 10
FORMAT (/,
' NETCDF_PUT_IVAR_1D - error while inquiring ID for ', &
7829 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7830 &
'call from:',2x,a,/,22x,a)
7831 20
FORMAT (/,
' NETCDF_PUT_IVAR_1D - error while writing variable:', &
7832 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7839 & start, total, ncid, varid)
7872 integer,
intent(in) :: ng, model
7874 integer,
intent(in) :: start(:), total(:)
7876 integer,
intent(in),
optional :: ncid, varid
7878 integer,
intent(in) :: A(:,:)
7880 character (len=*),
intent(in) :: ncname
7881 character (len=*),
intent(in) :: myVarName
7885 integer :: my_ncid, my_varid, status
7887#if !defined PARALLEL_IO && defined DISTRIBUTE
7888 integer,
dimension(2) :: ibuffer
7891 character (len=*),
parameter :: MyFile = &
7892 & __FILE__//
", netcdf_put_ivar_2d"
7900 IF (.not.
PRESENT(ncid))
THEN
7901 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
7910 IF (.not.
PRESENT(varid))
THEN
7911 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
7912 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7913 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
7925 status=nf90_put_var(my_ncid, my_varid, a, start, total)
7926 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
7927 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
7935#if !defined PARALLEL_IO && defined DISTRIBUTE
7948 IF (.not.
PRESENT(ncid))
THEN
7949 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
7952 10
FORMAT (/,
' NETCDF_PUT_IVAR_2D - error while inquiring ID for ', &
7953 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
7954 &
'call from:',2x,a,/,22x,a)
7955 20
FORMAT (/,
' NETCDF_PUT_IVAR_2D - error while writing variable:', &
7956 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
7963 & start, total, ncid, varid)
7999 integer,
intent(in) :: ng, model
8001 integer,
intent(in) :: start(:), total(:)
8003 integer,
intent(in),
optional :: ncid, varid
8005 logical,
intent(in) :: A
8007 character (len=*),
intent(in) :: ncname
8008 character (len=*),
intent(in) :: myVarName
8012 integer :: my_ncid, my_varid, status
8015 integer,
dimension(1) :: my_AI
8017#if !defined PARALLEL_IO && defined DISTRIBUTE
8018 integer,
dimension(2) :: ibuffer
8021 character (len=*),
parameter :: MyFile = &
8022 & __FILE__//
", netcdf_put_lvar_0d"
8030 IF (.not.
PRESENT(ncid))
THEN
8031 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8040 IF (.not.
PRESENT(varid))
THEN
8041 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8042 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8043 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8064 IF ((start(1).eq.0).and.(total(1).eq.0))
THEN
8065 status=nf90_put_var(my_ncid, my_varid, ai)
8068 status=nf90_put_var(my_ncid, my_varid, my_ai, start, total)
8070 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8071 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8079#if !defined PARALLEL_IO && defined DISTRIBUTE
8092 IF (.not.
PRESENT(ncid))
THEN
8093 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8096 10
FORMAT (/,
' NETCDF_PUT_LVAR_0D - error while inquiring ID for ', &
8097 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8098 &
'call from:',2x,a,/,22x,a)
8099 20
FORMAT (/,
' NETCDF_PUT_LVAR_0D - error while writing variable:', &
8100 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8107 & start, total, ncid, varid)
8143 integer,
intent(in) :: ng, model
8145 integer,
intent(in) :: start(:), total(:)
8147 integer,
intent(in),
optional :: ncid, varid
8149 logical,
intent(in) :: A(:)
8151 character (len=*),
intent(in) :: ncname
8152 character (len=*),
intent(in) :: myVarName
8156 integer :: i, my_ncid, my_varid, status
8158 integer,
dimension(SIZE(A,1)) :: AI
8160#if !defined PARALLEL_IO && defined DISTRIBUTE
8161 integer,
dimension(2) :: ibuffer
8164 character (len=*),
parameter :: MyFile = &
8165 & __FILE__//
", netcdf_put_lvar_1d"
8173 IF (.not.
PRESENT(ncid))
THEN
8174 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8183 IF (.not.
PRESENT(varid))
THEN
8184 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8185 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8186 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8209 status=nf90_put_var(my_ncid, my_varid, ai, start, total)
8210 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8211 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8219#if !defined PARALLEL_IO && defined DISTRIBUTE
8232 IF (.not.
PRESENT(ncid))
THEN
8233 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8236 10
FORMAT (/,
' NETCDF_PUT_LVAR_1D - error while inquiring ID for ', &
8237 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8238 &
'call from:',2x,a,/,22x,a)
8239 20
FORMAT (/,
' NETCDF_PUT_LVAR_1D - error while writing variable:', &
8240 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8247 & start, total, ncid, varid)
8283 integer,
intent(in) :: ng, model
8285 integer,
intent(in) :: start(:), total(:)
8287 integer,
intent(in),
optional :: ncid, varid
8289 logical,
intent(in) :: A(:,:)
8291 character (len=*),
intent(in) :: ncname
8292 character (len=*),
intent(in) :: myVarName
8296 integer :: i, j, my_ncid, my_varid, status
8298 integer,
dimension(SIZE(A,1),SIZE(A,2)) :: AI
8300#if !defined PARALLEL_IO && defined DISTRIBUTE
8301 integer,
dimension(2) :: ibuffer
8304 character (len=*),
parameter :: MyFile = &
8305 & __FILE__//
", netcdf_put_lvar_2d"
8313 IF (.not.
PRESENT(ncid))
THEN
8314 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8323 IF (.not.
PRESENT(varid))
THEN
8324 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8325 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8326 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8351 status=nf90_put_var(my_ncid, my_varid, ai, start, total)
8352 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8353 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8361#if !defined PARALLEL_IO && defined DISTRIBUTE
8374 IF (.not.
PRESENT(ncid))
THEN
8375 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8378 10
FORMAT (/,
' NETCDF_PUT_LVAR_2D - error while inquiring ID for ', &
8379 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8380 &
'call from:',2x,a,/,22x,a)
8381 20
FORMAT (/,
' NETCDF_PUT_LVAR_2D - error while writing variable:', &
8382 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8389 & start, total, ncid, varid)
8431 integer,
intent(in) :: ng, model
8433 integer,
intent(in) :: start(:), total(:)
8435 integer,
intent(in),
optional :: ncid, varid
8437 character (len=*),
intent(in) :: A
8438 character (len=*),
intent(in) :: ncname
8439 character (len=*),
intent(in) :: myVarName
8443 integer :: my_ncid, my_varid, status
8445#if !defined PARALLEL_IO && defined DISTRIBUTE
8446 integer,
dimension(2) :: ibuffer
8449 character (len=LEN(A)),
dimension(1) :: my_A
8451 character (len=*),
parameter :: MyFile = &
8452 & __FILE__//
", netcdf_put_svar_0d"
8460 IF (.not.
PRESENT(ncid))
THEN
8461 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8470 IF (.not.
PRESENT(varid))
THEN
8471 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8472 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8473 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8485 IF ((start(1).eq.1).and.(total(1).eq.1))
THEN
8486 status=nf90_put_var(my_ncid, my_varid, a)
8489 status=nf90_put_var(my_ncid, my_varid, my_a, start, total)
8491 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8492 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8500#if !defined PARALLEL_IO && defined DISTRIBUTE
8513 IF (.not.
PRESENT(ncid))
THEN
8514 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8517 10
FORMAT (/,
' NETCDF_PUT_SVAR_0D - error while inquiring ID for ', &
8518 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8519 &
'call from:',2x,a,/,22x,a)
8520 20
FORMAT (/,
' NETCDF_PUT_SVAR_0D - error while writing variable:', &
8521 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8528 & start, total, ncid, varid)
8571 integer,
intent(in) :: ng, model
8573 integer,
intent(in) :: start(:), total(:)
8575 integer,
intent(in),
optional :: ncid, varid
8577 character (len=*),
intent(in) :: A(:)
8579 character (len=*),
intent(in) :: ncname
8580 character (len=*),
intent(in) :: myVarName
8584 integer :: my_ncid, my_varid, status
8586#if !defined PARALLEL_IO && defined DISTRIBUTE
8587 integer,
dimension(2) :: ibuffer
8590 character (len=*),
parameter :: MyFile = &
8591 & __FILE__//
", netcdf_put_svar_1d"
8599 IF (.not.
PRESENT(ncid))
THEN
8600 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8609 IF (.not.
PRESENT(varid))
THEN
8610 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8611 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8612 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8624 status=nf90_put_var(my_ncid, my_varid, a, start, total)
8625 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8626 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8634#if !defined PARALLEL_IO && defined DISTRIBUTE
8647 IF (.not.
PRESENT(ncid))
THEN
8648 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8651 10
FORMAT (/,
' NETCDF_PUT_SVAR_1D - error while inquiring ID for ', &
8652 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8653 &
'call from:',2x,a,/,22x,a)
8654 20
FORMAT (/,
' NETCDF_PUT_SVAR_1D - error while writing variable:', &
8655 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8662 & start, total, ncid, varid)
8705 integer,
intent(in) :: ng, model
8707 integer,
intent(in) :: start(:), total(:)
8709 integer,
intent(in),
optional :: ncid, varid
8711 character (len=*),
intent(in) :: A(:,:)
8713 character (len=*),
intent(in) :: ncname
8714 character (len=*),
intent(in) :: myVarName
8718 integer :: my_ncid, my_varid, status
8720#if !defined PARALLEL_IO && defined DISTRIBUTE
8721 integer,
dimension(2) :: ibuffer
8724 character (len=*),
parameter :: MyFile = &
8725 & __FILE__//
", netcdf_put_svar_2d"
8733 IF (.not.
PRESENT(ncid))
THEN
8734 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8743 IF (.not.
PRESENT(varid))
THEN
8744 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8745 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8746 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8758 status=nf90_put_var(my_ncid, my_varid, a, start, total)
8759 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8760 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8768#if !defined PARALLEL_IO && defined DISTRIBUTE
8781 IF (.not.
PRESENT(ncid))
THEN
8782 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8785 10
FORMAT (/,
' NETCDF_PUT_SVAR_2D - error while inquiring ID for ', &
8786 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8787 &
'call from:',2x,a,/,22x,a)
8788 20
FORMAT (/,
' NETCDF_PUT_SVAR_2D - error while writing variable:', &
8789 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8796 & start, total, ncid, varid)
8839 integer,
intent(in) :: ng, model
8841 integer,
intent(in) :: start(:), total(:)
8843 integer,
intent(in),
optional :: ncid, varid
8845 character (len=*),
intent(in) :: A(:,:,:)
8847 character (len=*),
intent(in) :: ncname
8848 character (len=*),
intent(in) :: myVarName
8852 integer :: my_ncid, my_varid, status
8854#if !defined PARALLEL_IO && defined DISTRIBUTE
8855 integer,
dimension(2) :: ibuffer
8858 character (len=*),
parameter :: MyFile = &
8859 & __FILE__//
", netcdf_put_svar_3d"
8867 IF (.not.
PRESENT(ncid))
THEN
8868 CALL netcdf_open (ng, model, trim(ncname), 1, my_ncid)
8877 IF (.not.
PRESENT(varid))
THEN
8878 status=nf90_inq_varid(my_ncid, trim(myvarname), my_varid)
8879 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8880 WRITE (
stdout,10) trim(myvarname), trim(ncname), &
8892 status=nf90_put_var(my_ncid, my_varid, a, start, total)
8893 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
8894 WRITE (
stdout,20) trim(myvarname), trim(ncname), &
8902#if !defined PARALLEL_IO && defined DISTRIBUTE
8915 IF (.not.
PRESENT(ncid))
THEN
8916 CALL netcdf_close (ng, model, my_ncid, ncname, .false.)
8919 10
FORMAT (/,
' NETCDF_PUT_SVAR_3D - error while inquiring ID for ', &
8920 &
'variable:',2x,a,/,22x,
'in input file:',2x,a,/,22x, &
8921 &
'call from:',2x,a,/,22x,a)
8922 20
FORMAT (/,
' NETCDF_PUT_SVAR_3D - error while writing variable:', &
8923 & 2x,a,/,22x,
'in input file:',2x,a,/,22x,
'call from:',2x,a, &
8949 integer,
intent(in) :: ng, model
8951 integer,
intent(inout) :: ncid
8953 logical,
intent(in),
optional :: lupdate
8955 character (len=*),
intent(in),
optional :: ncname
8960 logical :: my_lupdate
8963 integer :: i, status
8965 integer :: is, ie, lstr
8967#if !defined PARALLEL_IO && defined DISTRIBUTE
8968 integer,
dimension(3) :: ibuffer
8971 character (len=200) :: my_ncname
8973 character (len=512) :: bio_file
8976 character (len=*),
parameter :: myfile = &
8977 & __FILE__//
", netcdf_close"
8984 DO i=1,len(my_ncname)
8988 IF (.not.
PRESENT(ncname))
THEN
8994 status=nf90_get_att(ncid, nf90_global,
'file', my_ncname)
8996 my_ncname=trim(ncname)
9006 IF (.not.
PRESENT(lupdate))
THEN
9014 IF (my_lupdate)
THEN
9020 lstr=len_trim(bioname(i))
9023 bio_file(is:ie)=trim(bioname(i))
9029 lstr=len_trim(bio_file)-1
9031 status=nf90_put_att(ncid, nf90_global,
'bio_file', &
9033 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9034 WRITE (
stdout,10)
'bio_file', trim(my_ncname), &
9036 & nf90_strerror(status)
9048 status=nf90_close(ncid)
9049 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9051 & nf90_strerror(status)
9055 IF (ldebug_ncid)
THEN
9056 WRITE (
dbout,
'(a,1x," <= ",i8,2(2x,a))') &
9065#if !defined PARALLEL_IO && defined DISTRIBUTE
9078 10
FORMAT (/,
' NETCDF_CLOSE - error while writing global ', &
9079 &
'attribute:',2x,a,/,16x,
'file:',2x,a,/,16x, &
9080 &
'call from:',2x,a,/,16x,a)
9081 20
FORMAT (/,
' NETCDF_CLOSE - error during closing of file, ', &
9082 &
'ncid = ',i3,/,16x,
'file:',2x,a,/,16x,
'call from:',2x,a, &
9110 integer,
intent(in) :: ng, model
9112 integer,
intent(out) :: ncid
9114 character (len=*),
intent(in) :: ncname
9118 integer :: my_cmode, status
9119 integer :: oldfillmode
9120#if !defined PARALLEL_IO && defined DISTRIBUTE
9121 integer :: ibuffer(3)
9124 character (len=*),
parameter :: myfile = &
9125 & __FILE__//
", netcdf_create"
9131#if defined PARALLEL_IO && defined DISTRIBUTE
9138 my_cmode=ior(
cmode, nf90_mpiio)
9139 my_cmode=ior(my_cmode, nf90_clobber)
9140 status=nf90_create(path = trim(ncname), &
9141 &
cmode = my_cmode, &
9145 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9147 & nf90_strerror(status)
9155 status=nf90_set_fill(ncid, nf90_nofill, oldfillmode)
9156 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9158 & nf90_strerror(status)
9164 my_cmode=ior(nf90_clobber,
cmode)
9165# if defined DISTRIBUTE && !defined HDF5 && \
9166 (defined concurrent_kernel || defined disjointed)
9167 my_cmode=ior(my_cmode, nf90_share)
9170 status=nf90_create(trim(ncname), my_cmode, ncid)
9171 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9173 & nf90_strerror(status)
9177 IF (ldebug_ncid)
THEN
9178 WRITE (
dbout,
'(a," ** ",i8,2(2x,a))') &
9187 status=nf90_set_fill(ncid, nf90_nofill, oldfillmode)
9188 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9191 & nf90_strerror(status)
9208 10
FORMAT (/,
' NETCDF_CREATE - unable to create output NetCDF ', &
9209#if defined PARALLEL_IO && defined DISTRIBUTE
9210 &
'parallel I/O file:',/,17x,a,/,17x,
'call from:',2x,a, &
9213 &
'file:',/,17x,a,/,17x,
'call from:',2x,a,/,17x,a)
9242 integer,
intent(in) :: ng, model, ncid
9244 character (len=*),
intent(in) :: ncname
9250#if !defined PARALLEL_IO && defined DISTRIBUTE
9251 integer :: ibuffer(2)
9254 character (len=*),
parameter :: myfile = &
9255 & __FILE__//
", netcdf_enddef"
9261#if defined PARALLEL_IO && defined DISTRIBUTE
9268 status=nf90_enddef(ncid)
9269 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9271 & nf90_strerror(status)
9285 10
FORMAT (/,
' NETCDF_ENDDEF - unable to end definition mode for', &
9286 &
' file:',/,17x,a,/,17x,
'call from:',2x,a,/,17x,a)
9317 integer,
intent(in) :: ng, model, omode
9319 integer,
intent(out) :: ncid
9321 character (len=*),
intent(in) :: ncname
9325 integer :: my_omode, status
9327#if !defined PARALLEL_IO && defined DISTRIBUTE
9328 integer :: ibuffer(3)
9331 character (len=*),
parameter :: myfile = &
9332 & __FILE__//
", netcdf_open"
9338#if defined PARALLEL_IO && defined DISTRIBUTE
9341# ifdef NF_OPEN_SERIAL
9342 status=nf90_open(trim(ncname), nf90_nowrite, ncid)
9344 status=nf90_open(path = trim(ncname), &
9345 & mode = ior(nf90_nowrite, nf90_mpiio), &
9351# ifdef NF_OPEN_SERIAL
9352 status=nf90_open(trim(ncname), nf90_write, ncid)
9354 status=nf90_open(path = trim(ncname), &
9355 & mode = ior(nf90_write, nf90_mpiio), &
9361# ifdef NF_OPEN_SERIAL
9362 status=nf90_open(trim(ncname), nf90_nowrite, ncid)
9364 status=nf90_open(path = trim(ncname), &
9365 & mode = ior(nf90_nowrite, nf90_mpiio), &
9371 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9373 & nf90_strerror(status)
9381 my_omode=nf90_nowrite
9382# if defined DISTRIBUTE && !defined HDF5 && \
9383 (defined concurrent_kernel || defined disjointed)
9384 my_omode=ior(my_omode, nf90_share)
9386 status=nf90_open(trim(ncname), my_omode, ncid)
9389# if defined DISTRIBUTE && !defined HDF5 && \
9390 (defined concurrent_kernel || defined disjointed)
9391 my_omode=ior(my_omode, nf90_share)
9393 status=nf90_open(trim(ncname), my_omode, ncid)
9395 my_omode=nf90_nowrite
9396# if defined DISTRIBUTE && !defined HDF5 && \
9397 (defined concurrent_kernel || defined disjointed)
9398 my_omode=ior(my_omode, nf90_share)
9400 status=nf90_open(trim(ncname), my_omode, ncid)
9402 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9404 & nf90_strerror(status)
9408 IF (ldebug_ncid)
THEN
9409 WRITE (
dbout,
'(a,2x," => ",i8,2(2x,a))') &
9428 10
FORMAT (/,
' NETCDF_OPEN - unable to open existing NetCDF ', &
9429#if defined PARALLEL_IO && defined DISTRIBUTE
9430 &
'file for parallel access:',/,15x,a,/,15x, &
9431 &
'call from:',2x,a,/,15x,a)
9433 &
'file:',/,15x,a,/,15x,
'call from:',2x,a,/,15x,a)
9461 integer,
intent(in) :: ng, model, ncid
9463 character (len=*),
intent(in) :: ncname
9469#if !defined PARALLEL_IO && defined DISTRIBUTE
9470 integer :: ibuffer(2)
9473 character (len=*),
parameter :: myfile = &
9474 & __FILE__//
", netcdf_redef"
9481 status=nf90_redef(ncid)
9482 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9484 & nf90_strerror(status)
9490#if !defined PARALLEL_IO && defined DISTRIBUTE
9498 10
FORMAT (/,
' NETCDF_REDEF - unable to put in definition mode', &
9499 &
' file:',/,16x,a,/,16x,
'call from:',2x,a,/,16x,a)
9529 integer,
intent(in) :: ng, model, ncid
9531 character (len=*),
intent(in) :: ncname
9537#if !defined PARALLEL_IO && defined DISTRIBUTE
9538 integer :: ibuffer(2)
9541 character (len=*),
parameter :: myfile = &
9542 & __FILE__//
", netcdf_sync"
9549 status=nf90_sync(ncid)
9550 IF (founderror(status, nf90_noerr, __line__, myfile))
THEN
9552 & nf90_strerror(status)
9558#if !defined PARALLEL_IO && defined DISTRIBUTE
9566 10
FORMAT (/,
' NETCDF_SYNC - unable to synchronize to disk file:', &
9567 & /,15x,a,/,15x,
'call from:',2x,a,/15x,a)
subroutine, public datestr(datenumber, isdayunits, datestring)
subroutine, public time_units(ustring, year, month, day, hour, minutes, seconds)
subroutine, public datenum(datenumber, year, month, day, hour, minutes, seconds)
character(len=256) varname
character(len=256) sourcefile
integer, dimension(:), allocatable istvar
character(len=maxlen), dimension(6, 0:nv) vname
integer, dimension(:), allocatable idsvar
subroutine netcdf_put_ivar_0d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine, public netcdf_close(ng, model, ncid, ncname, lupdate)
subroutine netcdf_put_fvar_0d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_get_svar_2d(ng, model, ncname, myvarname, a, ncid, start, total)
integer, dimension(nvara) var_aint
subroutine netcdf_get_fatt_r8(ng, model, ncname, varid, attname, attvalue, foundit, ncid)
subroutine netcdf_get_fvar_3dp(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
subroutine, public netcdf_redef(ng, model, ncname, ncid)
subroutine, public netcdf_get_satt(ng, model, ncname, varid, attname, attvalue, foundit, ncid)
subroutine netcdf_put_fvar_4d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
character(len=1024), dimension(nvara) var_achar
subroutine netcdf_put_ivar_1d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
integer, parameter nf_tout
integer, dimension(mvars) var_flag
integer, dimension(mdims) dim_id
subroutine netcdf_put_svar_0d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine, public netcdf_check_dim(ng, model, ncname, ncid)
character(len=100), dimension(mdims) dim_name
subroutine, public netcdf_check_var(ng, model, ncname, ncid)
logical function netcdf_find_var(ng, model, ncid, varname, varid)
subroutine netcdf_put_fvar_1dp(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine, public netcdf_open(ng, model, ncname, omode, ncid)
subroutine netcdf_put_svar_1d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_put_ivar_2d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
integer, parameter io_tiled_access
integer, parameter nf_fout
subroutine, public netcdf_enddef(ng, model, ncname, ncid)
subroutine netcdf_get_time_1d(ng, model, ncname, myvarname, rdate, a, ncid, start, total, min_val, max_val)
integer, dimension(mvars) var_ndim
integer, dimension(mdims) dim_size
subroutine netcdf_get_ivar_1d(ng, model, ncname, myvarname, a, ncid, start, total)
subroutine netcdf_get_svar_0d(ng, model, ncname, myvarname, a, ncid, start, total)
character(len=100), dimension(mvars) var_name
character(len=100), dimension(matts) att_name
subroutine netcdf_put_svar_2d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_get_ivar_0d(ng, model, ncname, myvarname, a, ncid, start, total)
subroutine netcdf_get_fvar_2dp(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
subroutine netcdf_get_time_0d(ng, model, ncname, myvarname, rdate, a, ncid, start, total, min_val, max_val)
subroutine netcdf_put_svar_3d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
integer, dimension(mvars) var_id
subroutine netcdf_get_fvar_1dp(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
subroutine netcdf_put_fvar_3d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
integer, dimension(matts) att_kind
subroutine netcdf_put_lvar_1d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_put_fvar_1d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_get_lvar_1d(ng, model, ncname, myvarname, a, ncid, start, total)
integer, parameter nf_type
subroutine netcdf_put_fvar_2d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_put_fvar_2dp(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_put_lvar_2d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
integer, dimension(nvard, mvars) var_dim
subroutine netcdf_get_fvar_4d(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
subroutine netcdf_get_fvar_0d(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
integer, dimension(mvars) var_natt
real(r8), dimension(nvara) var_afloat
subroutine, public netcdf_sync(ng, model, ncname, ncid)
subroutine, public netcdf_get_dim(ng, model, ncname, ncid, dimname, dimsize, dimid)
subroutine netcdf_get_fatt_dp(ng, model, ncname, varid, attname, attvalue, foundit, ncid)
subroutine netcdf_get_svar_3d(ng, model, ncname, myvarname, a, ncid, start, total)
subroutine netcdf_get_fvar_0dp(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
integer, dimension(nvard) var_dsize
subroutine netcdf_get_fvar_2d(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
integer, parameter io_nontiled_access
integer, dimension(nvard) var_dids
subroutine netcdf_get_ivar_2d(ng, model, ncname, myvarname, a, ncid, start, total)
subroutine netcdf_put_lvar_0d(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine netcdf_put_fvar_3dp(ng, model, ncname, myvarname, a, start, total, ncid, varid)
character(len=100), dimension(nvard) var_dname
subroutine netcdf_put_fvar_0dp(ng, model, ncname, myvarname, a, start, total, ncid, varid)
subroutine, public netcdf_inq_varid(ng, model, ncname, myvarname, ncid, varid)
subroutine netcdf_get_fvar_3d(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
character(len=100), dimension(nvara) var_aname
subroutine, public netcdf_create(ng, model, ncname, ncid)
subroutine netcdf_get_fvar_1d(ng, model, ncname, myvarname, a, ncid, start, total, broadcast, min_val, max_val)
subroutine, public netcdf_inq_var(ng, model, ncname, ncid, myvarname, searchvar, varid, nvardim, nvaratt)
integer, parameter nf_frst
subroutine netcdf_get_lvar_0d(ng, model, ncname, myvarname, a, ncid, start, total)
subroutine netcdf_get_svar_1d(ng, model, ncname, myvarname, a, ncid, start, total)
integer, dimension(mvars) var_type
integer, dimension(:), allocatable n
type(t_iobounds), dimension(:), allocatable iobounds
character(len=3), dimension(4) kernelstring
integer, dimension(:), allocatable nt
real(dp), dimension(:), allocatable theta_s
real(dp), parameter spval_check
logical, dimension(:,:,:), allocatable lobc
integer, dimension(:), allocatable nfrec
real(dp), dimension(:), allocatable tcline
real(dp), dimension(:), allocatable theta_b
real(r8), dimension(:,:,:), allocatable vdecay
real(dp), dimension(:), allocatable hc
real(r8), dimension(4) hgamma
real(r8), dimension(:,:,:), allocatable hdecayb
integer, dimension(:), allocatable nbrec
integer, dimension(:), allocatable vstretching
real(r8), dimension(:,:,:), allocatable vdecayb
real(r8), dimension(:,:,:), allocatable hdecay
real(r8), dimension(4) vgamma
integer, dimension(:), allocatable vtransform
character(len(sinp)) function, public lowercase(sinp)
logical function, public find_string(a, asize, string, aindex)
logical function, public founderror(flag, noerr, line, routine)