# Lines start from "#" are ignored from input as comments
# Order of following keywords is arbitrary, But, the order in each keyword
# has the meaning (ex. domain_id number is provideed following the order of the lines)

#========================================================================
# case parameters
# provide overall parameters for the model
# [FORMAT] param name value (or switch)

#----- case name -----
# this name is used as a part of output file name to distinguish from other runs
param name abashiri

#----- coriolis switch -----
# if you need to consider the coriolis effect then set true (default: false)
param coriolis true

#----- heat flux switch -----
# if you take account the heat flux from the water surface, set this true (default: false)
# This object uses bulk formula. You need to specify the weather object (type: file).
param heatflux false

#----- non-hydrostatic swith -----
# if you calculate the flow in which the vertical acceleretion is important,
# set this true (default: false)
param nonhydrostatic false

#----- wind forcing switch -----
# if you want to include surface wind shear, set this true (default: false)
# you need to specify the weather object (type: file or const)
param windforce true

#----- latitude information -----
# this is needed for coriolis object (default: center of Tokyo bay)
param latitude 44.0

#----- masking condition -----
# you can select the type of masking (type: slip, nonslip and drag), (default: slip)
param masking slip

#----- surface grid movement -----
# if you want to move the surface grid according to surface, set this true
# (default: false)
param surfacegridmove false

#----- total count fo calculation -----
# number of calculation step (default: 1)
param totalcount 19441

#----- save interval -----
# the interval of saving output file (default: 1)
# the number of file set will be totalcount/saveinterval
param saveinterval 90

#----- basic time step -----
# this time step is minimun time step (in sec) in any fields
# you can use the time step of multiple of this time step in other fields.
# see "field" keyword for this setting
param basetimestep 40.0

#----- collocation switch -----
# if you want to use the collocated grid arrangement in this mdoel, set this true
# THIS IS NOT RECOMMENDED SO FAR BECAUSE OF NUMERICAL OSCILLATION
# NEAR THE MASKING CORNERS (default: false)
param collocation false

#----- theta method parameter -----
# only appried for surface and vertical diffusion treatments (default: 1.0)
# fully explicit(0.0), fully implicit(1.0) the middle (0<theta<1)
# the middle provides high accuracy in time but unstable
param theta 1.0

#----- switch for vertical diffusion -----
# if you want implicit diffusion scheme, set this true (default: true)
# if you set false, then explicit diffusion scheme is applied
param zdiffusionimplicit true

#----- initial surface level -----
# if you want to define the initial surface level, specify the value (default: 0.0)
param initialsurfacelevel 0.0

#----- angular velocity -----
# if you want to change the angular velocity from the earth rotation
# specify the value in rad/s (default: earth rotation)
param angularvelocity 7.27E-05

#========================================================================

#----- domains and its resolution, uniform delta and offset -----
# specify number of grid cell in the domain.
# number cells inside physical domain become "nx-3", "ny-3" and "nz-3"
# boundary cells exist out side the physical domain for each end
# origin index of the domain is (1,1,1) and the position is (0.0, 0.0, 0.0)
# the position of the origin can be moved by offsets
# [FORMAT] domain nx ny nz dx(m) dy(m) dz(m) offsetx(m) offsety(m) offsetz(m)
# increse the lines as number of domains you need
domain 17 31 68 200.0 200.0 1.0 0.0 0.0 0.0
domain 17 31 68 200.0 200.0 1.0 2600.0 0.0 0.0
domain 17 31 68 200.0 200.0 1.0 0.0 5400.0 0.0
domain 17 31 68 200.0 200.0 1.0 2600.0 5400.0 0.0


#========================================================================

# ----- field decomposition -----
# whole domain in the calculation can be devided into fields of different time step
# you must specify at least one filed for the calculation
# [FORMAT] field multiple_of_basetimestep included_domain included_domain ...
# WARNING: MUST SEPARATE SINGLE SPACE
field 1 0 1 2 3
# field 1 4 5 6
# field 1 7 8 9


#========================================================================

