Skip to content

Commit

Permalink
Merge pull request #477 from FESOM/refactoring_channel
Browse files Browse the repository at this point in the history
Refactoring channel
  • Loading branch information
JanStreffing authored Mar 12, 2024
2 parents 3d97fcb + 3227868 commit b6a7a41
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 90 deletions.
42 changes: 27 additions & 15 deletions config/namelist.config.toy_soufflet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

! This is the namelist file for model general configuration

&modelname
Expand All @@ -6,26 +7,30 @@ runid='fesom'

&timestep
step_per_day=72 !96 !96 !72 !72 !45 !72 !96
run_length= 10 !62 !62 !62 !28
run_length_unit='y' ! y, m, d, s
run_length=10 !62 !62 !62 !28
run_length_unit='d' ! y, m, d, s
/

&clockinit ! the model starts at
timenew=0.0
daynew=1
yearnew=1948
yearnew=1958
/

&paths
MeshPath='/work/ollie/sjuricke/Soufflet_20/'
ClimateDataPath='/work/ollie/dsidoren/input/hydrography/phc3.0/'
ResultPath='/home/ollie/dsidoren/test_visc/'
MeshPath='/albedo/home/pscholz/fesom2/test/meshes/soufflet/'
ClimateDataPath='/albedo/work/projects/p_fesom/FROM-OLLIE/FESOM2/hydrography/phc3.0/'
ResultPath='../result_tmp/'
/

&restart_log
restart_length=1 !only required for d,h,s cases, y, m take 1
restart_length_unit='y' !output period: y, d, h, s
logfile_outfreq=960 !in logfile info. output frequency, # steps
restart_length=1 ! --> do netcdf restart ( only required for d,h,s cases, y, m take 1)
restart_length_unit='y' !output period: y, d, h, s, off
raw_restart_length=1 ! --> do core dump restart
raw_restart_length_unit='off' ! e.g. y, d, h, s, off
bin_restart_length=1 ! --> do derived type binary restart
bin_restart_length_unit='off' ! e.g. y, d, h, s, off
logfile_outfreq=72 !in logfile info. output frequency, # steps
/

&ale_def
Expand All @@ -34,10 +39,10 @@ use_partial_cell=.false.
/

&geometry
cartesian=.false.
cartesian=.true.
fplane=.false.
cyclic_length=4.5 ![degree]
rotated_grid=.false. !option only valid for coupled model case now
rotated_grid=.false. !option only valid for coupled model case now
force_rotation=.false.
alphaEuler=50. ![degree] Euler angles, convention:
betaEuler=15. ![degree] first around z, then around new x,
Expand All @@ -49,15 +54,22 @@ include_fleapyear=.false.
/

&run_config
use_ice=.false. ! ocean+ice
use_ice=.false. ! ocean+ice
use_cavity=.false. !
use_cavity_partial_cell=.false.
use_floatice = .false.
use_sw_pene=.false.
flag_debug=.false.
flag_warn_cflz=.false.
toy_ocean=.true.
which_toy="soufflet"
flag_debug=.true.
flag_debug=.false.

/

&machine
n_levels=2
n_part= 12, 36 ! 432 number of partitions on each hierarchy level
!PS n_levels=2
!PS n_part= 70, 128 ! 432 number of partitions on each hierarchy level
n_levels=1
n_part= 128 !6096 ! 432 number of partitions on each hierarchy level
/
72 changes: 8 additions & 64 deletions config/namelist.oce.toy_soufflet
Original file line number Diff line number Diff line change
Expand Up @@ -3,81 +3,25 @@
&oce_dyn
state_equation=0 ! 1 - full equation of state, 0 - linear equation of state
C_d=0.0025 ! Bottom drag, nondimensional
gamma0=0.00 ! [m/s], backgroung viscosity= gamma0*len, it should be as small as possible (keep it < 0.01 m/s).
gamma1=0.002 ! [nodim], for computation of the flow aware viscosity
gamma2=0.02 ! [s/m], is only used in easy backscatter option
Div_c=.5 ! the strength of the modified Leith viscosity, nondimensional, 0.3 -- 1.0
Leith_c=.5 ! the strength of the Leith viscosity
visc_option=5 ! 1=Harmonic Leith parameterization;
! 2=Laplacian+Leith+biharmonic background
! 3=Biharmonic Leith parameterization
! 4=Biharmonic flow aware
! 5=Easy Backscatter
! 6=Biharmonic flow aware (viscosity depends on velocity Laplacian)
! 7=Biharmonic flow aware (viscosity depends on velocity differences)
easy_bs_return= 1.5 ! coefficient for returned sub-gridscale energy, to be used with visc_option=5 (easy backscatter)
A_ver= 1.e-4 ! Vertical viscosity, m^2/s
scale_area=5.8e9 ! Visc. and diffus. are for an element with scale_area
mom_adv=2 ! 1=vector CV, p1 vel, 2=sca. CV, 3=vector inv.
free_slip=.false. ! Switch on free slip
i_vert_visc=.true.
w_split=.false.
w_exp_max=1.e-3
SPP=.false. ! Salt Plume Parameterization
Fer_GM=.false. ! to swith on/off GM after Ferrari et al. 2010
K_GM_max = 3000.0 ! max. GM thickness diffusivity (m2/s)
Fer_GM=.false. ! to swith on/off GM after Ferrari et al. 2010
K_GM_max = 2000.0 ! max. GM thickness diffusivity (m2/s)
K_GM_min = 2.0 ! max. GM thickness diffusivity (m2/s)
K_GM_bvref = 2 ! def of bvref in ferreira scaling 0=srf,1=bot mld,2=mean over mld,3=weighted mean over mld
K_GM_rampmax = 40.0 ! Resol >K_GM_rampmax[km] GM on
K_GM_rampmin = 30.0 ! Resol <K_GM_rampmin[km] GM off, in between linear scaled down
K_GM_rampmax = -1.0 ! Resol >K_GM_rampmax[km] GM on
K_GM_rampmin = -1.0 ! Resol <K_GM_rampmin[km] GM off, in between linear scaled down
K_GM_resscalorder = 1

