Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(export): add "in" suffix to netcdf export name when in validate mode #2090

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/Utilities/Export/NCModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ module NCModelExportModule

use KindModule, only: DP, I4B, LGP
use ConstantsModule, only: LINELENGTH, LENCOMPONENTNAME, LENMODELNAME, &
LENMEMPATH, LENBIGLINE, LENVARNAME, DIS, DISU, DISV
use SimVariablesModule, only: errmsg
LENMEMPATH, LENBIGLINE, LENVARNAME, MVALIDATE, &
DIS, DISU, DISV
use SimVariablesModule, only: isim_mode, idm_context, errmsg
use SimModule, only: store_error, store_error_filename
use InputLoadTypeModule, only: ModelDynamicPkgsType
use ModflowInputModule, only: ModflowInputType
Expand Down Expand Up @@ -232,6 +233,10 @@ subroutine set(this, modelname, modeltype, modelfname, nctype)
call store_error_filename(modelfname)
end select

if (isim_mode == MVALIDATE) then
this%title = trim(this%title)//' array input'
end if

! set export type
if (nctype == NETCDF_UGRID) then
this%grid = 'LAYERED MESH'
Expand All @@ -257,9 +262,7 @@ end subroutine set
!<
subroutine export_init(this, modelname, modeltype, modelfname, disenum, &
nctype, iout)
use SimVariablesModule, only: isim_mode, idm_context
use TdisModule, only: datetime0, nstp
use ConstantsModule, only: MVALIDATE
use MemoryManagerModule, only: mem_setptr
use MemoryHelperModule, only: create_mem_path
use MemoryManagerExtModule, only: mem_set_value
Expand All @@ -286,7 +289,6 @@ subroutine export_init(this, modelname, modeltype, modelfname, disenum, &
this%modelname = modelname
this%modeltype = modeltype
this%modelfname = modelfname
this%nc_fname = trim(modelname)//'.nc'
this%gridmap_name = ''
this%ncf_mempath = ''
this%ogc_wkt = ''
Expand All @@ -303,6 +305,12 @@ subroutine export_init(this, modelname, modeltype, modelfname, disenum, &
this%iout = iout
this%chunking_active = .false.

! set export file name
if (isim_mode /= MVALIDATE) then
this%nc_fname = trim(modelname)//'.nc'
else
this%nc_fname = trim(modelname)//'.in.nc'
end if
call lowcase(this%nc_fname)

! set file scoped attributes
Expand Down
Loading