MODFLOW 6  version 6.7.0.dev2
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 (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
 netcdf export 1D integer More...
 
subroutine nc_export_int2d (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 2D integer More...
 
subroutine nc_export_int3d (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 3D integer More...
 
subroutine nc_export_dbl1d (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, nc_fname)
 netcdf export 1D double More...
 
subroutine nc_export_dbl2d (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 2D double More...
 
subroutine nc_export_dbl3d (p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
 netcdf export 3D double More...
 

Detailed Description

Definition at line 86 of file DisNCStructured.f90.

Member Function/Subroutine Documentation

◆ nc_export_dbl1d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl1d ( real(dp), dimension(:), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1334 of file DisNCStructured.f90.

1338  use netcdfcommonmodule, only: ixstp
1339  real(DP), dimension(:), pointer, contiguous, intent(in) :: p_mem
1340  integer(I4B), intent(in) :: ncid
1341  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1342  type(StructuredNCVarIdType), intent(inout) :: var_ids
1343  type(DisType), pointer, intent(in) :: dis
1344  type(InputParamDefinitionType), pointer, intent(in) :: idt
1345  character(len=*), intent(in) :: mempath
1346  character(len=*), intent(in) :: nc_tag
1347  character(len=*), intent(in) :: pkgname
1348  character(len=*), intent(in) :: gridmap_name
1349  logical(LGP), intent(in) :: latlon
1350  integer(I4B), intent(in) :: deflate
1351  integer(I4B), intent(in) :: shuffle
1352  integer(I4B), intent(in) :: chunk_z
1353  integer(I4B), intent(in) :: chunk_y
1354  integer(I4B), intent(in) :: chunk_x
1355  integer(I4B), intent(in) :: iper
1356  integer(I4B), intent(in) :: iaux
1357  character(len=*), intent(in) :: nc_fname
1358  integer(I4B) :: var_id, axis_sz, istp
1359  character(len=LINELENGTH) :: varname, longname
1360 
1361  if (idt%shape == 'NROW' .or. &
1362  idt%shape == 'NCOL' .or. &
1363  idt%shape == 'NCPL' .or. &
1364  idt%shape == 'NAUX NCPL') then
1365 
1366  if (iper == 0) then
1367  select case (idt%shape)
1368  case ('NROW')
1369  axis_sz = dim_ids%y
1370  case ('NCOL')
1371  axis_sz = dim_ids%x
1372  case ('NCPL', 'NAUX NCPL')
1373  axis_sz = dim_ids%ncpl
1374  end select
1375 
1376  varname = export_varname(pkgname, idt%tagname, mempath)
1377  longname = export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1378  iaux=iaux)
1379 
1380  ! reenter define mode and create variable
1381  call nf_verify(nf90_redef(ncid), nc_fname)
1382  call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1383  (/axis_sz/), var_id), &
1384  nc_fname)
1385 
1386  ! NROW/NCOL shapes use default chunking
1387  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1388 
1389  ! put attr
1390  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1391  (/nf90_fill_double/)), nc_fname)
1392  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1393  longname), nc_fname)
1394 
1395  ! add mf6 attr
1396  call ncvar_mf6attr(ncid, var_id, iaux, nc_tag, nc_fname)
1397 
1398  ! exit define mode and write data
1399  call nf_verify(nf90_enddef(ncid), nc_fname)
1400  call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1401  nc_fname)
1402  else
1403  ! timeseries
1404  istp = ixstp()
1405  call nf_verify(nf90_put_var(ncid, &
1406  var_ids%export, p_mem, &
1407  start=(/1, istp/), &
1408  count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1409  end if
1410 
1411  else
1412 
1413  if (iper == 0) then
1414  varname = export_varname(pkgname, idt%tagname, mempath, iaux=iaux)
1415  longname = export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1416  iaux=iaux)
1417 
1418  ! reenter define mode and create variable
1419  call nf_verify(nf90_redef(ncid), nc_fname)
1420  call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1421  (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1422  var_id), nc_fname)
1423 
1424  ! apply chunking parameters
1425  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1426  ! deflate and shuffle
1427  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1428 
1429  ! put attr
1430  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1431  (/nf90_fill_double/)), nc_fname)
1432  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1433  longname), nc_fname)
1434 
1435  ! add grid mapping and mf6 attr
1436  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1437  call ncvar_mf6attr(ncid, var_id, iaux, nc_tag, nc_fname)
1438 
1439  ! exit define mode and write data
1440  call nf_verify(nf90_enddef(ncid), nc_fname)
1441  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1442  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1443  nc_fname)
1444  else
1445  ! timeseries
1446  istp = ixstp()
1447  call nf_verify(nf90_put_var(ncid, &
1448  var_ids%export, p_mem, &
1449  start=(/1, 1, 1, istp/), &
1450  count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1451  nc_fname)
1452  end if
1453  end if
This module contains the NetCDFCommonModule.
Definition: NetCDFCommon.f90:6
integer(i4b) function, public ixstp()
step index for timeseries data
Here is the call graph for this function:

◆ nc_export_dbl2d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl2d ( real(dp), dimension(:, :), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1458 of file DisNCStructured.f90.

1461  real(DP), dimension(:, :), pointer, contiguous, intent(in) :: p_mem
1462  integer(I4B), intent(in) :: ncid
1463  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1464  type(StructuredNCVarIdType), intent(inout) :: var_ids
1465  type(DisType), pointer, intent(in) :: dis
1466  type(InputParamDefinitionType), pointer, intent(in) :: idt
1467  character(len=*), intent(in) :: mempath
1468  character(len=*), intent(in) :: nc_tag
1469  character(len=*), intent(in) :: pkgname
1470  character(len=*), intent(in) :: gridmap_name
1471  logical(LGP), intent(in) :: latlon
1472  integer(I4B), intent(in) :: deflate
1473  integer(I4B), intent(in) :: shuffle
1474  integer(I4B), intent(in) :: chunk_z
1475  integer(I4B), intent(in) :: chunk_y
1476  integer(I4B), intent(in) :: chunk_x
1477  character(len=*), intent(in) :: nc_fname
1478  character(len=LINELENGTH) :: varname
1479  integer(I4B) :: var_id
1480 
1481  varname = export_varname(pkgname, idt%tagname, mempath)
1482 
1483  ! reenter define mode and create variable
1484  call nf_verify(nf90_redef(ncid), nc_fname)
1485  call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1486  (/dim_ids%x, dim_ids%y/), var_id), &
1487  nc_fname)
1488 
1489  ! apply chunking parameters
1490  call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1491  ! deflate and shuffle
1492  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1493 
1494  ! put attr
1495  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1496  (/nf90_fill_double/)), nc_fname)
1497  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1498  idt%longname), nc_fname)
1499 
1500  ! add grid mapping and mf6 attr
1501  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1502  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1503 
1504  ! exit define mode and write data
1505  call nf_verify(nf90_enddef(ncid), nc_fname)
1506  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1507  count=(/dis%ncol, dis%nrow/)), &
1508  nc_fname)
Here is the call graph for this function:

◆ nc_export_dbl3d()

subroutine disncstructuredmodule::nc_export_array::nc_export_dbl3d ( real(dp), dimension(:, :, :), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1513 of file DisNCStructured.f90.

1516  real(DP), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem
1517  integer(I4B), intent(in) :: ncid
1518  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1519  type(StructuredNCVarIdType), intent(inout) :: var_ids
1520  type(DisType), pointer, intent(in) :: dis
1521  type(InputParamDefinitionType), pointer, intent(in) :: idt
1522  character(len=*), intent(in) :: mempath
1523  character(len=*), intent(in) :: nc_tag
1524  character(len=*), intent(in) :: pkgname
1525  character(len=*), intent(in) :: gridmap_name
1526  logical(LGP), intent(in) :: latlon
1527  integer(I4B), intent(in) :: deflate
1528  integer(I4B), intent(in) :: shuffle
1529  integer(I4B), intent(in) :: chunk_z
1530  integer(I4B), intent(in) :: chunk_y
1531  integer(I4B), intent(in) :: chunk_x
1532  character(len=*), intent(in) :: nc_fname
1533  integer(I4B) :: var_id
1534  character(len=LINELENGTH) :: varname, longname
1535 
1536  varname = export_varname(pkgname, idt%tagname, mempath)
1537  longname = export_longname(idt%longname, pkgname, idt%tagname, mempath)
1538 
1539  ! reenter define mode and create variable
1540  call nf_verify(nf90_redef(ncid), nc_fname)
1541  call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1542  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1543  nc_fname)
1544 
1545  ! apply chunking parameters
1546  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1547  ! deflate and shuffle
1548  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1549 
1550  ! put attr
1551  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1552  (/nf90_fill_double/)), nc_fname)
1553  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1554  longname), nc_fname)
1555 
1556  ! add grid mapping and mf6 attr
1557  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1558  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1559 
1560  ! exit define mode and write data
1561  call nf_verify(nf90_enddef(ncid), nc_fname)
1562  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1563  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1564  nc_fname)
Here is the call graph for this function:

◆ nc_export_int1d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int1d ( integer(i4b), dimension(:), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1106 of file DisNCStructured.f90.

1109  use netcdfcommonmodule, only: ixstp
1110  integer(I4B), dimension(:), pointer, contiguous, intent(in) :: p_mem
1111  integer(I4B), intent(in) :: ncid
1112  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1113  type(StructuredNCVarIdType), intent(inout) :: var_ids
1114  type(DisType), pointer, intent(in) :: dis
1115  type(InputParamDefinitionType), pointer, intent(in) :: idt
1116  character(len=*), intent(in) :: mempath
1117  character(len=*), intent(in) :: nc_tag
1118  character(len=*), intent(in) :: pkgname
1119  character(len=*), intent(in) :: gridmap_name
1120  logical(LGP), intent(in) :: latlon
1121  integer(I4B), intent(in) :: deflate
1122  integer(I4B), intent(in) :: shuffle
1123  integer(I4B), intent(in) :: chunk_z
1124  integer(I4B), intent(in) :: chunk_y
1125  integer(I4B), intent(in) :: chunk_x
1126  integer(I4B), intent(in) :: iper
1127  character(len=*), intent(in) :: nc_fname
1128  integer(I4B) :: var_id, axis_sz, istp
1129  character(len=LINELENGTH) :: varname, longname
1130 
1131  varname = export_varname(pkgname, idt%tagname, mempath)
1132 
1133  if (idt%shape == 'NROW' .or. &
1134  idt%shape == 'NCOL' .or. &
1135  idt%shape == 'NCPL' .or. &
1136  idt%shape == 'NAUX NCPL') then
1137 
1138  if (iper == 0) then
1139  select case (idt%shape)
1140  case ('NROW')
1141  axis_sz = dim_ids%y
1142  case ('NCOL')
1143  axis_sz = dim_ids%x
1144  case ('NCPL', 'NAUX NCPL')
1145  axis_sz = dim_ids%ncpl
1146  end select
1147 
1148  longname = export_longname(idt%longname, pkgname, idt%tagname, mempath)
1149 
1150  ! reenter define mode and create variable
1151  call nf_verify(nf90_redef(ncid), nc_fname)
1152  call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1153  (/axis_sz/), var_id), &
1154  nc_fname)
1155 
1156  ! NROW/NCOL shapes use default chunking
1157  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1158 
1159  ! put attr
1160  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1161  (/nf90_fill_int/)), nc_fname)
1162  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1163  longname), nc_fname)
1164 
1165  ! add mf6 attr
1166  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1167 
1168  ! exit define mode and write data
1169  call nf_verify(nf90_enddef(ncid), nc_fname)
1170  call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1171  nc_fname)
1172  else
1173  ! timeseries
1174  istp = ixstp()
1175  call nf_verify(nf90_put_var(ncid, &
1176  var_ids%export, p_mem, &
1177  start=(/1, istp/), &
1178  count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1179  end if
1180 
1181  else
1182 
1183  if (iper == 0) then
1184  ! reenter define mode and create variable
1185  call nf_verify(nf90_redef(ncid), nc_fname)
1186  call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1187  (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1188  var_id), nc_fname)
1189 
1190  ! apply chunking parameters
1191  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1192  ! deflate and shuffle
1193  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1194 
1195  ! put attr
1196  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1197  (/nf90_fill_int/)), nc_fname)
1198  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1199  idt%longname), nc_fname)
1200 
1201  ! add grid mapping and mf6 attr
1202  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1203  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1204 
1205  ! exit define mode and write data
1206  call nf_verify(nf90_enddef(ncid), nc_fname)
1207  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1208  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1209  nc_fname)
1210  else
1211  ! timeseries
1212  istp = ixstp()
1213  call nf_verify(nf90_put_var(ncid, &
1214  var_ids%export, p_mem, &
1215  start=(/1, 1, 1, istp/), &
1216  count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1217  nc_fname)
1218  end if
1219  end if
Here is the call graph for this function:

◆ nc_export_int2d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int2d ( integer(i4b), dimension(:, :), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1224 of file DisNCStructured.f90.

1227  integer(I4B), dimension(:, :), pointer, contiguous, intent(in) :: p_mem
1228  integer(I4B), intent(in) :: ncid
1229  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1230  type(StructuredNCVarIdType), intent(inout) :: var_ids
1231  type(DisType), pointer, intent(in) :: dis
1232  type(InputParamDefinitionType), pointer, intent(in) :: idt
1233  character(len=*), intent(in) :: mempath
1234  character(len=*), intent(in) :: nc_tag
1235  character(len=*), intent(in) :: pkgname
1236  character(len=*), intent(in) :: gridmap_name
1237  logical(LGP), intent(in) :: latlon
1238  integer(I4B), intent(in) :: deflate
1239  integer(I4B), intent(in) :: shuffle
1240  integer(I4B), intent(in) :: chunk_z
1241  integer(I4B), intent(in) :: chunk_y
1242  integer(I4B), intent(in) :: chunk_x
1243  character(len=*), intent(in) :: nc_fname
1244  character(len=LINELENGTH) :: varname
1245  integer(I4B) :: var_id
1246 
1247  varname = export_varname(pkgname, idt%tagname, mempath)
1248 
1249  ! reenter define mode and create variable
1250  call nf_verify(nf90_redef(ncid), nc_fname)
1251  call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1252  (/dim_ids%x, dim_ids%y/), var_id), &
1253  nc_fname)
1254 
1255  ! apply chunking parameters
1256  call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1257  ! deflate and shuffle
1258  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1259 
1260  ! put attr
1261  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1262  (/nf90_fill_int/)), nc_fname)
1263  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1264  idt%longname), nc_fname)
1265 
1266  ! add grid mapping and mf6 attr
1267  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1268  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1269 
1270  ! exit define mode and write data
1271  call nf_verify(nf90_enddef(ncid), nc_fname)
1272  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1273  count=(/dis%ncol, dis%nrow/)), &
1274  nc_fname)
Here is the call graph for this function:

◆ nc_export_int3d()

subroutine disncstructuredmodule::nc_export_array::nc_export_int3d ( integer(i4b), dimension(:, :, :), intent(in), pointer, contiguous  p_mem,
integer(i4b), intent(in)  ncid,
type(structuredncdimidtype), intent(inout)  dim_ids,
type(structuredncvaridtype), intent(inout)  var_ids,
type(distype), intent(in), pointer  dis,
type(inputparamdefinitiontype), intent(in), pointer  idt,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  nc_tag,
character(len=*), intent(in)  pkgname,
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 1279 of file DisNCStructured.f90.

1282  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(in) :: p_mem
1283  integer(I4B), intent(in) :: ncid
1284  type(StructuredNCDimIdType), intent(inout) :: dim_ids
1285  type(StructuredNCVarIdType), intent(inout) :: var_ids
1286  type(DisType), pointer, intent(in) :: dis
1287  type(InputParamDefinitionType), pointer, intent(in) :: idt
1288  character(len=*), intent(in) :: mempath
1289  character(len=*), intent(in) :: nc_tag
1290  character(len=*), intent(in) :: pkgname
1291  character(len=*), intent(in) :: gridmap_name
1292  logical(LGP), intent(in) :: latlon
1293  integer(I4B), intent(in) :: deflate
1294  integer(I4B), intent(in) :: shuffle
1295  integer(I4B), intent(in) :: chunk_z
1296  integer(I4B), intent(in) :: chunk_y
1297  integer(I4B), intent(in) :: chunk_x
1298  character(len=*), intent(in) :: nc_fname
1299  character(len=LINELENGTH) :: varname
1300  integer(I4B) :: var_id
1301 
1302  varname = export_varname(pkgname, idt%tagname, mempath)
1303 
1304  ! reenter define mode and create variable
1305  call nf_verify(nf90_redef(ncid), nc_fname)
1306  call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1307  (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1308  nc_fname)
1309 
1310  ! apply chunking parameters
1311  call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1312  ! deflate and shuffle
1313  call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1314 
1315  ! put attr
1316  call nf_verify(nf90_put_att(ncid, var_id, '_FillValue', &
1317  (/nf90_fill_int/)), nc_fname)
1318  call nf_verify(nf90_put_att(ncid, var_id, 'long_name', &
1319  idt%longname), nc_fname)
1320 
1321  ! add grid mapping and mf6 attr
1322  call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1323  call ncvar_mf6attr(ncid, var_id, 0, nc_tag, nc_fname)
1324 
1325  ! exit define mode and write data
1326  call nf_verify(nf90_enddef(ncid), nc_fname)
1327  call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1328  count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1329  nc_fname)
Here is the call graph for this function:

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