diff --git a/src/driver/mpas_subdriver.F b/src/driver/mpas_subdriver.F index 2705777a25..79a051f347 100644 --- a/src/driver/mpas_subdriver.F +++ b/src/driver/mpas_subdriver.F @@ -39,7 +39,7 @@ module mpas_subdriver contains - subroutine mpas_init(corelist, domain_ptr, mpi_comm) + subroutine mpas_init(corelist, domain_ptr, mpi_comm, namelistFileParam, streamsFileParam) use mpas_stream_manager, only : MPAS_stream_mgr_init, MPAS_build_stream_filename, MPAS_stream_mgr_validate_streams use iso_c_binding, only : c_char, c_loc, c_ptr, c_int @@ -53,7 +53,9 @@ subroutine mpas_init(corelist, domain_ptr, mpi_comm) type (core_type), intent(inout), pointer :: corelist type (domain_type), intent(inout), pointer :: domain_ptr integer, intent(in), optional :: mpi_comm - + character(len=*), intent(in), optional :: namelistFileParam + character(len=*), intent(in), optional :: streamsFileParam + integer :: iArg, nArgs logical :: readNamelistArg, readStreamsArg character(len=StrKIND) :: argument, namelistFile, streamsFile @@ -109,6 +111,15 @@ end subroutine xml_stream_get_attributes readNamelistArg = .false. readStreamsArg = .false. + if (present(namelistFileParam) .and. len_trim(namelistFileParam) > 0 ) then + readNamelistArg = .true. + namelistFile = trim(namelistFileParam) + endif + if (present(streamsFileParam) .and. len_trim(streamsFileParam) > 0 ) then + readStreamsArg = .true. + streamsFile = trim(streamsFileParam) + endif + nArgs = command_argument_count() iArg = 1 do while (iArg < nArgs)