Skip to content

Commit

Permalink
make existence of tke and iwe files optional for restart so that the …
Browse files Browse the repository at this point in the history
…restart also works when the files dont exist like in a restart from TKE to TKE+IDEMIX. If the files would be needed but they do not exist they are simply initialised with zeros for the first time step
  • Loading branch information
patrickscholz committed Jun 23, 2023
1 parent b802a4f commit e017f03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/io_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ subroutine ini_ocean_io(year, dynamics, tracers, partit, mesh)
!___Save restart variables for TKE and IDEMIX_________________________________
! if (trim(mix_scheme)=='cvmix_TKE' .or. trim(mix_scheme)=='cvmix_TKE+IDEMIX') then
if (mix_scheme_nmb==5 .or. mix_scheme_nmb==56) then
call oce_files%def_node_var('tke', 'Turbulent Kinetic Energy', 'm2/s2', tke(:,:), mesh, partit)
call oce_files%def_node_var_optional('tke', 'Turbulent Kinetic Energy', 'm2/s2', tke(:,:), mesh, partit)
endif
! if (trim(mix_scheme)=='cvmix_IDEMIX' .or. trim(mix_scheme)=='cvmix_TKE+IDEMIX') then
if (mix_scheme_nmb==6 .or. mix_scheme_nmb==56) then
call oce_files%def_elem_var('iwe', 'Internal Wave Energy' , 'm2/s2', iwe(:,:), mesh, partit)
call oce_files%def_elem_var_optional('iwe', 'Internal Wave Energy' , 'm2/s2', iwe(:,:), mesh, partit)
endif
if (dynamics%opt_visc==8) then
call oce_files%def_elem_var('uke', 'unresolved kinetic energy', 'm2/s2', uke(:,:), mesh, partit)
call oce_files%def_elem_var('uke_rhs', 'unresolved kinetic energy rhs', 'm2/s2', uke_rhs(:,:), mesh, partit)
call oce_files%def_elem_var_optional('uke', 'unresolved kinetic energy', 'm2/s2', uke(:,:), mesh, partit)
call oce_files%def_elem_var_optional('uke_rhs', 'unresolved kinetic energy rhs', 'm2/s2', uke_rhs(:,:), mesh, partit)
endif

do j=1,tracers%num_tracers
Expand Down

0 comments on commit e017f03

Please sign in to comment.