Skip to content

Commit b288064

Browse files
mjrenomjreno
authored andcommitted
add warning when wkt provided for rotated grid with structured export
1 parent 22e5811 commit b288064

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/mf6io/mf6ivar/dfn/utl-ncf.dfn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ shape (ncpl)
9696
optional true
9797
reader readarray
9898
longname cell center latitude
99-
description cell center latitude. Only supported for NETCDF\_STRUCTURED export types.
99+
description cell center latitude. Only supported for NETCDF\_STRUCTURED export type.
100100

101101
block griddata
102102
name longitude
@@ -105,4 +105,4 @@ shape (ncpl)
105105
optional true
106106
reader readarray
107107
longname cell center longitude
108-
description cell center longitude. Only supported for NETCDF\_STRUCTURED export types.
108+
description cell center longitude. Only supported for NETCDF\_STRUCTURED export type.

src/Utilities/Export/DisNCStructured.f90

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module DisNCStructuredModule
99

1010
use KindModule, only: DP, I4B, LGP
1111
use ConstantsModule, only: LINELENGTH, LENBIGLINE, LENCOMPONENTNAME, &
12-
LENMEMPATH, LENVARNAME
12+
LENMEMPATH, LENVARNAME, DNODATA, DZERO
1313
use SimVariablesModule, only: errmsg, warnmsg
1414
use SimModule, only: store_error, store_warning, store_error_filename
1515
use MemoryManagerModule, only: mem_setptr
@@ -127,6 +127,7 @@ subroutine dis_export_init(this, modelname, modeltype, modelfname, nc_fname, &
127127
! initialize base class
128128
call this%NCModelExportType%init(modelname, modeltype, modelfname, nc_fname, &
129129
disenum, nctype, iout)
130+
130131
! update values from input context
131132
if (this%ncf_mempath /= '') then
132133
call mem_set_value(this%chunk_z, 'CHUNK_Z', this%ncf_mempath, found)
@@ -163,6 +164,14 @@ subroutine dis_export_init(this, modelname, modeltype, modelfname, nc_fname, &
163164
call mem_setptr(this%latitude, 'LATITUDE', this%ncf_mempath)
164165
call mem_setptr(this%longitude, 'LONGITUDE', this%ncf_mempath)
165166
end if
167+
168+
if (this%wkt /= '') then
169+
if (this%dis%angrot /= DZERO) then
170+
write (warnmsg, '(a)') 'WKT parameter set with structured rotated &
171+
&grid. Projected coordinates will have grid local values.'
172+
call store_warning(warnmsg)
173+
end if
174+
end if
166175
end if
167176

168177
if (this%dis%lenuni == 1) then
@@ -380,7 +389,6 @@ end subroutine export_input_arrays
380389
!> @brief netcdf export package dynamic input with ilayer index variable
381390
!<
382391
subroutine package_step_ilayer(this, export_pkg, ilayer_varname, ilayer)
383-
use ConstantsModule, only: DNODATA, DZERO
384392
use TdisModule, only: kper
385393
use NCModelExportModule, only: ExportPackageType
386394
use DefinitionSelectModule, only: get_param_definition_type
@@ -528,7 +536,6 @@ end subroutine package_step
528536
!<
529537
subroutine export_layer_3d(this, export_pkg, idt, ilayer_read, ialayer, &
530538
dbl1d, nc_varname, input_attr, iaux)
531-
use ConstantsModule, only: DNODATA, DZERO
532539
use TdisModule, only: kper
533540
use NCModelExportModule, only: ExportPackageType
534541
class(DisNCStructuredType), intent(inout) :: this
@@ -878,7 +885,6 @@ end subroutine add_proj_data
878885
!> @brief add grid coordinates
879886
!<
880887
subroutine add_grid_data(this)
881-
use ConstantsModule, only: DZERO
882888
class(DisNCStructuredType), intent(inout) :: this
883889
integer(I4B) :: ibnd, n !, k, i, j
884890
real(DP), dimension(:, :), pointer, contiguous :: dbl2d

0 commit comments

Comments
 (0)