Skip to content

Commit

Permalink
Separate input and output
Browse files Browse the repository at this point in the history
Separating the inputs from the outputs. This should enable us to have
more 'predictable' runs, in that running with the same inputs and the
same config/namelists should lead to the same results.
We can save time because we do not need to wait during backuping the
restart files (this is the main motivation in DestinE project).
Still this is done so that the old default behaviour is not changed.
  • Loading branch information
Sebastian Beyer committed Sep 20, 2024
1 parent 0e5bfdc commit 6a4ff95
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 135 deletions.
7 changes: 4 additions & 3 deletions src/fesom_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ subroutine fesom_init(fesom_total_nsteps)
call clock_newyear ! check if it is a new year
if (f%mype==0) f%t6=MPI_Wtime()
!___CREATE NEW RESTART FILE IF APPLICABLE___________________________________
call restart(0, 0, 0, r_restart, f%which_readr, f%ice, f%dynamics, f%tracers, f%partit, f%mesh)

if (r_restart) call read_initial_conditions(0, 0, 0, f%which_readr, f%ice, f%dynamics, f%tracers, f%partit, f%mesh)
if (f%mype==0) f%t7=MPI_Wtime()
! store grid information into netcdf file
if (.not. r_restart) call write_mesh_info(f%partit, f%mesh)
Expand Down Expand Up @@ -618,7 +619,7 @@ subroutine fesom_runloop(current_nsteps)
!--------------------------

f%t5 = MPI_Wtime()
call restart(n, nstart, f%total_nsteps, .false., f%which_readr, f%ice, f%dynamics, f%tracers, f%partit, f%mesh)
call write_initial_conditions(n, nstart, f%total_nsteps, f%ice, f%dynamics, f%tracers, f%partit, f%mesh)
f%t6 = MPI_Wtime()

f%rtime_fullice = f%rtime_fullice + f%t2 - f%t1
Expand Down Expand Up @@ -790,4 +791,4 @@ subroutine fesom_finalize()
! call clock_finish
end subroutine

end module
end module
6 changes: 4 additions & 2 deletions src/gen_model_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ subroutine setup_model(partit)
read (fileunit, NML=geometry)
read (fileunit, NML=calendar)
read (fileunit, NML=run_config)
read (fileunit,NML=icebergs)

!!$ read (fileunit, NML=machine)
close (fileunit)


! by default use ResultPath for RestartPath
if (RestartPath == 'same-as-result') RestartPath = ResultPath


! ==========
! compute dt
Expand Down
4 changes: 2 additions & 2 deletions src/gen_modules_clock.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subroutine clock_init(partit)
yearstart=yearnew

! init clock for this run
open(99,file=trim(ResultPath)//trim(runid)//'.clock',status='old')
open(99,file=trim(RestartPath)//trim(runid)//'.clock',status='old')
read(99,*) timeold, dayold, yearold
read(99,*) timenew, daynew, yearnew
close(99)
Expand Down Expand Up @@ -211,4 +211,4 @@ end subroutine is_fleapyr
!
!----------------------------------------------------------------------------
!
end module g_clock
end module g_clock
5 changes: 3 additions & 2 deletions src/gen_modules_config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ module g_config
character(MAX_PATH) :: ClimateDataPath='./hydrography/'
character(MAX_PATH) :: TideForcingPath='./tide_forcing/'
character(MAX_PATH) :: ResultPath='./result/'
character(MAX_PATH) :: RestartPath='same-as-result'
character(20) :: MeshId='NONE'
namelist /paths/ MeshPath, ClimateDataPath, &
TideForcingPath, ResultPath, MeshId
TideForcingPath, ResultPath, RestartPath, MeshId

!_____________________________________________________________________________
! *** restart_log ***
Expand Down Expand Up @@ -163,4 +164,4 @@ module g_config
real(kind=WP) :: dummy=1.e10


end module g_config
end module g_config
Loading

0 comments on commit 6a4ff95

Please sign in to comment.