Skip to content

Commit

Permalink
Merge pull request #578 from FESOM/refactoring_addDVDsergeyandknut
Browse files Browse the repository at this point in the history
Add Discret Variance Decay (DVD) diagnostic of Knut and Sergey
  • Loading branch information
JanStreffing committed Aug 19, 2024
2 parents 2a68b33 + c1d078e commit 191ef67
Show file tree
Hide file tree
Showing 14 changed files with 2,581 additions and 248 deletions.
2 changes: 1 addition & 1 deletion config/namelist.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runid='fesom'
&timestep
step_per_day=32 !96 !96 !72 !72 !45 !72 !96
run_length=62 !62 !62 !62 !28
run_length_unit='y' ! y, m, d, s
run_length_unit='y' ! y, m, d, s
/

&clockinit ! the model starts at
Expand Down
2 changes: 1 addition & 1 deletion config/namelist.cvmix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ tidal_vert_decayscale= 500.0 ! units: m; zeta in Simmons et al. (used to com
tidal_max_coeff = 50e-4 ! units: m^2/s; largest acceptable value for diffusivity
tidal_lcl_mixfrac = 0.33 !tidal dissipation efficiency (q in Simmons et al.), i.e. fraction of energy that dissipates locally
tidal_depth_cutoff = 0.0 !depth of the shallowest column where tidal mixing is computed (positive below surface)
tidal_botforc_file = '/work/ollie/pscholz/FORCING/IDEMIX/tidal_energy_gx1v6_20090205_rgrid.nc'
tidal_botforc_file = '/albedo/work/projects/p_pool_fesom1/fesom2.0/forcing/idemix/tidal_energy_gx1v6_20090205_rgrid.nc'
/

26 changes: 18 additions & 8 deletions src/MOD_TRACER.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,24 @@ MODULE MOD_TRACER
real(kind=WP), allocatable :: del_ttf_advhoriz(:,:), del_ttf_advvert(:,:)
!_______________________________________________________________________________
! in case ldiag_DVD=.true. --> calculate discrete variance decay (DVD)
real(kind=WP), allocatable :: tr_dvd_horiz(:,:,:), tr_dvd_vert(:,:,:)
! dvd_trflx_h, dvd_trflx_v ... reconstructed horizontal tracer fluxes at mid
! edge faces for temperature and salintiy. These fluxes
! are already computed in adv_flux_hor, adv_flux_ver
! but not saved
! dvd_trold ... tracer from previouse time steps later needed to
! compute Tstar = 0.5*( T^(n+1) + T^n)
real(kind=WP), allocatable, dimension(:,:,:) :: dvd_trflx_hor, dvd_trflx_ver

!_______________________________________________________________________________
! The fct part
real(kind=WP),allocatable,dimension(:,:) :: fct_LO ! Low-order solution
real(kind=WP),allocatable,dimension(:,:) :: adv_flux_hor ! Antidif. horiz. contrib. from edges / backup for iterafive fct scheme
real(kind=WP),allocatable,dimension(:,:) :: adv_flux_ver ! Antidif. vert. fluxes from nodes / backup for iterafive fct scheme

real(kind=WP),allocatable,dimension(:,:) :: fct_ttf_max,fct_ttf_min
real(kind=WP),allocatable,dimension(:,:) :: fct_plus,fct_minus

!_______________________________________________________________________________
! MUSCL type reconstruction
integer,allocatable,dimension(:) :: nboundary_lay
integer,allocatable,dimension(:,:) :: edge_up_dn_tri
Expand All @@ -54,9 +64,9 @@ MODULE MOD_TRACER
! auxury type for reading namelist.tra
TYPE NML_TRACER_LIST_TYPE
INTEGER :: ID =-1
CHARACTER(len=4) :: adv_hor ='NONE'
CHARACTER(len=4) :: adv_ver ='NONE'
CHARACTER(len=4) :: adv_lim ='NONE'
CHARACTER(len=20) :: adv_hor ='NONE'
CHARACTER(len=20) :: adv_ver ='NONE'
CHARACTER(len=20) :: adv_lim ='NONE'
REAL(kind=WP) :: adv_ph =1.
REAL(kind=WP) :: adv_pv =1.
END TYPE NML_TRACER_LIST_TYPE
Expand Down Expand Up @@ -149,8 +159,8 @@ subroutine WRITE_T_TRACER_WORK(twork, unit)
call write_bin_array(twork%del_ttf, unit, iostat, iomsg)
call write_bin_array(twork%del_ttf_advhoriz, unit, iostat, iomsg)
call write_bin_array(twork%del_ttf_advvert, unit, iostat, iomsg)
call write_bin_array(twork%tr_dvd_horiz, unit, iostat, iomsg)
call write_bin_array(twork%tr_dvd_vert, unit, iostat, iomsg)
call write_bin_array(twork%dvd_trflx_hor, unit, iostat, iomsg)
call write_bin_array(twork%dvd_trflx_ver, unit, iostat, iomsg)
call write_bin_array(twork%fct_LO, unit, iostat, iomsg)
call write_bin_array(twork%adv_flux_hor, unit, iostat, iomsg)
call write_bin_array(twork%adv_flux_ver, unit, iostat, iomsg)
Expand All @@ -174,8 +184,8 @@ subroutine READ_T_TRACER_WORK(twork, unit)
call read_bin_array(twork%del_ttf, unit, iostat, iomsg)
call read_bin_array(twork%del_ttf_advhoriz, unit, iostat, iomsg)
call read_bin_array(twork%del_ttf_advvert, unit, iostat, iomsg)
call read_bin_array(twork%tr_dvd_horiz, unit, iostat, iomsg)
call read_bin_array(twork%tr_dvd_vert, unit, iostat, iomsg)
call read_bin_array(twork%dvd_trflx_hor, unit, iostat, iomsg)
call read_bin_array(twork%dvd_trflx_ver, unit, iostat, iomsg)
call read_bin_array(twork%fct_LO, unit, iostat, iomsg)
call read_bin_array(twork%adv_flux_hor, unit, iostat, iomsg)
call read_bin_array(twork%adv_flux_ver, unit, iostat, iomsg)
Expand Down
Loading

0 comments on commit 191ef67

Please sign in to comment.