MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
disncstructuredmodule::nc_export_array Interface Reference
Collaboration diagram for disncstructuredmodule::nc_export_array:
Collaboration graph

Private Member Functions

subroutine nc_export_int1d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
 netcdf export 1D integer More...
 
subroutine nc_export_int2d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 2D integer More...
 
subroutine nc_export_int3d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 3D integer More...
 
subroutine nc_export_dbl1d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
 netcdf export 1D double More...
 
subroutine nc_export_dbl2d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 2D double More...
 
subroutine nc_export_dbl3d (ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, nc_fname)
 netcdf export 3D double More...
 

Detailed Description

Definition at line 83 of file DisNCStructured.f90.

Member Function/Subroutine Documentation

◆ nc_export_dbl1d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl1d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
real(dp), dimension(:), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
integer(i4b), intent(in)  iper,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1229 of file DisNCStructured.f90.

1233  use constantsmodule, only: dnodata
1234  integer(I4B), intent(in) :: ncid
1235  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1236  type(StructuredNCVarIdType), intent(inout) :: var_ids
1237  type(DisType), pointer, intent(in) :: dis
1238  real(DP), dimension(:), pointer, contiguous, intent(in) :: p_mem
1239  character(len=*), intent(in) :: nc_varname
1240  character(len=*), intent(in) :: pkgname
1241  character(len=*), intent(in) :: tagname
1242  character(len=*), intent(in) :: shapestr
1243  character(len=*), intent(in) :: longname
1244  character(len=*), intent(in) :: nc_tag
1245  character(len=*), intent(in) :: gridmap_name
1246  logical(LGP), intent(in) :: latlon
1247  integer(I4B), intent(in) :: deflate
1248  integer(I4B), intent(in) :: shuffle
1249  integer(I4B), intent(in) :: chunk_z
1250  integer(I4B), intent(in) :: chunk_y
1251  integer(I4B), intent(in) :: chunk_x
1252  integer(I4B), intent(in) :: iper
1253  character(len=*), intent(in) :: nc_fname
1254  integer(I4B) :: var_id, axis_sz
1255  real(DP) :: fill_value
1256  character(len=LINELENGTH) :: longname_l
1257 
1258  if (shapestr == 'NROW' .or. &
1259  shapestr == 'NCOL' .or. &
1260  shapestr == 'NCPL') then
1261 
1262  select case (shapestr)
1263  case ('NROW')
1264  axis_sz = dim_ids%y
1265  case ('NCOL')
1266  axis_sz = dim_ids%x
1267  case ('NCPL')
1268  axis_sz = dim_ids%ncpl
1269  end select
1270 
1271  ! reenter define mode and create variable
1272  call nf_verify(nf90_redef(ncid), nc_fname)
1273  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1274  (/axis_sz/), var_id), &
1275  nc_fname)
1276 
1277  ! NROW/NCOL shapes use default chunking
1278  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1279 
1280  ! put attr
1281  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1282  (/nf90_fill_double/)), nc_fname)
1283  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1284  longname), nc_fname)
1285 
1286  ! add mf6 attr
1287  call ncvar_mf6attr(ncid, var_id, 0, 0, nc_tag, nc_fname)
1288 
1289  ! exit define mode and write data
1290  call nf_verify(nf90_enddef(ncid), nc_fname)
1291  call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1292  nc_fname)
1293 
1294  else
1295  if (iper > 0) then
1296  fill_value = dnodata
1297  else
1298  fill_value = nf90_fill_double
1299  end if
1300 
1301  longname_l = export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1302 
1303  ! reenter define mode and create variable
1304  call nf_verify(nf90_redef(ncid), nc_fname)
1305  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1306  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1307  nc_fname)
1308 
1309  ! apply chunking parameters
1310  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1311  ! deflate and shuffle
1312  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1313 
1314  ! put attr
1315  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1316  (/fill_value/)), nc_fname)
1317  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1318  longname_l), nc_fname)
1319 
1320  ! add grid mapping and mf6 attr
1321  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1322  call ncvar_mf6attr(ncid, var_id, iper, 0, nc_tag, nc_fname)
1323 
1324  ! exit define mode and write data
1325  call nf_verify(nf90_enddef(ncid), nc_fname)
1326  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1327  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1328  nc_fname)
1329  end if
This module contains simulation constants.
Definition: Constants.f90:9
real(dp), parameter dnodata
real no data constant
Definition: Constants.f90:95
Here is the call graph for this function:

◆ nc_export_dbl2d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl2d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
real(dp), dimension(:, :), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1334 of file DisNCStructured.f90.

1338  integer(I4B), intent(in) :: ncid
1339  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1340  type(StructuredNCVarIdType), intent(inout) :: var_ids
1341  type(DisType), pointer, intent(in) :: dis
1342  real(DP), dimension(:, :), pointer, contiguous, intent(in) :: p_mem
1343  character(len=*), intent(in) :: nc_varname
1344  character(len=*), intent(in) :: pkgname
1345  character(len=*), intent(in) :: tagname
1346  character(len=*), intent(in) :: shapestr
1347  character(len=*), intent(in) :: longname
1348  character(len=*), intent(in) :: nc_tag
1349  character(len=*), intent(in) :: gridmap_name
1350  logical(LGP), intent(in) :: latlon
1351  integer(I4B), intent(in) :: deflate
1352  integer(I4B), intent(in) :: shuffle
1353  integer(I4B), intent(in) :: chunk_z
1354  integer(I4B), intent(in) :: chunk_y
1355  integer(I4B), intent(in) :: chunk_x
1356  character(len=*), intent(in) :: nc_fname
1357  integer(I4B) :: var_id
1358 
1359  ! reenter define mode and create variable
1360  call nf_verify(nf90_redef(ncid), nc_fname)
1361  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1362  (/dim_ids%x, dim_ids%y/), var_id), &
1363  nc_fname)
1364 
1365  ! apply chunking parameters
1366  call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1367  ! deflate and shuffle
1368  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1369 
1370  ! put attr
1371  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1372  (/nf90_fill_double/)), nc_fname)
1373  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1374  longname), nc_fname)
1375 
1376  ! add grid mapping and mf6 attr
1377  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1378  call ncvar_mf6attr(ncid, var_id, 0, 0, nc_tag, nc_fname)
1379 
1380  ! exit define mode and write data
1381  call nf_verify(nf90_enddef(ncid), nc_fname)
1382  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1383  count=(/dis%ncol, dis%nrow/)), &
1384  nc_fname)
Here is the call graph for this function:

◆ nc_export_dbl3d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl3d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
real(dp), dimension(:, :, :), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
integer(i4b), intent(in)  iper,
integer(i4b), intent(in)  iaux,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1389 of file DisNCStructured.f90.

1393  use constantsmodule, only: dnodata
1394  integer(I4B), intent(in) :: ncid
1395  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1396  type(StructuredNCVarIdType), intent(inout) :: var_ids
1397  type(DisType), pointer, intent(in) :: dis
1398  real(DP), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem
1399  character(len=*), intent(in) :: nc_varname
1400  character(len=*), intent(in) :: pkgname
1401  character(len=*), intent(in) :: tagname
1402  character(len=*), intent(in) :: shapestr
1403  character(len=*), intent(in) :: longname
1404  character(len=*), intent(in) :: nc_tag
1405  character(len=*), intent(in) :: gridmap_name
1406  logical(LGP), intent(in) :: latlon
1407  integer(I4B), intent(in) :: deflate
1408  integer(I4B), intent(in) :: shuffle
1409  integer(I4B), intent(in) :: chunk_z
1410  integer(I4B), intent(in) :: chunk_y
1411  integer(I4B), intent(in) :: chunk_x
1412  integer(I4B), intent(in) :: iper
1413  integer(I4B), intent(in) :: iaux
1414  character(len=*), intent(in) :: nc_fname
1415  integer(I4B) :: var_id
1416  real(DP) :: fill_value
1417  character(len=LINELENGTH) :: longname_l
1418 
1419  if (iper > 0) then
1420  fill_value = dnodata
1421  else
1422  fill_value = nf90_fill_double
1423  end if
1424 
1425  longname_l = export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1426 
1427  ! reenter define mode and create variable
1428  call nf_verify(nf90_redef(ncid), nc_fname)
1429  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1430  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1431  nc_fname)
1432 
1433  ! apply chunking parameters
1434  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1435  ! deflate and shuffle
1436  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1437 
1438  ! put attr
1439  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1440  (/fill_value/)), nc_fname)
1441  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1442  longname_l), nc_fname)
1443 
1444  ! add grid mapping and mf6 attr
1445  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1446  call ncvar_mf6attr(ncid, var_id, iper, iaux, nc_tag, nc_fname)
1447 
1448  ! exit define mode and write data
1449  call nf_verify(nf90_enddef(ncid), nc_fname)
1450  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1451  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1452  nc_fname)
Here is the call graph for this function:

