Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port remaining 49R2 science contributions #49

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
15700b7
unresolved bathymetry input in grib 2
jrbidlot May 3, 2024
75cfac3
add gross error check for alt data
jrbidlot Jun 26, 2024
371bb7d
re merge with 49R1
jrbidlot Jul 5, 2024
341e885
add outch.F90
jrbidlot Jul 6, 2024
e16fa1f
generalise outch
jrbidlot Jul 7, 2024
7c7b96b
LL_GRID_SIMPLE_MATRIX false
jrbidlot Jul 24, 2024
2f4185d
fix out_onegrdpt.F90 when mss is not output
jrbidlot Jul 29, 2024
6364ef3
remove contributions that are not altimeter related
jrbidlot Aug 12, 2024
ebf6af8
grib 2 unresolved bathymetry obstructions
jrbidlot Aug 21, 2024
73f5ce7
to read Ocean surface currents
jrbidlot Aug 22, 2024
667dd39
add how to deal with stapType=avg
jrbidlot Aug 23, 2024
bd55736
debug
jrbidlot Aug 23, 2024
160312c
cleanup
jrbidlot Aug 23, 2024
7ca7e02
cleanup
jrbidlot Aug 23, 2024
ef25f84
IFS-49R2-SYNC: rebase cleanup
awnawab Dec 2, 2024
71d8873
IFS-49R2-SYNC: set LWVFLX_SNL to TRUE
awnawab Dec 2, 2024
b544cab
debug
jrbidlot Oct 4, 2024
2f613e2
debug
jrbidlot Oct 4, 2024
458d549
debug
jrbidlot Oct 6, 2024
8435b36
correct rearrngsar.F90 for JP = 0 cases
jrbidlot Oct 6, 2024
9877add
fix issue with windesea directional spread when no windsea detected
jrbidlot Oct 20, 2024
d42bf58
correct calling of w_maxh
jrbidlot Nov 3, 2024
bf91296
debug problem with call to MPL_ALLTOALLV in outwspec.F90
jrbidlot Nov 20, 2024
4e7e0db
debugging
jrbidlot Nov 21, 2024
3da4cba
test change to outwspec.F90
jrbidlot Nov 21, 2024
925c8b5
bug fix for outwspec.F90 for when NPROC > NANG*NFRE_RED
jrbidlot Nov 21, 2024
c5bb5ff
fix noise level for better MWP estimate under sea ice
jrbidlot Nov 29, 2024
951f596
WAVEMDL: fix bounds checking bug
awnawab Dec 8, 2024
0cb198c
NVHPC: downgrade optimisation for W_MAXH
awnawab Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion share/ecwam/scripts/ecwam_run_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ cat > wam_namelist << EOF
LRSTPARALR = F,
LRSTPARALW = F,
LSECONDORDER = F,
LWVFLX_SNL = F,
LWVFLX_SNL = T,
LLNORMWAMOUT = T,
LLNORMWAMOUT_GLOBAL = T,
CNORMWAMOUT_FILE = "statistics.log",
Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ elseif( CMAKE_Fortran_COMPILER_ID MATCHES GNU )
set_source_files_properties( mubuf.F90 PROPERTIES COMPILE_OPTIONS "-ffp-contract=off" )
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|NVHPC" AND CMAKE_BUILD_TYPE MATCHES "Bit")
set_source_files_properties(
sbottom.F90 PROPERTIES COMPILE_FLAGS " -g -O1 -Mflushz -Mno-signed-zeros "
w_maxh.F90 sbottom.F90 PROPERTIES COMPILE_FLAGS " -g -O1 -Mflushz -Mno-signed-zeros "
)
set_source_files_properties( mubuf.F90 PROPERTIES COMPILE_OPTIONS "-Mnofma" )
if( HAVE_SINGLE_PRECISION )
Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/ctuw.F90
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ SUBROUTINE CTUW (DELPRO, MSTART, MEND, &

!* LOOP OVER FREQUENCIES.
! ----------------------
!$acc kernels !loop private(CGYP,KIJS,KIJL,CGX,IX,KY,UU,UREL,ISSU,VV,VREL,ISSV,DXP,DYP,ADXP,ADYP,DXUP,DXDW,DYUP,DYDW,DXX,DYY,GRIDAREAM1,WEIGHT)
!$acc kernels
DO M = MSTART, MEND

!* LOOP OVER DIRECTIONS.
Expand Down
13 changes: 6 additions & 7 deletions src/ecwam/current2wam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SUBROUTINE CURRENT2WAM (FILNM, IREAD, CDATEIN, &
! *CALL* *CURRENT2WAM(FILNM, IREAD, CDATEIN,
! IFROMIJ, JFROMIJ,
! NXS, NXE, NYS, NYE, FIELDG,
! UCUR, VCUR)
! WVENVI)

! *FILNM* DATA INPUT FILENAME.
! *IREAD* RANK OF THE PROCESS WHICH INPUTS THE DATA.
Expand All @@ -40,8 +40,8 @@ SUBROUTINE CURRENT2WAM (FILNM, IREAD, CDATEIN, &
! *NXS:NXE* FIRST DIMENSION OF FIELDG
! *NYS:NYE* SECOND DIMENSION OF FIELDG
! *FIELDG* INPUT FORCING FIELDS ON THE WAVE MODEL GRID
! *UCUR* U-COMPONENT OF SURFACE CURRENT
! *VCUR* V-COMPONENT OF SURFACE CURRENT
! *WVENVI%UCUR* U-COMPONENT OF SURFACE CURRENT
! *WVENVI%VCUR* V-COMPONENT OF SURFACE CURRENT


! METHOD.
Expand Down Expand Up @@ -94,7 +94,7 @@ SUBROUTINE CURRENT2WAM (FILNM, IREAD, CDATEIN, &
TYPE(ENVIRONMENT), INTENT(INOUT) :: WVENVI


INTEGER(KIND=JWIM) :: NBIT = 1000000
INTEGER(KIND=JWIM) :: NBIT = 1100000

INTEGER(KIND=JWIM) :: KFILE_HANDLE1
INTEGER(KIND=JWIM) :: LFILE, KGRIB_HANDLE
Expand Down Expand Up @@ -244,8 +244,7 @@ SUBROUTINE CURRENT2WAM (FILNM, IREAD, CDATEIN, &

CDATEIN_OLD=CDATEIN


IF (IPARAM == 131) THEN
IF (IPARAM == 131 .OR. IPARAM == 140) THEN
!$OMP PARALLEL DO SCHEDULE(STATIC) PRIVATE(ICHNK, IJ, IX, JY)
DO ICHNK = 1, NCHNK
DO IJ = 1, NPROMA_WAM
Expand All @@ -262,7 +261,7 @@ SUBROUTINE CURRENT2WAM (FILNM, IREAD, CDATEIN, &
ENDDO
!$OMP END PARALLEL DO

ELSEIF (IPARAM == 132) THEN
ELSEIF (IPARAM == 132 .OR. IPARAM == 139) THEN
!$OMP PARALLEL DO SCHEDULE(STATIC) PRIVATE(ICHNK, IJ, IX, JY)
DO ICHNK = 1, NCHNK
DO IJ = 1, NPROMA_WAM
Expand Down
23 changes: 12 additions & 11 deletions src/ecwam/getcurr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ SUBROUTINE GETCURR(LWCUR, IREAD, BLK2LOC, &
USE YOWUBUF , ONLY : LUPDTWGHT
USE YOWWIND , ONLY : LLNEWCURR

USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK
USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK
USE EC_LUN , ONLY : NULERR
USE MPL_MODULE, ONLY : MPL_ALLREDUCE

! --------------------------------------------------------------------
Expand Down Expand Up @@ -207,16 +208,16 @@ SUBROUTINE GETCURR(LWCUR, IREAD, BLK2LOC, &


IF (CDATEIN /= CDTCUR) THEN
WRITE (IU06,*) ' **************************************'
WRITE (IU06,*) ' * *'
WRITE (IU06,*) ' * PROBLEM IN GETCURR : *'
WRITE (IU06,*) ' * THE REQUESTED DATE FOR THE CURRENTS*'
WRITE (IU06,*) ' * DOES NOT CORRESPOND TO THE DECODED *'
WRITE (IU06,*) ' * DATE !!!! *'
WRITE (IU06,*) ' * CDTCUR =',CDTCUR
WRITE (IU06,*) ' * CDATEIN=',CDATEIN
WRITE (IU06,*) ' * *'
WRITE (IU06,*) ' **************************************'
WRITE (NULERR,*) ' **************************************'
WRITE (NULERR,*) ' * *'
WRITE (NULERR,*) ' * PROBLEM IN GETCURR : *'
WRITE (NULERR,*) ' * THE REQUESTED DATE FOR THE CURRENTS*'
WRITE (NULERR,*) ' * DOES NOT CORRESPOND TO THE DECODED *'
WRITE (NULERR,*) ' * DATE !!!! *'
WRITE (NULERR,*) ' * CDTCUR =',CDTCUR
WRITE (NULERR,*) ' * CDATEIN=',CDATEIN
WRITE (NULERR,*) ' * *'
WRITE (NULERR,*) ' **************************************'
CALL ABORT1
ENDIF
ELSE
Expand Down
11 changes: 11 additions & 0 deletions src/ecwam/grib2wgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,17 @@ SUBROUTINE GRIB2WGRID (IU06, KPROMA, &
STEP=(END_STEP-START_STEP)/2
ENDIF
IFORP=STEP
ELSEIF (CSTEPTYPE(1:3) == 'avg') THEN
CALL IGRIB_SET_VALUE(KGRIB_HANDLE,'stepUnits','s')
CALL IGRIB_GET_VALUE(KGRIB_HANDLE,'startStep',START_STEP)
CALL IGRIB_GET_VALUE(KGRIB_HANDLE,'endStep',END_STEP)
! THE DATA ARE VALID BETWEEN TWO TIMES. TAKE THE MIDDLE POINT
IF (START_STEP /= END_STEP) THEN
STEP=(END_STEP-START_STEP)/2
ELSE
STEP=START_STEP
ENDIF
IFORP=STEP
ELSE
WRITE(*,*) 'UNKNOWN DEFINITION OF FORECAST STEP TYPE !!!'
WRITE(*,*) 'stepType = ',CSTEPTYPE
Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/mpcrtbl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ SUBROUTINE MPCRTBL

! PARAMETER 033
IR = DEFINE_PARAMETER( 33, 'hmax', 140218, 0, 0, 0, .True., .True., &
& 'MAXIMUM WAVE HEIGHT' )
& 'ENVELOP MAXIMUM WAVE HEIGHT' )

! PARAMETER 034
IR = DEFINE_PARAMETER( 34, 'tmax', 140217, 0, 0, 0, .True., .True., &
Expand Down
10 changes: 7 additions & 3 deletions src/ecwam/mpuserin.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SUBROUTINE MPUSERIN
USE PARKIND_WAVE, ONLY : JWIM, JWRB, JWRU

USE YOWALTAS , ONLY : NUMALT ,IBUFRSAT ,ALTSDTHRSH,ALTBGTHRSH, &
& HSALTCUT, LALTGRDOUT, LALTPAS, &
& ALTGRTHRSH, HSALTCUT, LALTGRDOUT, LALTPAS, &
& XKAPPA2 ,HSCOEFCOR,HSCONSCOR ,LALTCOR ,LALTLRGR, &
& LODBRALT ,CSATNAME
USE YOWCOUP , ONLY : LWCOU ,KCOUSTEP ,LWFLUX ,LWVFLX_SNL, &
Expand Down Expand Up @@ -209,7 +209,7 @@ SUBROUTINE MPUSERIN
& IBUFRSAT, CSATNAME, &
& SWAMPWIND, SWAMPWIND2, SWAMPCIFR, SWAMPCITH, &
& DTNEWWIND, LTURN90, &
& LALTLRGR, HSCOEFCOR, HSCONSCOR,ALTSDTHRSH,ALTBGTHRSH,HSALTCUT, &
& LALTLRGR, HSCOEFCOR, HSCONSCOR,ALTSDTHRSH,ALTBGTHRSH,ALTGRTHRSH,HSALTCUT, &
& ISTREAM, NLOCGRB, IREFDATE, &
& NCONSENSUS, NDWD, NMFR, NNCEP, NUKM, &
& LGUST, LADEN, LRELWIND, LALTGRDOUT, LSUBGRID, LALTPAS, &
Expand Down Expand Up @@ -421,6 +421,7 @@ SUBROUTINE MPUSERIN
! ALTIMETER WAVE HEIGHTS.
! ALTSDTHRSH:THRESHOLD FOR SUSPICIOUS DATA (SEE GRFIELD).
! ALTBGTHRSH:THRESHOLD FOR BACKGROUND CHECK (SEE GRFIELD).
! ALTGRTHRSH:THRESHOLD FOR GROSS ERROR CHECK (SEE GRFIELD).
! HSALTCUT: USER INPUT OF THE MINIMUM WAVE HEIGHT ALLOWED IN ALTAS
! (SEE GRFIELD).
! ISTREAM: STREAM NUMBER USED WHEN GRIBBING THE DATA
Expand Down Expand Up @@ -467,6 +468,7 @@ SUBROUTINE MPUSERIN
! DEFINITIONS ARE USED.
! LL_GRID_SIMPLE_MATRIX IF TRUE THEN THE 2D SPECTRA WILL USE THE LEGACY grid_simple_matrix
! TO ENCODE THE 2D SPECTRA in GRIB1. THIS SHOULD BE PHASED OUT as soon as feasible!
! LLRSTGRIBPARAM IF TRUE, UNKNOWN GRIB PARAMETER WILL BE RESET TO EXPERIMENTAL PARAMETER TABLE 212
! LICERUN : FLAG CONTROLLING WHETHER OR NOT SEA ICE FRACTION (OR SST)
! FIEDS ARE PROVIDED WITH THE WIND FIELDS TO GENERATE THE
! SEA ICE MASK (TRUE BY DEFAULT).
Expand Down Expand Up @@ -616,6 +618,8 @@ SUBROUTINE MPUSERIN
HSCONSCOR(ISAT) = 0.0_JWRB

ALTBGTHRSH(ISAT) = 1.5_JWRB
ALTGRTHRSH(ISAT) = 3.0_JWRB

! if no value is provided in the namelist ALTSDTHRSH will
! be set in grfield.
ALTSDTHRSH(ISAT) = -1.0_JWRB
Expand Down Expand Up @@ -722,7 +726,7 @@ SUBROUTINE MPUSERIN

LNEWLVTP = .FALSE.

LL_GRID_SIMPLE_MATRIX = .TRUE.
LL_GRID_SIMPLE_MATRIX = .FALSE.

LLRSTGRIBPARAM = .FALSE.

Expand Down
31 changes: 26 additions & 5 deletions src/ecwam/outblock.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ SUBROUTINE OUTBLOCK (KIJS, KIJL, MIJ, &
& NIPRMOUT, ITOBOUT ,NTEWH ,IPRMINFO
USE YOWCOUP , ONLY : LWNEMOCOUSTRN
USE YOWFRED , ONLY : FR, TH , DFIM, DELTH, COSTH, SINTH, XKMSS_CUTOFF


USE YOWICE , ONLY : FLMIN ,LICERUN ,LMASKICE
USE YOWPARAM , ONLY : NANG ,NFRE
USE YOWPCONS , ONLY : ZMISS ,DEG ,EPSUS ,EPSU10, G, ZPI
USE YOWSTAT , ONLY : IREFRA
Expand Down Expand Up @@ -133,12 +132,14 @@ SUBROUTINE OUTBLOCK (KIJS, KIJL, MIJ, &
REAL(KIND=JWRB), DIMENSION(KIJL) :: ESEA ,FSEA ,THWISEA, P1SEA , P2SEA , SPRDSEA
REAL(KIND=JWRB), DIMENSION(KIJL) :: CHARNOCK, BETAHQ, CDATM
REAL(KIND=JWRB), DIMENSION(KIJL) :: HALP
REAL(KIND=JWRB), DIMENSION(KIJL) :: ZTHRS, ZRDUC
REAL(KIND=JWRB), DIMENSION(KIJL,NTRAIN) :: EMTRAIN
REAL(KIND=JWRB), DIMENSION(KIJL,NTRAIN) :: THTRAIN, PMTRAIN
REAL(KIND=JWRB), DIMENSION(KIJL,NANG) :: COSWDIF

! *FL2ND* SPECTRUM with second order effect added if LSECONDORDER is true .
! and in the absolute frame of reference if currents are used
! and in the absolute frame of reference if currents are used
! and will have low frequency noise added if waves in sea-ice
REAL(KIND=JWRB), DIMENSION(KIJL,NANG,NFRE) :: FL2ND

LOGICAL :: LLPEAKF
Expand Down Expand Up @@ -166,6 +167,26 @@ SUBROUTINE OUTBLOCK (KIJS, KIJL, MIJ, &
ENDIF
IF (LSECONDORDER) CALL CAL_SECOND_ORDER_SPEC(KIJS, KIJL, FL2ND, WAVNUM, DEPTH, SIG)

! Adapting the noise level structure to be more consistent in sea ice conditions
IF (LICERUN .AND. .NOT. LMASKICE) THEN
DO IJ=KIJS,KIJL
ZTHRS(IJ) = (1._JWRB - 0.9_JWRB*MIN(CICOVER(IJ),0.99_JWRB))*FLMIN
ENDDO

DO M=1,NFRE
DO IJ=KIJS,KIJL
ZRDUC(IJ) = EXP(-10.0_JWRB*FR(M)**2/SQRT(MAX(WSWAVE(IJ),1.0_JWRB)))
ENDDO

DO K=1,NANG
DO IJ=KIJS,KIJL
IF (FL2ND(IJ,K,M) <= ZTHRS(IJ)) THEN
FL2ND(IJ,K,M) = MAX(ZRDUC(IJ) * FL2ND(IJ,K,M), ZTHRS(IJ)*ZRDUC(IJ)**2)
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF

! COMPUTE MEAN PARAMETERS

Expand Down Expand Up @@ -531,8 +552,8 @@ SUBROUTINE OUTBLOCK (KIJS, KIJL, MIJ, &
ENDIF

!! alternative ways to determine wave height extremes
IF (IPFGTBL(63 + 3*NTRAIN + NTEWH) /= 0 .OR. IPFGTBL(64 + 3*NTRAIN + NTEWH) /= 0 .OR. &
& IPFGTBL(65 + 3*NTRAIN + NTEWH) /= 0 .OR. IPFGTBL(66 + 3*NTRAIN + NTEWH) /= 0 ) THEN
IF (IPFGTBL(64 + 3*NTRAIN + NTEWH) /= 0 .OR. IPFGTBL(65 + 3*NTRAIN + NTEWH) /= 0 .OR. &
& IPFGTBL(66 + 3*NTRAIN + NTEWH) /= 0 .OR. IPFGTBL(67 + 3*NTRAIN + NTEWH) /= 0 ) THEN
CALL W_MAXH (KIJS, KIJL, FL1, DEPTH, WAVNUM, &
& CMAX_F, HMAX_N, CMAX_ST, HMAX_ST, PHIST)
ENDIF
Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/outwint.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ SUBROUTINE OUTWINT(BOUT)
IFCST=IFCST/3600
ELSE
WRITE(IU06,*) ' -----------------------------------------'
WRITE(IU06,*) ' ERROR in routine OUTINT :'
WRITE(IU06,*) ' ERROR in routine OUTWINT :'
WRITE(IU06,*) ' forecast step must be multiple of hours!'
WRITE(IU06,*) ' IFCST =', IFCST
WRITE(IU06,*) ' CDATEF=', CDATEF
Expand Down
8 changes: 4 additions & 4 deletions src/ecwam/outwspec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ SUBROUTINE OUTWSPEC (IJS, IJL, SPEC, MARSTYPE, CDATE, CDATED, IFCST)
WRITE(IU06,*) ' SPECTRA WRITTEN TO FILE ',OUTFILEN(1:LFILE)
ENDIF

ALLOCATE(ZSENDBUF(NPROC*(NEND(IRANK)-NSTART(IRANK)+1)))
ALLOCATE(ZSENDBUF(MAXOUTTASK*(NEND(IRANK)-NSTART(IRANK)+1)))
ALLOCATE(ZRECVBUF(NEND(NPROC)))
ZRECVBUF(:)=0._JWRB

Expand Down Expand Up @@ -207,9 +207,9 @@ SUBROUTINE OUTWSPEC (IJS, IJL, SPEC, MARSTYPE, CDATE, CDATED, IFCST)
ENDDO

CALL GSTATS(692,0)
CALL MPL_ALLTOALLV(ZSENDBUF,ISENDCOUNTS, &
& ZRECVBUF,IRECVCOUNTS, &
& CDSTRING='OUTWSPEC:')
CALL MPL_ALLTOALLV(ZSENDBUF, ISENDCOUNTS, &
& ZRECVBUF, IRECVCOUNTS, &
& CDSTRING='OUTWSPEC:')
CALL GSTATS(692,1)


Expand Down
20 changes: 10 additions & 10 deletions src/ecwam/preset_wgrib_template.F90
Original file line number Diff line number Diff line change
Expand Up @@ -424,43 +424,43 @@ SUBROUTINE PRESET_WGRIB_TEMPLATE(CT, IGRIB_HANDLE, NGRIBV, LLCREATE, NBITSPERVAL
ENDIF

IF ( IGRIB_VERSION == 1 ) THEN
CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'offsetToEndOf4DvarWindow',IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'offsetToEndOf4DvarWindow',IDUM, KRET=IRET)
! set localFlag to 3 to prevent use of offsetToEndOf4DvarWindow
! if not used in the IFS template.
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'localFlag',3)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'systemNumber', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'systemNumber', IDUM, KRET=IRET)
IF (IRET /= 0) THEN
KSYSNB=65535
CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'systemNumber', KSYSNB)
ENDIF
CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'methodNumber', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'methodNumber', IDUM, KRET=IRET)
IF (IRET /= 0) THEN
KMETNB=65535
CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'methodNumber',KMETNB)
ENDIF
CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'referenceDate', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'referenceDate', IDUM, KRET=IRET)
IF (IRET /= 0) THEN
KREFDATE=0
CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'referenceDate',KREFDATE)
ENDIF

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'climateDateFrom', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'climateDateFrom', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'climateDateFrom',0)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'climateDateTo', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'climateDateTo', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'climateDateTo',0)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'legBaseDate', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'legBaseDate', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'legBaseDate',0)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'legBaseTime', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'legBaseTime', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'legBaseTime',0)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'legNumber', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'legNumber', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'legNumber',0)

