Skip to content
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

Initialising areaC #740

Open
anton-seaice opened this issue Oct 22, 2024 · 1 comment
Open

Initialising areaC #740

anton-seaice opened this issue Oct 22, 2024 · 1 comment

Comments

@anton-seaice
Copy link

Hi

I was going through the code to intialise the MOM grid, and have a question about the areas used on for the C grid U and v points.

The normal grid areas (for the tracer points and the the b-grid velocity point are initialised from the mom_mosaic grid file:

  call MOM_read_data(filename, 'area', tmpT, SGdom, scale=US%m_to_L**2)
  call pass_var(tmpT, SGdom)
  call extrapolate_metric(tmpT, 2*(G%jsc-G%jsd)+2, missing=0.)


  do j=G%jsd,G%jed ; do i=G%isd,G%ied ; i2 = 2*i ; j2 = 2*j
    G%areaT(i,j) = (tmpT(i2-1,j2-1) + tmpT(i2,j2)) + &
                   (tmpT(i2-1,j2) + tmpT(i2,j2-1))
  enddo ; enddo
  do J=G%JsdB,G%JedB ; do I=G%IsdB,G%IedB ; i2 = 2*i ; j2 = 2*j
    G%areaBu(I,J) = (tmpT(i2,j2) + tmpT(i2+1,j2+1)) + &
                    (tmpT(i2,j2+1) + tmpT(i2+1,j2))
  enddo ; enddo

This seems as expected - it sums the area of the relevant four cells in the mosaic file.

However the area for the C-grid points are initialised assuming each grid cell is square and multiplying the side-lengths:

  do j=G%jsd,G%jed ; do I=G%IsdB,G%IedB
    ! This open face length may be revised later.
    G%dy_Cu(I,j) = G%mask2dCu(I,j) * G%dyCu(I,j)
    G%areaCu(I,j) = G%dxCu(I,j) * G%dy_Cu(I,j)
    G%IareaCu(I,j) = G%mask2dCu(I,j) * Adcroft_reciprocal(G%areaCu(I,j))
  enddo ; enddo


  do J=G%JsdB,G%JedB ; do i=G%isd,G%ied
    ! This open face length may be revised later.
    G%dx_Cv(i,J) = G%mask2dCv(i,J) * G%dxCv(i,J)
    G%areaCv(i,J) = G%dyCv(i,J) * G%dx_Cv(i,J)
    G%IareaCv(i,J) = G%mask2dCv(i,J) * Adcroft_reciprocal(G%areaCv(i,J))
  enddo ; enddo

Why is areaCu and areaCv not initialised following the same method as areaT and areaBu? The differences will be significant near the poles of the grid ...

Thanks

Anton

@herrwang0
Copy link

herrwang0 commented Oct 22, 2024

Hi @anton-seaice,

The reason is that grid widths at velocity point G%dy_Cu and G%dx_Cv can be later modified by CHANNEL_CONFIG. This allows narrow channels to have their actual widths, rather than limited by the model's grid size.

See how G%dy_Cu, G%dx_Cv and velocity point areas are modified by the following subroutines, depending on the choices of CHANNEL_CONFIG. This is 14 lines after subroutine initialize_masks is called.

call get_param(PF, mdl, "CHANNEL_CONFIG", config, &
"A parameter that determines which set of channels are \n"//&
"restricted to specific widths. Options are:\n"//&
" \t none - All channels have the grid width.\n"//&
" \t global_1deg - Sets 16 specific channels appropriate \n"//&
" \t\t for a 1-degree model, as used in CM2G.\n"//&
" \t list - Read the channel locations and widths from a \n"//&
" \t\t text file, like MOM_channel_list in the MOM_SIS \n"//&
" \t\t test case.\n"//&
" \t file - Read open face widths everywhere from a \n"//&
" \t\t NetCDF file on the model grid.", &
default="none")
select case ( trim(config) )
case ("none")
case ("list") ; call reset_face_lengths_list(G, PF, US)
case ("file") ; call reset_face_lengths_file(G, PF, US)
case ("global_1deg") ; call reset_face_lengths_named(G, PF, trim(config), US)
case default ; call MOM_error(FATAL, "MOM_initialize_fixed: "// &
"Unrecognized channel configuration "//trim(config))
end select

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants