diff --git a/manual/num/rotagrid.tex b/manual/num/rotagrid.tex index 60b58ef6d..c44c6f387 100644 --- a/manual/num/rotagrid.tex +++ b/manual/num/rotagrid.tex @@ -40,7 +40,12 @@ \subsubsection{~Rotated grids} \label{sub:num_space_rotagrid} has been used. Gridded netCDF files generated by {\bf ww3\_ounf} also include \emph{standard\_latitude} and \emph{standard\_longitude} two-dimensional arrays that describe location of the rotated model cell centres in the standard lat-lon -reference frame. +reference frame. + +If the user wishes to generate boundary conditions for a rotated pole grid using +the {\bf ww3\_bound} or {\bf ww3\_bounc} boundary processing programs, then it +should be noted that the input spectra for these programs are always expected +to be formulated on a \emph{standard pole}. Six subroutines are provided in module {\bf w3servmd.ftn} for rotated grid conversion: diff --git a/manual/run/ww3_bounc.tex b/manual/run/ww3_bounc.tex index 5814ba141..b75a1fca1 100644 --- a/manual/run/ww3_bounc.tex +++ b/manual/run/ww3_bounc.tex @@ -10,4 +10,7 @@ \subsubsection{The NetCDF boundary conditions program} \label{sub:ww3bounc} \proddeff{Output}{standard out}{Formatted output of program.}{6} \proddefa{nest.ww3}{Boundary conditions file.}{33} +\vspace{\baselineskip} \noindent +Note: When using this program to produce boundary inputs for a model formulated on rotated pole grid, the input spectra are always assumed to be formulated on a standard pole. + \pb diff --git a/manual/run/ww3_bound.tex b/manual/run/ww3_bound.tex index 310ceda61..6dd5b059e 100644 --- a/manual/run/ww3_bound.tex +++ b/manual/run/ww3_bound.tex @@ -9,4 +9,7 @@ \subsubsection{The boundary conditions program} \label{sub:ww3bound} \proddeff{Output}{standard out}{Formatted output of program.}{6} \proddefa{nest.ww3}{Boundary conditions file.}{33} +\vspace{\baselineskip} \noindent +Note: When using this program to produce boundary inputs for a model formulated on rotated pole grid, the input spectra are always assumed to be formulated on a standard pole. + \pb diff --git a/model/ftn/ww3_bounc.ftn b/model/ftn/ww3_bounc.ftn index 9fbbad6fb..fbd521399 100644 --- a/model/ftn/ww3_bounc.ftn +++ b/model/ftn/ww3_bounc.ftn @@ -7,7 +7,7 @@ !/ | F. Ardhuin | !/ | M. Accensi | !/ | FORTRAN 90 | -!/ | Last update : 04-May-2020 | +!/ | Last update : 21-Jul-2020 | !/ +-----------------------------------+ !/ !/ 24-May-2013 : Adaptation from ww3_bound.ftn ( version 4.08 ) @@ -18,6 +18,8 @@ !/ 20-Mar-2018 : Improve netcdf file reading ( version 6.02 ) !/ 15-May-2018 : Add namelist feature ( version 6.05 ) !/ 04-May-2020 : Update spectral conversion ( version 7.XX ) +!/ 21-Jul-2020 : Support rotated pole grid ( version 7.XX ) +!/ !/ !/ Copyright 2012-2013 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -53,6 +55,7 @@ ! EXTCDE Subr. Id. Abort program as graceful as possible. ! WAVNU1 Subr. W3DISPMD Solve dispersion relation. ! W3IOGR Subr. W3IOGRMD Reading/writing model definition file. +! W3EQTOLL Subr W3SERVMD Convert coordinates from rotated pole. ! ---------------------------------------------------------------- ! ! 5. Called by : @@ -66,6 +69,9 @@ ! - Can be used also to diagnose contents of nest.ww3 file ! in read mode ! +! - Input spectra are assumed to be formulated on a standard +! pole. However, the model grid can be on a rotated pole. +! ! 8. Structure : ! ! ---------------------------------------------------- @@ -106,11 +112,13 @@ GNAME, W3NMOD, W3SETG,& NSEA, MAPSTA, XYB, GTYPE, XGRD, YGRD, X0, Y0, & SX, SY, MAPSF, UNGTYPE, CLGTYPE, RLGTYPE, FLAGLL +!/RTD USE W3GDATMD, ONLY : POLAT, POLON USE W3ODATMD, ONLY: NDSO, NDSE USE W3IOBCMD, ONLY: VERBPTBC, IDSTRBC USE W3IOGRMD, ONLY: W3IOGR USE W3TIMEMD USE W3SERVMD, ONLY: ITRACE, NEXTLN, EXTCDE, DIST_SPHERE +!/RTD USE W3SERVMD, ONLY: W3EQTOLL USE W3NMLBOUNCMD USE NETCDF !/S USE W3SERVMD, ONLY : STRACE @@ -147,6 +155,8 @@ XBPI(:), YBPI(:), RDBPI(:,:), & XBPO(:), YBPO(:), RDBPO(:,:), & ABPIN(:,:), ABPIN2(:,:,:) +!/RTD REAL, ALLOCATABLE :: XTMP(:), YTMP(:), ANGTMP(:) +!/RTD LOGICAL :: ISRTD ! REAL, ALLOCATABLE :: TMPSPCI(:,:),TMPSPCO(:,:) @@ -204,6 +214,9 @@ ! CALL W3IOGR ( 'READ', NDSM ) WRITE (NDSO,920) GNAME +!/RTD! +!/RTD ISRTD = POLAT .LT. 90.0 +!/RTD! ! !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! 3. Read requests from input file. @@ -359,6 +372,7 @@ END IF END DO ALLOCATE(XBPO(NBO),YBPO(NBO)) +!/RTD IF (ISRTD) ALLOCATE(XTMP(NBO), YTMP(NBO), ANGTMP(NBO)) ALLOCATE (IPBPO(NBO,4),RDBPO(NBO,4)) IBO=0 DO ISEA=1,NSEA @@ -379,7 +393,16 @@ END SELECT !GTYPE END IF END DO - +!/RTD! +!/RTD IF (ISRTD) THEN +!/RTD ! Convert grid boundary cell locations to standard pole +!/RTD XTMP = XBPO +!/RTD YTMP = YBPO +!/RTD CALL W3EQTOLL(YTMP, XTMP, YBPO, XBPO, ANGTMP, POLAT, POLON, NBO) +!/RTD DEALLOCATE(XTMP, YTMP, ANGTMP) +!/RTD ENDIF +!/RTD! +! OPEN(NDSB,FILE='nest.ww3',FORM='UNFORMATTED',status='unknown') ALLOCATE(DIMID(NBO2,3),DIMLN(NBO2,3),NCID(NBO2)) diff --git a/model/ftn/ww3_bound.ftn b/model/ftn/ww3_bound.ftn index 34df94682..14cf3535d 100644 --- a/model/ftn/ww3_bound.ftn +++ b/model/ftn/ww3_bound.ftn @@ -6,12 +6,14 @@ !/ | WAVEWATCH III NOAA/NCEP | !/ | F. Ardhuin | !/ | FORTRAN 90 | -!/ | Last update : 20-Oct-2016 | +!/ | Last update : 21-Jul-2020 | !/ +-----------------------------------+ !/ !/ 28-Aug-2012 : adaptation from SHOM/Ifremer code ( version 4.08 ) !/ 01-Nov-2012 : Bug correction for NKI != NK ( version 4.08 ) !/ 20-Oct-2016 : Error statement updates ( version 5.15 ) +!/ 21-Jul-2020 : Support rotated pole grid ( version 7.06 ) +!/ Chris Bunney, UKMO. !/ !/ Copyright 2012-2012 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -47,6 +49,7 @@ ! EXTCDE Subr. Id. Abort program as graceful as possible. ! WAVNU1 Subr. W3DISPMD Solve dispersion relation. ! W3IOGR Subr. W3IOGRMD Reading/writing model definition file. +! W3EQTOLL Subr W3SERVMD Convert coordinates from rotated pole. ! ---------------------------------------------------------------- ! ! 5. Called by : @@ -60,6 +63,9 @@ ! - Can be used also to diagnose contents of nest.ww3 file ! in read mode ! +! - Input spectra are assumed to be formulated on a standard +! pole. However, the model grid can be on a rotated pole. +! ! 8. Structure : ! ! ---------------------------------------------------- @@ -97,11 +103,13 @@ USE W3GDATMD, ONLY: NK, NTH, XFR, FR1, GNAME, W3NMOD, W3SETG, & NSEA, MAPSTA, XYB, GTYPE, XGRD, YGRD, X0, Y0, & SX, SY, MAPSF, UNGTYPE, CLGTYPE, RLGTYPE +!/RTD USE W3GDATMD, ONLY : POLAT, POLON USE W3ODATMD, ONLY: NDSO, NDSE USE W3IOBCMD, ONLY: VERBPTBC, IDSTRBC USE W3IOGRMD, ONLY: W3IOGR USE W3TIMEMD USE W3SERVMD, ONLY: ITRACE, NEXTLN, EXTCDE +!/RTD USE W3SERVMD, ONLY: W3EQTOLL !/S USE W3SERVMD, ONLY : STRACE !/ IMPLICIT NONE @@ -134,6 +142,8 @@ REAL, ALLOCATABLE :: XBPI(:), YBPI(:), RDBPI(:,:), & XBPO(:), YBPO(:), RDBPO(:,:), & ABPIN(:,:) +!/RTD REAL, ALLOCATABLE :: XTMP(:), YTMP(:), ANGTMP(:) +!/RTD LOGICAL :: ISRTD INTEGER, ALLOCATABLE :: IPBPI(:,:), IPBPO(:,:) @@ -174,6 +184,9 @@ ! CALL W3IOGR ( 'READ', NDSM ) WRITE (NDSO,920) GNAME +!/RTD! +!/RTD ISRTD = POLAT .LT. 90.0 +!/RTD! ! ! 3. Read input file ! @@ -288,6 +301,7 @@ END IF END DO ALLOCATE(XBPO(NBO),YBPO(NBO)) +!/RTD IF (ISRTD) ALLOCATE(XTMP(NBO), YTMP(NBO), ANGTMP(NBO)) ALLOCATE (IPBPO(NBO,4),RDBPO(NBO,4)) IBO=0 DO ISEA=1,NSEA @@ -308,7 +322,15 @@ END SELECT !GTYPE END IF END DO - +!/RTD! +!/RTD ! Convert grid boundary cell locations to standard pole +!/RTD IF( ISRTD ) THEN +!/RTD XTMP = XBPO +!/RTD YTMP = YBPO +!/RTD CALL W3EQTOLL(YTMP, XTMP, YBPO, XBPO, ANGTMP, POLAT, POLON, NBO) +!/RTD DEALLOCATE(XTMP, YTMP, ANGTMP) +!/RTD ENDIF +!/RTD! OPEN(NDSB,FILE='nest.ww3',FORM='UNFORMATTED',status='unknown') ALLOCATE(LATS(NBO2),LONS(NBO2)) DO IP=1,NBO2 @@ -411,6 +433,13 @@ ! READ(200+IP,'(A1,A10,A1,2F7.2,F10.1,F7.2,F6.1,F7.2,F6.1)') & space,buoyname,space,LATS(IP),LONS(IP),depth,U10,Udir,Curr,Currdir +!/RTD! +!/RTD IF (ISRTD) THEN +!/RTD ! Rotated coordinates are scaled in range 0 - 360 +!/RTD IF(LONS(IP) .LT. 0) LONS(IP) = LONS(IP) + 360.0 +!/RTD IF(LONS(IP) .GT. 360) LONS(IP) = LONS(IP) - 360.0 +!/RTD ENDIF +!/RTD! READ(200+IP,*,IOSTAT=IERR) SPEC2D IF (IFMIN2.GT.1) THEN ! diff --git a/model/inp/ww3_bounc.inp b/model/inp/ww3_bounc.inp index 61143ad06..672a0dc34 100644 --- a/model/inp/ww3_bounc.inp +++ b/model/inp/ww3_bounc.inp @@ -16,6 +16,9 @@ $ List of spectra files. These NetCDF files use the WAVEWATCH III $ format as described in the ww3_ounp.inp file. The files are $ defined relative to the directory in which the program is run. $ +$ Note: When using a rotated pole WW3 grid, these input spectra are +$ always assumed to be formulated on a standard pole. +$ SPECTRA_NC/ww3.62163_spec.nc SPECTRA_NC/ww3.62069_spec.nc 'STOPSTRING' diff --git a/model/inp/ww3_bound.inp b/model/inp/ww3_bound.inp index 15a082b0a..05976bd41 100644 --- a/model/inp/ww3_bound.inp +++ b/model/inp/ww3_bound.inp @@ -26,6 +26,9 @@ $ $ If data is used other than from previous WAVEWATCH III runs, then $ this data will need to be converted to the WAVEWATCH III format. $ +$ Note: When using a rotated pole WW3 grid, these input spectra are +$ always assumed to be formulated on a standard pole. +$ $ In the case of NetCDF files see ww3_bounc.inp $ SPECTRI/mww3.W004N476.spec diff --git a/model/nml/ww3_bounc.nml b/model/nml/ww3_bounc.nml index 79c4923af..eb2e667bc 100644 --- a/model/nml/ww3_bounc.nml +++ b/model/nml/ww3_bounc.nml @@ -5,6 +5,8 @@ ! -------------------------------------------------------------------- ! ! Define the input boundaries to preprocess via BOUND_NML namelist +! Note: When using a rotated pole WW3 grid, the input spectra are +! always assumed to be formulated on a standard pole. ! ! * namelist must be terminated with / ! * definitions & defaults: