Skip to content

Tidal forcing does not work with ssh_gradient for RK4 #497

Closed

Description

@pwolfram

Tidal forcing currently modifies zMid for the RK4 implementation. However, there is no direct feedback on pressure forcing when ssh_gradient is used because the tendency does not include zMid but instead ssh.

Activity

  1. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor
  2. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor

    Reference code from src/core_ocean/shared/mpas_ocn_vel_pressure_grad.F

    160       if (config_pressure_gradient_type.eq.'ssh_gradient') then                                                             
    161                                                                                                                             
    162          ! pressure for sea surface height                                                                                  
    163          ! - g grad ssh                                                                                                     
    164                                                                                                                             
    165          !$omp do schedule(runtime) private(cell1, cell2, invdcEdge, k)                                                     
    166          do iEdge=1,nEdges                                                                                                  
    167             cell1 = cellsOnEdge(1,iEdge)                                                                                    
    168             cell2 = cellsOnEdge(2,iEdge)                                                                                    
    169             invdcEdge = 1.0_RKIND / dcEdge(iEdge)                                                                           
    170                                                                                                                             
    171             do k=1,maxLevelEdgeTop(iEdge)                                                                                   
    172                tend(k,iEdge) = tend(k,iEdge) - gravity * edgeMask(k,iEdge) * invdcEdge * ( ssh(cell2) - ssh(cell1) )        
    173             end do                                                                                                          
    174          end do                                                                                                             
    175          !$omp end do                                                                                                       
    176                                                                                                                             
    177       elseif (config_pressure_gradient_type.eq.'pressure_and_zmid') then                                                    
    178                                                                                                                             
    179          ! pressure for generalized coordinates                                                                             
    180          ! -1/density_0 (grad p_k + density g grad z_k^{mid})                                                               
    181                                                                                                                             
    182          !$omp do schedule(runtime) private(cell1, cell2, invdcEdge, k)                                                     
    183          do iEdge=1,nEdges                                                                                                  
    184             cell1 = cellsOnEdge(1,iEdge)                                                                                    
    185             cell2 = cellsOnEdge(2,iEdge)                                                                                    
    186             invdcEdge = 1.0_RKIND / dcEdge(iEdge)                                                                           
    187                                                                                                                             
    188             do k=1,maxLevelEdgeTop(iEdge)                                                                                   
    189                tend(k,iEdge) = tend(k,iEdge) + edgeMask(k,iEdge) * invdcEdge * ( &                                          
    190                  - density0Inv * ( pressure(k,cell2) - pressure(k,cell1) ) &                                                
    191                  - gdensity0Inv * 0.5_RKIND*(density(k,cell1)+density(k,cell2)) * ( zMid(k,cell2) - zMid(k,cell1) ) )       
    192             end do                                                                                                          
    193          end do                                                                                                             
    194          !$omp end do                                                                                                       
    195                                                                                                                             
    

    The application of tides to zMid at https://github.com/MPAS-Dev/MPAS-Model/pull/371/files#diff-d2a9414bd0f5332537025544c6ed7ea9R356 is not getting used in the ssh_gradient version of the pressure gradient as shown above.

  3. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor

    @sbrus89 and @mark-petersen, it looks like we will need to have separate applications of tides given choice of config_pressure_gradient_type.

  4. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor
  5. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor

    Would it make more sense to incorporate tidal forcing directly into the pressure gradient solver directly as its own tidal term? It seems like this may make more sense because it doesn't come into play except when the horizontal pressure gradient is computed.

  6. pwolfram commented on Mar 30, 2020

    @pwolfram
    ContributorAuthor

    This solution also has the potential for making the tidal application agnostic to time integration choice too.

  7. added a commit that references this issue on Apr 2, 2020
  8. pwolfram commented on Apr 2, 2020

    @pwolfram
    ContributorAuthor

    Closed by #498, thanks @sbrus89!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions