Skip to content

Commit

Permalink
add a check on version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMeixner-NOAA committed May 7, 2024
1 parent 40fa419 commit 4566f92
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions model/src/w3iopomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,8 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr)
#endif
integer :: v_aso, v_cao, v_cdo, v_iceo
integer :: v_iceho, v_icefo, v_grdid, v_spco
CHARACTER(LEN=31) :: IDTST
CHARACTER(LEN=10) :: VERTST

IOTST = 0

Expand All @@ -1192,16 +1194,19 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr)
if (nf90_err(ncerr) .ne. 0) return

! Read and check the version:
! TO DO add reading of IDTST and VERTST and make checks:
! IF ( IDTST .NE. IDSTR ) THEN
! WRITE (NDSE,902) IDTST, IDSTR
! CALL EXTCDE ( 10 )
! END IF
! IF ( VERTST .NE. VEROPT ) THEN
! WRITE (NDSE,903) VERTST, VEROPT
! CALL EXTCDE ( 11 )
! END IF
ncerr = nf90_get_att(fh, 'title', IDTST)
if (nf90_err(ncerr) .ne. 0) return
ncerr = nf90_put_att(fh, 'version', VERTST)
if (nf90_err(ncerr) .ne. 0) return

IF ( IDTST .NE. IDSTR ) THEN
WRITE (NDSE,902) IDTST, IDSTR
CALL EXTCDE ( 10 )
END IF
IF ( VERTST .NE. VEROPT ) THEN
WRITE (NDSE,903) VERTST, VEROPT
CALL EXTCDE ( 11 )
END IF

! Read the dimension information for NOPTS.
ncerr = nf90_inq_dimid(fh, DNAME_NOPTS, d_nopts)
Expand Down Expand Up @@ -1439,6 +1444,7 @@ SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr)
integer :: v_aso, v_cao, v_cdo, v_iceo
integer :: v_iceho, v_icefo, v_grdid, v_spco


!If first pass, or if you are writting a file for every time-step:
IF ( IPASS.EQ.1 .OR. timestep_only.EQ.1 ) THEN
! Create the netCDF file.
Expand Down

0 comments on commit 4566f92

Please sign in to comment.