Skip to content

Commit

Permalink
add "in" suffix to netcdf export name when in validate mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mjreno authored and mjreno committed Dec 5, 2024
1 parent fe1ff54 commit 4ad3a5c
Showing 1 changed file with 13 additions and 5 deletions.
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

0 comments on commit 4ad3a5c

Please sign in to comment.