Skip to content

Commit

Permalink
Merge pull request #25 from edwardhartnett/JessicaMeixner-NOAA-featur…
Browse files Browse the repository at this point in the history
…e/pointbinary2nc

Jessica meixner noaa feature/pointbinary2nc
  • Loading branch information
edwardhartnett authored Apr 3, 2024
2 parents 479029f + a9f4f0f commit 4c99c06
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 17 deletions.
10 changes: 7 additions & 3 deletions model/src/gx_outp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ PROGRAM GXOUTP
#endif
USE W3ODATMD, ONLY: W3SETO, W3NOUT
USE W3IOGRMD, ONLY: W3IOGR
USE W3IOPOMD, ONLY: W3IOPO
!!!MTM
!!!USE W3IOPOMD, ONLY: W3IOPO
USE W3IOPOMD
USE netcdf

USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE
#ifdef W3_S
USE W3SERVMD, ONLY : STRACE
Expand Down Expand Up @@ -277,7 +281,7 @@ PROGRAM GXOUTP
!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! 3. Read general data and first fields from file
!
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
ALLOCATE ( FLREQ(NOPTS) )
!
WRITE (NDSO,930)
Expand Down Expand Up @@ -369,7 +373,7 @@ PROGRAM GXOUTP
DO
DTEST = DSEC21 ( TIME , TOUT )
IF ( DTEST .GT. 0. ) THEN
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
WRITE (NDSO,998)
EXIT
Expand Down
4 changes: 3 additions & 1 deletion model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
USE W3IOGRMD
USE W3IOGOMD
USE W3IOPOMD
USE netcdf
!!!MTM
USE W3IOTRMD
USE W3IORSMD
USE W3IOBCMD
Expand Down Expand Up @@ -2601,7 +2603,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
! Gets the necessary spectral data
!
CALL W3IOPE ( VA )
CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD &
CALL W3IOPON ( 'WRITE', NDS(8), ITEST, IMOD &
#ifdef W3_ASCII
,NDS(15) &
#endif
Expand Down
8 changes: 5 additions & 3 deletions model/src/wmiopomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,9 @@ SUBROUTINE WMIOPO ( TOUT )
USE W3ODATMD, ONLY: W3SETO
USE WMMDATMD, ONLY: WMSETM
USE W3CSPCMD, ONLY: W3CSPC
USE W3IOPOMD, ONLY: W3IOPO
USE W3IOPOMD
USE netcdf
!!! MTM
!
USE W3GDATMD, ONLY: NK, NTH, NSPEC, XFR, FR1, TH, SGRDS
USE W3WDATMD, ONLY: TIME
Expand Down Expand Up @@ -1176,9 +1178,9 @@ SUBROUTINE WMIOPO ( TOUT )
!
TIME = TOUT
!
CALL W3IOPO ( 'WRITE', MDSUP, II, 0 &
CALL W3IOPON ( 'WRITE', MDSUP, II, 0 &
#ifdef W3_ASCII
,MDSUPA &
,MDSUPA &
#endif
)
!
Expand Down
14 changes: 8 additions & 6 deletions model/src/ww3_ounp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ PROGRAM W3OUNP
USE W3ODATMD, ONLY: W3SETO, W3NOUT
USE W3ODATMD, ONLY: IAPROC, NAPROC, NAPERR, NAPOUT, DIMP
USE W3IOGRMD, ONLY: W3IOGR
USE W3IOPOMD, ONLY: W3IOPO
USE W3IOPOMD
USE netcdf
!!!MTM
USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE, STRSPLIT
#ifdef W3_S
USE W3SERVMD, ONLY : STRACE
Expand Down Expand Up @@ -387,7 +389,7 @@ PROGRAM W3OUNP
!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! 3. Read general data and first fields from file
!
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
!
IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,930)
DO I=1, NOPTS
Expand Down Expand Up @@ -604,7 +606,7 @@ PROGRAM W3OUNP
DO WHILE (DTEST.NE.0)
DTEST = DSEC21 ( TIME , TOUT )
IF ( DTEST .GT. 0. ) THEN
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949)
GOTO 888
Expand Down Expand Up @@ -1070,7 +1072,7 @@ PROGRAM W3OUNP
DTEST = DSEC21 ( TIME , TOUT )
IF ( DTEST .GT. 0. ) THEN
! reads TIME from out_pnt.ww3
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949)
GOTO 700
Expand Down Expand Up @@ -1215,7 +1217,7 @@ PROGRAM W3OUNP
! 7.3 Reinitiazes TIME (close open out_pnt.ww3) and TOUT to process a new bunch of stations
CLOSE(NDSOP) ! closes binary file out_pnt*
IPASS = 0 ! resets time counter for binary file out_pnt*
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
#ifdef W3_T
WRITE(NDSE,*) 'out_pnt* closed and reopened'
#endif
Expand All @@ -1228,7 +1230,7 @@ PROGRAM W3OUNP
DO WHILE (DTEST.NE.0)
DTEST = DSEC21 ( TIME , TOUT )
IF ( DTEST .GT. 0. ) THEN
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
IF ( IAPROC .EQ. NAPOUT ) WRITE (NDSO,949)
GOTO 700
Expand Down
18 changes: 14 additions & 4 deletions model/src/ww3_outp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ PROGRAM W3OUTP
#endif
USE W3ODATMD, ONLY: W3SETO, W3NOUT
USE W3IOGRMD, ONLY: W3IOGR
USE W3IOPOMD, ONLY: W3IOPO
!!!MTM
!!! USE W3IOPOMD, ONLY: W3IOPO
USE W3IOPOMD, ONLY: W3IOPO, W3IOPON, W3IOPON_READ, W3IOPON_WRITE
USE netcdf
!!!MTM
USE W3SERVMD, ONLY : ITRACE, NEXTLN, EXTCDE
#ifdef W3_S
USE W3SERVMD, ONLY : STRACE
Expand Down Expand Up @@ -359,7 +363,9 @@ PROGRAM W3OUTP
!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! 3. Read general data and first fields from file
!
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
!!!MTM
!!!CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
!
WRITE (NDSO,930)
DO I=1, NOPTS
Expand Down Expand Up @@ -457,7 +463,9 @@ PROGRAM W3OUTP
DO
CALL STME21 ( TIME , IDTIME )
WRITE (NDSO,948) IDTIME
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
!!!MTM
!!! CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
WRITE (NDSO,949)
GOTO 888
Expand Down Expand Up @@ -777,7 +785,9 @@ PROGRAM W3OUTP
DO
DTEST = DSEC21 ( TIME , TOUT )
IF ( DTEST .GT. 0. ) THEN
CALL W3IOPO ( 'READ', NDSOP, IOTEST )
!!!MTM
!!! CALL W3IOPO ( 'READ', NDSOP, IOTEST )
CALL W3IOPON ( 'READ', NDSOP, IOTEST )
IF ( IOTEST .EQ. -1 ) THEN
WRITE (NDSO,949)
EXIT
Expand Down
5 changes: 5 additions & 0 deletions regtests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ function(unit_test name)
add_test(NAME ${name} COMMAND ${name})
endfunction()

# The binary file mod_def.ww3 is needed for testing. It's created by
# the ww3_grid utility.
#add_custom_target(create_mod_def TEST ../../bin/ww3_grid
# COMMENT "Creating mod_def.ww3 file for testing")

# Copy test data files that are in the repo to the build directory.
copy_test_data(switch.io)
copy_test_data_2(ww3_grid.inp ww3_grid.inp)
Expand Down

0 comments on commit 4c99c06

Please sign in to comment.