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

Separate input output #629

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
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
7 changes: 5 additions & 2 deletions src/gen_model_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ 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 RestartInPath and RestartOutPath
if (RestartInPath == 'same-as-result') RestartInPath = ResultPath
if (RestartOutPath == 'same-as-result') RestartOutPath = ResultPath


! ==========
! compute dt
Expand Down
6 changes: 3 additions & 3 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(RestartInPath)//trim(runid)//'.clock',status='old')
read(99,*) timeold, dayold, yearold
read(99,*) timenew, daynew, yearnew
close(99)
Expand Down Expand Up @@ -167,7 +167,7 @@ subroutine clock_finish
dum_yearnew=yearold+1
endif

open(99,file=trim(ResultPath)//trim(runid)//'.clock',status='unknown')
open(99,file=trim(RestartOutPath)//trim(runid)//'.clock',status='unknown')
write(99,*) timeold, dayold, yearold
write(99,*) dum_timenew, dum_daynew, dum_yearnew
close(99)
Expand Down Expand Up @@ -211,4 +211,4 @@ end subroutine is_fleapyr
!
!----------------------------------------------------------------------------
!
end module g_clock
end module g_clock
6 changes: 4 additions & 2 deletions src/gen_modules_config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ module g_config
character(MAX_PATH) :: ClimateDataPath='./hydrography/'
character(MAX_PATH) :: TideForcingPath='./tide_forcing/'
character(MAX_PATH) :: ResultPath='./result/'
character(MAX_PATH) :: RestartInPath='same-as-result'
character(MAX_PATH) :: RestartOutPath='same-as-result'
character(20) :: MeshId='NONE'
namelist /paths/ MeshPath, ClimateDataPath, &
TideForcingPath, ResultPath, MeshId
TideForcingPath, ResultPath, RestartInPath, RestartOutPath, MeshId

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


end module g_config
end module g_config
4 changes: 2 additions & 2 deletions src/icepack_drivers/icedrv_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ end subroutine init_io_icepack
module subroutine init_restart_icepack(year, mesh)

use mod_mesh
use g_config, only: runid, ResultPath
use g_config, only: runid, RestartOutPath
use io_restart, only: ip_id, def_variable_2d, def_dim

implicit none
Expand Down Expand Up @@ -341,7 +341,7 @@ module subroutine init_restart_icepack(year, mesh)
write(cyear,'(i4)') year
! Create an icepack restart file
! Only serial output implemented so far
ip_id%filename=trim(ResultPath)//trim(runid)//'.'//cyear//'.icepack.restart.nc'
ip_id%filename=trim(RestartOutPath)//trim(runid)//'.'//cyear//'.icepack.restart.nc'
if (ip_id%is_in_use) return
ip_id%is_in_use=.true.

Expand Down
Loading
Loading