Skip to content

Commit

Permalink
Merge branch 'develop' into init_bugs2
Browse files Browse the repository at this point in the history
  • Loading branch information
aronroland committed Dec 14, 2023
2 parents a3e143c + 1f928aa commit 57ba5f8
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 10 deletions.
4 changes: 2 additions & 2 deletions model/src/w3sdb1md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ SUBROUTINE W3SDB1 (IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D )
!
! 0. Initialzations ------------------------------------------------- /
! Never touch this 4 lines below ... otherwise my exceptionhandling will not work.
S = 0.
D = 0.

THR = DBLE(1.E-15)
IF (SUM(A) .LT. THR) RETURN

S = 0.
D = 0.
IWB = 1
!
#ifdef W3_T
Expand Down
3 changes: 1 addition & 2 deletions model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2420,8 +2420,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
#endif
!
#ifdef W3_MPI
IF ( ( (DSEC21(TIME,TONEXT(:,1)).EQ.0.) .AND. FLOUT(1) ) .OR. &
( (DSEC21(TIME,TONEXT(:,7)).EQ.0.) .AND. FLOUT(7) .AND. SBSED ) ) THEN
IF ( (FLOUTG) .OR. (FLOUTG2 .AND. SBSED) ) THEN
IF (.NOT. LPDLIB) THEN
IF (NRQGO.NE.0 ) THEN
#endif
Expand Down
76 changes: 72 additions & 4 deletions model/src/wminitmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
!
! 2.c Set up I/O for individual models (initial)
!
ALLOCATE ( MDS(13,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), &
ALLOCATE ( MDS(15,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), &
FLGRD(NOGRP,NGRPP,NRGRD), OT2(0:NRGRD), FLGD(NOGRP,NRGRD), &
MDSF(-NRINP:NRGRD,JFIRST:9), IPRT(6,NRGRD), LPRT(NRGRD), &
FLGR2(NOGRP,NGRPP,NRGRD),FLG2D(NOGRP,NGRPP), FLG1D(NOGRP), &
Expand Down Expand Up @@ -2303,8 +2303,20 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
SELECT CASE (J)
CASE (1)
MDS(7,I) = NDSFND
#ifdef W3_ASCII
CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' )
CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., &
DESC='ASCII output file' )
MDS(14,I) = NDSFND ! ASCII
#endif
CASE (2)
MDS(8,I) = NDSFND
#ifdef W3_ASCII
CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' )
CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., &
DESC='ASCII output file' )
MDS(15,I) = NDSFND ! ASCII
#endif
CASE (3)
MDS(12,I) = NDSFND
CALL WMUGET ( MDSE, MDST, NDSFND, 'INP' )
Expand Down Expand Up @@ -2422,6 +2434,28 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
END IF
END IF
!
#ifdef W3_ASCII
IF ( MDS(14,I) .NE. -1 ) THEN ! Grid output (ASCII)
IF ( IAPROC .EQ. NAPFLD ) THEN
TNAME = TRIM(FNMPRE)//'out_grd.' // FILEXT(:II) // '.txt'
CALL WMUSET ( MDSE,MDST, MDS(14,I), .TRUE., NAME=TNAME )
ELSE
CALL WMUSET ( MDSE,MDST, MDS(14,I), .FALSE. )
MDS(14,I) = -1
END IF
END IF
!
IF ( MDS(15,I) .NE. -1 ) THEN ! Point output (ASCII)
IF ( IAPROC .EQ. NAPPNT ) THEN
TNAME = TRIM(FNMPRE)//'out_pnt.' // FILEXT(:II) // '.txt'
CALL WMUSET ( MDSE,MDST, MDS(15,I), .TRUE., NAME=TNAME )
ELSE
CALL WMUSET ( MDSE,MDST, MDS(15,I), .FALSE. )
MDS(15,I) = -1
END IF
END IF
#endif
!
#ifdef W3_T
WRITE (MDST,9081) I, TIME
#endif
Expand Down Expand Up @@ -3389,7 +3423,7 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
!
#ifdef W3_T
9020 FORMAT ( ' TEST WMINIT : UNIT NUMBERS FOR GRIDS (',A,')'/ &
15X,'GRID MDS(1-13)',43X,'NTRACE')
15X,'GRID MDS(1-15)',43X,'NTRACE')
9021 FORMAT (14X,16I4)
9022 FORMAT ( ' TEST WMINIT : UNIT NUMBERS FOR INTPUT FILES'/ &
15X,'GRID MDSF(JFIRST-9)')
Expand Down Expand Up @@ -4108,7 +4142,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
!
! 2.c Set up I/O for individual models (initial)
!
ALLOCATE ( MDS(13,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), &
ALLOCATE ( MDS(15,NRGRD), NTRACE(2,NRGRD), ODAT(40,0:NRGRD), &
FLGRD(NOGRP,NGRPP,NRGRD), OT2(0:NRGRD), FLGD(NOGRP,NRGRD), &
MDSF(-NRINP:NRGRD,JFIRST:9), IPRT(6,NRGRD), LPRT(NRGRD), &
FLGR2(NOGRP,NGRPP,NRGRD),FLG2D(NOGRP,NGRPP), FLG1D(NOGRP), &
Expand Down Expand Up @@ -5400,8 +5434,20 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
SELECT CASE (J)
CASE (1)
MDS(7,I) = NDSFND
#ifdef W3_ASCII
CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' )
CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., &
DESC='ASCII output file' )
MDS(14,I) = NDSFND ! ASCII
#endif
CASE (2)
MDS(8,I) = NDSFND
#ifdef W3_ASCII
CALL WMUGET ( MDSE, MDST, NDSFND, 'OUT' )
CALL WMUSET ( MDSE, MDST, NDSFND, .TRUE., &
DESC='ASCII output file' )
MDS(15,I) = NDSFND ! ASCII
#endif
CASE (3)
MDS(12,I) = NDSFND
CALL WMUGET ( MDSE, MDST, NDSFND, 'INP' )
Expand Down Expand Up @@ -5519,6 +5565,28 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
END IF
END IF
!
#ifdef W3_ASCII
IF ( MDS(14,I) .NE. -1 ) THEN ! Grid output (ASCII)
IF ( IAPROC .EQ. NAPFLD ) THEN
TNAME = TRIM(FNMPRE)//'out_grd.' // FILEXT(:II) // '.txt'
CALL WMUSET ( MDSE,MDST, MDS(14,I), .TRUE., NAME=TNAME )
ELSE
CALL WMUSET ( MDSE,MDST, MDS(14,I), .FALSE. )
MDS(14,I) = -1
END IF
END IF
!
IF ( MDS(15,I) .NE. -1 ) THEN ! Point output (ASCII)
IF ( IAPROC .EQ. NAPPNT ) THEN
TNAME = TRIM(FNMPRE)//'out_pnt.' // FILEXT(:II) // '.txt'
CALL WMUSET ( MDSE,MDST, MDS(15,I), .TRUE., NAME=TNAME )
ELSE
CALL WMUSET ( MDSE,MDST, MDS(15,I), .FALSE. )
MDS(15,I) = -1
END IF
END IF
#endif
!
#ifdef W3_T
WRITE (MDST,9081) I, TIME
#endif
Expand Down Expand Up @@ -6493,7 +6561,7 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, &
!
#ifdef W3_T
9020 FORMAT ( ' TEST WMINITNML : UNIT NUMBERS FOR GRIDS (',A,')'/ &
15X,'GRID MDS(1-13)',43X,'NTRACE')
15X,'GRID MDS(1-15)',43X,'NTRACE')
9021 FORMAT (14X,16I4)
9022 FORMAT ( ' TEST WMINITNML : UNIT NUMBERS FOR INTPUT FILES'/ &
15X,'GRID MDSF(JFIRST-9)')
Expand Down
4 changes: 2 additions & 2 deletions model/src/ww3_ounp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,7 @@ SUBROUTINE W3CRNC (ITYPE, OTYPE, NCTYPE, NCFILE, NCID, DIMID, DIMLN, VARID, ONE,
IRET=NF90_PUT_ATT(NCID,VARID(4),'long_name','x')
IRET=NF90_PUT_ATT(NCID,VARID(4),'standard_name','x')
IRET=NF90_PUT_ATT(NCID,VARID(4),'globwave_name','x')
IRET=NF90_PUT_ATT(NCID,VARID(4),'units','m')
IRET=NF90_PUT_ATT(NCID,VARID(4),'units','km')
IRET=NF90_PUT_ATT(NCID,VARID(4),'scale_factor',1.)
IRET=NF90_PUT_ATT(NCID,VARID(4),'add_offset',0.)
IRET=NF90_PUT_ATT(NCID,VARID(4),'valid_min',0.)
Expand All @@ -3225,7 +3225,7 @@ SUBROUTINE W3CRNC (ITYPE, OTYPE, NCTYPE, NCFILE, NCID, DIMID, DIMLN, VARID, ONE,
IRET=NF90_PUT_ATT(NCID,VARID(5),'long_name','y')
IRET=NF90_PUT_ATT(NCID,VARID(5),'standard_name','y')
IRET=NF90_PUT_ATT(NCID,VARID(5),'globwave_name','y')
IRET=NF90_PUT_ATT(NCID,VARID(5),'units','m')
IRET=NF90_PUT_ATT(NCID,VARID(5),'units','km')
IRET=NF90_PUT_ATT(NCID,VARID(5),'scale_factor',1.)
IRET=NF90_PUT_ATT(NCID,VARID(5),'add_offset',0.)
IRET=NF90_PUT_ATT(NCID,VARID(5),'valid_min',0.)
Expand Down

0 comments on commit 57ba5f8

Please sign in to comment.