Bugfix rotbd#1
Conversation
There was a problem hiding this comment.
Let me check if I understand the logic of the implementation:
- BCTURN is set to FALSE by default (so no turning of spectra)
- Only if W3IOBC is called, which reads and writes actual boundary condition files (nestX.ww3), is BCTURN set to TRUE.
- W3UBPT reads BCTURN from w3iobcmd. If BCTURN=FALSE it means that we are not in a state where the model reads/writes to boundary condiiton file, hence spectra are not to be rotated standard lon-lat. If BCTURN=TRUE it means that W3IOBC was called and the model reads/writes to a nest.ww3 file where spectra must be rotated to standard lon-lat. BCTURN is set to FALSE when rotation to standard lon-lat has completed.
Is the correct?
I would like for us to go through W3WAVE to see how W3IOBC and W3UBPT are called.
| !! 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.
W3IOBC is not calling W3UBPT, as far as I can tell? Isn't it W3WAVE?
| 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.
Spelling mistake: "roteted" --> "rotated"
| USE W3SERVMD, ONLY: W3ACTURN | ||
| !! BCTURN==.TRUE. only when calling W3UBPT from W3IOBC, | ||
| !! 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.
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.
Pull Request Summary
This bugfix corrects the erroneous advection across multi-grid boundaries when using rotated grids (switch RTD) with ww3_multi
This bug fix is intended to be pulled by @MadsBruunPoulsen into the FCOO/WW3 branch
fb_xsmf.It is a tentative solution to the issue NOAA-EMC#1579 by @CarstenHansen, following the suggestion given there.
Description
The bug is described in detail in NOAA-EMC#1579. The solution provides the expected correct grid boundary transfer under
ww3_multi, e.g. as illustrated in Fig. 2.A flag is declared global in
w3_iobcmd.F90where it is set to 'TRUE' only when reading boundary conditions from file (nest.ww3), and used inw3updtmd.F90to indicate when rotation must be done (as suggested in NOAA-EMC#1579 (comment)). Setting this flag is not a property of the individual grid, but distinguish if if boundary conditions are either read from file or transferred by theww3_multimechanism.Issue(s) addressed
Fixes NOAA-EMC#1579 (comment)
Commit Message
Correct the erroneous advection across multi-grid boundaries when using rotated grids (switch RTD) with ww3_multi.
Co-author: @MadsBrunPoulsen.
Check list
Testing
grdset_r), an extension to the existing advection regtestmww3_test02.grdset_rtomww3_test02. Suggested additions to theinfofile is provided ininfo_rtd. The program regtests/bin/run_cmake_test is modified to be able to create the initial files for the rotated grids.