# ----- connect information -----
# you need to provide connection information of domains
# [TYPES OF CONNECTION]
# (1) southe-north (excahnging bc each other)
# (2) west-east (excahnging bc each other)
# (3) down-top (excahnging bc each other)
# (4) southe->north or south<-north (just giving bc in the direction of arrow)
# (5) west->east or west<-east (just giving bc in the direction of arrow)
# (6) down->top or down<-top (just giving bc in the direction of arrow)
# if the domains are connected each other with offset, then specify the offset
# if the domain connection also corresponds to the field connection, then set field connection true
# [FORMAT] connect connect_face domain_1 domain_2 offset_1 offset_2 field_connection
connect south-north 0 2 0 0 false
connect south-north 1 3 0 0 false
connect west-east 0 1 0 0 false
connect west-east 2 3 0 0 false


#========================================================================

#----- domain nesting -----
# you can use 1-way nesting for 2D computation (but UNDER DEVELOPMENT!!!!!)
# specify the position of the parent domain to give the data to face of the child domain
# offset 1 and 2 are tangential direction of domain face, offset 3 is normal direction of
# the domain face. (for the present you can specify ONLY offset3)
# [FORMAT] nest domain_face parent_domain child_domain offset1 offset2 offset3;
#nest west 2 4 0 0 60
#nest east 2 4 0 0 83

#========================================================================

#----- bottom geometry information -----
# if you need to express the bottom topography (depth data), set this true
# otherwise the flat bottom is used in the computation
grid readbtm true (OBSOLETE; just specify btmfile, then reading btm file)

# ----- file name of bottom geometry -----
# file name of bottom topography file (depth, positive distance from the surface to bottom)
# two dimensional data for each domain, the information of all the domain must be included
# in one file and separated with one blank line (data starts from north-west to south-east)
# if the domains are connected, two lines of cells must overlap for each connected domains
grid btmfile abashiriBotData.inp

# ----- no uniform horizontal grid -----
# if you don't use unifom grid in horizontal direction, specify the file including
# grid information at each node of all the domain (need to specify true or false)
grid readxy false (OBSOLETE; just specify xyfile, then reading xy file)

#----- file name of horizontal grid information -----
# the data in the file must start from information of x-coordinate for first domain
# the y-coordinate information is following after one blank line. The similar procedure
# is neede in the file for the other domains. You need to pay attention to the
# overlappings for connected domain.
grid xyfile xxx.inp

#----- adjustment factor for the grid length -----
# the values in these file have to be in [m]
# so if the unit of the file is different, ex. [cm], you need to taransform with the factor
grid factor 0.01

#========================================================================

#----- vertical grid resolution and spacings -----
# non-uniform data in z-direction (from bottom to surface) including boundary cells
# (i.e. k=0 and k=nz-2)
# You can specify spacing in z-direction and temperature and salinity values
# these values become the same in the cells of same depth level
# [FORMAT] depth dz temp salinity [velocity period airofoil_length]
# inside the blacket (i.e. velocity period aerofoil_length) for the internal wave maker
# (only for west side of the domain)

