Skip to content

Commit

Permalink
Implemented two options (selected by 'i_hmin_airsea_ex') for locally …
Browse files Browse the repository at this point in the history
…turning off heat/salt exchange. i_hmin_airsea_ex=1: exchange turned off if local grid depth<hmin_airsea_ex; i_hmin_airsea_ex=2: exchange turned off if local water depth<hmin_airsea_ex.
  • Loading branch information
feiye-vims committed Aug 21, 2020
1 parent ca5970a commit 7e9ff0a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
15 changes: 13 additions & 2 deletions sample_inputs/param.nml
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,22 @@
!-----------------------------------------------------------------------
! Heat and salt exchange. isconsv=1 needs ihconsv=1; ihconsv=1 needs nws=2.
! If isconsv=1, need to compile with precip/evap module turned on.
! If at least one of ihconsv and isconsv is set to 1,
! locally turning off air-sea exchange in shallow waters (<0.25 m) is recommended.
! Options for locally turning off heat/salt exchange are specified by
! i_hmin_airsea_ex:
! 0: not turned off locally;
! 1: locally turned off, based on grid depth, i.e.,
! off when the local grid depth (z in hgrid) < hmin_airsea_ex;
! 2 (recommended): locally turned off, based on local total water depth, i.e.,
! off when the local total water depth < hmin_airsea_ex,
! hmin_airsea_ex:
! 0.2 m is recommended for both i_hmin_airsea_ex=1 and i_hmin_airsea_ex=2
!-----------------------------------------------------------------------
ihconsv = 0 !heat exchange option
isconsv = 0 !evaporation/precipitation model
! Min total water depth for applying heat/salt exchange (i.e. off if the local total water depth <hmin_airsea_ex)
hmin_airsea_ex = 1.e-3 ![m]
i_hmin_airsea_ex = 2 ! no effect if ihconsv=0 and isconsv=0
hmin_airsea_ex = 0.2 ![m], no effect if ihconsv=0 and isconsv=0

!-----------------------------------------------------------------------
! Turbulence closure.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/schism_glbl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module schism_glbl

! Misc. variables shared between routines
integer,save :: nz_r,ieqstate,kr_co, &
&ihconsv,isconsv,ihdif,ntracers, &
&ihconsv,isconsv,i_hmin_airsea_ex,ihdif,ntracers, &
&ihydraulics,irouse_test,iwbl_itmax,nettype,nfltype, &
&ntetype,nsatype,ntrtype1(natrm),nettype2,nnode_et,nfltype2,nnode_fl, &
&ntetype2,nsatype2,nnode_tr2(natrm),inu_tr(natrm), &
Expand Down
13 changes: 10 additions & 3 deletions src/Hydro/schism_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ subroutine schism_init(iorder,indir,iths,ntime)
&iwbl,if_source,nramp_ss,dramp_ss,ieos_type,ieos_pres,eos_a,eos_b,slr_rate, &
&rho0,shw,isav,sav_cd,nstep_ice,iunder_deep,h1_bcc,h2_bcc,hw_depth,hw_ratio, &
&ibtrack_openbnd,level_age,vclose_surf_frac,iadjust_mass_consv0,ipre2, &
&ielm_transport,max_subcyc,hmin_airsea_ex
&ielm_transport,max_subcyc,i_hmin_airsea_ex,hmin_airsea_ex

namelist /SCHOUT/iof_hydro,iof_wwm,iof_gen,iof_age,iof_sed,iof_eco,iof_icm,iof_cos,iof_fib, &
&iof_sed2d,iof_ice,iof_ana,iof_marsh,iof_dvd, &
Expand Down Expand Up @@ -435,7 +435,7 @@ subroutine schism_init(iorder,indir,iths,ntime)
nramp=1; dramp=1._rkind; nadv=1; dtb_min=10._rkind; dtb_max=30._rkind; h0=0.01_rkind; nchi=0; dzb_min=0.5_rkind; dzb_decay=0._rkind;
hmin_man=1._rkind; ncor=0; rlatitude=46._rkind; coricoef=0._rkind;
nws=0; impose_net_flux=0; wtiminc=dt; iwind_form=-1; nrampwind=1;
drampwind=1; iwindoff=0; ihconsv=0; isconsv=0; itur=0; dfv0=0.01_rkind; dfh0=real(1.d-4,rkind);
drampwind=1; iwindoff=0; ihconsv=0; isconsv=0; i_hmin_airsea_ex=2; itur=0; dfv0=0.01_rkind; dfh0=real(1.d-4,rkind);
h1_pp=20._rkind; h2_pp=50._rkind; vdmax_pp1=0.01_rkind; vdmax_pp2=0.01_rkind
vdmin_pp1=real(1.d-5,rkind); vdmin_pp2=vdmin_pp1; tdmin_pp1=vdmin_pp1; tdmin_pp2=vdmin_pp1
mid='KL'; stab='KC'; xlsc0=0.1_rkind;
Expand All @@ -459,7 +459,7 @@ subroutine schism_init(iorder,indir,iths,ntime)
iadjust_mass_consv0=0 !Enforce mass conservation for a tracer
ipre2=0
ielm_transport=0; max_subcyc=10
hmin_airsea_ex=1.d-3
hmin_airsea_ex=0.2_rkind

