NOAA-GFDL / MOM6-examples

Example configurations for MOM6 and SIS2
Other
88 stars 148 forks source link

`Spoon` topography is incorrectly implemented in `initialize_topography_named` #392

Open pittwolfe opened 1 year ago

pittwolfe commented 1 year ago

The spoon topography is supposed to limit to max_depth at the southern boundary of the domain, but does not because of an extraneous square. The lines in question are in MOM_shared_initialization.F90:

elseif (trim(topog_config) == "spoon") then
  D0 = (max_depth - Dedge) / &
           ((1.0 - exp(-0.5*G%len_lat*G%Rad_Earth_L*PI/(180.0 *expdecay))) * &
            (1.0 - exp(-0.5*G%len_lat*G%Rad_Earth_L*PI/(180.0 *expdecay))))
  do i=is,ie ; do j=js,je
!  This sets a bowl shaped (sort of) bottom topography, with a       !
!  maximum depth of max_depth.                                   !
    D(i,j) =  Dedge + D0 * &
           (sin(PI * (G%geoLonT(i,j) - (G%west_lon)) / G%len_lon) * &
         (1.0 - exp((G%geoLatT(i,j) - (G%south_lat+G%len_lat))*G%Rad_Earth_L*PI / &
                    (180.0*expdecay)) ))
  enddo ; enddo

The definition of D0 is copied from the bowl topography, which contains a product of exponentials. The spoon topography only has a single exponential (decaying from the north), so the denominator of D0 should be linear, not quadratic.

Can issue a pull request on this if warranted, but I thought I'd check first before figuring out how to do that correctly.

pittwolfe commented 1 year ago

Now that I think about it, there shouldn't the 0.5 in the exponentials either. The lines in question should read

D0 = (max_depth - Dedge) / &
           (1.0 - exp(-G%len_lat*G%Rad_Earth_L*PI/(180.0 *expdecay)))