scaling_Ferreira =.true. ! GM vertical scaling after Ferreira et al.(2005) (as also implemented by Qiang in FESOM 1.4)
scaling_Ferreira =.false. ! GM vertical scaling after Ferreira et al.(2005) (as also implemented by Qiang in FESOM 1.4)
scaling_Rossby =.false. ! GM is smoothly switched off according to Rossby radius (from 1. in coarse areas to 0. where resolution reaches 2 points/Rossby radius)
scaling_resolution =.true. ! GM is spatially scaled with resolution; A value of K_GM corresponds then to a resolution of 100km
scaling_FESOM14 =.true. ! special treatment of GM in the NH (as also implemented by Qiang in FESOM 1.4; it is zero within the boundary layer)
scaling_FESOM14 =.false. ! special treatment of GM in the NH (as also implemented by Qiang in FESOM 1.4; it is zero within the boundary layer)

Redi =.false.
visc_sh_limit=5.0e-3 ! for KPP, max visc due to shear instability
mix_scheme='PP' ! vertical mixing scheme: KPP, PP
mix_scheme='PP' ! vertical mixing scheme: KPP, PP
Ricr = 0.3 ! critical bulk Richardson Number
concv = 1.6 ! constant for pure convection (eqn. 23) (Large 1.5-1.6; MOM default 1.8)
/

&oce_tra
use_momix = .false. ! switch on/off !Monin-Obukhov -> TB04 mixing
momix_lat = -50.0 ! latitidinal treshhold for TB04, =90 --> global
momix_kv = 0.01 ! PP/KPP, mixing coefficient within MO length
use_instabmix = .true. ! enhance convection in case of instable stratification
instabmix_kv = 0.1
use_windmix = .false. ! enhance mixing trough wind only for PP mixing (for stability)
windmix_kv = 1.e-3
windmix_nl = 2

diff_sh_limit=5.0e-3 ! for KPP, max diff due to shear instability
Kv0_const=.false.
double_diffusion=.false. ! for KPP,dd switch
K_ver=1.0e-5
K_hor=10.
surf_relax_T=0.0
surf_relax_S=0.0 ! 50m/300days 6.43e-07! m/s 10./(180.*86400.)
balance_salt_water =.false. ! balance virtual-salt or freshwater flux or not
clim_relax=0.0 ! 1/s, geometrical information has to be supplied
ref_sss_local=.true.
ref_sss=34.
i_vert_diff=.true. ! true
tracer_adv =2 ! 1=MUSCL, 2=MUSCL+FCT
! Implemented trassers (3d restoring):
! 301 - Fram strait.
! 302 - Bering Strait
! 303 - BSO
num_tracers=2 !number of all tracers
tracer_ID =0,1 !their IDs (0 and 1 are reserved for temperature and salinity)
/

&oce_init3d ! initial conditions for tracers
n_ic3d = 2 ! number of tracers to initialize
idlist = 1, 0 ! their IDs (0 is temperature, 1 is salinity, etc.). The reading order is defined here!
filelist = 'phc3.0_winter.nc', 'phc3.0_winter.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist
varlist = 'salt', 'temp' ! variables to read from specified files
t_insitu = .true. ! if T is insitu it will be converted to potential after reading it
/
57 changes: 57 additions & 0 deletions config/namelist.tra.toy_soufflet
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
&tracer_listsize
num_tracers=100 !number of tracers to allocate. shallbe large or equal to the number of streams in &nml_list
/

&tracer_list
nml_tracer_list =
1 , 'MFCT', 'QR4C', 'FCT ', 1., 1.,
2 , 'MFCT', 'QR4C', 'FCT ', 1., 1.,
!101, 'UPW1', 'UPW1', 'NON ', 0., 0.
/

&tracer_init3d ! initial conditions for tracers
n_ic3d = 2 ! number of tracers to initialize
idlist = 2, 1 ! their IDs (0 is temperature, 1 is salinity, etc.). The reading order is defined here!
filelist = 'phc3.0_winter.nc', 'phc3.0_winter.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist
varlist = 'salt', 'temp' ! variables to read from specified files
t_insitu = .true. ! if T is insitu it will be converted to potential after reading it
/

&tracer_init2d ! initial conditions for 2D tracers (sea ice)
n_ic2d = 3 ! number of tracers to initialize
idlist = 1, 2, 3 ! their IDs (0 is a_ice, 1 is m_ice, 3 m_snow). The reading order is defined here!
filelist = 'a_ice.nc', 'm_ice.nc', 'm_snow.nc' ! list of files in ClimateDataPath to read (one file per tracer), same order as idlist
varlist = 'a_ice', 'm_ice', 'm_snow' ! variables to read from specified files
ini_ice_from_file=.false.
/

&tracer_general
! bharmonic diffusion for tracers. We recommend to use this option in very high resolution runs (Redi is generally off there).
smooth_bh_tra =.false. ! use biharmonic diffusion (filter implementation) for tracers
gamma0_tra = 0.0005 ! gammaX_tra are analogous to those in the dynamical part
gamma1_tra = 0.0125
gamma2_tra = 0.
i_vert_diff =.true.
/

&tracer_phys
use_momix = .false. ! switch on/off !Monin-Obukhov -> TB04 mixing
momix_lat = -50.0 ! latitidinal treshhold for TB04, =90 --> global
momix_kv = 0.01 ! PP/KPP, mixing coefficient within MO length
use_instabmix = .true. ! enhance convection in case of instable stratification
instabmix_kv = 0.1
use_windmix = .false. ! enhance mixing trough wind only for PP mixing (for stability)
windmix_kv = 1.e-3
windmix_nl = 2
diff_sh_limit=5.0e-3 ! for KPP, max diff due to shear instability
Kv0_const=.false.
double_diffusion=.false. ! for KPP,dd switch
K_ver=1.0e-5
K_hor=10.
surf_relax_T=0.0
surf_relax_S=1.929e-06 ! 50m/300days 6.43e-07! m/s 10./(180.*86400.)
balance_salt_water =.false. ! balance virtual-salt or freshwater flux or not
clim_relax=0.0 ! 1/s, geometrical information has to be supplied
ref_sss_local=.true.
ref_sss=34.
/
28 changes: 17 additions & 11 deletions src/write_step_info.F90
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ subroutine check_blowup(istep, ice, dynamics, tracers, partit, mesh)
USE MOD_PARTIT
USE MOD_PARSUP
USE MOD_MESH
use g_config, only: logfile_outfreq, which_ALE
use g_config, only: logfile_outfreq, which_ALE, toy_ocean, use_ice
use o_PARAM
use o_ARRAYS, only: water_flux, stress_surf, &
heat_flux, Kv, Av
Expand Down Expand Up @@ -344,14 +344,18 @@ subroutine check_blowup(istep, ice, dynamics, tracers, partit, mesh)
write(*,*)
write(*,*) 'wflux = ',water_flux(n)
write(*,*)
write(*,*) 'u_wind = ',u_wind(n),', v_wind = ',v_wind(n)
write(*,*)
do nz=1,nod_in_elem2D_num(n)
write(*,*) 'stress_surf(1:2,',nz,') = ',stress_surf(:,nod_in_elem2D(nz,n))
end do
if (.not. toy_ocean) then
write(*,*) 'u_wind = ',u_wind(n),', v_wind = ',v_wind(n)
write(*,*)
do nz=1,nod_in_elem2D_num(n)
write(*,*) 'stress_surf(1:2,',nz,') = ',stress_surf(:,nod_in_elem2D(nz,n))
end do
end if
if (use_ice) then
write(*,*)
write(*,*) 'm_ice = ',m_ice(n),', m_ice_old = ',m_ice_old(n)
write(*,*) 'a_ice = ',a_ice(n),', a_ice_old = ',a_ice_old(n)
end if
write(*,*)
write(*,*) 'Wvel(:, n) = ',Wvel(ulevels_nod2D(n):nlevels_nod2D(n),n)
write(*,*)
Expand Down Expand Up @@ -448,11 +452,13 @@ subroutine check_blowup(istep, ice, dynamics, tracers, partit, mesh)
write(*,*) 'ssh_rhs = ',ssh_rhs(n)
write(*,*) 'ssh_rhs_old = ',ssh_rhs_old(n)
write(*,*)
write(*,*) 'm_ice = ',m_ice(n)
write(*,*) 'm_ice_old = ',m_ice_old(n)
write(*,*) 'm_snow = ',m_snow(n)
write(*,*) 'm_snow_old = ',m_snow_old(n)
write(*,*)
if (use_ice) then
write(*,*) 'm_ice = ',m_ice(n)
write(*,*) 'm_ice_old = ',m_ice_old(n)
write(*,*) 'm_snow = ',m_snow(n)
write(*,*) 'm_snow_old = ',m_snow_old(n)
write(*,*)
end if
write(*,*) 'hnode = ',hnode(:,n)
write(*,*) 'hnode_new = ',hnode_new(:,n)
write(*,*)
Expand Down

0 comments on commit b6a7a41

Please sign in to comment.