Skip to content

Commit

Permalink
Add WW3 outputs for Ufuk
Browse files Browse the repository at this point in the history
  • Loading branch information
josephzhang8 committed Feb 8, 2024
1 parent c5cd940 commit c26afb7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Core/schism_glbl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module schism_glbl
character(len=12),save :: ifile_char
! character(len=48),save,dimension(mnout) :: outfile !,variable_nm,variable_dim
integer,save :: ihfskip,nrec,nspool,ifile,ifile_len, &
&noutput,it_main,iths_main,id_out_var(2000),ncount_2dnode, &
&noutput,it_main,iths_main,id_out_var(2000),id_out_ww3(100),ncount_2dnode, &
&ncount_2delem,ncount_2dside,ncount_3dnode,ncount_3delem,ncount_3dside,nsend_varout
integer,save,allocatable :: srqst7(:)
real(rkind),save :: time_stamp !simulation time in sec
Expand Down
10 changes: 8 additions & 2 deletions src/Hydro/misc_subs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6179,11 +6179,12 @@ end subroutine smooth_2dvar
! Compute wave force using Longuet-Higgins Stewart formulation
subroutine compute_wave_force_lon(RSXX0,RSXY0,RSYY0)
use schism_glbl, only : rkind,nsa,np,npa,nvrt,rho0,idry,idry_s,dp,dps,hmin_radstress, &
&WWAVE_FORCE,errmsg,it_main,time_stamp,ipgl
&WWAVE_FORCE,errmsg,it_main,time_stamp,ipgl,id_out_ww3
use schism_msgp
use schism_io, only: writeout_nc
implicit none
!TODO: change to intent(in)
REAL(rkind), intent(inout) :: RSXX0(np),RSXY0(np),RSYY0(np) !from WW3, [N/m]
REAL(rkind), intent(in) :: RSXX0(np),RSXY0(np),RSYY0(np) !from WW3, [N/m]

REAL(rkind) :: RSXX(npa),RSXY(npa),RSYY(npa) !from WW3, [N/m]
!REAL(rkind), allocatable :: DSXX3D(:,:,:),DSXY3D(:,:,:),DSYY3D(:,:,:)
Expand All @@ -6194,6 +6195,11 @@ subroutine compute_wave_force_lon(RSXX0,RSXY0,RSYY0)
! allocate(DSXX3D(2,NVRT,nsa), DSYY3D(2,NVRT,nsa),DSXY3D(2,NVRT,nsa),stat=i)
! if(i/=0) call parallel_abort('compute_wave_force_lon, alloc')

!Output for check
call writeout_nc(id_out_ww3(1),'RSXX',1,1,np,RSXX0)
call writeout_nc(id_out_ww3(2),'RSXY',1,1,np,RSXY0)
call writeout_nc(id_out_ww3(3),'RSYY',1,1,np,RSYY0)

!Check
sum1=sum(RSXX0)
sum2=sum(RSXY0)
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ ifdef USE_WWM
wwm_output.o wwm_compute.o wwm_compute_roller.o wwm_diffrac.o wwm_coupl_roms_pipe.o wwm_coupl_roms_pgmcl.o wwm_jacobi.o wwm_coupl_shyfem.o wwm_coupl_selfe.o wwm_coupl_timor.o wwm_vegdiss.o wwm_main.o wwm_lpp_filter.o
endif

ifdef USE_WW3
PPFLAGS := $(PPFLAGS) $(IBMCPP)-DUSE_WW3
endif

ifdef USE_ICE
PPFLAGS := $(PPFLAGS) $(IBMCPP)-DUSE_ICE
OBJS := $(OBJS) ice_module.o ice_therm_mod.o ice_init.o ice_step.o ice_evp.o ice_mevp.o \
Expand Down
2 changes: 1 addition & 1 deletion src/WWMIII/wwm_coupl_selfe.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SUBROUTINE RADIATION_STRESS_SCHISM
CALL exchange_s3d_2(DSXY3D)

! Computing the wave forces; these are noted Rsx, Rsy in Rolland et al. (2012), see Eq. (9)
! These are stored in wwave_force(:,1:nsa,1:2) [m/s^2]
! These are stored in wwave_force(2,nvrt,nsa) [m/s^2]
DO IS = 1, nsa
IF(idry_s(IS) == 1) CYCLE

Expand Down

0 comments on commit c26afb7

Please sign in to comment.