Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iofix #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 100 additions & 77 deletions src/io.F
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ SUBROUTINE OUTPUT
# if defined(SEDIMENT)
USE SEDIMENT_MODULE
# endif
# if defined (TRACKING)
USE TRACER
# if defined (TRACKING)
USE TRACER
# endif

IMPLICIT NONE

SCREEN_COUNT=SCREEN_COUNT+DT
Expand Down Expand Up @@ -107,16 +106,13 @@ SUBROUTINE OUTPUT
CALL OUTPUT_SEDIMENT
ENDIF
# endif
# if defined (TRACKING)
PLOT_COUNT_TRACKING=PLOT_COUNT_TRACKING+DT
IF(PLOT_COUNT_TRACKING>=PLOT_INTV_TRACKING)THEN
PLOT_COUNT_TRACKING=PLOT_COUNT_TRACKING-PLOT_INTV_TRACKING
CALL OUTPUT_TRACKING
ENDIF
#if defined (TRACKING)
PLOT_COUNT_TRACKING=PLOT_COUNT_TRACKING+DT
IF(PLOT_COUNT_TRACKING>=PLOT_INTV_TRACKING)THEN
PLOT_COUNT_TRACKING=PLOT_COUNT_TRACKING-PLOT_INTV_TRACKING
CALL OUTPUT_TRACKING
ENDIF
# endif



END SUBROUTINE OUTPUT

!-------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1022,36 +1018,58 @@ SUBROUTINE READ_INPUT

IF(WaveMaker(1:7)=='INI_SOL')THEN

CALL READ_LOGICAL(SolitaryPositiveDirection,FILE_NAME, &
'SolitaryPositiveDirection',ierr)

IF(ierr==1)THEN
SolitaryPositiveDirection = .TRUE.
CALL READ_LOGICAL(SolitaryPositiveDirection,FILE_NAME, &
'SolitaryPositiveDirection',ierr)

ALL READ_FLOAT(DEP_Ser,FILE_NAME,'DEP_WK',ierr)

# if defined (PARALLEL)
if (myid.eq.0) WRITE(3,'(A50)') 'DepthWaveMaker not defined, read DEP_WK'
# else
WRITE(3,'(A50)')'DepthWaveMaker not defined, read DEP_WK'
# endif
IF(ierr==1)THEN ! if can not find again
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
endif
call MPI_FINALIZE ( ier )
# else
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
# endif
STOP
ENDIF

ENDIF ! end read DepthWaveMaker

SolitaryPositiveDirection = .TRUE.
ENDIF

IF(SolitaryPositiveDirection) THEN
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A60)')'Solitary wave propagate in + X direction'
WRITE(3,'(A60)')'Solitary wave propagate in + X direction'
endif
# else
WRITE(*,'(A60)')'Solitary wave propagate in + X direction'
WRITE(3,'(A60)')'Solitary wave propagate in + X direction'
# endif
ELSE
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A60)')'Solitary wave propagate in - X direction'
WRITE(3,'(A60)')'Solitary wave propagate in - X direction'
endif
# else
WRITE(*,'(A60)')'Solitary wave propagate in - X direction'
WRITE(3,'(A60)')'Solitary wave propagate in - X direction'
# endif
ENDIF

IF(SolitaryPositiveDirection) THEN
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A60)')'Solitary wave propagate in + X direction'
WRITE(3,'(A60)')'Solitary wave propagate in + X direction'
endif
# else
WRITE(*,'(A60)')'Solitary wave propagate in + X direction'
WRITE(3,'(A60)')'Solitary wave propagate in + X direction'
# endif
ELSE
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A60)')'Solitary wave propagate in - X direction'
WRITE(3,'(A60)')'Solitary wave propagate in - X direction'
endif
# else
WRITE(*,'(A60)')'Solitary wave propagate in - X direction'
WRITE(3,'(A60)')'Solitary wave propagate in - X direction'
# endif
ENDIF

CALL READ_FLOAT(AMP_SOLI,FILE_NAME,'AMP',ierr)
CALL READ_FLOAT(AMP_SOLI,FILE_NAME,'AMP',ierr)
IF(ierr==1)THEN
# if defined (PARALLEL)
if (myid.eq.0) THEN
Expand Down Expand Up @@ -1896,30 +1914,29 @@ SUBROUTINE READ_INPUT

CALL READ_FLOAT(DEP_Ser,FILE_NAME,'DepthWaveMaker',ierr)

IF(ierr==1)THEN
CALL READ_FLOAT(DEP_Ser,FILE_NAME,'DEP_WK',ierr)

# if defined (PARALLEL)
if (myid.eq.0) WRITE(3,'(A50)') 'DepthWaveMaker not defined, read DEP_WK'
# else
WRITE(3,'(A50)')'DepthWaveMaker not defined, read DEP_WK'
# endif
IF(ierr==1)THEN ! if can not find again
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
endif
call MPI_FINALIZE ( ier )
# else
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
# endif
STOP
ENDIF

ENDIF ! end read DepthWaveMaker

IF(ierr==1)THEN
CALL READ_FLOAT(DEP_Ser,FILE_NAME,'DEP_WK',ierr)

# if defined (PARALLEL)
if (myid.eq.0) WRITE(3,'(A50)') 'DepthWaveMaker not defined, read DEP_WK'
# else
WRITE(3,'(A50)')'DepthWaveMaker not defined, read DEP_WK'
# endif
IF(ierr==1)THEN ! if can not find again
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
endif
call MPI_FINALIZE ( ier )
# else
WRITE(*,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
WRITE(3,'(A80)')'you should specify either DepthWaveMaker or DEP_WK,STOP'
# endif
STOP
ENDIF

ENDIF ! end read DepthWaveMaker

IF(WaveMaker(1:3)=='ABS')THEN
CALL READ_FLOAT(WidthWaveMaker,FILE_NAME,'WidthWaveMaker',ierr)
Expand Down Expand Up @@ -2541,15 +2558,15 @@ SUBROUTINE READ_INPUT
# if defined (ZALPHA)
CALL READ_FLOAT(Beta_ref,FILE_NAME,'Beta_ref',ierr)
IF(ierr==1)THEN
Beta_ref = -0.531_SP
Beta_ref = - 0.531_SP
# if defined (PARALLEL)
if (myid.eq.0) THEN
WRITE(*,'(A40)')'Beta_ref Default: -0.531'
WRITE(3,'(A40)')'Beta_ref Default: -0.531'
WRITE(*,'(A40)')'Beta_ref Default: - 0.531'
WRITE(3,'(A40)')'Beta_ref Default: - 0.531'
endif
# else
WRITE(*,'(A40)')'Beta_ref Default: -0.531'
WRITE(3,'(A40)')'Beta_ref Default: -0.531'
WRITE(*,'(A40)')'Beta_ref Default: - 0.531'
WRITE(3,'(A40)')'Beta_ref Default: - 0.531'
# endif
ENDIF
# endif
Expand Down Expand Up @@ -3320,6 +3337,7 @@ SUBROUTINE STATIONS

INTEGER :: iunit
REAL(SP) :: dum1,dum2
REAL(SP) :: eta_sta,u_sta,v_sta
CHARACTER(LEN=80)::FILE_NAME=' '
CHARACTER(LEN=80)::TMP_NAME=' '
CHARACTER(LEN=80)::FDIR=' '
Expand Down Expand Up @@ -3393,8 +3411,16 @@ SUBROUTINE STATIONS
do i=1,NumberStations
if (nsta(i).eq.1) then
iunit=100+i
write (iunit,'(20E16.8)') time, eta(ista(i),jsta(i)),&
u(ista(i),jsta(i)),v(ista(i),jsta(i))
IF(mask(ista(i),jsta(i))<1)THEN
eta_sta=ZERO
u_sta=ZERO
v_sta=ZERO
ELSE ! to avoid topography on nested water surface
eta_sta=eta(ista(i),jsta(i))
u_sta=u(ista(i),jsta(i))
v_sta=v(ista(i),jsta(i))
ENDIF
write (iunit,'(20E16.5E4)') time, eta_sta,u_sta,v_sta
endif
enddo

Expand Down Expand Up @@ -3498,8 +3524,7 @@ SUBROUTINE STATIONS_SPHERICAL_IJ
u_sta=u(ista(i),jsta(i))
v_sta=v(ista(i),jsta(i))
ENDIF
write (iunit,'(20E16.8)') time, eta_sta,&
u_sta,v_sta
write (iunit,'(20E16.5E4)') time, eta_sta,u_sta,v_sta
endif
enddo

Expand Down Expand Up @@ -3601,12 +3626,10 @@ SUBROUTINE STATIONS
ELSE ! to avoid topography on nested water surface
eta_sta=eta(ista(i),jsta(i))
u_sta=u(ista(i),jsta(i))
v_sta=v(ista(i),jsta(i))
v_sta=v(ista(i),jsta(i))
ENDIF

write (iunit,'(20E16.5)') time, eta_sta,&
u_sta,v_sta

write (iunit,'(20E16.5E4)') time,eta_sta,u_sta,v_sta
! write (iunit,*) time, eta(ista(i),jsta(i)),u(ista(i),jsta(i)),&
! v(ista(i),jsta(i))

Expand Down
2 changes: 1 addition & 1 deletion src/mod_parallel_field_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SUBROUTINE PutFileASCII(FILE,PHI)
! format length
write(FORMAT_LEN(1:1),'(A1)') '('
write(FORMAT_LEN(2:8),'(I7)') Mglob
write(FORMAT_LEN(9:13),'(A5)') 'E16.6'
write(FORMAT_LEN(9:13),'(A5)') 'E16.6E4'
write(FORMAT_LEN(14:14),'(A1)') ')'
ENDIF

Expand Down