17 character(len=256) :: filename
20 integer :: debug_level
25 character(len=40) :: dimname(4)
100 subroutine open_nc(this,filename,action,debug_level)
105 character(len=*),
intent(in) :: filename
106 character(len=1),
intent(in) :: action
107 integer,
intent(in),
optional :: debug_level
109 integer :: ncid, status
112 if(present(debug_level)) this%debug_level=debug_level
114 this%filename=trim(filename)
116 if(action==
"r" .or. action==
"R")
then
117 status = nf90_open(path = trim(filename), mode = nf90_nowrite, ncid = ncid)
118 elseif(action==
"w" .or. action==
"W")
then
119 status = nf90_open(path = trim(filename), mode = nf90_write, ncid = ncid)
121 write(*,*)
'unknow action :', action
124 if (status /= nf90_noerr) call this%handle_err(status)
127 if(this%debug_level>0)
then
128 write(*,*)
'>>> open file: ',trim(this%filename)
143 integer :: ncid, status
148 status = nf90_close(ncid)
149 if (status /= nf90_noerr) call this%handle_err(status)
163 character(len=*),
intent(in) :: attname
164 real,
intent(out) :: rval
166 integer :: ncid, status
172 status = nf90_get_att(ncid, nf90_global, trim(attname), rval)
173 if (status /= nf90_noerr) call this%handle_err(status)
187 character(len=*),
intent(in) :: attname
188 integer,
intent(out) :: ival
190 integer :: ncid, status
196 status = nf90_get_att(ncid, nf90_global, trim(attname), ival)
197 if (status /= nf90_noerr) call this%handle_err(status)
211 character(len=*),
intent(in) :: attname
212 character(len=*),
intent(out) :: string
214 integer :: ncid, status
220 status = nf90_get_att(ncid, nf90_global, trim(attname), string)
221 if (status /= nf90_noerr) call this%handle_err(status)
236 character(len=*),
intent(in) :: dimname
237 integer,
intent(out) :: dimvalue
239 integer :: ncid, status
246 status = nf90_inq_dimid(ncid,trim(dimname), dimid)
247 if (status /= nf90_noerr) call this%handle_err(status)
248 status = nf90_inquire_dimension(ncid, dimid, len = dimvalue)
249 if (status /= nf90_noerr) call this%handle_err(status)
267 character(len=*),
intent(in) :: varname
268 integer,
intent(in) :: nd1
269 character,
intent(in) :: field(nd1)
272 character*40,
parameter :: thissubname=
'replace_var_nc_char_1d'
279 if(this%debug_level>100)
then
280 write(*,*) trim(thissubname),
' show samples:'
281 write(*,*) (field(i),i=1,min(nd1,10))
284 call this%replace_var_nc_char(varname,ilength,field)
302 character(len=*),
intent(in) :: varname
303 integer,
intent(in) :: nd1,nd2
304 character,
intent(in) :: field(nd1,nd2)
307 character,
allocatable :: temp(:)
309 character*40,
parameter :: thissubname=
'replace_var_nc_char_2d'
312 integer :: istart,iend
316 allocate(temp(ilength))
321 temp(istart:iend)=field(:,j)
324 if(this%debug_level>100)
then
325 write(*,*) trim(thissubname),
' show samples:'
326 write(*,*) field(1,1)
329 call this%replace_var_nc_char(varname,ilength,temp)
350 character(len=*),
intent(in) :: varname
351 integer,
intent(in) :: nd1,nd2,nd3
352 character,
intent(in) :: field(nd1,nd2,nd3)
355 character,
allocatable :: temp(:)
357 character*40,
parameter :: thissubname=
'replace_var_nc_char_3d'
361 integer :: istart,iend
366 allocate(temp(ilength))
370 istart=(k-1)*length2d+(j-1)*nd1+1
371 iend =(k-1)*length2d+(j-1)*nd1+nd1
372 temp(istart:iend)=field(:,j,k)
376 if(this%debug_level>100)
then
377 write(*,*) trim(thissubname),
' show samples:'
378 write(*,*) field(1,1,1)
381 call this%replace_var_nc_char(varname,ilength,temp)
400 character(len=*),
intent(in) :: varname
401 integer,
intent(in) :: ilength
402 character,
intent(in) :: field(ilength)
408 integer :: ends(4),start(4)
410 integer :: length4d,length3d,length2d
411 integer :: ndims,ndim
414 character*40 :: dimname
416 character*40,
parameter :: thissubname=
'replace_var_nc_char'
424 status = nf90_inq_varid(ncid, trim(varname), varid)
425 if(status /= nf90_noerr) call this%handle_err(status)
434 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
435 if(status /= nf90_noerr) call this%handle_err(status)
436 if(xtype==nf90_char)
then
439 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_int,
' but read in ',xtype
444 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
445 if(status /= nf90_noerr) call this%handle_err(status)
448 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
449 if(status /= nf90_noerr) call this%handle_err(status)
452 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
453 if (status /= nf90_noerr) call this%handle_err(status)
456 this%dimname(i)=trim(dimname)
457 if(this%ends(i) < 1)
then
458 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
462 length2d=ends(1)*ends(2)
463 length3d=length2d*ends(3)
464 length4d=length3d*ends(4)
465 if(ilength .ne. length4d)
then
466 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
471 status = nf90_put_var(ncid, varid, field, &
472 start = start(1:4) , &
474 if(status /= nf90_noerr) call this%handle_err(status)
476 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
480 if(this%debug_level>0)
then
481 write(*,
'(a,a)')
'>>>replace variable: ',trim(varname)
483 if(this%debug_level>10)
then
484 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
485 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
487 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
507 character(len=*),
intent(in) :: varname
508 integer,
intent(in) :: nd1
509 real(4),
intent(in) :: field(nd1)
512 character*40,
parameter :: thissubname=
'replace_var_nc_real_1d'
519 if(this%debug_level>100)
then
520 write(*,*) trim(thissubname),
' show samples:'
521 write(*,*) (field(i),i=1,min(nd1,10))
524 call this%replace_var_nc_real(varname,ilength,field)
542 character(len=*),
intent(in) :: varname
543 integer,
intent(in) :: nd1,nd2
544 real(4),
intent(in) :: field(nd1,nd2)
547 real(4),
allocatable :: temp(:)
549 character*40,
parameter :: thissubname=
'replace_var_nc_real_2d'
552 integer :: istart,iend
556 allocate(temp(ilength))
561 temp(istart:iend)=field(:,j)
564 if(this%debug_level>100)
then
565 write(*,*) trim(thissubname),
' show samples:'
566 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
569 call this%replace_var_nc_real(varname,ilength,temp)
593 character(len=*),
intent(in) :: varname
594 integer,
intent(in) :: nd1,nd2,nd3
595 real(4),
intent(in) :: field(nd1,nd2,nd3)
598 real(4),
allocatable :: temp(:)
600 character*40,
parameter :: thissubname=
'replace_var_nc_real_3d'
604 integer :: istart,iend
609 allocate(temp(ilength))
613 istart=(k-1)*length2d+(j-1)*nd1+1
614 iend =(k-1)*length2d+(j-1)*nd1+nd1
615 temp(istart:iend)=field(:,j,k)
619 if(this%debug_level>100)
then
620 write(*,*) trim(thissubname),
' show samples:'
622 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
626 call this%replace_var_nc_real(varname,ilength,temp)
645 character(len=*),
intent(in) :: varname
646 integer,
intent(in) :: ilength
647 real(4),
intent(in) :: field(ilength)
653 integer :: ends(4),start(4)
655 integer :: length4d,length3d,length2d
656 integer :: ndims,ndim
659 character*40 :: dimname
661 character*40,
parameter :: thissubname=
'replace_var_nc_real'
669 status = nf90_inq_varid(ncid, trim(varname), varid)
670 if(status /= nf90_noerr) call this%handle_err(status)
679 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
680 if(status /= nf90_noerr) call this%handle_err(status)
681 if(xtype==nf90_float)
then
684 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_int,
' but read in ',xtype
689 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
690 if(status /= nf90_noerr) call this%handle_err(status)
693 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
694 if(status /= nf90_noerr) call this%handle_err(status)
697 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
698 if (status /= nf90_noerr) call this%handle_err(status)
701 this%dimname(i)=trim(dimname)
702 if(this%ends(i) < 1)
then
703 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
707 length2d=ends(1)*ends(2)
708 length3d=length2d*ends(3)
709 length4d=length3d*ends(4)
710 if(ilength .ne. length4d)
then
711 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
716 status = nf90_put_var(ncid, varid, field, &
717 start = start(1:4) , &
719 if(status /= nf90_noerr) call this%handle_err(status)
721 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
725 if(this%debug_level>0)
then
726 write(*,
'(a,a)')
'>>>replace variable: ',trim(varname)
728 if(this%debug_level>10)
then
729 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
730 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
732 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
754 character(len=*),
intent(in) :: varname
755 integer,
intent(in) :: nd1
756 real(8),
intent(in) :: field(nd1)
759 character*40,
parameter :: thissubname=
'replace_var_nc_double_1d'
766 if(this%debug_level>100)
then
767 write(*,*) trim(thissubname),
' show samples:'
768 write(*,*) (field(i),i=1,min(nd1,10))
771 call this%replace_var_nc_double(varname,ilength,field)
792 character(len=*),
intent(in) :: varname
793 integer,
intent(in) :: nd1,nd2
794 real(8),
intent(in) :: field(nd1,nd2)
797 real(8),
allocatable :: temp(:)
799 character*40,
parameter :: thissubname=
'replace_var_nc_double_2d'
802 integer :: istart,iend
806 allocate(temp(ilength))
811 temp(istart:iend)=field(:,j)
814 if(this%debug_level>100)
then
815 write(*,*) trim(thissubname),
' show samples:'
816 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
819 call this%replace_var_nc_double(varname,ilength,temp)
843 character(len=*),
intent(in) :: varname
844 integer,
intent(in) :: nd1,nd2,nd3
845 real(8),
intent(in) :: field(nd1,nd2,nd3)
848 real(8),
allocatable :: temp(:)
850 character*40,
parameter :: thissubname=
'replace_var_nc_double_3d'
854 integer :: istart,iend
859 allocate(temp(ilength))
863 istart=(k-1)*length2d+(j-1)*nd1+1
864 iend =(k-1)*length2d+(j-1)*nd1+nd1
865 temp(istart:iend)=field(:,j,k)
869 if(this%debug_level>100)
then
870 write(*,*) trim(thissubname),
' show samples:'
872 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
876 call this%replace_var_nc_double(varname,ilength,temp)
896 character(len=*),
intent(in) :: varname
897 integer,
intent(in) :: ilength
898 real(8),
intent(in) :: field(ilength)
904 integer :: ends(4),start(4)
906 integer :: length4d,length3d,length2d
907 integer :: ndims,ndim
910 character*40 :: dimname
912 character*40,
parameter :: thissubname=
'replace_var_nc_double'
920 status = nf90_inq_varid(ncid, trim(varname), varid)
921 if(status /= nf90_noerr) call this%handle_err(status)
930 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
931 if(status /= nf90_noerr) call this%handle_err(status)
932 if(xtype==nf90_double)
then
935 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_int,
' but read in ',xtype
940 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
941 if(status /= nf90_noerr) call this%handle_err(status)
944 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
945 if(status /= nf90_noerr) call this%handle_err(status)
948 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
949 if (status /= nf90_noerr) call this%handle_err(status)
952 this%dimname(i)=trim(dimname)
953 if(this%ends(i) < 1)
then
954 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
958 length2d=ends(1)*ends(2)
959 length3d=length2d*ends(3)
960 length4d=length3d*ends(4)
961 if(ilength .ne. length4d)
then
962 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
967 status = nf90_put_var(ncid, varid, field, &
968 start = start(1:4) , &
970 if(status /= nf90_noerr) call this%handle_err(status)
972 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
976 if(this%debug_level>0)
then
977 write(*,
'(a,a)')
'>>>replace variable: ',trim(varname)
979 if(this%debug_level>10)
then
980 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
981 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
983 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
1002 character(len=*),
intent(in) :: varname
1003 integer,
intent(in) :: nd1
1004 integer,
intent(in) :: field(nd1)
1007 character*40,
parameter :: thissubname=
'get_var_nc_int_1d'
1014 if(this%debug_level>100)
then
1015 write(*,*) trim(thissubname),
' show samples:'
1016 write(*,*) (field(i),i=1,min(nd1,10))
1019 call this%replace_var_nc_int(varname,ilength,field)
1040 character(len=*),
intent(in) :: varname
1041 integer,
intent(in) :: nd1,nd2
1042 integer,
intent(in) :: field(nd1,nd2)
1045 integer,
allocatable :: temp(:)
1047 character*40,
parameter :: thissubname=
'replace_var_nc_int_2d'
1050 integer :: istart,iend
1054 allocate(temp(ilength))
1059 temp(istart:iend)=field(:,j)
1062 if(this%debug_level>100)
then
1063 write(*,*) trim(thissubname),
' show samples:'
1064 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
1067 call this%replace_var_nc_int(varname,ilength,temp)
1088 character(len=*),
intent(in) :: varname
1089 integer,
intent(in) :: nd1,nd2,nd3
1090 integer,
intent(in) :: field(nd1,nd2,nd3)
1093 integer,
allocatable :: temp(:)
1095 character*40,
parameter :: thissubname=
'replace_var_nc_int_3d'
1099 integer :: istart,iend
1103 ilength=length2d*nd3
1104 allocate(temp(ilength))
1108 istart=(k-1)*length2d+(j-1)*nd1+1
1109 iend =(k-1)*length2d+(j-1)*nd1+nd1
1110 temp(istart:iend)=field(:,j,k)
1114 if(this%debug_level>100)
then
1115 write(*,*) trim(thissubname),
' show samples:'
1117 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
1121 call this%replace_var_nc_int(varname,ilength,temp)
1140 character(len=*),
intent(in) :: varname
1141 integer,
intent(in) :: ilength
1142 integer,
intent(in) :: field(ilength)
1148 integer :: ends(4),start(4)
1150 integer :: length4d,length3d,length2d
1151 integer :: ndims,ndim
1152 integer :: dimids(4)
1154 character*40 :: dimname
1156 character*40,
parameter :: thissubname=
'replace_var_nc_int'
1164 status = nf90_inq_varid(ncid, trim(varname), varid)
1165 if(status /= nf90_noerr) call this%handle_err(status)
1174 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
1175 if(status /= nf90_noerr) call this%handle_err(status)
1176 if(xtype==nf90_int)
then
1179 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_int,
' but read in ',xtype
1184 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
1185 if(status /= nf90_noerr) call this%handle_err(status)
1188 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
1189 if(status /= nf90_noerr) call this%handle_err(status)
1192 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
1193 if (status /= nf90_noerr) call this%handle_err(status)
1195 this%ends(i)=ends(i)
1196 this%dimname(i)=trim(dimname)
1197 if(this%ends(i) < 1)
then
1198 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
1202 length2d=ends(1)*ends(2)
1203 length3d=length2d*ends(3)
1204 length4d=length3d*ends(4)
1205 if(ilength .ne. length4d)
then
1206 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
1211 status = nf90_put_var(ncid, varid, field, &
1212 start = start(1:4) , &
1214 if(status /= nf90_noerr) call this%handle_err(status)
1216 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
1220 if(this%debug_level>0)
then
1221 write(*,
'(a,a)')
'>>>replace variable: ',trim(varname)
1223 if(this%debug_level>10)
then
1224 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
1225 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
1227 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
1246 character(len=*),
intent(in) :: varname
1247 integer,
intent(in) :: nd1
1248 real(8),
intent(out) :: field(nd1)
1251 character*40,
parameter :: thissubname=
'get_var_nc_double_1d'
1257 call this%get_var_nc_double(varname,ilength,field)
1259 if(nd1==this%ends(1))
then
1260 if(this%debug_level>100)
then
1261 write(*,*) trim(thissubname),
' show samples:'
1262 write(*,*) (field(i),i=1,min(nd1,10))
1265 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1284 character(len=*),
intent(in) :: varname
1285 integer,
intent(in) :: nd1,nd2
1286 real(8),
intent(out) :: field(nd1,nd2)
1289 real(8),
allocatable :: temp(:)
1291 character*40,
parameter :: thissubname=
'get_var_nc_double_2d'
1294 integer :: istart,iend
1298 allocate(temp(ilength))
1300 call this%get_var_nc_double(varname,ilength,temp)
1302 if(nd1==this%ends(1) .and. nd2==this%ends(2))
then
1306 field(:,j)=temp(istart:iend)
1309 if(this%debug_level>100)
then
1310 write(*,*) trim(thissubname),
' show samples:'
1311 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
1314 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1315 write(*,*) nd1,this%ends(1),nd2,this%ends(2)
1336 character(len=*),
intent(in) :: varname
1337 integer,
intent(in) :: nd1,nd2,nd3
1338 real(8),
intent(out) :: field(nd1,nd2,nd3)
1341 real(8),
allocatable :: temp(:)
1343 character*40,
parameter :: thissubname=
'get_var_nc_double_3d'
1347 integer :: istart,iend
1351 ilength=length2d*nd3
1352 allocate(temp(ilength))
1354 call this%get_var_nc_double(varname,ilength,temp)
1356 if(nd1==this%ends(1) .and. nd2==this%ends(2) .and. nd3==this%ends(3))
then
1359 istart=(k-1)*length2d+(j-1)*nd1+1
1360 iend =(k-1)*length2d+(j-1)*nd1+nd1
1361 field(:,j,k)=temp(istart:iend)
1365 if(this%debug_level>100)
then
1366 write(*,*) trim(thissubname),
' show samples:'
1368 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
1372 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1373 write(*,*) nd1,this%ends(1),nd2,this%ends(2),nd3,this%ends(3)
1392 character(len=*),
intent(in) :: varname
1393 integer,
intent(in) :: ilength
1394 real(8),
intent(out) :: field(ilength)
1400 integer :: ends(4),start(4)
1402 integer :: length4d,length3d,length2d
1403 integer :: ndims,ndim
1404 integer :: dimids(4)
1406 character*40 :: dimname
1408 character*40,
parameter :: thissubname=
'get_var_nc_double'
1416 status = nf90_inq_varid(ncid, trim(varname), varid)
1417 if(status /= nf90_noerr) call this%handle_err(status)
1426 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
1427 if(status /= nf90_noerr) call this%handle_err(status)
1428 if(xtype==nf90_double)
then
1431 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_double,
' but read in ',xtype
1436 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
1437 if(status /= nf90_noerr) call this%handle_err(status)
1440 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
1441 if(status /= nf90_noerr) call this%handle_err(status)
1444 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
1445 if (status /= nf90_noerr) call this%handle_err(status)
1447 this%ends(i)=ends(i)
1448 this%dimname(i)=trim(dimname)
1449 if(this%ends(i) < 1)
then
1450 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
1454 length2d=ends(1)*ends(2)
1455 length3d=length2d*ends(3)
1456 length4d=length3d*ends(4)
1457 if(ilength .ne. length4d)
then
1458 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
1463 status = nf90_get_var(ncid, varid, field, &
1464 start = start(1:4) , &
1466 if(status /= nf90_noerr) call this%handle_err(status)
1468 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
1472 if(this%debug_level>0)
then
1473 write(*,
'(a,a)')
'>>>read in variable: ',trim(varname)
1475 if(this%debug_level>10)
then
1476 write(*,
'(a,I10)')
' data type : ',this%xtype
1477 write(*,
'(a,I10)')
' dimension size: ',this%nDims
1479 write(*,
'(a,I5,I10,2x,a)')
' rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
1498 character(len=*),
intent(in) :: varname
1499 integer,
intent(in) :: nd1
1500 real(4),
intent(out) :: field(nd1)
1503 character*40,
parameter :: thissubname=
'get_var_nc_real_1d'
1509 call this%get_var_nc_real(varname,ilength,field)
1511 if(nd1==this%ends(1))
then
1512 if(this%debug_level>100)
then
1513 write(*,*) trim(thissubname),
' show samples:'
1514 write(*,*) (field(i),i=1,min(nd1,10))
1517 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1539 character(len=*),
intent(in) :: varname
1540 integer,
intent(in) :: nd1,nd2
1541 real(4),
intent(out) :: field(nd1,nd2)
1544 real(4),
allocatable :: temp(:)
1546 character*40,
parameter :: thissubname=
'get_var_nc_real_2d'
1549 integer :: istart,iend
1553 allocate(temp(ilength))
1555 call this%get_var_nc_real(varname,ilength,temp)
1557 if(nd1==this%ends(1) .and. nd2==this%ends(2))
then
1561 field(:,j)=temp(istart:iend)
1564 if(this%debug_level>100)
then
1565 write(*,*) trim(thissubname),
' show samples:'
1566 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
1569 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1570 write(*,*) nd1,this%ends(1),nd2,this%ends(2)
1591 character(len=*),
intent(in) :: varname
1592 integer,
intent(in) :: nd1,nd2,nd3
1593 real(4),
intent(out) :: field(nd1,nd2,nd3)
1596 real(4),
allocatable :: temp(:)
1598 character*40,
parameter :: thissubname=
'get_var_nc_real_3d'
1602 integer :: istart,iend
1606 ilength=length2d*nd3
1607 allocate(temp(ilength))
1609 call this%get_var_nc_real(varname,ilength,temp)
1611 if(nd1==this%ends(1) .and. nd2==this%ends(2) .and. nd3==this%ends(3))
then
1614 istart=(k-1)*length2d+(j-1)*nd1+1
1615 iend =(k-1)*length2d+(j-1)*nd1+nd1
1616 field(:,j,k)=temp(istart:iend)
1620 if(this%debug_level>100)
then
1621 write(*,*) trim(thissubname),
' show samples:'
1623 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
1627 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1628 write(*,*) nd1,this%ends(1),nd2,this%ends(2),nd3,this%ends(3)
1650 character(len=*),
intent(in) :: varname
1651 integer,
intent(in) :: ilength
1652 real(4),
intent(out) :: field(ilength)
1658 integer :: ends(4),start(4)
1660 integer :: length4d,length3d,length2d
1661 integer :: ndims,ndim
1662 integer :: dimids(4)
1664 character*40 :: dimname
1666 character*40,
parameter :: thissubname=
'get_var_nc_real'
1674 status = nf90_inq_varid(ncid, trim(varname), varid)
1675 if(status /= nf90_noerr) call this%handle_err(status)
1684 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
1685 if(status /= nf90_noerr) call this%handle_err(status)
1686 if(xtype==nf90_float)
then
1689 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_float,
' but read in ',xtype
1694 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
1695 if(status /= nf90_noerr) call this%handle_err(status)
1698 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
1699 if(status /= nf90_noerr) call this%handle_err(status)
1702 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
1703 if (status /= nf90_noerr) call this%handle_err(status)
1705 this%ends(i)=ends(i)
1706 this%dimname(i)=trim(dimname)
1707 if(this%ends(i) < 1)
then
1708 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
1712 length2d=ends(1)*ends(2)
1713 length3d=length2d*ends(3)
1714 length4d=length3d*ends(4)
1715 if(ilength .ne. length4d)
then
1716 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
1721 status = nf90_get_var(ncid, varid, field, &
1722 start = start(1:4) , &
1724 if(status /= nf90_noerr) call this%handle_err(status)
1726 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
1730 if(this%debug_level>0)
then
1731 write(*,
'(a,a)')
'>>>read in variable: ',trim(varname)
1733 if(this%debug_level>10)
then
1734 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
1735 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
1737 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
1756 character(len=*),
intent(in) :: varname
1757 integer,
intent(in) :: nd1
1758 integer,
intent(out) :: field(nd1)
1761 character*40,
parameter :: thissubname=
'get_var_nc_int_1d'
1767 call this%get_var_nc_int(varname,ilength,field)
1769 if(nd1==this%ends(1))
then
1770 if(this%debug_level>100)
then
1771 write(*,*) trim(thissubname),
' show samples:'
1772 write(*,*) (field(i),i=1,min(nd1,10))
1775 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1797 character(len=*),
intent(in) :: varname
1798 integer,
intent(in) :: nd1,nd2
1799 integer,
intent(out) :: field(nd1,nd2)
1802 integer,
allocatable :: temp(:)
1804 character*40,
parameter :: thissubname=
'get_var_nc_int_2d'
1807 integer :: istart,iend
1811 allocate(temp(ilength))
1813 call this%get_var_nc_int(varname,ilength,temp)
1815 if(nd1==this%ends(1) .and. nd2==this%ends(2))
then
1819 field(:,j)=temp(istart:iend)
1822 if(this%debug_level>100)
then
1823 write(*,*) trim(thissubname),
' show samples:'
1824 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
1827 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1828 write(*,*) nd1,this%ends(1),nd2,this%ends(2)
1849 character(len=*),
intent(in) :: varname
1850 integer,
intent(in) :: nd1,nd2,nd3
1851 integer,
intent(out) :: field(nd1,nd2,nd3)
1854 integer,
allocatable :: temp(:)
1856 character*40,
parameter :: thissubname=
'get_var_nc_int_3d'
1860 integer :: istart,iend
1864 ilength=length2d*nd3
1865 allocate(temp(ilength))
1867 call this%get_var_nc_int(varname,ilength,temp)
1869 if(nd1==this%ends(1) .and. nd2==this%ends(2) .and. nd3==this%ends(3))
then
1872 istart=(k-1)*length2d+(j-1)*nd1+1
1873 iend =(k-1)*length2d+(j-1)*nd1+nd1
1874 field(:,j,k)=temp(istart:iend)
1878 if(this%debug_level>100)
then
1879 write(*,*) trim(thissubname),
' show samples:'
1881 write(*,*)
'k,max,min:',k,maxval(field(:,:,k)),minval(field(:,:,k))
1885 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
1886 write(*,*) nd1,this%ends(1),nd2,this%ends(2),nd3,this%ends(3)
1908 character(len=*),
intent(in) :: varname
1909 integer,
intent(in) :: ilength
1910 integer,
intent(out) :: field(ilength)
1916 integer :: ends(4),start(4)
1918 integer :: length4d,length3d,length2d
1919 integer :: ndims,ndim
1920 integer :: dimids(4)
1922 character*40 :: dimname
1924 character*40,
parameter :: thissubname=
'get_var_nc_int'
1932 status = nf90_inq_varid(ncid, trim(varname), varid)
1933 if(status /= nf90_noerr) call this%handle_err(status)
1942 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
1943 if(status /= nf90_noerr) call this%handle_err(status)
1944 if(xtype==nf90_int)
then
1947 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_int,
' but read in ',xtype
1952 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
1953 if(status /= nf90_noerr) call this%handle_err(status)
1956 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
1957 if(status /= nf90_noerr) call this%handle_err(status)
1960 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
1961 if (status /= nf90_noerr) call this%handle_err(status)
1963 this%ends(i)=ends(i)
1964 this%dimname(i)=trim(dimname)
1965 if(this%ends(i) < 1)
then
1966 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
1970 length2d=ends(1)*ends(2)
1971 length3d=length2d*ends(3)
1972 length4d=length3d*ends(4)
1973 if(ilength .ne. length4d)
then
1974 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
1979 status = nf90_get_var(ncid, varid, field, &
1980 start = start(1:4) , &
1982 if(status /= nf90_noerr) call this%handle_err(status)
1984 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
1988 if(this%debug_level>0)
then
1989 write(*,
'(a,a)')
'>>>read in variable: ',trim(varname)
1991 if(this%debug_level>10)
then
1992 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
1993 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
1995 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
2014 character(len=*),
intent(in) :: varname
2015 integer,
intent(in) :: nd1
2016 integer(2),
intent(out) :: field(nd1)
2019 character*40,
parameter :: thissubname=
'get_var_nc_short_1d'
2025 call this%get_var_nc_short(varname,ilength,field)
2027 if(nd1==this%ends(1))
then
2028 if(this%debug_level>100)
then
2029 write(*,*) trim(thissubname),
' show samples:'
2030 write(*,*) (field(i),i=1,min(nd1,10))
2033 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
2055 character(len=*),
intent(in) :: varname
2056 integer,
intent(in) :: nd1,nd2
2057 integer(2),
intent(out) :: field(nd1,nd2)
2060 integer(2),
allocatable :: temp(:)
2062 character*40,
parameter :: thissubname=
'get_var_nc_short_2d'
2065 integer :: istart,iend
2069 allocate(temp(ilength))
2071 call this%get_var_nc_short(varname,ilength,temp)
2073 if(nd1==this%ends(1) .and. nd2==this%ends(2))
then
2077 field(:,j)=temp(istart:iend)
2080 if(this%debug_level>100)
then
2081 write(*,*) trim(thissubname),
' show samples:'
2082 write(*,*)
'max,min:',maxval(field(:,:)),minval(field(:,:))
2085 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
2086 write(*,*) nd1,this%ends(1),nd2,this%ends(2)
2105 character(len=*),
intent(in) :: varname
2106 integer,
intent(in) :: ilength
2107 integer(2),
intent(out) :: field(ilength)
2113 integer :: ends(4),start(4)
2115 integer :: length4d,length3d,length2d
2116 integer :: ndims,ndim
2117 integer :: dimids(4)
2119 character*40 :: dimname
2121 character*40,
parameter :: thissubname=
'get_var_nc_short'
2129 status = nf90_inq_varid(ncid, trim(varname), varid)
2130 if(status /= nf90_noerr) call this%handle_err(status)
2139 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
2140 if(status /= nf90_noerr) call this%handle_err(status)
2141 if(xtype==nf90_short)
then
2144 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_short,
' but read in ',xtype
2149 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
2150 if(status /= nf90_noerr) call this%handle_err(status)
2153 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
2154 if(status /= nf90_noerr) call this%handle_err(status)
2157 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
2158 if (status /= nf90_noerr) call this%handle_err(status)
2160 this%ends(i)=ends(i)
2161 this%dimname(i)=trim(dimname)
2162 if(this%ends(i) < 1)
then
2163 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
2167 length2d=ends(1)*ends(2)
2168 length3d=length2d*ends(3)
2169 length4d=length3d*ends(4)
2170 if(ilength .ne. length4d)
then
2171 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
2176 status = nf90_get_var(ncid, varid, field, &
2177 start = start(1:4) , &
2179 if(status /= nf90_noerr) call this%handle_err(status)
2181 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
2185 if(this%debug_level>0)
then
2186 write(*,
'(a,a)')
'>>>read in variable: ',trim(varname)
2188 if(this%debug_level>10)
then
2189 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
2190 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
2192 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
2211 character(len=*),
intent(in) :: varname
2212 integer,
intent(in) :: nd1
2213 character,
intent(out) :: field(nd1)
2216 character*40,
parameter :: thissubname=
'get_var_nc_char_1d'
2222 call this%get_var_nc_char(varname,ilength,field)
2224 if(nd1==this%ends(1))
then
2225 if(this%debug_level>100)
then
2226 write(*,*) trim(thissubname),
' show samples:'
2227 write(*,*) (field(i),i=1,min(nd1,10))
2230 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
2249 character(len=*),
intent(in) :: varname
2250 integer,
intent(in) :: nd1,nd2
2251 character,
intent(out) :: field(nd1,nd2)
2254 character,
allocatable :: temp(:)
2256 character*40,
parameter :: thissubname=
'get_var_nc_char_2d'
2259 integer :: istart,iend
2263 allocate(temp(ilength))
2265 call this%get_var_nc_char(varname,ilength,temp)
2267 if(nd1==this%ends(1) .and. nd2==this%ends(2))
then
2271 field(:,j)=temp(istart:iend)
2274 if(this%debug_level>100)
then
2275 write(*,*) trim(thissubname),
' show samples:'
2276 write(*,*) field(1,1)
2279 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
2280 write(*,*) nd1,this%ends(1),nd2,this%ends(2)
2301 character(len=*),
intent(in) :: varname
2302 integer,
intent(in) :: nd1,nd2,nd3
2303 character,
intent(out) :: field(nd1,nd2,nd3)
2306 character,
allocatable :: temp(:)
2308 character*40,
parameter :: thissubname=
'get_var_nc_char_3d'
2312 integer :: istart,iend
2316 ilength=length2d*nd3
2317 allocate(temp(ilength))
2319 call this%get_var_nc_char(varname,ilength,temp)
2321 if(nd1==this%ends(1) .and. nd2==this%ends(2) .and. nd3==this%ends(3))
then
2324 istart=(k-1)*length2d+(j-1)*nd1+1
2325 iend =(k-1)*length2d+(j-1)*nd1+nd1
2326 field(:,j,k)=temp(istart:iend)
2330 if(this%debug_level>100)
then
2331 write(*,*) trim(thissubname),
' show samples:'
2332 write(*,*) field(1,1,1)
2335 write(*,*) trim(thissubname),
' ERROR: dimension does not match.'
2336 write(*,*) nd1,this%ends(1),nd2,this%ends(2),nd3,this%ends(3)
2358 character(len=*),
intent(in) :: varname
2359 integer,
intent(in) :: ilength
2360 character,
intent(out) :: field(ilength)
2366 integer :: ends(4),start(4)
2368 integer :: length4d,length3d,length2d
2369 integer :: ndims,ndim
2370 integer :: dimids(4)
2372 character*40 :: dimname
2374 character*40,
parameter :: thissubname=
'get_var_nc_char'
2382 status = nf90_inq_varid(ncid, trim(varname), varid)
2383 if(status /= nf90_noerr) call this%handle_err(status)
2392 status = nf90_inquire_variable(ncid, varid, xtype = xtype)
2393 if(status /= nf90_noerr) call this%handle_err(status)
2394 if(xtype==nf90_char)
then
2397 write(*,*) trim(thissubname),
' ERROR: wrong data type, expect ',nf90_char,
' but read in ',xtype
2402 status = nf90_inquire_variable(ncid, varid, ndims = ndims)
2403 if(status /= nf90_noerr) call this%handle_err(status)
2406 status = nf90_inquire_variable(ncid, varid, dimids = dimids(1:ndims))
2407 if(status /= nf90_noerr) call this%handle_err(status)
2410 status = nf90_inquire_dimension(ncid, dimids(i), dimname, len = ndim)
2411 if (status /= nf90_noerr) call this%handle_err(status)
2413 this%ends(i)=ends(i)
2414 this%dimname(i)=trim(dimname)
2415 if(this%ends(i) < 1)
then
2416 write(*,*) trim(thissubname),
' Error, ends dimension should larger than 0 :', ends(i)
2420 length2d=ends(1)*ends(2)
2421 length3d=length2d*ends(3)
2422 length4d=length3d*ends(4)
2423 if(ilength .ne. length4d)
then
2424 write(*,*) trim(thissubname),
'ERROR: ',ilength,
' should equal to ',length4d
2429 status = nf90_get_var(ncid, varid, field, &
2430 start = start(1:4) , &
2432 if(status /= nf90_noerr) call this%handle_err(status)
2434 write(*,*) trim(thissubname),
'Error: too many dimensions:',ndims
2438 if(this%debug_level>0)
then
2439 write(*,
'(a,a)')
'>>>read in variable: ',trim(varname)
2441 if(this%debug_level>10)
then
2442 write(*,
'(8x,a,I10)')
'data type : ',this%xtype
2443 write(*,
'(8x,a,I10)')
'dimension size: ',this%nDims
2445 write(*,
'(8x,a,I5,I10,2x,a)')
'rank, ends, name=',i,this%ends(i),trim(this%dimname(i))
2461 integer,
intent ( in) :: status
2462 if(status /= nf90_noerr)
then
2463 print *, trim(nf90_strerror(status))
2481 real,
intent(in ) :: ps(nx,ny)
2482 real,
intent(inout) :: t2(nx,ny)
2485 real(8) :: rd,cp,rd_over_cp
2494 t2(i,j)=t2(i,j)*(ps(i,j)/1000.0)**rd_over_cp - 273.15
2516 character(len=*),
intent(in) :: varname,dname1,dname2,dname3 &
2518 integer :: status, ncid, dim1id, dim2id, dim3id, varid
2520 status = nf90_redef(this%ncid)
2521 if (status /= nf90_noerr) call this%handle_err(status)
2523 status = nf90_inq_dimid(this%ncid, dname1, dim1id)
2524 if (status /= nf90_noerr) call this%handle_err(status)
2525 status = nf90_inq_dimid(this%ncid, dname2, dim2id)
2526 if (status /= nf90_noerr) call this%handle_err(status)
2527 status = nf90_inq_dimid(this%ncid, dname3, dim3id)
2528 if (status /= nf90_noerr) call this%handle_err(status)
2530 status = nf90_def_var(this%ncid, varname, nf90_double, &
2531 (/ dim1id, dim2id, dim3id /), varid)
2532 if (status /= nf90_noerr) call this%handle_err(status)
2534 status = nf90_put_att(this%ncid, varid,
'long_name', lname)
2535 if (status /= nf90_noerr) call this%handle_err(status)
2536 status = nf90_put_att(this%ncid, varid,
'units', units)
2537 if (status /= nf90_noerr) call this%handle_err(status)
2539 status = nf90_enddef(this%ncid)
2541 if (status /= nf90_noerr) call this%handle_err(status)
procedure get_var_nc_int
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_short_1d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_real
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_int_1d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
generic get_var=> get_var_nc_double_1d, get_var_nc_double_2d,get_var_nc_double_3d,get_var_nc_real_1d, get_var_nc_real_2d,get_var_nc_real_3d,get_var_nc_short_1d, get_var_nc_short_2d,get_var_nc_int_1d, get_var_nc_int_2d,get_var_nc_int_3d,get_var_nc_char_1d, get_var_nc_char_2d,get_var_nc_char_3d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_int_2d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_int_3d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_double_3d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_att_nc_real
Get attribute.
subroutine open_nc(this, filename, action, debug_level)
Open a netcdf file, set initial debug level.
generic get_att=> get_att_nc_int, get_att_nc_real, get_att_nc_string
Get attribute.
procedure add_new_var=> add_new_var_3d
Add a new 3d variable to output file.
subroutine close_nc(this)
Close a netcdf file.
procedure replace_var_nc_char_1d
Replace character type variable.
procedure get_var_nc_double_2d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_real_1d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_double_1d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_real_3d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
Functions to read and write netcdf files.
procedure get_var_nc_real
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_short_2d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
subroutine add_new_var_3d(this, varname, dname1, dname2, dname3, lname, units)
Add a new variable to sfc_data.nc with dimensions (Time, yaxis_1, xaxis_1).
procedure replace_var_nc_char
Replace character type variable.
procedure replace_var_nc_real_2d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure convert_theta2t_2dgrid
Convert theta T (Kelvin) to T (deg C).
procedure replace_var_nc_int_1d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_char
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_real_1d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_short
Read in a 1d, 2d, 3d, or 4d field from the nc file.
subroutine get_dim_nc(this, dimname, dimvalue)
Get dimensions in netcdf file.
procedure get_dim=> get_dim_nc
read in dimension from the nc file
procedure replace_var_nc_int
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure handle_err
Handle netCDF errors.
procedure get_var_nc_real_2d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_real_3d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_double_1d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_double
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_double
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_double_2d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_char_2d
Replace character type variable.
procedure get_att_nc_string
Get attribute.
procedure get_var_nc_int_2d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_char_1d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_char_2d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_char_3d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure get_var_nc_double_3d
Read in a 1d, 2d, 3d, or 4d field from the nc file.
procedure replace_var_nc_char_3d
Replace 3D character type variable.
generic replace_var=> replace_var_nc_double_1d, replace_var_nc_double_2d,replace_var_nc_double_3d,replace_var_nc_real_1d, replace_var_nc_real_2d,replace_var_nc_real_3d,replace_var_nc_int_1d, replace_var_nc_int_2d,replace_var_nc_int_3d,replace_var_nc_char_1d, replace_var_nc_char_2d,replace_var_nc_char_3d
Replace 1d, 2d, 3d, or 4d field from the nc file.
procedure get_att_nc_int
Get attribute.
procedure replace_var_nc_int_3d
Replace 1d, 2d, 3d, or 4d field from the nc file.