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

User/wfc/restart ensemblename fix #562

Merged
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
22 changes: 11 additions & 11 deletions src/framework/MOM_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,17 @@
restartname = trim(CS%restartfile)//trim(restartname)
endif ; endif

! Determine if there is a filename_appendix (used for ensemble runs).
call get_filename_appendix(filename_appendix)
if (len_trim(filename_appendix) > 0) then
length = len_trim(restartname)

Check warning on line 1412 in src/framework/MOM_restart.F90

View check run for this annotation

Codecov / codecov/patch

src/framework/MOM_restart.F90#L1412

Added line #L1412 was not covered by tests
if (restartname(length-2:length) == '.nc') then
restartname = restartname(1:length-3)//'.'//trim(filename_appendix)//'.nc'

Check warning on line 1414 in src/framework/MOM_restart.F90

View check run for this annotation

Codecov / codecov/patch

src/framework/MOM_restart.F90#L1414

Added line #L1414 was not covered by tests
else
restartname = restartname(1:length) //'.'//trim(filename_appendix)

Check warning on line 1416 in src/framework/MOM_restart.F90

View check run for this annotation

Codecov / codecov/patch

src/framework/MOM_restart.F90#L1416

Added line #L1416 was not covered by tests
endif
endif

next_var = 1
do while (next_var <= CS%novars )
start_var = next_var
Expand All @@ -1430,17 +1441,6 @@
enddo
next_var = m

! Determine if there is a filename_appendix (used for ensemble runs).
call get_filename_appendix(filename_appendix)
if (len_trim(filename_appendix) > 0) then
length = len_trim(restartname)
if (restartname(length-2:length) == '.nc') then
restartname = restartname(1:length-3)//'.'//trim(filename_appendix)//'.nc'
else
restartname = restartname(1:length) //'.'//trim(filename_appendix)
endif
endif

restartpath = trim(directory) // trim(restartname)

if (num_files < 10) then
Expand Down
Loading