-
Notifications
You must be signed in to change notification settings - Fork 1
Bugfix rotbd #1
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
base: fb_xsmf
Are you sure you want to change the base?
Bugfix rotbd #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,11 @@ MODULE W3IOBCMD | |
| CHARACTER(LEN=32), PARAMETER :: & | ||
| IDSTRBC = 'WAVEWATCH III BOUNDARY DATA FILE' | ||
| !/ | ||
| #ifdef W3_RTD | ||
| ! Logical to tell subroutine W3UBPT if inbound boundary conditions are to be roteted | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spelling mistake: "roteted" --> "rotated" |
||
| LOGICAL :: BCTURN = .FALSE. | ||
| #endif | ||
| !/ | ||
| CONTAINS | ||
| !/ ------------------------------------------------------------------- / | ||
| !> | ||
|
|
@@ -562,10 +567,14 @@ SUBROUTINE W3IOBC ( INXOUT, NDSB, TIME1, TIME2, IOTST, IMOD ) | |
| ! | ||
| ! End FCOO local | ||
| #ifdef W3_RTD | ||
| ! After read from file nestN.ww3, W3WAVE calls W3UBPT which rotates the spectra | ||
| ! only if the parameter BCTURN .eq. .TRUE. | ||
| ! | ||
| ! All boundary conditions position arrays XBPI, YBPI are defined | ||
| ! in standard lat/lon coordinates. If Polat = 90. (and Polon = -180.), | ||
| ! the b.c. positions don't need to be remapped | ||
| IF ( Polat < 90. ) THEN | ||
| BCTURN = .true. ! To turn spectra in later call W3UBPT | ||
| !! Convert standard into rotated lat/lon. JGLi12Jun2012 | ||
| ALLOCATE ( Anglbdy(NBI), ELatbdy(NBI), ELonbdy(NBI) ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1399,6 +1399,9 @@ SUBROUTINE W3UBPT | |
| !! Use rotation angle and action conversion sub. JGLi12Jun2012 | ||
| USE W3GDATMD, ONLY: NK, NTH, NSPEC, AnglD, PoLat | ||
| USE W3SERVMD, ONLY: W3ACTURN | ||
| !! BCTURN==.TRUE. only when calling W3UBPT from W3IOBC, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. W3IOBC is not calling W3UBPT, as far as I can tell? Isn't it W3WAVE? |
||
| !! This is in order *not* to turn 2-way nested bdy data under ww3_multi | ||
| USE W3IOBCMD, ONLY: BCTURN | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make more sense to control this behavior from W3WAVE instead of loading this variable from W3IOBCMD? I guess that W3WAVE only calls W3IOBC if it needs to write a nest.ww3 file, so one could also introduce the logical in W3WAVE instead of W3IOBCMD. This logical could then work as an input when calling W3UBPT in W3WAVE and then you would not have to reset BCTURN=FALSE at the bottom. With my limited insights into WW3 architechure I would think that this is a more readable edit. |
||
| #endif | ||
| #ifdef W3_T0 | ||
| USE W3GDATMD, ONLY: DDEN | ||
|
|
@@ -1475,18 +1478,24 @@ SUBROUTINE W3UBPT | |
| ! | ||
| #ifdef W3_RTD | ||
| !! Rotate the spectra if model is on rotated grid. JGLi12Jun2012 | ||
| !! PoLat == 90. if the grid is standard lat/lon (C. Hansen 20190613) | ||
| IF ( PoLat < 90. ) THEN | ||
| !! PoLat == 90. if the grid is standard lat/lon | ||
| !! If PoLat < 90. we have set a logical BCTURN == .true. to turn the spectra. | ||
| !! Note, for to-way nesting under ww3_multi, spectra are *not* turned. | ||
| !! Spectra are turned/deturned only when read/write from/to file (W3IOBC). | ||
| IF ( BCTURN ) THEN | ||
| Spectr = BBPIN(:,IBI) | ||
| AnglBP = AnglD(ISEA) | ||
| CALL W3ACTURN( NTH, NK, AnglBP, Spectr ) | ||
| BBPIN(:,IBI) = Spectr | ||
| END IF | ||
|
|
||
| #endif | ||
| ! | ||
| END DO | ||
|
|
||
| #ifdef W3_RTD | ||
| !! Return to default *not* turning the spectra | ||
| BCTURN = .false. | ||
| #endif | ||
| ! | ||
| ! 3. Wave height test output ---------------------------------------- * | ||
| ! | ||
| #ifdef W3_T0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| ############################################################################# | ||
| # # | ||
| # This is testing for nested grids with common rotated pole spherical grid # | ||
| # run_cmake_test is run with option -g rtd | ||
| # | ||
| # mww3_test_02 : Tests for static nesting (propagation only) # | ||
| # Single nest basic test. # | ||
| # | ||
| # Test case adopted from mww3_test_02 with inputs marked 'rtd' | ||
| # | ||
| # * ww3_grid_rtd_outer.inp : (only outer grid) # | ||
| # + Spatial grid: 43 x 43 rectilinear spherical grid # | ||
| # - dx = 0.225 deg, dy = 0.225 deg # | ||
| # - Xrange = -5.625:3.825 deg, Yrange = -5.625:3.825 deg # | ||
| # - Grid north pole at lon, lat = -90., 0. # | ||
| # + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.1 # | ||
| # | ||
| # * ww3_grid_rtd_fine.inp : (double resolution inner grid) # | ||
| # + Spatial grid: 25 x 25 rectilinear spherical grid # | ||
| # - dx = 0.1125 deg, dy = 0.1125 deg # | ||
| # - Xrange = 0:2.7 deg, Yrange = 0:2.7 deg # | ||
| # - Grid north pole at lon, lat = -90., 0. # | ||
| # + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.1 # | ||
|
|
||
| # * Grid set : | ||
| # + grdset_b: outer + fine | ||
|
|
||
| # * Switch: | ||
| # + switch_PR3_UQ_MPI_RTD | ||
|
|
||
| # Example run_test command: | ||
| # ./bin/run_cmake_test -N -g rtd -m grdset_r -n 3 -p mpirun \ # | ||
| # -s PR3_UQ_MPI_RTD -w work_bp_PR3_MPI_RTD ../model mww3_test_02 # | ||
|
|
||
| # Run the WW3 run_cmake_test script at FCOO | ||
| # | ||
| # # Load a build environment using the gfortran compiler: | ||
| # | ||
| # spack load netcdf-fortran%gcc | ||
| # spack load cmake%gcc | ||
| # | ||
| # # Run the WW3 run_cmake_test script from the directory containg the WW3 repo: | ||
| # | ||
| # ../ww3_resurser/run_regtests.sh -N -g rtd -m grdset_r -n 3 -s PR3_UQ_MPI_RTD \ | ||
| # mww3_test_02 | ||
| # | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ############################################################################# | ||
| # # | ||
| # Case switch RTD # | ||
| # # | ||
| # mww3_test_02 : Test for static nesting (propagation only) # | ||
| # Single nest basic test. # | ||
| # # | ||
| # The test case here is for spherical (longitude,latitude) grids with a # | ||
| # (common) rotated pole # | ||
| # The test case is adopted from mww3_test_02 with inputs marked 'rtd' # | ||
| # The grid set grdset_r is a spherical approximation to Cartesian grdset_b # | ||
| # The script run_cmake_test is run with option -g rtd # | ||
| # # | ||
| # * ww3_grid_rtd_outer.inp : (only outer grid) # | ||
| # + Spatial grid: 43 x 43 rectilinear spherical grid # | ||
| # - dx = 0.225 deg, dy = 0.225 deg # | ||
| # - Xrange = -5.625:3.825 deg, Yrange = -5.625:3.825 deg # | ||
| # - Grid north pole at lon, lat = -90., 0. # | ||
| # + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.1 # | ||
| # # | ||
| # * ww3_grid_rtd_fine.inp : (double resolution inner grid) # | ||
| # + Spatial grid: 25 x 25 rectilinear spherical grid # | ||
| # - dx = 0.1125 deg, dy = 0.1125 deg # | ||
| # - Xrange = 0:2.7 deg, Yrange = 0:2.7 deg # | ||
| # - Grid north pole at lon, lat = -90., 0. # | ||
| # + Spectral grid: ntheta = 24, nf = 25, f1 = 0.04177, fgamma = 1.1 # | ||
| # # | ||
| # * Grid set : # | ||
| # + grdset_r: outer + fine # | ||
| # # | ||
| # * Switch: # | ||
| # + switch_PR3_UQ_MPI_RTD # | ||
| # # | ||
| # Example run_test command: # | ||
| # ./bin/run_cmake_test -N -g rtd -m grdset_r -n 3 -p mpirun \ # | ||
| # -s PR3_UQ_MPI_RTD -w work_bp_PR3_MPI_RTD ../model mww3_test_02 # | ||
| # # | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| &OUTS E3D=1, TH1MF=1, STH1MF=1, TH2MF=1, STH2MF=1 / | ||
| &PRO2 DTIME = 0. / | ||
| &PRO3 WDTHCG = 0., WDTHTH = 0. / | ||
| &ROTD PLAT = 0.0 PLON = -90.0, UNROT = .TRUE. / | ||
| END OF NAMELISTS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| &OUTS E3D=1, TH1MF=1, STH1MF=1, TH2MF=1, STH2MF=1 / | ||
| &PRO2 DTIME = 0. / | ||
| &PRO3 WDTHCG = 0., WDTHTH = 0. / | ||
| &ROTD PLAT = 0.0 PLON = -90.0, UNROT = .TRUE. / | ||
| END OF NAMELISTS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1.35 1.35 'point_A' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| $ WAVEWATCH III Grid preprocessor input file | ||
| $ ------------------------------------------ | ||
| 'Fine (12.5km) inner nest ' | ||
| $ | ||
| 1.1 0.04177 25 24 0. | ||
| $ | ||
| F T T F F F | ||
| 450. 450. 450. 15. | ||
| $ | ||
| &OUTS E3D=1, TH1MF=1, STH1MF=1, TH2MF=1, STH2MF=1 / | ||
| &PRO2 DTIME = 0. / | ||
| $ &PRO2 DTIME = 21600. / | ||
| &PRO3 WDTHCG = 0., WDTHTH = 0. / | ||
| &ROTD PLAT = 0.0 PLON = -90.0, UNROT = .FALSE. / | ||
| END OF NAMELISTS | ||
| $ | ||
| 'RECT' T 'NONE' | ||
| 25 25 | ||
| 0.1125 0.1125 1. | ||
| 0.0 0.0 1. | ||
| $ | ||
| -0.1 0.25 10 -1000. 4 1 '(....)' 'UNIT' 'input' | ||
| $ | ||
| 625*1 | ||
| $ | ||
| 10 1 1 '(....)' 'PART' 'mapsta.inp' | ||
| $ | ||
| 1 1 T | ||
| 1 25 T | ||
| 25 25 T | ||
| 25 1 T | ||
| 1 1 T | ||
| 0 0 F | ||
| $ | ||
| 0 0 F | ||
| 0 0 | ||
| $ | ||
| 0. 0. 0. 0. 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| ! -------------------------------------------------------------------- ! | ||
| ! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! | ||
| ! -------------------------------------------------------------------- ! | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the spectrum parameterization via SPECTRUM_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &SPECTRUM_NML | ||
| SPECTRUM%XFR = 1.1 | ||
| SPECTRUM%FREQ1 = 0.04177 | ||
| SPECTRUM%NK = 25 | ||
| SPECTRUM%NTH = 24 | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the run parameterization via RUN_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &RUN_NML | ||
| RUN%FLCX = T | ||
| RUN%FLCY = T | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the timesteps parameterization via TIMESTEPS_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &TIMESTEPS_NML | ||
| TIMESTEPS%DTMAX = 450. | ||
| TIMESTEPS%DTXY = 450. | ||
| TIMESTEPS%DTKTH = 450. | ||
| TIMESTEPS%DTMIN = 15. | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the grid to preprocess via GRID_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &GRID_NML | ||
| GRID%NAME = 'Fine (12.5km) inner nest' | ||
| GRID%NML = '../input/namelists_rtd_fine.nml' | ||
| GRID%TYPE = 'RECT' | ||
| GRID%COORD = 'SPHE' | ||
| GRID%CLOS = 'NONE' | ||
| GRID%ZLIM = -0.1 | ||
| GRID%DMIN = 0.25 | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the rectilinear grid type via RECT_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &RECT_NML | ||
| RECT%NX = 25 | ||
| RECT%NY = 25 | ||
| RECT%SX = 0.1125 ! from SX_cart=12.5E3 m to SX_cart/111111.111 deg | ||
| RECT%SY = 0.1125 | ||
| RECT%X0 = 0.0 ! from 600.0E3 | ||
| RECT%Y0 = 0.0 ! from 600.0E3 | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the depth to preprocess via DEPTH_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &DEPTH_NML | ||
| DEPTH%SF = -1000. | ||
| DEPTH%FILENAME = '../input/fine.depth' | ||
| DEPTH%IDLA = 4 | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! Define the input boundary points via INBND_COUNT_NML and | ||
| ! INBND_POINT_NML namelist | ||
| ! -------------------------------------------------------------------- ! | ||
| &INBND_COUNT_NML | ||
| INBND_COUNT%N_POINT = 5 | ||
| / | ||
|
|
||
| &INBND_POINT_NML | ||
| INBND_POINT(1) = 1 1 T | ||
| INBND_POINT(2) = 1 25 T | ||
| INBND_POINT(3) = 25 25 T | ||
| INBND_POINT(4) = 25 1 T | ||
| INBND_POINT(5) = 1 1 T | ||
| / | ||
|
|
||
| ! -------------------------------------------------------------------- ! | ||
| ! WAVEWATCH III - end of namelist ! | ||
| ! -------------------------------------------------------------------- ! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| $ WAVEWATCH III Grid preprocessor input file | ||
| $ ------------------------------------------ | ||
| 'The outer grid @ 0.225 deg ' | ||
| $ | ||
| 1.1 0.04177 25 24 0. | ||
| $ | ||
| F T T F F F | ||
| 900. 900. 900. 15. | ||
| $ | ||
| &OUTS E3D=1, TH1MF=1, STH1MF=1, TH2MF=1, STH2MF=1 / | ||
| &PRO2 DTIME = 0. / | ||
| $ &PRO2 DTIME = 21600. / | ||
| &PRO3 WDTHCG = 0., WDTHTH = 0. / | ||
| &ROTD PLAT = 0.0 PLON = -90.0, UNROT = .FALSE. / | ||
| END OF NAMELISTS | ||
| $ | ||
| 'RECT' T 'NONE' | ||
| 43 43 | ||
| 0.225 0.225 1. | ||
| -5.625 -5.625 1. | ||
| $ | ||
| -0.1 0.25 10 -1000. 4 1 '(....)' 'UNIT' 'input' | ||
| $ | ||
| 1849*1 | ||
| $ | ||
| 10 1 1 '(....)' 'PART' 'mapsta.inp' | ||
| $ | ||
| 0 0 F | ||
| 0 0 F | ||
| 0 0 | ||
| $ | ||
| 0. 0. 0. 0. 0 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check if I understand the logic of the implementation:
Is the correct?
I would like for us to go through W3WAVE to see how W3IOBC and W3UBPT are called.