#listed BOTTOM --> SURFACE (incl. two BC cells, in this case, total 67)
depth 1.00 7.789 21.741
depth 1.00 7.789 21.741
depth 1.00 7.789 21.741
depth 1.00 7.789 21.741
depth 1.00 7.789 21.741
depth 1.00 7.78993333333 21.7396
depth 1.00 8.03258333333 21.5873611111
depth 0.75 8.23167741935 21.428483871
depth 0.75 8.524 21.265
depth 0.60 9.03131034483 20.9657586207
depth 0.50 9.6844516129 20.5943548387
depth 0.50 9.99376923077 20.4484615385
depth 0.40 10.3634285714 20.195
depth 0.30 10.67068 19.9806
depth 0.20 11.0319375 19.7049375
depth 0.15 11.337 19.4659545455
depth 0.125 11.6023125 19.243
depth 0.125 11.7872894737 19.0361710526
depth 0.10 11.8446590909 18.8795454545
depth 0.10 11.9148275862 18.7231724138
depth 0.10 11.9608918919 18.5537567568
depth 0.10 11.9649411765 18.4151764706
depth 0.10 11.9654 18.2306
depth 0.10 11.9500769231 18.0731538462
depth 0.10 11.9589615385 17.8977307692
depth 0.10 11.9135 17.688
depth 0.10 11.832 17.4983684211
depth 0.10 11.8051578947 17.2349473684
depth 0.10 11.6054242424 16.9564848485
depth 0.10 10.8235 16.7965
depth 0.10 9.95 16.4071428571
depth 0.10 10.297 15.386
depth 0.10 9.654 15.228
depth 0.10 9.716 14.74
depth 0.10 7.77373913043 13.8555217391
depth 0.10 5.7385 12.7755
depth 0.10 3.68595348837 8.69004651163
depth 0.10 3.59304166667 2.07370833333
depth 0.10 3.585 2.061
depth 0.10 3.582 2.06
depth 0.10 3.57944444444 2.05733333333
depth 0.10 3.57975 2.05925
depth 0.10 3.58183333333 2.05766666667
depth 0.10 3.583 2.06
depth 0.10 3.58046153846 2.05923076923
depth 0.10 3.582 2.06
depth 0.10 3.57915384615 2.05969230769
depth 0.10 3.5826 2.0616
depth 0.10 3.579 2.06044444444
depth 0.10 3.583 2.0578
depth 0.10 3.57171428571 2.05457142857
depth 0.10 3.573 2.057
depth 0.10 3.57488888889 2.05788888889
depth 0.10 3.569 2.054
depth 0.10 3.58087096774 2.05867741935
depth 0.10 3.57517647059 2.05864705882
depth 0.15 3.5803 2.0553
depth 0.20 3.58025925926 2.05696296296
depth 0.25 3.57663829787 2.05476595745
depth 0.30 3.57753658537 2.0533902439
depth 0.40 3.58018181818 2.05918181818
depth 0.50 3.572 2.055
depth 0.50 3.5708 2.052
depth 0.50 3.56085714286 2.0529047619
depth 0.50 3.56026315789 2.054
depth 0.50 3.5582 2.0512
depth 0.50 3.5582 2.0512


#========================================================================

#----- default boundary condition for domain faces -----
# this will be cancelled if the domains are connected
# [TYPES]
# (1) freesurface (only for top face)
# (2) wall, i.e. non-slip boundary
# (3) rigidslip, slip boundary without displacement
# (4) wave, internal wave generator, only available for west face
# you need to set bc-type for all faces of all domains)
# [FORMAT] bcdomain face type
# SPECIFY THIS WITH THE ORDER SAME WITH DOMAIN KEYWORD!

# for domain 0
bcdomain top freesurface
bcdomain down rigidslip
bcdomain east rigidslip
bcdomain west rigidslip
bcdomain north rigidslip
bcdomain south rigidslip

# for domain 1
bcdomain top freesurface
bcdomain down rigidslip
bcdomain east rigidslip
bcdomain west rigidslip
bcdomain north rigidslip
bcdomain south rigidslip

# for domain 2
bcdomain top freesurface
bcdomain down rigidslip
bcdomain east rigidslip
bcdomain west rigidslip
bcdomain north rigidslip
bcdomain south rigidslip

# for domain 3
bcdomain top freesurface
bcdomain down rigidslip
bcdomain east rigidslip
bcdomain west rigidslip
bcdomain north rigidslip
bcdomain south rigidslip

# we USED TO have boundary condition for surface (bcsurf)
# to use the tidal boundary but it's function has been moved to extbcsur keyword
# so there is no need to use bcsurf now

# We can create the mask region by the blockmask keyword
# just specify domain number, mask or unmask, start and end of block region
#[FORMAT] blockmask domain_num mask_type start_i start_j start_k end_i end_j end_k

#blockmask 0 mask 7 0 0 13 2 6


#========================================================================

#----- weather information -----
# specify type of weather information
# this infromation is needed for wind forcing and heat flux
# [TYPE]
# (1) file (reading from file, need to specify filename, data interval
# and the north shift (deg) from y-axis)
# (2) const (fix the wind speed (m/s), no information of heat flux, need to specify the wind
# speed in x and y direction )
# [FORMAT] weather name value (or filename)
# need to specify type swith const/file

#for constant wind
#weather type const
#weather horizontal 0.0
#weather vertical 5.0

weather type file
weather filename abashiriMetData.inp

weather timeinterval 3600.0
weather northshift -20.0

#========================================================================