◆ nc_export_int1d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int1d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
integer(i4b), dimension(:), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
integer(i4b), intent(in)  iper,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1022 of file DisNCStructured.f90.

1026  integer(I4B), intent(in) :: ncid
1027  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1028  type(StructuredNCVarIdType), intent(inout) :: var_ids
1029  type(DisType), pointer, intent(in) :: dis
1030  integer(I4B), dimension(:), pointer, contiguous, intent(in) :: p_mem
1031  character(len=*), intent(in) :: nc_varname
1032  character(len=*), intent(in) :: pkgname
1033  character(len=*), intent(in) :: tagname
1034  character(len=*), intent(in) :: shapestr
1035  character(len=*), intent(in) :: longname
1036  character(len=*), intent(in) :: nc_tag
1037  character(len=*), intent(in) :: gridmap_name
1038  logical(LGP), intent(in) :: latlon
1039  integer(I4B), intent(in) :: deflate
1040  integer(I4B), intent(in) :: shuffle
1041  integer(I4B), intent(in) :: chunk_z
1042  integer(I4B), intent(in) :: chunk_y
1043  integer(I4B), intent(in) :: chunk_x
1044  integer(I4B), intent(in) :: iper
1045  character(len=*), intent(in) :: nc_fname
1046  integer(I4B) :: var_id, axis_sz
1047  character(len=LINELENGTH) :: longname_l
1048 
1049  if (shapestr == 'NROW' .or. &
1050  shapestr == 'NCOL' .or. &
1051  shapestr == 'NCPL') then
1052 
1053  select case (shapestr)
1054  case ('NROW')
1055  axis_sz = dim_ids%y
1056  case ('NCOL')
1057  axis_sz = dim_ids%x
1058  case ('NCPL')
1059  axis_sz = dim_ids%ncpl
1060  end select
1061 
1062  longname_l = export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1063 
1064  ! reenter define mode and create variable
1065  call nf_verify(nf90_redef(ncid), nc_fname)
1066  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1067  (/axis_sz/), var_id), &
1068  nc_fname)
1069 
1070  ! NROW/NCOL shapes use default chunking
1071  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1072 
1073  ! put attr
1074  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1075  (/nf90_fill_int/)), nc_fname)
1076  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1077  longname_l), nc_fname)
1078 
1079  ! add mf6 attr
1080  call ncvar_mf6attr(ncid, var_id, iper, 0, nc_tag, nc_fname)
1081 
1082  ! exit define mode and write data
1083  call nf_verify(nf90_enddef(ncid), nc_fname)
1084  call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1085  nc_fname)
1086 
1087  else
1088  ! reenter define mode and create variable
1089  call nf_verify(nf90_redef(ncid), nc_fname)
1090  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1091  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1092  nc_fname)
1093 
1094  ! apply chunking parameters
1095  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1096  ! deflate and shuffle
1097  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1098 
1099  ! put attr
1100  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1101  (/nf90_fill_int/)), nc_fname)
1102  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1103  longname), nc_fname)
1104 
1105  ! add grid mapping and mf6 attr
1106  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1107  call ncvar_mf6attr(ncid, var_id, 0, 0, nc_tag, nc_fname)
1108 
1109  ! exit define mode and write data
1110  call nf_verify(nf90_enddef(ncid), nc_fname)
1111  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1112  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1113  nc_fname)
1114  end if
Here is the call graph for this function:

◆ nc_export_int2d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int2d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
integer(i4b), dimension(:, :), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1119 of file DisNCStructured.f90.