!Output elev, hvel by detault
iof_hydro=0; iof_wwm=0; iof_gen=0; iof_age=0; iof_sed=0; iof_eco=0; iof_dvd=0
Expand Down Expand Up @@ -724,6 +724,13 @@ subroutine schism_init(iorder,indir,iths,ntime)
if(isconsv/=0.and.ihconsv==0) call parallel_abort('Evap/precip model must be used with heat exchnage model')
!'
if(ihconsv/=0.and.(nws<2.or.nws>3)) call parallel_abort('Heat budge model must have nws>=2')

if(isconsv/=0.or.ihconsv/=0) then
if(i_hmin_airsea_ex<0.or.i_hmin_airsea_ex>2) then
write(errmsg,*)'INIT: illegal i_hmin_airsea_ex',i_hmin_airsea_ex
call parallel_abort(errmsg)
endif
endif
!'
if(isconsv/=0) then
#ifndef PREC_EVAP
Expand Down
14 changes: 12 additions & 2 deletions src/Hydro/schism_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6155,7 +6155,12 @@ subroutine schism_step(it)
!$OMP do
do i=1,nea
if(idry_e(i)==1) cycle
if(ze(nvrt,i)-ze(kbe(i),i)<hmin_airsea_ex) cycle
! Skip air-sea exchange for certain elements
if(i_hmin_airsea_ex==1) then
if(dpe(i)<hmin_airsea_ex) cycle
elseif(i_hmin_airsea_ex==2) then
if(ze(nvrt,i)-ze(kbe(i),i)<hmin_airsea_ex) cycle
endif

if(impose_net_flux/=0) then !imposed net
precip=sum(fluxprc(elnode(1:i34(i),i)))/real(i34(i),rkind) !P-E
Expand All @@ -6174,7 +6179,12 @@ subroutine schism_step(it)
!$OMP do
do i=1,nea
if(idry_e(i)==1) cycle
if(ze(nvrt,i)-ze(kbe(i),i)<hmin_airsea_ex) cycle
! Skip air-sea exchange for certain elements
if(i_hmin_airsea_ex==1) then
if(dpe(i)<hmin_airsea_ex) cycle
elseif(i_hmin_airsea_ex==2) then
if(ze(nvrt,i)-ze(kbe(i),i)<hmin_airsea_ex) cycle
endif

! Wet element (not shallow)
! Surface flux
Expand Down
5 changes: 4 additions & 1 deletion src/Readme.beta_notes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ Changes in param.[in,nml] and main parameter inputs for other modules:

Github versions:

adde1aa (July 8, 2020): added a new parameter 'hmin_airsea_ex' (min total water depth for heat/salt exchange);
hash # (Aug 20, 2020): added two options (selected by 'i_hmin_airsea_ex') for locally turning off heat/salt exchange.
i_hmin_airsea_ex=1: exchange turned off if local grid depth<hmin_airsea_ex
i_hmin_airsea_ex=2: exchange turned off if local water depth<hmin_airsea_ex
This replaces the change made by adde1aa (July 8, 2020): added a new parameter 'hmin_airsea_ex' (min total water depth for heat/salt exchange);
2f7bab1 (Jun 28,2020): reorganized ICM process (rates/fluxes) and added output flag in param.nml.

1477780 (May 8, 2020): changed sediment.in to sediment.nml (and made parameters lower case: BEDLOAD_COEFF,
Expand Down

0 comments on commit 7e9ff0a

Please sign in to comment.