#----- preparing physical variables to advect and diffuse -----
# you can put arbitrary number of physical variables here, ex., tracer, DO and others.
# (ofcourse you need to program the source terms into the model if needed)
# [FORMAT]phys name difinition_position advection_switch diffusion_switch prandtl_num initial_value
# [TYPES OF POSITION]
# (1)staggered grid (u:uface, v:vface, w:wface, others:center)
# (2)collocated grid (all the variable: center)
# (NEED NOT ADD TURBULENCE QUANTITIES, HERE! THEY ARE AUTOMATICALLY
# ADDED WHEN THE TURBULENCE MODEL IS SELECTED )
# u, v, w, temp, salinity are ESSENTIAL so you CANNOT remove them!
# when you DON'T want to use them just set FALSE at advection and diffusion switches

phys u uface true true 1.0 0.0
phys v vface true true 1.0 0.0
phys w wface false false 1.0 0.0
phys temp center true true 7.09 20.0
phys salinity center true true 638.00 0.0
#phys tracer center true false 1.0 0.0

#================================================================

#----- advection scheme -----
# selection of advective scheme for momentum, scholar and turbulence quantities
# [TYPES OF SCHEME]
# (1) cip (CIP scheme)
# (2) rcip (Rational CIP scheme)
# (3) uw (1st order upwind scheme)
# (4) uq (ULTIMATE QUICKEST scheme)
# [FORMAT ]advect momentum_scheme scalar_scheme turbulence_scheme
advect rcip rcip uw

#========================================================================

#----- turbulent models -----
# you need to specify the turbulence model in vertical direction
# [TYPES OF MODEL IN VERTICAL DIRECTION]
# (1) nt (no turbulence)
# (2) ke (k-epsilon)
# (3) my (Mellor-Yamada level 2.5)
# (4) sf (stratification func)
# (5) les (LES)
# [TYPES OF MODEL IN HORIZONTAL DIRECTION]
# richardson (Richardson 4/3 law)
# const (fixed value, unit:m^2/sec)
# ke (only for vertical model is ke)
# [FORMAT] turb vertical_model [horizontal_model horizontal_model_coefficient]
# if you omit the setting for horizontal_turbulence model,
# then default is used as: [richardson 0.01]
turb les
# turb les richardson 0.02
# turb my const 10.0

#========================================================================

#----- external boundary condition of domain faces-----
# You can specify the boudary condition on the domain face
# need not to consider the staggered arrangement for this keyword
# it automatically recognized in the code
# [TYPE OF FACES]
# (1) east
# (2) west
# (3) north
# (4) south
# (5) top
# (6) down
# file need to contains 1 column of data with the inderval of dataTimeInterval
# need to provide longer than the computing time, i.e. totalcount*basetimestep
# [FORMAT] extbcdom domain face physname filename dataTimeInterval
#extbcdom 12 east salinity river_mouth_salinity_boundary.txt 3600.0
#extbcdom 0 west salinity lake_salinity_boundary.txt 3600.0
#extbcdom 0 west u lake_velocity_boundary.txt 3600.0

#----- external boundary of surface at domain faces -----
# you can specify the surface level at domain faces
# with this keyword, you can put tidal boundary
# [TYPE OF FACES]
# (1) east
# (2) west
# (3) north
# (4) south
# [FORMAT] extbcsur domian face filename dataTimeInterval
#extbcsur 12 east rivermouth_surface_boundary.txt 3600.0
#extbcsur 0 west lake_surface_boundary.txt 3600.0


#========================================================================

#----- point boundary condition for physical variables -----
# this keyword is used when you need to specify boundary condition at one cell
# for example, river inflow and outflow.
# [TYPE OF PHYS]
# (1) usual phys varibles
# (2) flux, (uflux, vflux and wflux)
# if you specify the flux, the flux is fixed even the grid moves (good for rive flows).
# ATTENSION please specify the (i,j,k) considering the staggered arrangement
# [FORMAT] pntbcdom domain phys i j k filename dataTimeInterval
# file need to contains 1 column of data with the inderval of dataTimeInterval
# need to provide longer than the computing time, i.e. totalcount*basetimestep
#pntbcdom 0 uflux 1 4 14 pnt_u_1.inp 3600.0
#pntbcdom 0 temp 1 4 14 pnt_temp_1.inp 3600.0
#pntbcdom 3 v 1 1 25 pnt_v_2.inp 3600.0
#pntbcdom 3 temp 1 1 25 pnt_temp_2.inp 3600.0
#pntbcdom 4 v 1 8 24 pnt_v_3.inp 3600.0
#pntbcdom 4 temp 1 8 24 pnt_temp_3.inp 3600.0
#pntbcdom 7 v 2 6 46 pnt_v_4_1.inp 3600.0
#pntbcdom 7 v 2 6 45 pnt_v_4_1.inp 3600.0
#pntbcdom 7 v 2 6 44 pnt_v_4_2.inp 3600.0
#pntbcdom 7 v 2 6 43 pnt_v_4_3.inp 3600.0
#pntbcdom 7 v 2 6 42 pnt_v_4_4.inp 3600.0
#pntbcdom 7 v 2 6 41 pnt_v_4_5.inp 3600.0

# there exists a keyword pntbcsur for surface point boundary condition
# but no use for the present

#========================================================================

#----- initialize physical variable in a block region -----
# you can initialize the physical variables in a blocked region
# [FORMAT] blockinit domain_num phys_name value init_count start_i start_j start_k end_i end_j end_k
# WARNING: Ranges are like, i=start_i; i< end_i, i++. So the cells at end are not included!
# You need to specify count to initialize (init_count), then you can initialize anytime you want
# init_count=0 means initialization at start
#blockinit 0 tracer 1.0 0 60 0 45 100 3 56

#----- initialize physical variables in depth direction -----
# you can specify the initial condition in depth direction for any physical variables
# the format of the file is same as depth keyword but for arbitrary phys
# [FORMAT] depinit physname depthfile init_count
# You need to specify count to initialize (init_count), then you can initialize anytime you want
# init_count=0 means initialization at start
#depinit temp temp_vertical_distribution.inp 0
#depinit tarcer tracer_vertical_distribution.inp 0

#----- initialize physical variables in whole domain -----
# you can initialize the physical variable in whole domain when calculation count is equal to
# ini_count
# [FORMAT] bulkinit physname value init_count
#bulkinit temp 20.0 0

#----- initialize physical variables in 2D distribution-----
# you can initialize the physical variable by arbitrary 2d distribution
# applying 2d profile to faces, xy, yz and xz when count equals to ini_count
# file format is same with the reading of bottom geometry file
# [FORMAT] 2dinit face physname filename init_count
#2dinit xz salinity 2d_data.txt 0

#========================================================================

#----- domain face drag -----
# if you want to add special dragging force from the domain faces, i.e. side wall effects etc,
# specify the domain, face and drag coefficient
# [TYPE OF FACES]
# (1) east
# (2) west
# (3) north
# (4) south
# (5) top
# (6) down
# [FORMAT] dfacedrag domain_num face drag_coef
#dfacedrag 0 south 0.01
#dfacedrag 1 south 0.01
#dfacedrag 2 south 0.01
#dfacedrag 3 south 0.01
#dfacedrag 0 down 0.0026
#dfacedrag 1 down 0.0026
#dfacedrag 2 down 0.0026
#dfacedrag 3 down 0.0026

#========================================================================

# ----- particle tracking -----
# You can put the arbitrary number of particle for the tracer analysis
# the history of particle path is saved at the end of run in separeted file
# particle history added with saveinterval, 10 particle creats 10 history files
# [TYPE]
# (1) float (move on the surface, never go deep)
# [FORMAT] particle type x_initial_position y_initial_position z_initial_position
# z_initial_position has no meaning for float, so arbitrary
#particle float 3000 5000 0
#particle float 3000 5500 0
#particle float 3000 6000 0

# ----- constant source -----

# ----- shaved cell -----

#========================================================================
# Multi-phase calculation options
# if wanting to calculate multiphase flow (for present liquid and gas), following switch set true
# (default: false)

#param multiphase true

# To change the direction of gravity, specify the tilting of z-axis and
# rotation of the tilt direction from x-axis
# Unit is degree
#[FORMAT] gravityangle tilt rotation

#gravityangle 5.0 0.0