1123  integer(I4B), intent(in) :: ncid
1124  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1125  type(StructuredNCVarIdType), intent(inout) :: var_ids
1126  type(DisType), pointer, intent(in) :: dis
1127  integer(I4B), dimension(:, :), pointer, contiguous, intent(in) :: p_mem
1128  character(len=*), intent(in) :: nc_varname
1129  character(len=*), intent(in) :: pkgname
1130  character(len=*), intent(in) :: tagname
1131  character(len=*), intent(in) :: shapestr
1132  character(len=*), intent(in) :: longname
1133  character(len=*), intent(in) :: nc_tag
1134  character(len=*), intent(in) :: gridmap_name
1135  logical(LGP), intent(in) :: latlon
1136  integer(I4B), intent(in) :: deflate
1137  integer(I4B), intent(in) :: shuffle
1138  integer(I4B), intent(in) :: chunk_z
1139  integer(I4B), intent(in) :: chunk_y
1140  integer(I4B), intent(in) :: chunk_x
1141  character(len=*), intent(in) :: nc_fname
1142  integer(I4B) :: var_id
1143 
1144  ! reenter define mode and create variable
1145  call nf_verify(nf90_redef(ncid), nc_fname)
1146  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1147  (/dim_ids%x, dim_ids%y/), var_id), &
1148  nc_fname)
1149 
1150  ! apply chunking parameters
1151  call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1152  ! deflate and shuffle
1153  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1154 
1155  ! put attr
1156  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1157  (/nf90_fill_int/)), nc_fname)
1158  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1159  longname), nc_fname)
1160 
1161  ! add grid mapping and mf6 attr
1162  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1163  call ncvar_mf6attr(ncid, var_id, 0, 0, nc_tag, nc_fname)
1164 
1165  ! exit define mode and write data
1166  call nf_verify(nf90_enddef(ncid), nc_fname)
1167  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1168  count=(/dis%ncol, dis%nrow/)), &
1169  nc_fname)
Here is the call graph for this function:

◆ nc_export_int3d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int3d ( integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
integer(i4b), dimension(:, :, :), intent(in), pointer, contiguous  p_mem,
character(len=*), intent(in)  nc_varname,
character(len=*), intent(in)  pkgname,
character(len=*), intent(in)  tagname,
character(len=*), intent(in)  shapestr,
character(len=*), intent(in)  longname,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  gridmap_name,
logical(lgp), intent(in)  latlon,
integer(i4b), intent(in)  deflate,
integer(i4b), intent(in)  shuffle,
integer(i4b), intent(in)  chunk_z,
integer(i4b), intent(in)  chunk_y,
integer(i4b), intent(in)  chunk_x,
character(len=*), intent(in)  nc_fname 
)
private

Definition at line 1174 of file DisNCStructured.f90.

1178  integer(I4B), intent(in) :: ncid
1179  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1180  type(StructuredNCVarIdType), intent(inout) :: var_ids
1181  type(DisType), pointer, intent(in) :: dis
1182  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem
1183  character(len=*), intent(in) :: nc_varname
1184  character(len=*), intent(in) :: pkgname
1185  character(len=*), intent(in) :: tagname
1186  character(len=*), intent(in) :: shapestr
1187  character(len=*), intent(in) :: longname
1188  character(len=*), intent(in) :: nc_tag
1189  character(len=*), intent(in) :: gridmap_name
1190  logical(LGP), intent(in) :: latlon
1191  integer(I4B), intent(in) :: deflate
1192  integer(I4B), intent(in) :: shuffle
1193  integer(I4B), intent(in) :: chunk_z
1194  integer(I4B), intent(in) :: chunk_y
1195  integer(I4B), intent(in) :: chunk_x
1196  character(len=*), intent(in) :: nc_fname
1197  integer(I4B) :: var_id
1198 
1199  ! reenter define mode and create variable
1200  call nf_verify(nf90_redef(ncid), nc_fname)
1201  call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1202  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1203  nc_fname)
1204 
1205  ! apply chunking parameters
1206  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1207  ! deflate and shuffle
1208  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1209 
1210  ! put attr
1211  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1212  (/nf90_fill_int/)), nc_fname)
1213  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1214  longname), nc_fname)
1215 
1216  ! add grid mapping and mf6 attr
1217  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1218  call ncvar_mf6attr(ncid, var_id, 0, 0, nc_tag, nc_fname)
1219 
1220  ! exit define mode and write data
1221  call nf_verify(nf90_enddef(ncid), nc_fname)
1222  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1223  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1224  nc_fname)
Here is the call graph for this function:

The documentation for this interface was generated from the following file: