From 9548975aa85eb57080dd11465452c0bd35147b06 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Thu, 9 May 2024 20:56:56 +0000 Subject: [PATCH] add regtests --- model/src/w3iopomd.F90 | 11 ++++++++--- regtests/bin/matrix.base | 1 + regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC | 1 + regtests/ww3_ufs1.1/input_unstr/switch_PDLIB | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC diff --git a/model/src/w3iopomd.F90 b/model/src/w3iopomd.F90 index 28d444f5d..a4b55cbb9 100644 --- a/model/src/w3iopomd.F90 +++ b/model/src/w3iopomd.F90 @@ -1178,6 +1178,7 @@ 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 + integer :: v_title_len, v_version_len CHARACTER(LEN=31) :: IDTST CHARACTER(LEN=10) :: VERTST @@ -1193,10 +1194,14 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr) ncerr = nf90_open(filename, NF90_NOWRITE, fh) if (nf90_err(ncerr) .ne. 0) return - ! Read and check the version: - ncerr = nf90_get_att(fh, 'title', IDTST) + ! Read and check the version: + ncerr = nf90_inquire_attribute(fh, NF90_GLOBAL, 'title', len = v_title_len) if (nf90_err(ncerr) .ne. 0) return - ncerr = nf90_put_att(fh, 'version', VERTST) + ncerr = nf90_get_att(fh, NF90_GLOBAL, 'title', IDTST) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_inquire_attribute(fh, NF90_GLOBAL, 'version', len = v_version_len) + if (nf90_err(ncerr) .ne. 0) return + ncerr = nf90_get_att(fh, NF90_GLOBAL, 'version', VERTST) if (nf90_err(ncerr) .ne. 0) return IF ( IDTST .NE. IDSTR ) THEN diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 97ae213f4..519425f78 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -180,6 +180,7 @@ if [ "$prop2D" = 'y' ] then echo ' ' >> matrix.body + echo "$rtst -s PR1_MPI_BIN2NC -w work_PR1_MPI_BIN2NC -f -p $mpi -n $np $ww3 ww3_tp2.2" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.1" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.2" >> matrix.body echo "$rtst -s PR1_MPI -w work_PR1_MPI -f -p $mpi -n $np $ww3 ww3_tp2.3" >> matrix.body diff --git a/regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC b/regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC new file mode 100644 index 000000000..bb79e8549 --- /dev/null +++ b/regtests/ww3_tp2.2/input/switch_PR1_MPI_BIN2NC @@ -0,0 +1 @@ +NOGRB DIST MPI PR1 FLX2 LN0 ST0 NL0 BT0 DB0 TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 BIN2NC diff --git a/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB b/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB index ff569c11f..0927be62d 100644 --- a/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB +++ b/regtests/ww3_ufs1.1/input_unstr/switch_PDLIB @@ -1 +1 @@ -PDLIB SCOTCH NOGRB DIST MPI PR3 UQ FLX0 SEED ST4 STAB0 NL1 BT1 DB1 MLIM FLD1 TR0 BS0 WNX1 WNT1 CRX1 CRT1 O0 O1 O2 O3 O4 O5 O6 O7 O14 O15 IC0 IS0 REF0 +PDLIB SCOTCH NOGRB DIST MPI PR3 UQ FLX0 SEED ST4 STAB0 NL1 BT1 DB1 MLIM FLD1 TR0 BS0 WNX1 WNT1 CRX1 CRT1 O0 O1 O2 O3 O4 O5 O6 O7 O14 O15 IC0 IS0 REF0 BIN2NC