Skip to content
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
20 changes: 16 additions & 4 deletions model/fv_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,15 @@ module fv_control_mod

!-------------------------------------------------------------------------------

subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split)
subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split, &
nml_filename_in, skip_nml_read_in)

type(fv_atmos_type), allocatable, intent(inout), target :: Atm(:)
real, intent(in) :: dt_atmos
integer, intent(OUT) :: this_grid
logical, allocatable, intent(OUT) :: grids_on_this_pe(:)
character(len=32), optional, intent(in) :: nml_filename_in ! alternate nml
logical, optional, intent(in) :: skip_nml_read_in ! use previously loaded nml

integer, intent(INOUT) :: p_split
character(100) :: pe_list_name, errstring
Expand All @@ -214,6 +217,9 @@ subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split)
real :: sdt
integer :: unit, ens_root_pe, tile_id(1)

character(len=32) :: nml_filename = 'input.nml'
logical :: skip_nml_read = .false.

!!!!!!!!!! POINTERS FOR READING NAMELISTS !!!!!!!!!!

!------------------------------------------
Expand Down Expand Up @@ -408,6 +414,9 @@ subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split)
call mp_assign_gid
ens_root_pe = mpp_root_pe()

if (present(nml_filename_in)) nml_filename = nml_filename_in
if (present(skip_nml_read_in)) skip_nml_read = skip_nml_read_in

! 1. read nesting namelists
call read_namelist_nest_nml
call read_namelist_fv_nest_nml
Expand Down Expand Up @@ -482,9 +491,10 @@ subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split)
if (n > 1) then
Atm(n)%nml_filename = 'input_'//trim(pe_list_name)//'.nml'
else
Atm(n)%nml_filename = 'input.nml'
! Atm(n)%nml_filename = 'input.nml'
Atm(n)%nml_filename = trim(nml_filename)
endif
if (.not. file_exists(Atm(n)%nml_filename)) then
if (.not. file_exists(Atm(n)%nml_filename) .and. .not. skip_nml_read) then
call mpp_error(FATAL, "Could not find nested grid namelist "//Atm(n)%nml_filename)
endif
enddo
Expand Down Expand Up @@ -550,7 +560,9 @@ subroutine fv_control_init(Atm, dt_atmos, this_grid, grids_on_this_pe, p_split)
else
Atm(this_grid)%nml_filename = ''
endif
call read_input_nml(Atm(this_grid)%nml_filename) !re-reads into internal namelist
if (.not. skip_nml_read) then
call read_input_nml(Atm(this_grid)%nml_filename) !re-reads into internal namelist
endif
#endif
call read_namelist_fv_grid_nml
call read_namelist_fv_core_nml(Atm(this_grid)) ! do options processing here too?
Expand Down