Skip to content

Commit

Permalink
Restore restart_trcrd.F90 from release-1.3
Browse files Browse the repository at this point in the history
Building BLOM stand-alone without iHAMOCC is does not allow any
references to hamocc functions. For now, it's more convenient to restore
'ifdef HAMOCC' when used in BLOM.
  • Loading branch information
TomasTorsvik committed Oct 17, 2023
1 parent aa961e8 commit 666b1e4
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions trc/restart_trcrd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ subroutine restart_trcrd(rstfnm_ocn)

logical :: error
character(len=256) :: rstfnm_ocntrc
! HAMOCC
character(len=256) :: rstfnm_hamocc
#ifdef HAMOCC
logical :: use_hamocc = .true.
#else
logical :: use_hamocc = .false.
character(len=256) :: rstfnm_hamocc
#endif
!
! --- ------------------------------------------------------------------
Expand All @@ -52,36 +48,36 @@ subroutine restart_trcrd(rstfnm_ocn)
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
if (use_HAMOCC) then
call restart_getfile(rstfnm_ocn, 'rbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
end if
#ifdef HAMOCC
call restart_getfile(rstfnm_ocn, 'rbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
#endif
else
call restart_getfile(rstfnm_ocn, 'resttrc', rstfnm_ocntrc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_ocntrc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
if (use_HAMOCC) then
call restart_getfile(rstfnm_ocn, 'restbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
end if
#ifdef HAMOCC
call restart_getfile(rstfnm_ocn, 'restbgc', rstfnm_hamocc, error)
if (error) then
write(lp,*) 'restart_trcrd: could not generate rstfnm_hamocc file!'
call xcstop('(restat_trcrd)')
stop '(restart_trcrd)'
endif
#endif
endif
endif

call xcbcst(rstfnm_ocntrc)
if (use_HAMOCC) then
call xcbcst(rstfnm_hamocc)
end if
#ifdef HAMOCC
call xcbcst(rstfnm_hamocc)
#endif

!
! --- ------------------------------------------------------------------
Expand All @@ -90,9 +86,9 @@ subroutine restart_trcrd(rstfnm_ocn)
!
call restart_ocntrcrd(rstfnm_ocntrc)

if (use_HAMOCC) then
call hamocc_init(1,rstfnm_hamocc)
end if
#ifdef HAMOCC
call hamocc_init(1,rstfnm_hamocc)
#endif

return
end subroutine restart_trcrd

0 comments on commit 666b1e4

Please sign in to comment.