CALL IGRIB_GET_VALUE(NGRIB_HANDLE_IFS,'oceanAtmosphereCoupling', IDUM, KRET=IRET)
CALL IGRIB_GET_VALUE(IGRIB_HANDLE_IFS,'oceanAtmosphereCoupling', IDUM, KRET=IRET)
IF (IRET /= 0) CALL IGRIB_SET_VALUE(IGRIB_HANDLE,'oceanAtmosphereCoupling',0)

ENDIF
Expand Down
7 changes: 6 additions & 1 deletion src/ecwam/sepwisw.F90
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ SUBROUTINE SEPWISW (KIJS, KIJL, MIJ, FL1, XLLWS, CINV, &
DO M=1,NFRE
DO K=1,NANG
DO IJ=KIJS,KIJL
F1(IJ,K,M)=MAX(FL1(IJ,K,M)-F1(IJ,K,M)+EPSMIN,0.0_JWRB)
!! add a small amount of noise in the wind direction
IF ( COSWDIF(IJ,K) > 0.8_JWRB .AND. M >= NFRE/2 ) THEN
F1(IJ,K,M)=MAX(FL1(IJ,K,M)-F1(IJ,K,M)+EPSMIN*COSWDIF(IJ,K)**4,0.0_JWRB)
ELSE
F1(IJ,K,M)=MAX(FL1(IJ,K,M)-F1(IJ,K,M),0.0_JWRB)
ENDIF
ENDDO
ENDDO
ENDDO
Expand Down
12 changes: 5 additions & 7 deletions src/ecwam/userin.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
USE PARKIND_WAVE, ONLY : JWIM, JWRB, JWRU

USE YOWALTAS , ONLY : NUMALT ,IBUFRSAT ,ALTSDTHRSH,ALTBGTHRSH, &
& HSALTCUT, LALTGRDOUT, LALTPAS, LALTPASSIV, &
& ALTGRTHRSH,HSALTCUT, LALTGRDOUT, LALTPAS, LALTPASSIV, &
& XKAPPA2 ,HSCOEFCOR,HSCONSCOR ,LALTCOR ,LALTLRGR, &
& LODBRALT ,CSATNAME
USE YOWCOUP , ONLY : LWCOU ,LWCOU2W ,LWCOURNW, LWCOUAST, &
Expand Down Expand Up @@ -1044,14 +1044,12 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) ' THE DATA WILL BE CORRECTED '
WRITE(IU06,*) ' ACCORDING TO THE MODEL SEA STATE.'
ENDIF
WRITE(IU06,*) ' THE THRESHOLD FOR BACKGROUND CHECK IS ', &
& ALTBGTHRSH(ISAT)
WRITE(IU06,*) ' THE THRESHOLD FOR BACKGROUND CHECK IS ', ALTBGTHRSH(ISAT)
WRITE(IU06,*) ' THE THRESHOLD FOR GROSS ERROR CHECK IS ', ALTGRTHRSH(ISAT)
IF (HSALTCUT(ISAT) < 999999.) THEN
WRITE(IU06,*) ' THE INPUT MINIMUM WAVE HEIGHT IS ', &
& HSALTCUT(ISAT)
WRITE(IU06,*) ' THE INPUT MINIMUM WAVE HEIGHT IS ', HSALTCUT(ISAT)
ELSE
WRITE(IU06,*) ' THE MINIMUM WAVE HEIGHT WILL BE', &
& ' THE OBSERVATION ERROR.'
WRITE(IU06,*) ' THE MINIMUM WAVE HEIGHT WILL BE THE OBSERVATION ERROR.'
ENDIF
IF (LALTGRDOUT(ISAT)) THEN
WRITE(IU06,*) ' GRIDDED ALTIMETER FIELDS WILL BE PRODUCED FOR THIS ALTIMETER.'
Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/wavemdl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
ALLOCATE(ZCOMCNT(NPROC))
ZCOMCNT=NCOMLOC
CALL MPL_GATHERV(PSENDBUF=ZCOMBUFS(IST:IED),KROOT=IRECV, &
& PRECVBUF=ZCOMBUFR(:),KRECVCOUNTS=ZCOMCNT, &
& PRECVBUF=ZCOMBUFR,KRECVCOUNTS=ZCOMCNT, &
& CDSTRING='WAVEMDL:')
DEALLOCATE(ZCOMCNT)

Expand Down
2 changes: 1 addition & 1 deletion src/ecwam/wvwaminit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SUBROUTINE WVWAMINIT (LLCOUPLED, IULOG, LLRNL, &
USE PARKIND_WAVE, ONLY : JWIM, JWRB, JWRU

USE YOWMAP , ONLY : AMOSOP ,AMONOP ,IQGAUSS ,NGX ,NGY
USE YOWMPP , ONLY : IRANK ,NPROC ,KTAG
USE YOWMPP , ONLY : IRANK ,NPROC
USE YOWPARAM , ONLY : KWAMVER ,LLUNSTR

USE YOWTEST , ONLY : IU06
Expand Down
Loading
Loading