From 8e151a69f5937b2d14390acbda71a94c5edc51f7 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Tue, 3 Oct 2023 12:51:47 +0000 Subject: [PATCH 1/5] implement ascii output for out_grd.ww3, out_pnt.ww3, mod_def.ww3 using CPP key ASCII --- model/src/cmake/switches.json | 10 + model/src/w3gridmd.F90 | 13 +- model/src/w3initmd.F90 | 3 + model/src/w3iogomd.F90 | 405 +++++++++++++++++++++++++++++++++- model/src/w3iogrmd.F90 | 385 +++++++++++++++++++++++++++++++- model/src/w3iopomd.F90 | 60 ++++- model/src/w3odatmd.F90 | 2 +- model/src/w3wavemd.F90 | 12 +- model/src/w3wdatmd.F90 | 8 +- model/src/wminitmd.F90 | 18 ++ model/src/wmiopomd.F90 | 9 +- model/src/wmmdatmd.F90 | 5 + 12 files changed, 913 insertions(+), 17 deletions(-) diff --git a/model/src/cmake/switches.json b/model/src/cmake/switches.json index ca01708af..160f5f0c1 100644 --- a/model/src/cmake/switches.json +++ b/model/src/cmake/switches.json @@ -813,5 +813,15 @@ "name": "B4B" } ] + }, + { + "name": "ascii", + "num_switches": "upto1", + "description": "ASCII output for binary .ww3 file", + "valid-options": [ + { + "name": "ASCII" + } + ] } ] diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 281ed7a3f..531dc4b64 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -586,6 +586,9 @@ MODULE W3GRIDMD IY2, J, JJ, IXR(4), IYR(4), ISEAI(4),& IST, NKI, NTHI, NRIC, NRIS, I, IDFT, & NSTAT, NBT, NLAND, NOSW, NMAPB, IMAPB +#ifdef W3_ASCII + INTEGER :: NDSMA +#endif #ifdef W3_NL2 INTEGER :: IDEPTH #endif @@ -1158,6 +1161,7 @@ SUBROUTINE W3GRID() NDSI = 10 NDSS = 99 NDSM = 20 + NDSM = 21 ! INQUIRE(FILE=TRIM(FNMPRE)//"ww3_grid.nml", EXIST=FLGNML) IF (FLGNML) THEN @@ -5907,9 +5911,16 @@ SUBROUTINE W3GRID() !10. Write model definition file. ! WRITE (NDSO,999) - CALL W3IOGR ( 'WRITE', NDSM ) + CALL W3IOGR ( 'WRITE', NDSM & +#ifdef W3_ASCII + ,NDSA=NDSMA & +#endif + ) ! CLOSE (NDSM) +#ifdef W3_ASCII + CLOSE (NDSMA) +#endif ! GOTO 2222 ! diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index 2d5eacc33..50f0680ad 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -239,6 +239,9 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, ! (first). ! 11: Track information file unit number. ! 12: Track output file unit number. + ! 13: Wave separation output file unit number. + ! 14: Grid output file unit number. + ! 15: Point output file unit number. ascii ! MTRACE I.A. I Array with subroutine tracing information. ! 1: Output unit number for trace. ! 2: Maximum number of trace prints. diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index a6ef03325..3a358aa19 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -2376,7 +2376,11 @@ END SUBROUTINE W3OUTG !> !> @author H. L. Tolman @date 22-Mar-2021 !> - SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) + SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & +#ifdef W3_ASCII + ,NDSOA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -2535,6 +2539,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) CHARACTER(LEN=15) :: TIMETAG +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSOA +#endif !/ !/ ------------------------------------------------------------------- / !/ Local parameters @@ -2610,7 +2617,11 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) #endif IF ( WRITE ) THEN OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & - form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) + form ='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I)//'.txt', & + form ='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -2625,6 +2636,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) WRITE (NDSOG) & IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & UNDEF, NOSWLL +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL:', & + IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, TNAME, MOGRP, MGRPP, NSEA, NX, NY, & @@ -2685,6 +2703,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOG,FILE=FNMPRE(:J)//TIMETAG//'.out_grd.' & //FILEXT(:I),form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//TIMETAG//'.out_grd.' & + //FILEXT(:I)//'.txt',form='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOG,FILE=FNMPRE(:J)//'out_grd.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -2699,6 +2721,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) WRITE (NDSOG) & IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & UNDEF, NOSWLL +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL:', & + IDSTR, VEROGR, GNAME, NOGRP, NGRPP, NSEA, NX, NY, & + UNDEF, NOSWLL +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, TNAME, MOGRP, MGRPP, NSEA, NX, NY, & @@ -2737,6 +2766,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! IF ( WRITE ) THEN WRITE (NDSOG) TIME, FLOGRD +#ifdef W3_ASCII + WRITE (NDSOA,*) 'TIME, FLOGRD:', & + TIME, FLOGRD +#endif ELSE READ (NDSOG,END=803,ERR=802,IOSTAT=IERR) TIME, FLOGRD END IF @@ -2752,6 +2785,10 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) MAPTMP = MAPSTA + 8*MAPST2 WRITE (NDSOG) & ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) +#ifdef W3_ASCII + WRITE (NDSOA,*) 'MAPSTA:', & + ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) +#endif ELSE READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) & ((MAPTMP(IY,IX),IX=1,NX),IY=1,NY) @@ -2946,9 +2983,18 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! IF ( IFI .EQ. 1 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) DW(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'DW:', DW(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) CX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CX:', CX(1:NSEA) +#endif WRITE ( NDSOG ) CY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CY:', CY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 3 ) THEN DO ISEA=1, NSEA #ifdef W3_SMC @@ -2967,15 +3013,33 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (UA*cos(UD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UA*sin(UD)):', AUX2 +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) AS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AS:', AS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) WLV(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WLV:', WLV(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) ICE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'ICE:', ICE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) BERG(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BERG:', BERG(1:NSEA) +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 8 ) THEN DO ISEA=1, NSEA #ifdef W3_SMC @@ -2994,22 +3058,43 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (TAUA*cos(TAUADIR)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (TAUA*sin(TAUADIR)):', AUX2 +#endif ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) RHOAIR(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'RHOAIR:', RHOAIR(1:NSEA) +#endif #ifdef W3_BT4 ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) SED_D50(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SED_D50:', SED_D50(1:NSEA) +#endif #endif #ifdef W3_IS2 ELSE IF (IFI .EQ. 1 .AND. IFJ .EQ. 11 ) THEN WRITE (NDSOG ) ICEH(1:NSEA) +#ifdef W3_ASCII + WRITE (NDSOA,* ) 'ICEH:', ICEH(1:NSEA) +#endif ELSE IF (IFI .EQ. 1 .AND. IFJ .EQ. 12 ) THEN WRITE (NDSOG ) ICEF(1:NSEA) +#ifdef W3_ASCII + WRITE (NDSOA,* ) 'ICEF:', ICEF(1:NSEA) +#endif #endif #ifdef W3_SETUP ELSE IF ( IFI .EQ. 1 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) ZETA_SETUP(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'ZETA_SETUP:', ZETA_SETUP(1:NSEA) +#endif #endif ! @@ -3017,102 +3102,223 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) ! ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) HS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HS:', HS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) WLM(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WLM:', WLM(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) T02(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T02:', T02(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) T0M1(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T0M1:', T0M1(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) T01(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'T01:', T01(1:NSEA) +#endif ELSE IF ( (IFI .EQ. 2 .AND. IFJ .EQ. 6) .OR. & (IFI .EQ. 2 .AND. IFJ .EQ. 18) ) THEN ! Note: TP output is derived from FP field. WRITE ( NDSOG ) FP0(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'FP0:', FP0(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) THM(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THM:', THM(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) THS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THS:', THS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) THP0(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'THP0:', THP0(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) HSIG(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HSIG:', HSIG(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) STMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STMAXE:', STMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) STMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STMAXD:', STMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) HMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HMAXE:', HMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 14 ) THEN WRITE ( NDSOG ) HCMAXE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HCMAXE:', HCMAXE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 15 ) THEN WRITE ( NDSOG ) HMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HMAXD:', HMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 16 ) THEN WRITE ( NDSOG ) HCMAXD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'HCMAXD:', HCMAXD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 17 ) THEN WRITE ( NDSOG ) WBT(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WBT:', WBT(1:NSEA) +#endif ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 19 ) THEN WRITE ( NDSOG ) WNMEAN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WNMEAN:', WNMEAN(1:NSEA) +#endif ! ! Section 3) ! ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) EF(1:NSEA,E3DF(2,1):E3DF(3,1)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'EF:', EF(1:NSEA,E3DF(2,1):E3DF(3,1)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) TH1M(1:NSEA,E3DF(2,2):E3DF(3,2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TH1M:', TH1M(1:NSEA,E3DF(2,2):E3DF(3,2)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) STH1M(1:NSEA,E3DF(2,3):E3DF(3,3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STH1M:', STH1M(1:NSEA,E3DF(2,3):E3DF(3,3)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) TH2M(1:NSEA,E3DF(2,4):E3DF(3,4)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TH2M:', TH2M(1:NSEA,E3DF(2,4):E3DF(3,4)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) STH2M(1:NSEA,E3DF(2,5):E3DF(3,5)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'STH2M:', STH2M(1:NSEA,E3DF(2,5):E3DF(3,5)) +#endif ELSE IF ( IFI .EQ. 3 .AND. IFJ .EQ. 6) THEN WRITE ( NDSOG ) WN(1:NK,1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WN:', WN(1:NK,1:NSEA) +#endif ! ! Section 4) ! ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) PHS(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHS:', PHS(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) PTP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTP:', PTP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) PLP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PLP:', PLP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PDIR(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PDIR:', PDIR(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) PSI(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PSI:', PSI(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) PWS(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PWS:', PWS(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) PTHP0(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTHP0:', PTHP0(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) PQP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PQP:', PQP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) PPE(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PPE:', PPE(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) PGW(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PGW:', PGW(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) PSW(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PSW:', PSW(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) PTM1(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PTM1:', PTM1(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) PT1(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PT1:', PT1(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 14 ) THEN WRITE ( NDSOG ) PT2(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PT2:', PT2(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 15 ) THEN WRITE ( NDSOG ) PEP(1:NSEA,0:NOSWLL) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PEP:', PEP(1:NSEA,0:NOSWLL) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 16 ) THEN WRITE ( NDSOG ) PWST(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PWST:', PWST(1:NSEA) +#endif ELSE IF ( IFI .EQ. 4 .AND. IFJ .EQ. 17 ) THEN WRITE ( NDSOG ) PNR(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PNR:', PNR(1:NSEA) +#endif ! ! Section 5) ! ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 1 ) THEN DO ISEA=1, NSEA - IX = MAPSF(ISEA,1) - IY = MAPSF(ISEA,2) - IF ( MAPSTA(IY,IX) .EQ. 1 ) THEN + IF ( UST(ISEA) .NE. UNDEF .AND. ASF(ISEA) .NE. UNDEF ) THEN AUX1(ISEA) = UST(ISEA) * ASF(ISEA) * & COS(USTDIR(ISEA)) AUX2(ISEA) = UST(ISEA) * ASF(ISEA) * & @@ -3123,68 +3329,185 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + DO ISEA=1, NSEA + WRITE ( NDSOA,* ) 'UST:', UST(ISEA) + WRITE ( NDSOA,* ) 'ASF:', ASF(ISEA) + WRITE ( NDSOA,* ) 'USTDIR:', cos(USTDIR(ISEA)) + WRITE ( NDSOA,* ) 'AUX1 (UST*ASF*cos(USTDIR)):', AUX1(ISEA) + END DO + WRITE ( NDSOA,* ) 'AUX1 (UST*ASF*cos(USTDIR)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UST*ASF*sin(USTDIR)):', AUX2 +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) CHARN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CHARN:', CHARN(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) CGE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CGE:', CGE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIAW(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIAW:', PHIAW(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TAUWIX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWIX:', TAUWIX(1:NSEA) +#endif WRITE ( NDSOG ) TAUWIY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWIY:', TAUWIY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) TAUWNX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWNX:', TAUWNX(1:NSEA) +#endif WRITE ( NDSOG ) TAUWNY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUWNY:', TAUWNY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(1):', WHITECAP(1:NSEA,1) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(2):', WHITECAP(1:NSEA,2) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,3) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(3):', WHITECAP(1:NSEA,3) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) WHITECAP(1:NSEA,4) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'WHITECAP(4):', WHITECAP(1:NSEA,4) +#endif ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) TWS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TWS:', TWS(1:NSEA) +#endif ! ! Section 6) ! ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) SXX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SXX:', SXX(1:NSEA) +#endif WRITE ( NDSOG ) SYY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SYY:', SYY(1:NSEA) +#endif WRITE ( NDSOG ) SXY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'SXY:', SXY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) TAUOX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOX:', TAUOX(1:NSEA) +#endif WRITE ( NDSOG ) TAUOY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOY:', TAUOY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) BHD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BHD:', BHD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIOC(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIOC:', PHIOC(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TUSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TUSX:', TUSX(1:NSEA) +#endif WRITE ( NDSOG ) TUSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TUSY:', TUSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) USSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSX:', USSX(1:NSEA) +#endif WRITE ( NDSOG ) USSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSY:', USSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 7 ) THEN WRITE ( NDSOG ) PRMS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PRMS:', PRMS(1:NSEA) +#endif WRITE ( NDSOG ) TPMS(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TPMS:', TPMS(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 8 ) THEN WRITE ( NDSOG ) US3D(1:NSEA, US3DF(2):US3DF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'US3D:', US3D(1:NSEA, US3DF(2):US3DF(3)) +#endif WRITE ( NDSOG ) US3D(1:NSEA,NK+US3DF(2):NK+US3DF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'US3D+NK:', US3D(1:NSEA,NK+US3DF(2):NK+US3DF(3)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 9 ) THEN WRITE ( NDSOG ) P2SMS(1:NSEA,P2MSF(2):P2MSF(3)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'P2SMS:', P2SMS(1:NSEA,P2MSF(2):P2MSF(3)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 10 ) THEN WRITE ( NDSOG ) TAUICE(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUICE(1):', TAUICE(1:NSEA,1) +#endif WRITE ( NDSOG ) TAUICE(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUICE(2):', TAUICE(1:NSEA,2) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 11 ) THEN WRITE ( NDSOG ) PHICE(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHICE:', PHICE(1:NSEA) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 12 ) THEN WRITE ( NDSOG ) USSP(1:NSEA, 1:USSPF(2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSP:', USSP(1:NSEA, 1:USSPF(2)) +#endif WRITE ( NDSOG ) USSP(1:NSEA,NK+1:NK+USSPF(2)) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USSP:', USSP(1:NSEA,NK+1:NK+USSPF(2)) +#endif ELSE IF ( IFI .EQ. 6 .AND. IFJ .EQ. 13 ) THEN WRITE ( NDSOG ) TAUOCX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOCX:', TAUOCX(1:NSEA) +#endif WRITE ( NDSOG ) TAUOCY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUOCY:', TAUOCY(1:NSEA) +#endif ! ! Section 7) ! @@ -3199,7 +3522,13 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (ABA*cos(ABD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (ABA*sin(ABD)):', AUX2 +#endif !WRITE ( NDSOG ) ABA(1:NSEA) !WRITE ( NDSOG ) ABD(1:NSEA) ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 2 ) THEN @@ -3213,53 +3542,119 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD ) END IF END DO WRITE ( NDSOG ) AUX1 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX1 (UBA*cos(UBD)):', AUX1 +#endif WRITE ( NDSOG ) AUX2 +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'AUX2 (UBA*sin(UBD)):', AUX2 +#endif ! WRITE ( NDSOG ) UBA(1:NSEA) ! WRITE ( NDSOG ) UBD(1:NSEA) ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) BEDFORMS(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(1):', BEDFORMS(1:NSEA,1) +#endif WRITE ( NDSOG ) BEDFORMS(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(2):', BEDFORMS(1:NSEA,2) +#endif WRITE ( NDSOG ) BEDFORMS(1:NSEA,3) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'BEDFORMS(3):', BEDFORMS(1:NSEA,3) +#endif ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) PHIBBL(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'PHIBBL:', PHIBBL(1:NSEA) +#endif ELSE IF ( IFI .EQ. 7 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) TAUBBL(1:NSEA,1) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUBBL(1):', TAUBBL(1:NSEA,1) +#endif WRITE ( NDSOG ) TAUBBL(1:NSEA,2) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'TAUBBL(2):', TAUBBL(1:NSEA,2) +#endif ! ! Section 8) ! ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) MSSX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSX:', MSSX(1:NSEA) +#endif WRITE ( NDSOG ) MSSY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSY:', MSSY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) MSCX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCX:', MSCX(1:NSEA) +#endif WRITE ( NDSOG ) MSCY(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCY:', MSCY(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) MSSD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSSD:', MSSD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) MSCD(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'MSCD:', MSCD(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) QP(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'QP:', QP(1:NSEA) +#endif ELSE IF ( IFI .EQ. 8 .AND. IFJ .EQ. 6 ) THEN WRITE ( NDSOG ) QKK(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'QKK:', QKK(1:NSEA) +#endif ! ! Section 9) ! ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 1 ) THEN WRITE ( NDSOG ) DTDYN(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'DTDYN:', DTDYN(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 2 ) THEN WRITE ( NDSOG ) FCUT(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'FCUT:', FCUT(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 3 ) THEN WRITE ( NDSOG ) CFLXYMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLXYMAX:', CFLXYMAX(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 4 ) THEN WRITE ( NDSOG ) CFLTHMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLTHMAX:', CFLTHMAX(1:NSEA) +#endif ELSE IF ( IFI .EQ. 9 .AND. IFJ .EQ. 5 ) THEN WRITE ( NDSOG ) CFLKMAX(1:NSEA) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'CFLMAX:', CFLKMAX(1:NSEA) +#endif ! ! Section 10) ! ELSE IF ( IFI .EQ. 10 ) THEN WRITE ( NDSOG ) USERO(1:NSEA,IFJ) +#ifdef W3_ASCII + WRITE ( NDSOA,* ) 'USER0:', USERO(1:NSEA,IFJ) +#endif ! END IF ! diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index 3aa2688ab..8834f77e4 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -112,7 +112,11 @@ MODULE W3IOGRMD !> @author F. Ardhuin !> @date 19-Oct-2020 - SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) + SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & +#ifdef W3_ASCII + ,NDSA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -209,6 +213,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) ! INXOUT C*(*) I Test string for read/write, valid are: ! 'READ', 'WRITE' and 'GRID'. ! NDSM Int. I File unit number. + ! NDSA Int. I File unit number. ascii ! IMOD Int. I Model number for W3GDAT etc. ! FEXT C*(*) I File extension to be used. ! ---------------------------------------------------------------- @@ -317,6 +322,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) CHARACTER, INTENT(IN), OPTIONAL :: FEXT*(*) +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSA +#endif !/ !/ ------------------------------------------------------------------- / !/ Local parameters @@ -563,6 +571,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN OPEN (NDSM,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSA,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT)//'.txt', & + form='FORMATTED',ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSM,FILE=FNMPRE(:IPRE)//'mod_def.'//FILEXT(:IEXT), & form='UNFORMATTED', convert=file_endian,STATUS='OLD',ERR=800,IOSTAT=IERR) @@ -578,14 +590,38 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & FNAMEF, FNAMEI +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & + NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & + FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & + FNAMEF, FNAMEI:', & + IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & + NBI, NFBPO, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & + FNAME4, FNAME5, FNAME6, FNAMEP, FNAMEG, & + FNAMEF, FNAMEI +#endif ! #ifdef W3_SMC WRITE (NDSM) NCel, NUFc, NVFc, NRLv, MRFct +#ifdef W3_ASCII + WRITE (NDSA,*) 'NCel, NUFc, NVFc, NRLv, MRFct:', & + NCel, NUFc, NVFc, NRLv, MRFct +#endif WRITE (NDSM) NGLO, NARC, NBGL, NBAC, NBSMC +#ifdef W3_ASCII + WRITE (NDSM) 'NGLO, NARC, NBGL, NBAC, NBSMC:', & + NGLO, NARC, NBGL, NBAC, NBSMC +#endif #endif ! WRITE (NDSM) & (NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO) +#ifdef W3_ASCII + WRITE (NDSA,*) & + '(NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO):', & + (NBO(I),I=0,NFBPO), (NBO2(I),I=0,NFBPO) +#endif #ifdef W3_T WRITE (NDST,9001) IDSTR, VERGRD, NX, NY, NSEA, NTH, NK, & NBI, NFBPO, 9, GNAME, FNAME0, FNAME1, FNAME2, FNAME3, & @@ -717,6 +753,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) MAPTMP = MAPSTA + 8*MAPST2 WRITE (NDSM) & GTYPE, FLAGLL, ICLOSE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'GTYPE, FLAGLL, ICLOSE:', & + GTYPE, FLAGLL, ICLOSE +#endif ! ! Writes different kind of information depending on grid type ! @@ -725,9 +766,19 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) CASE ( RLGTYPE, SMCTYPE ) WRITE (NDSM) & SX, SY, X0, Y0 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SX, SY, X0, Y0:', & + SX, SY, X0, Y0 +#endif CASE ( CLGTYPE ) WRITE (NDSM) & REAL(XGRD), REAL(YGRD) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'REAL(XGRD), REAL(YGRD):', & + REAL(XGRD), REAL(YGRD) +#endif CASE (UNGTYPE) WRITE (NDSM) & FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & @@ -746,6 +797,41 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) B_JGS_NORM_THR, & B_JGS_NLEVEL, & B_JGS_SOURCE_NONLINEAR +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & + FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & + DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & + NTRI,COUNTOT, COUNTRI, NNZ, & + B_JGS_TERMINATE_MAXITER, & + B_JGS_TERMINATE_DIFFERENCE, & + B_JGS_TERMINATE_NORM, & + B_JGS_LIMITER, & + B_JGS_BLOCK_GAUSS_SEIDEL, & + B_JGS_USE_JACOBI, & + B_JGS_MAXITER, & + B_JGS_PMIN, & + B_JGS_DIFF_THR, & + B_JGS_NORM_THR, & + B_JGS_NLEVEL, & + B_JGS_SOURCE_NONLINEAR:', & + FSN, FSPSI,FSFCT,FSNIMP,FSTOTALIMP,FSTOTALEXP, & + FSBCCFL, FSREFRACTION, FSFREQSHIFT, FSSOURCE, & + DO_CHANGE_WLV, SOLVERTHR_STP, CRIT_DEP_STP, & + NTRI,COUNTOT, COUNTRI, NNZ, & + B_JGS_TERMINATE_MAXITER, & + B_JGS_TERMINATE_DIFFERENCE, & + B_JGS_TERMINATE_NORM, & + B_JGS_LIMITER, & + B_JGS_BLOCK_GAUSS_SEIDEL, & + B_JGS_USE_JACOBI, & + B_JGS_MAXITER, & + B_JGS_PMIN, & + B_JGS_DIFF_THR, & + B_JGS_NORM_THR, & + B_JGS_NLEVEL, & + B_JGS_SOURCE_NONLINEAR +#endif !Init COUNTCON and IOBDP to zero, it needs to be set somewhere or !removed COUNTCON=0 @@ -755,10 +841,26 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'X0, Y0, SX, SY, DXYMAX, XGRD, YGRD, TRIGP, TRIA, & + LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & + DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & + POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI:', & + X0, Y0, SX, SY, DXYMAX, XGRD, YGRD, TRIGP, TRIA, & + LEN, IEN, ANGLE0, ANGLE, SI, MAXX, MAXY, & + DXYMAX, INDEX_CELL, CCON, COUNTCON, IE_CELL, & + POS_CELL, IOBP, IOBPA, IOBDP, IOBPD, IAA, JAA, POSI +#endif END SELECT !GTYPE ! WRITE (NDSM) & ZB, MAPTMP, MAPFS, MAPSF, TRFLAG +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZB, MAPTMP, MAPFS, MAPSF, TRFLAG:', & + ZB, MAPTMP, MAPFS, MAPSF, TRFLAG +#endif ! #ifdef W3_SMC IF( GTYPE .EQ. SMCTYPE ) THEN @@ -767,6 +869,18 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) ICLBAC WRITE (NDSM) ANGARC WRITE (NDSM) CTRNX, CTRNY, CLATF +#ifdef W3_ASCII + WRITE (NDSA,*) 'NLvCel, NLvUFc, NLvVFc:', & + NLvCel, NLvUFc, NLvVFc + WRITE (NDSA,*) 'IJKCel, IJKUFc, IJKVFc, ISMCBP:', & + IJKCel, IJKUFc, IJKVFc, ISMCBP + WRITE (NDSA,*) 'ICLBAC:', & + ICLBAC + WRITE (NDSA,*) 'ANGARC:', & + ANGARC + WRITE (NDSA,*) 'CTRNX, CTRNY, CLATF:', & + CTRNX, CTRNY, CLATF +#endif IF ( FLTEST ) THEN WRITE (NDSE,"(' NRLv, MRFct and NBSMC values are',3I9)") NRLv, MRFct, NBSMC WRITE (NDSE,"(' IJKCel, IJKUFc, IJKVFc Write for',3I9)") NCel, NUFc, NVFc @@ -776,6 +890,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #endif ! IF ( TRFLAG .NE. 0 ) WRITE (NDSM) TRNX, TRNY +#ifdef W3_ASCII + IF ( TRFLAG .NE. 0 ) WRITE (NDSA,*) 'TRNX, TRNY:', TRNX, TRNY +#endif WRITE (NDSM) & DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & @@ -784,14 +901,43 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& IICEDDISP, IICEFDISP, BTBETA, & AAIRCMIN, AAIRGB +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & + FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & + FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, CTHG0S, & + STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, IICEDISP, & + ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& + IICEDDISP, IICEFDISP, BTBETA, & + AAIRCMIN, AAIRGB:', & + DTCFL, DTCFLI, DTMAX, DTMIN, DMIN, CTMAX, & + FICE0, FICEN, FICEL, PFMOVE, FLDRY, FLCX, FLCY, FLCTH, & + FLCK, FLSOU, FLBPI, FLBPO, CLATS, CLATIS, CTHG0S, & + STEXU, STEYU, STEDU, IICEHMIN, IICEHINIT, IICEDISP, & + ICESCALES(1:4), CALTYPE, CMPRTRCK, IICEHFAC, IICEHDISP,& + IICEDDISP, IICEFDISP, BTBETA, & + AAIRCMIN, AAIRGB +#endif WRITE(NDSM)GRIDSHIFT +#ifdef W3_ASCII + WRITE(NDSA,*)'GRIDSHIFT:', & + GRIDSHIFT +#endif #ifdef W3_SEC1 WRITE (NDSM) NITERSEC1 +#ifdef W3_ASCII + WRITE (NDSA,*) 'NITERSEC1:', & + NITERSEC1 +#endif #endif #ifdef W3_RTD !! Add rotated Polat/lon and AnglD to mod_def JGLi12Jun2012 WRITE (NDSM) PoLat, PoLon, AnglD, FLAGUNR +#ifdef W3_ASCII + WRITE (NDSA,*) 'PoLat, PoLon, AnglD, FLAGUNR:', & + PoLat, PoLon, AnglD, FLAGUNR +#endif #endif !! WRITE(NDSM) & @@ -977,6 +1123,15 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & + XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & + FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE:', & + MAPWN, MAPTH, DTH, TH, ESIN, ECOS, ES2, ESC, EC2, & + XFR, FR1, SIG, SIG2, DSIP, DSII, DDEN, DDEN2, FTE, & + FTF, FTWN, FTTR, FTWL, FACTI1, FACTI2, FACHFA, FACHFE +#endif ELSE IF (.NOT.SINIT) CALL W3DIMS ( IGRD, NK, NTH, NDSE, NDST ) READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & @@ -999,6 +1154,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & E3DF, P2MSF, US3DF,USSPF, USSP_WN +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'E3DF, P2MSF, US3DF,USSPF, USSP_WN:', & + E3DF, P2MSF, US3DF,USSPF, USSP_WN +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & E3DF, P2MSF, US3DF,USSPF, USSP_WN @@ -1015,6 +1175,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & XBPO, YBPO, RDBPO, IPBPO, ISBPO +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'XBPO, YBPO, RDBPO, IPBPO, ISBPO:', & + XBPO, YBPO, RDBPO, IPBPO, ISBPO +#endif ELSE CALL W3DMO5 ( IGRD, NDSE, NDST, 2 ) READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & @@ -1040,6 +1205,13 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & PTMETH, PTFCUT +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & + PTMETH, PTFCUT:', & + IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & + PTMETH, PTFCUT +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IHMAX, HSPMIN, WSMULT, WSCUT, FLCOMB, NOSWLL, & @@ -1057,37 +1229,84 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) & FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & FFACBERG, DELAB, FWTABLE +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & + FFACBERG, DELAB, FWTABLE:', & + FACP, XREL, XFLT, FXFM, FXPM, XFT, XFC, FACSD, FHMAX, & + FFACBERG, DELAB, FWTABLE +#endif #ifdef W3_RWND WRITE (NDSM) & RWINDC +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'RWINDC:', & + RWINDC +#endif #endif #ifdef W3_WCOR WRITE (NDSM) & WWCOR +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'WWCOR:', & + WWCOR +#endif #endif #ifdef W3_REF1 WRITE (NDSM) & RREF, REFPARS, REFLC, REFLD +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'RREF, REFPARS, REFLC, REFLD:', & + RREF, REFPARS, REFLC, REFLD +#endif #endif #ifdef W3_IG1 WRITE (NDSM) & IGPARS(1:12) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IGPARS(1:12):', & + IGPARS(1:12) +#endif #endif #ifdef W3_IC2 WRITE (NDSM) & IC2PARS(1:8) +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC2PARS(1:8):', & + IC2PARS(1:8) +#endif #endif #ifdef W3_IC3 WRITE (NDSM) & IC3PARS +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC3PARS:', & + IC3PARS +#endif #endif #ifdef W3_IC4 WRITE (NDSM) & IC4PARS,IC4_KI,IC4_FC +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC4PARS,IC4_KI,IC4_FC:', & + IC4PARS,IC4_KI,IC4_FC +#endif #endif #ifdef W3_IC5 WRITE (NDSM) & IC5PARS +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'IC5PARS:', & + IC5PARS +#endif #endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & @@ -1142,6 +1361,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLX2 IF ( WRITE ) THEN WRITE (NDSM) NITTIN, CINXSI +#ifdef W3_ASCII + WRITE (NDSA,*)' NITTIN, CINXSI:', & + NITTIN, CINXSI +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) NITTIN, CINXSI END IF @@ -1152,6 +1375,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & NITTIN, CINXSI, CD_MAX, CAP_ID +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'NITTIN, CINXSI, CD_MAX, CAP_ID:', & + NITTIN, CINXSI, CD_MAX, CAP_ID +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & NITTIN, CINXSI, CD_MAX, CAP_ID @@ -1162,6 +1390,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLX4 IF ( WRITE ) THEN WRITE (NDSM) FLX4A0 +#ifdef W3_ASCII + WRITE (NDSA,*)' FLX4A0:', & + FLX4A0 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) FLX4A0 END IF @@ -1171,6 +1403,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_LN1 IF ( WRITE ) THEN WRITE (NDSM) SLNC1, FSPM, FSHF +#ifdef W3_ASCII + WRITE (NDSA,*)' SLNC1, FSPM, FSHF:', & + SLNC1, FSPM, FSHF +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SLNC1, FSPM, FSHF END IF @@ -1180,6 +1416,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_ST1 IF ( WRITE ) THEN WRITE (NDSM) SINC1, SDSC1 +#ifdef W3_ASCII + WRITE (NDSA,*)' SINC1, SDSC1:', & + SINC1, SDSC1 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SINC1, SDSC1 END IF @@ -1193,6 +1433,17 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & CDSA0, CDSA1, CDSA2, SDSALN, & CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZWIND, FSWELL, & + SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & + CDSA0, CDSA1, CDSA2, SDSALN, & + CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2:',& + ZWIND, FSWELL, & + SHSTAB, OFSTAB, CCNG, CCPS, FFNG, FFPS, & + CDSA0, CDSA1, CDSA2, SDSALN, & + CDSB0, CDSB1, CDSB2, CDSB3, FPIMIN, XFH, XF1, XF2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZWIND, FSWELL, & @@ -1216,6 +1467,19 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) SSTXFTFTAIL, SSTXFTWN, & DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & FFXPM, FFXFM +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + SSWELLF, SSDSC1, WWNMEANP, WWNMEANPTAIL, SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, & + DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & + FFXPM, FFXFM:', & + ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + SSWELLF, SSDSC1, WWNMEANP, WWNMEANPTAIL, SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, & + DDELTA1, DDELTA2, SSTXFTF, SSTXFTWN, & + FFXPM, FFXFM +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & @@ -1246,6 +1510,33 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) DELU, DELALP, TAUT, TAUHFT, TAUHFT2, & IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & DIKCUMUL, CUMULW +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & + ZZ0RAT, SSDSC, & + SSDSISO, SSDSBR, SSDSBT, SSDSBM, SSDSP, & + SSDSCOS, SSDSDTH, WWNMEANP, WWNMEANPTAIL,SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & + SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & + SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & + SSDSHCK, DELUST, DELTAIL, DELTAUW, & + DELU, DELALP, TAUT, TAUHFT, TAUHFT2, & + IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & + DIKCUMUL, CUMULW:', & + ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & + TTAUWSHELTER, SSWELLFPAR, SSWELLF, SSINBR, & + ZZ0RAT, SSDSC, & + SSDSISO, SSDSBR, SSDSBT, SSDSBM, SSDSP, & + SSDSCOS, SSDSDTH, WWNMEANP, WWNMEANPTAIL,SSTXFTF, & + SSTXFTFTAIL, SSTXFTWN, SSTXFTF, SSTXFTWN, & + SSDSBRF1, SSDSBRF2, SSDSBRFDF,SSDSBCK, SSDSABK, & + SSDSPBK, SSDSBINT, FFXPM, FFXFM, FFXFA, & + SSDSHCK, DELUST, DELTAIL, DELTAUW, & + DELU, DELALP, TAUT, TAUHFT, TAUHFT2, & + IKTAB, DCKI, QBI, SATINDICES, SATWEIGHTS, & + DIKCUMUL, CUMULW +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ZZWND, AALPHA, ZZ0MAX, BBETA, SSINTHP, ZZALP, & @@ -1268,6 +1559,14 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) SIN6A0, SDS6ET, SDS6A1, SDS6A2, & SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & SIN6WS, SIN6FC +#ifdef W3_ASCII + WRITE (NDSA,*) 'SIN6A0, SDS6ET, SDS6A1, SDS6A2, & + SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & + SIN6WS, SIN6FC:', & + SIN6A0, SDS6ET, SDS6A1, SDS6A2, & + SDS6P1, SDS6P2, SWL6S6, SWL6B1, SWL6CSTB1, & + SIN6WS, SIN6FC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SIN6A0, SDS6ET, SDS6A1, SDS6A2, & @@ -1282,6 +1581,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3:',& + SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SNLC1, LAM, KDCON, KDMN, SNLS1, SNLS2, SNLS3 @@ -1294,6 +1598,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) IQTPE, NLTAIL, NDPTHS WRITE (NDSM) DPTHNL +#ifdef W3_ASCII + WRITE (NDSA,*) 'IQTPE, NLTAIL, NDPTHS:', & + IQTPE, NLTAIL, NDPTHS + WRITE (NDSA,*) 'DPTHNL:', & + DPTHNL +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & IQTPE, NLTAIL, NDPTHS @@ -1312,6 +1622,16 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) WRITE (NDSM) SNLL(1:SNLNQ), SNLM(1:SNLNQ), & SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & SNLCS(1:SNLNQ) +#ifdef W3_ASCII + WRITE (NDSA,*) 'SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS:',& + SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS + WRITE (NDSA,*) 'SNLL(1:SNLNQ), SNLM(1:SNLNQ), & + SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & + SNLCS(1:SNLNQ):', & + SNLL(1:SNLNQ), SNLM(1:SNLNQ), & + SNLT(1:SNLNQ), SNLCD(1:SNLNQ), & + SNLCS(1:SNLNQ) +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SNLNQ, SNLMSC, SNLNSC, SNLSFD, SNLSFS @@ -1342,6 +1662,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_NL4 IF ( WRITE ) THEN WRITE (NDSM) ITSA, IALT +#ifdef W3_ASCII + WRITE (NDSA,*) 'ITSA, IALT:', & + ITSA, IALT +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & ITSA, IALT @@ -1355,6 +1679,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) CALL INSNL5 WRITE (NDSM) QR5DPT, QR5OML, QI5DIS, QI5KEV, & QI5NNZ, QI5IPL, QI5PMX +#ifdef W3_ASCII + WRITE (NDSA,*) 'QR5DPT, QR5OML, QI5DIS, QI5KEV, & + QI5NNZ, QI5IPL, QI5PMX:', & + QR5DPT, QR5OML, QI5DIS, QI5KEV, & + QI5NNZ, QI5IPL, QI5PMX +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & QR5DPT, QR5OML, QI5DIS, QI5KEV, & @@ -1369,6 +1699,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3:', & + CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & CNLSA, CNLSC, CNLSFM, CNLSC1, CNLSC2, CNLSC3 @@ -1412,6 +1747,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_BT1 IF ( WRITE ) THEN WRITE (NDSM) SBTC1 +#ifdef W3_ASCII + WRITE (NDSA,*) 'SBTC1:', SBTC1 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) SBTC1 END IF @@ -1423,6 +1761,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & SBTCX, SED_D50, SED_PSIC +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SBTCX, SED_D50, SED_PSIC:', & + SBTCX, SED_D50, SED_PSIC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SBTCX, SED_D50, SED_PSIC @@ -1436,6 +1779,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) & SDBC1, SDBC2, FDONLY +#ifdef W3_ASCII + WRITE (NDSA,*) & + 'SDBC1, SDBC2, FDONLY:', & + SDBC1, SDBC2, FDONLY +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & SDBC1, SDBC2, FDONLY @@ -1448,6 +1796,12 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) IF ( WRITE ) THEN WRITE (NDSM) UOSTFILELOCAL, UOSTFILESHADOW, & UOSTFACTORLOCAL, UOSTFACTORSHADOW +#ifdef W3_ASCII + WRITE (NDSA,*) 'UOSTFILELOCAL, UOSTFILESHADOW, & + UOSTFACTORLOCAL, UOSTFACTORSHADOW:', & + UOSTFILELOCAL, UOSTFILESHADOW, & + UOSTFACTORLOCAL, UOSTFACTORSHADOW +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & UOSTFILELOCAL, UOSTFILESHADOW, & @@ -1464,6 +1818,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_IS1 IF ( WRITE ) THEN WRITE (NDSM) IS1C1, IS1C2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'IS1C1, IS1C2:', IS1C1, IS1C2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) IS1C1, IS1C2 END IF @@ -1472,6 +1829,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_IS2 IF ( WRITE ) THEN WRITE (NDSM) IS2PARS +#ifdef W3_ASCII + WRITE (NDSA,*) 'IS3PARS:', IS2PARS +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) IS2PARS IF ( .NOT. FLIS ) THEN @@ -1487,6 +1847,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_PR2 IF ( WRITE ) THEN WRITE (NDSM) DTME, CLATMN +#ifdef W3_ASCII + WRITE (NDSA,*) 'DTME, CLATMN:', DTME, CLATMN +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & DTME, CLATMN @@ -1498,6 +1861,9 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_PR3 IF ( WRITE ) THEN WRITE (NDSM) WDCG, WDTH +#ifdef W3_ASCII + WRITE (NDSA,*) 'WDCG, WDTH:', WDCG, WDTH +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & WDCG, WDTH @@ -1509,6 +1875,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_SMC IF ( WRITE ) THEN WRITE(NDSM) DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC +#ifdef W3_ASCII + WRITE(NDSA,*) 'DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC:', & + DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & DTMS, Refran, FUNO3, FVERG, FSWND, ARCTC @@ -1520,6 +1890,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLD1 IF ( WRITE ) THEN WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', & + TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 @@ -1528,6 +1902,10 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) #ifdef W3_FLD2 IF ( WRITE ) THEN WRITE (NDSM) TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#ifdef W3_ASCII + WRITE (NDSA,*) 'TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2:', & + TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 +#endif ELSE READ (NDSM,END=801,ERR=802,IOSTAT=IERR) & TAIL_ID, TAIL_LEV, TAIL_TRAN1, TAIL_TRAN2 @@ -1546,6 +1924,11 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT ) END IF ! CLOSE ( NDSM ) +#ifdef W3_ASCII + IF ( WRITE ) THEN + CLOSE ( NDSA ) + END IF +#endif call print_memcheck(memunit, 'memcheck_____:'//' WIOGR SECTION 9') ! RETURN diff --git a/model/src/w3iopomd.F90 b/model/src/w3iopomd.F90 index 802685869..d573879ce 100644 --- a/model/src/w3iopomd.F90 +++ b/model/src/w3iopomd.F90 @@ -1034,7 +1034,11 @@ END SUBROUTINE W3IOPE !> !> @author H. L. Tolman @date 25-Jul-2006 !> - SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) + SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD & +#ifdef W3_ASCII + ,NDSOA & +#endif + ) !/ !/ +-----------------------------------+ !/ | WAVEWATCH III NOAA/NCEP | @@ -1062,7 +1066,8 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) ! ---------------------------------------------------------------- ! INXOUT C*(*) I Test string for read/write, valid are: ! 'READ' and 'WRITE'. - ! NDSOP Int. I File unit number. + ! NDSOP Int. I File unit number. for binary + ! NDSOA Int. I File unit number. for ASCII ! IOTST Int. O Test indictor for reading. ! 0 : Data read. ! -1 : Past end of file. @@ -1140,6 +1145,9 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) !/ Parameter list !/ INTEGER, INTENT(IN) :: NDSOP +#ifdef W3_ASCII + INTEGER, INTENT(IN), OPTIONAL :: NDSOA +#endif INTEGER, INTENT(OUT) :: IOTST INTEGER, INTENT(IN), OPTIONAL :: IMOD CHARACTER, INTENT(IN) :: INXOUT*(*) @@ -1205,6 +1213,10 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOP,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I)//'.txt', & + form='FORMATTED', ERR=800,IOSTAT=IERR) +#endif ELSE OPEN (NDSOP,FILE=FNMPRE(:J)//'out_pnt.'//FILEXT(:I), & form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR,STATUS='OLD') @@ -1218,6 +1230,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & IDSTR, VEROPT, NK, NTH, NOPTS +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROPT, NK, NTH, NOPTS:', & + IDSTR, VEROPT, NK, NTH, NOPTS +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, MK, MTH, NOPTS @@ -1248,6 +1265,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + '((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS):', & + ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) @@ -1289,6 +1311,10 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN OPEN (NDSOP,FILE=FNMPRE(:J)//TIMETAG//'.out_pnt.' & //FILEXT(:I),form='UNFORMATTED', convert=file_endian,ERR=800,IOSTAT=IERR) +#ifdef W3_ASCII + OPEN (NDSOA,FILE=FNMPRE(:J)//TIMETAG//'.out_pnt.' & + //FILEXT(:I)//'.txt',form='FORMATTED', ERR=800,IOSTAT=IERR) +#endif END IF ! REWIND ( NDSOP ) @@ -1300,6 +1326,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & IDSTR, VEROPT, NK, NTH, NOPTS +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IDSTR, VEROPT, NK, NTH, NOPTS:', & + IDSTR, VEROPT, NK, NTH, NOPTS +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IDTST, VERTST, MK, MTH, NOPTS @@ -1330,6 +1361,11 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) IF ( WRITE ) THEN WRITE (NDSOP) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + '((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS):', & + ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & ((PTLOC(J,I),J=1,2),I=1,NOPTS), (PTNME(I),I=1,NOPTS) @@ -1349,6 +1385,9 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) ! IF ( WRITE ) THEN WRITE (NDSOP) TIME +#ifdef W3_ASCII + WRITE (NDSOA,*) 'TIME:', TIME +#endif ELSE READ (NDSOP,END=803,ERR=802,IOSTAT=IERR) TIME END IF @@ -1378,6 +1417,23 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD ) #endif ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), & ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC) +#ifdef W3_ASCII + WRITE (NDSOA,*) & + 'IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I):', & + IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I), & +#ifdef W3_FLX5 + 'TAUAO(I), TAUDO(I), DAIRO(I):', & + TAUAO(I), TAUDO(I), DAIRO(I), & +#endif +#ifdef W3_SETUP + 'ZET_SETO(I):', & + ZET_SETO(I), & +#endif + 'ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I):', & + ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), & + 'ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC):', & + ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC) +#endif ELSE READ (NDSOP,END=801,ERR=802,IOSTAT=IERR) & IW(I), II(I), IL(I), DPO(I), WAO(I), WDO(I), & diff --git a/model/src/w3odatmd.F90 b/model/src/w3odatmd.F90 index 4fc29eab9..d268793fb 100644 --- a/model/src/w3odatmd.F90 +++ b/model/src/w3odatmd.F90 @@ -436,7 +436,7 @@ MODULE W3ODATMD INTEGER :: TOSNL5(2) #endif INTEGER :: TOFRST(2), TONEXT(2,8), TOLAST(2,8), & - TBPI0(2), TBPIN(2), NDS(13), OFILES(7) + TBPI0(2), TBPIN(2), NDS(15), OFILES(7) REAL :: DTOUT(8) LOGICAL :: FLOUT(8) TYPE(OTYPE1) :: OUT1 diff --git a/model/src/w3wavemd.F90 b/model/src/w3wavemd.F90 index 6cbc7e74f..44c80964d 100644 --- a/model/src/w3wavemd.F90 +++ b/model/src/w3wavemd.F90 @@ -2567,7 +2567,11 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & #ifdef W3_SBS IF ( J .EQ. 1 ) THEN #endif - CALL W3IOGO( 'WRITE', NDS(7), ITEST, IMOD ) + CALL W3IOGO( 'WRITE', NDS(7), ITEST, IMOD & +#ifdef W3_ASCII + ,NDS(14) & +#endif + ) #ifdef W3_SBS ENDIF #endif @@ -2598,7 +2602,11 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT & ! Gets the necessary spectral data ! CALL W3IOPE ( VA ) - CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD ) + CALL W3IOPO ( 'WRITE', NDS(8), ITEST, IMOD & +#ifdef W3_ASCII + ,NDS(15) & +#endif + ) END IF ! ELSE IF ( J .EQ. 3 ) THEN diff --git a/model/src/w3wdatmd.F90 b/model/src/w3wdatmd.F90 index 848f3858f..bb6e823a6 100644 --- a/model/src/w3wdatmd.F90 +++ b/model/src/w3wdatmd.F90 @@ -413,7 +413,7 @@ SUBROUTINE W3DIMW ( IMOD, NDSE, NDST, F_ONLY ) ! !/ ------------------------------------------------------------------- / USE W3GDATMD, ONLY: NGRIDS, IGRID, W3SETG, NSPEC, NSEA, NSEAL, GRIDS - USE W3ODATMD, ONLY: NAPROC, IAPROC + USE W3ODATMD, ONLY: NAPROC, IAPROC, UNDEF USE W3SERVMD, ONLY: EXTCDE USE CONSTANTS, ONLY : LPDLIB, DAIR USE W3PARALL, ONLY: SET_UP_NSEAL_NSEALM, LSLOC @@ -588,9 +588,9 @@ SUBROUTINE W3DIMW ( IMOD, NDSE, NDST, F_ONLY ) WDATAS(IMOD)%ICEH (0:NSEA) = GRIDS(IMOD)%IICEHINIT WDATAS(IMOD)%ICEF (0:NSEA) = 1000. WDATAS(IMOD)%ICEDMAX(:) = 1000. - WDATAS(IMOD)%UST (0:NSEATM) = 1.E-5 - WDATAS(IMOD)%USTDIR(0:NSEATM) = 0. - WDATAS(IMOD)%ASF (:) = 0. + WDATAS(IMOD)%UST (0:NSEATM) = UNDEF + WDATAS(IMOD)%USTDIR(0:NSEATM) = UNDEF + WDATAS(IMOD)%ASF (:) = UNDEF WDATAS(IMOD)%FPIS (:) = 0. WDATAS(IMOD)%DINIT = .TRUE. CALL W3SETW ( IMOD, NDSE, NDST ) diff --git a/model/src/wminitmd.F90 b/model/src/wminitmd.F90 index ac9d0036f..daea42c5c 100644 --- a/model/src/wminitmd.F90 +++ b/model/src/wminitmd.F90 @@ -426,6 +426,9 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & #endif #ifdef W3_MPRF USE WMMDATMD, ONLY: MDSP +#endif +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA #endif USE W3INITMD, ONLY: WWVER USE W3ODATMD, ONLY: OFILES @@ -1897,6 +1900,12 @@ SUBROUTINE WMINIT ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & CALL WMUSET ( MDSS, MDST, MDSUP, .TRUE., 'OUT', & TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II), & 'Unified point output') +#ifdef W3_ASCII + CALL WMUGET ( MDSS, MDST, MDSUPA, 'OUA' ) + CALL WMUSET ( MDSS, MDST, MDSUPA, .TRUE., 'OUA', & + TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II)//'.txt', & + 'Unified point output ascii') +#endif END IF END IF ! @@ -3750,6 +3759,9 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & #endif #ifdef W3_MPRF USE WMMDATMD, ONLY: MDSP +#endif +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA #endif USE W3INITMD, ONLY: WWVER USE W3NMLMULTIMD @@ -4977,6 +4989,12 @@ SUBROUTINE WMINITNML ( IDSI, IDSO, IDSS, IDST, IDSE, IFNAME, & CALL WMUSET ( MDSS, MDST, MDSUP, .TRUE., 'OUT', & TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II), & 'Unified point output') +#ifdef W3_ASCII + CALL WMUGET ( MDSS, MDST, MDSUPA, 'OUA' ) + CALL WMUSET ( MDSS, MDST, MDSUPA, .TRUE., 'OUA', & + TRIM(FNMPRE)//'out_pnt.'//MNAMES(0)(1:II)//'.txt', & + 'Unified point output ascii') +#endif END IF END IF ! diff --git a/model/src/wmiopomd.F90 b/model/src/wmiopomd.F90 index 071f7e051..73e036535 100644 --- a/model/src/wmiopomd.F90 +++ b/model/src/wmiopomd.F90 @@ -723,6 +723,9 @@ SUBROUTINE WMIOPO ( TOUT ) ICEO,ICEHO,ICEFO USE WMMDATMD, ONLY: MDST, MDSE, IMPROC, NMPROC, NMPUPT, NRGRD, & RESPEC, UPTMAP, MDSUP +#ifdef W3_ASCII + USE WMMDATMD, ONLY: MDSUPA +#endif #ifdef W3_MPI USE WMMDATMD, ONLY: MPI_COMM_MWAVE, MPI_COMM_GRD, ALLPRC, & MTAG0 @@ -1173,7 +1176,11 @@ SUBROUTINE WMIOPO ( TOUT ) ! TIME = TOUT ! - CALL W3IOPO ( 'WRITE', MDSUP, II, 0 ) + CALL W3IOPO ( 'WRITE', MDSUP, II, 0 & +#ifdef W3_ASCII + ,MDSUPA & +#endif + ) ! RETURN ! diff --git a/model/src/wmmdatmd.F90 b/model/src/wmmdatmd.F90 index e93c2cfb9..94aa7a7a9 100644 --- a/model/src/wmmdatmd.F90 +++ b/model/src/wmmdatmd.F90 @@ -74,6 +74,8 @@ MODULE WMMDATMD ! only. ! MDSP Int. Public Unit number for profiling. ! MDSUP Int. Public Unit number for unified point output. + ! MDSUPA Int. Public Unit number for unified point output. + ! ASCII ! MDSF I.A. Public Unit numbers for input files. ! ! NMPROC Int. Public Number of processors (for total multi- @@ -313,6 +315,9 @@ MODULE WMMDATMD INTEGER :: MDST = 6 !< MDST INTEGER :: MDSE = 6 !< MDSE INTEGER :: MDSUP !< MDSUP +#ifdef W3_ASCII + INTEGER :: MDSUPA !< MDSUPA +#endif INTEGER :: NMPROC = 1 !< NMPROC INTEGER :: IMPROC = 1 !< IMPROC INTEGER :: NMPLOG = 1 !< NMPLOG From 57e330b3d7cd191aef0758665c82f8600604acb3 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Tue, 3 Oct 2023 12:55:53 +0000 Subject: [PATCH 2/5] add regtest in ww3_tp2.6 and mww3_test_09 update matrix.base --- regtests/bin/matrix.base | 2 ++ regtests/mww3_test_09/input/switch_MPI_ASCII | 1 + regtests/ww3_tp2.6/input/switch_ST4_ASCII | 1 + 3 files changed, 4 insertions(+) create mode 100644 regtests/mww3_test_09/input/switch_MPI_ASCII create mode 100644 regtests/ww3_tp2.6/input/switch_ST4_ASCII diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 88e7ee835..864583358 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -689,6 +689,7 @@ echo "$rtst -s ST0 -w work_ST0 $ww3 ww3_tp2.6" >> matrix.body echo "$rtst -s ST0 -w work_ST0 $ww3 ww3_tp2.7" >> matrix.body echo "$rtst -s ST4 -w work_ST4 $ww3 ww3_tp2.6" >> matrix.body + echo "$rtst -s ST4_ASCII -w work_ST4_ASCII $ww3 ww3_tp2.6" >> matrix.body fi if [ "$prop1D" = 'y' ] @@ -1885,6 +1886,7 @@ then echo ' ' >> matrix.body echo "$rtst -s MPI -w work_MPI -m grdset_a -f -p $mpi -n $np $ww3 mww3_test_09" >> matrix.body + echo "$rtst -s MPI_ASCII -w work_MPI_ASCII -m grdset_a -f -p $mpi -n $np $ww3 mww3_test_09" >> matrix.body fi # Rotated pole grid cases, (ww3_tp2.11 MPI only if requested) diff --git a/regtests/mww3_test_09/input/switch_MPI_ASCII b/regtests/mww3_test_09/input/switch_MPI_ASCII new file mode 100644 index 000000000..e3d9628f0 --- /dev/null +++ b/regtests/mww3_test_09/input/switch_MPI_ASCII @@ -0,0 +1 @@ +ASCII NOGRB MPI DIST PR2 UNO SMC 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 diff --git a/regtests/ww3_tp2.6/input/switch_ST4_ASCII b/regtests/ww3_tp2.6/input/switch_ST4_ASCII new file mode 100644 index 000000000..db1b70b66 --- /dev/null +++ b/regtests/ww3_tp2.6/input/switch_ST4_ASCII @@ -0,0 +1 @@ +ASCII NOGRB SHRD PR3 UQ FLX0 LN0 ST4 NL1 BT1 DB1 MLIM TR0 BS0 IC0 IS0 REF0 WNT1 WNX1 CRT1 CRX1 O0 O1 O2 O3 O4 O5 O6 O7 O10 O11 From 08cd8cf989d1d8780060be03171a75b07caa6145 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Tue, 3 Oct 2023 13:19:17 +0000 Subject: [PATCH 3/5] remove extra print for UST debugging --- model/src/w3iogomd.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index 3a358aa19..8f8af9c5a 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -3330,12 +3330,6 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & END DO WRITE ( NDSOG ) AUX1 #ifdef W3_ASCII - DO ISEA=1, NSEA - WRITE ( NDSOA,* ) 'UST:', UST(ISEA) - WRITE ( NDSOA,* ) 'ASF:', ASF(ISEA) - WRITE ( NDSOA,* ) 'USTDIR:', cos(USTDIR(ISEA)) - WRITE ( NDSOA,* ) 'AUX1 (UST*ASF*cos(USTDIR)):', AUX1(ISEA) - END DO WRITE ( NDSOA,* ) 'AUX1 (UST*ASF*cos(USTDIR)):', AUX1 #endif WRITE ( NDSOG ) AUX2 From ea7b9c1ebb7804171158231d616804426e5f9a06 Mon Sep 17 00:00:00 2001 From: ma05cde Date: Fri, 6 Oct 2023 14:05:10 +0000 Subject: [PATCH 4/5] correct issue --- model/src/w3iogrmd.F90 | 2 +- model/src/w3wdatmd.F90 | 8 ++++---- regtests/bin/run_cmake_test | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/model/src/w3iogrmd.F90 b/model/src/w3iogrmd.F90 index 8834f77e4..e96b7b788 100644 --- a/model/src/w3iogrmd.F90 +++ b/model/src/w3iogrmd.F90 @@ -610,7 +610,7 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT & #endif WRITE (NDSM) NGLO, NARC, NBGL, NBAC, NBSMC #ifdef W3_ASCII - WRITE (NDSM) 'NGLO, NARC, NBGL, NBAC, NBSMC:', & + WRITE (NDSA,*) 'NGLO, NARC, NBGL, NBAC, NBSMC:', & NGLO, NARC, NBGL, NBAC, NBSMC #endif #endif diff --git a/model/src/w3wdatmd.F90 b/model/src/w3wdatmd.F90 index bb6e823a6..848f3858f 100644 --- a/model/src/w3wdatmd.F90 +++ b/model/src/w3wdatmd.F90 @@ -413,7 +413,7 @@ SUBROUTINE W3DIMW ( IMOD, NDSE, NDST, F_ONLY ) ! !/ ------------------------------------------------------------------- / USE W3GDATMD, ONLY: NGRIDS, IGRID, W3SETG, NSPEC, NSEA, NSEAL, GRIDS - USE W3ODATMD, ONLY: NAPROC, IAPROC, UNDEF + USE W3ODATMD, ONLY: NAPROC, IAPROC USE W3SERVMD, ONLY: EXTCDE USE CONSTANTS, ONLY : LPDLIB, DAIR USE W3PARALL, ONLY: SET_UP_NSEAL_NSEALM, LSLOC @@ -588,9 +588,9 @@ SUBROUTINE W3DIMW ( IMOD, NDSE, NDST, F_ONLY ) WDATAS(IMOD)%ICEH (0:NSEA) = GRIDS(IMOD)%IICEHINIT WDATAS(IMOD)%ICEF (0:NSEA) = 1000. WDATAS(IMOD)%ICEDMAX(:) = 1000. - WDATAS(IMOD)%UST (0:NSEATM) = UNDEF - WDATAS(IMOD)%USTDIR(0:NSEATM) = UNDEF - WDATAS(IMOD)%ASF (:) = UNDEF + WDATAS(IMOD)%UST (0:NSEATM) = 1.E-5 + WDATAS(IMOD)%USTDIR(0:NSEATM) = 0. + WDATAS(IMOD)%ASF (:) = 0. WDATAS(IMOD)%FPIS (:) = 0. WDATAS(IMOD)%DINIT = .TRUE. CALL W3SETW ( IMOD, NDSE, NDST ) diff --git a/regtests/bin/run_cmake_test b/regtests/bin/run_cmake_test index a349240d8..0bd4d9729 100755 --- a/regtests/bin/run_cmake_test +++ b/regtests/bin/run_cmake_test @@ -654,6 +654,10 @@ then if [ $multi -eq 2 ] then mv mod_def.ww3 mod_def.$g + if [ -e mod_def.ww3.txt ] + then + mv mod_def.ww3.txt mod_def.${g}.txt + fi if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then mv $prog.nml.log ${prog}_$g.nml.log From e2337e95f76125ca95735c15d148581a511a7bff Mon Sep 17 00:00:00 2001 From: ma05cde Date: Thu, 12 Oct 2023 08:07:31 +0000 Subject: [PATCH 5/5] remove corrections that should be pushed on separated branch --- model/src/w3gridmd.F90 | 1 - model/src/w3iogomd.F90 | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/model/src/w3gridmd.F90 b/model/src/w3gridmd.F90 index 531dc4b64..aa618b59f 100644 --- a/model/src/w3gridmd.F90 +++ b/model/src/w3gridmd.F90 @@ -1161,7 +1161,6 @@ SUBROUTINE W3GRID() NDSI = 10 NDSS = 99 NDSM = 20 - NDSM = 21 ! INQUIRE(FILE=TRIM(FNMPRE)//"ww3_grid.nml", EXIST=FLGNML) IF (FLGNML) THEN diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index 8f8af9c5a..2ddfa77e0 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -3318,7 +3318,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD & ! ELSE IF ( IFI .EQ. 5 .AND. IFJ .EQ. 1 ) THEN DO ISEA=1, NSEA - IF ( UST(ISEA) .NE. UNDEF .AND. ASF(ISEA) .NE. UNDEF ) THEN + IX = MAPSF(ISEA,1) + IY = MAPSF(ISEA,2) + IF ( MAPSTA(IY,IX) .EQ. 1 ) THEN AUX1(ISEA) = UST(ISEA) * ASF(ISEA) * & COS(USTDIR(ISEA)) AUX2(ISEA) = UST(ISEA) * ASF(ISEA) * &