Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

ocean_mask file

Jiande

Jiande Wang
New Member
I looked at the content inside FRE-NCtools but don't see the tool for generating ocean_mask.nc file. What's the right tool or method on this ? Thanks. -- Jiande
 

cermak

Rob Cermak
Member
It looks like there are two FRE-NCtools programs that create ocean mask files (via Search · ocean_mask · NOAA-GFDL/FRE-NCtools):

make_quick_mosaic creates an ocean_mask.nc file.

make_coupler_mosaic creates an ocean_mask.nc file if there is one (1) tile or several ocean_mask_tile{d}.nc files if the number of tiles is greater than one (1).

I am not sure which one would be appropriate or the requirements to run either. Both require a diagnosed ocean_topog.nc file and specification of sea level (--sea_level #) "specify the sea level ( in meters ) and its value will be used to determine land/sea mask. When topography of a grid cell is less than sea level, this grid cell will be land, otherwise it will be ocean. Default value is 0".
 

Jiande

Jiande Wang
New Member
Rob:
Thanks for the detail explanation, for my case tile=1 so I used make_quick_mosaic and that fits for my purpose.
 

Jiande

Jiande Wang
New Member
Rob:
I have a follow up question here:
when I used make_quick_mosaic, the mask file values are either 0 or 1, but if I use make_coupler_mosaic, the values are not in this way.

this is the last couple of values in mask file from ncdump from quick mosaic:
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0

but from coupled mosaic, I have
0.999999999999916, 0.999999999999943, 1.00000000000002, 1.00000000000002,
0.99999999999994, 1.00000000000003, 0.999999999999934, 1.00000000000001,
0, 0, 0, 0
 

cermak

Rob Cermak
Member
From what I can tell, in make_coupler_mosaic, there is a mask of zeros (0) and ones (1), but what is ultimately saved is the computed fraction. It is a fraction of land over ocean (L2039: FRE-NCtools/make_coupler_mosaic.c at a20a73d79b542abc71d8d5f71504aaa67d7d2da5 · NOAA-GFDL/FRE-NCtools). For whatever reason, there is a round off error in the summing of cell areas for your particular grid. I ran a test with a very simplistic grid that yields 0s and 1s for both programs, see below.

In the ocean_mask.nc file produced from make_coupler_mosaic, the computed cell sizes for the points above should be in the netCDF file. Check the values for areaO and areaX for the ocean grid area and the corresponding ocean exchange grid area. If you only have one grid, the area should theoretically be the same.

For make_quick_mosaic, the cell area is computed once and just copied to either ocean_area or land_area depending on the depth vs. sea level test. For single grids, this will always return a zero (0) or one (1). FRE-NCtools/make_quick_mosaic.c at a20a73d79b542abc71d8d5f71504aaa67d7d2da5 · NOAA-GFDL/FRE-NCtools

Here is my test grid using FRE-NCtools. You should be able to use your own bathymetry/topography instead of the GEBCO subset.
Bash:
# Make a grid similar to Example 3 using FRE-NCtools
# instead of gridtools for comparison.
# Still need to use gridtools to create the
# subsetted GEBCO grid for creating ocean_topog.nc

make_hgrid --grid_type regular_lonlat_grid\
       --nxbnds 2 --nybnds 2 --xbnds -140,-120 --ybnds 25,55\
       --nlon 40 --nlat 60

# Ocean and Atmosphere are on the same grid, copy them
cp horizontal_grid.nc ocean_hgrid.nc
cp horizontal_grid.nc atmos_hgrid.nc

# Create solo mosaic files
make_solo_mosaic --num_tiles 1 --dir ./ --mosaic_name ocean_mosaic --tile_file ocean_hgrid.nc
make_solo_mosaic --num_tiles 1 --dir ./ --mosaic_name atmos_mosaic --tile_file atmos_hgrid.nc

# A vertical grid needs to exist to run make_topog
# This is an arbitrary vertical grid taken from another example.  The
# selection of bounds here do not necessarily make sense for this domain!
make_vgrid \
        --nbnds 3 \
        --bnds 0.,220.,5500. \
        --dbnds 10.,10.,367.14286 \
        --center c_cell \
        --grid_name ocean_vgrid

# Use the ocean_mosaic to create a topography
#mpirun -np 4 --oversubscribe make_topog_parallel\
make_topog\
    --verbose \
    --mosaic ocean_mosaic.nc --topog_type realistic \
    --scale_factor -1 \
    --vgrid ocean_vgrid.nc \
        --output ocean_topog.nc \
    --topog_file /home/cermak/workdir/bathy/gebco/GEBCO_Ex3_subset.nc \
    --topog_field elevation

# Create exchange files with ocean_mask.nc and land_mask.nc

# This might be run within a new INPUT directory as it copies files into that
# directory.
# make_quick_mosaic --input_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc

# make_coupler_mosaic
# make_coupler_mosaic --atmos_mosaic atmos_mosaic.nc --ocean_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc

Code:
netcdf ocean_mask_quick {
dimensions:
    nx = 20 ;
    ny = 30 ;
variables:
    double mask(ny, nx) ;
        mask:standard_name = "ocean fraction at T-cell centers" ;
        mask:units = "none" ;

// global attributes:
        :grid_version = "0.2" ;
        :code_version = "$Name:  $" ;
        :history = "make_quick_mosaic --input_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc" ;
data:

 mask =
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ;
}

Code:
netcdf ocean_mask_coupler {
dimensions:
    nx = 20 ;
    ny = 30 ;
variables:
    double mask(ny, nx) ;
        mask:standard_name = "ocean fraction at T-cell centers" ;
        mask:units = "none" ;
    double areaO(ny, nx) ;
        areaO:standard_name = "ocean grid area" ;
        areaO:units = "none" ;
    double areaX(ny, nx) ;
        areaX:standard_name = "ocean exchange grid area" ;
        areaX:units = "none" ;

// global attributes:
        :grid_version = "0.2" ;
        :code_version = "$Name: fre-nctools-bronx-10 $" ;
        :history = "make_coupler_mosaic --atmos_mosaic atmos_mosaic.nc --ocean_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc" ;
data:

 mask =
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 1, 1, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ;

 areaO =
  11159704157.3006, 11159704157.3009, 11159704157.3006, 11159704157.3006,
    11159704157.3009, 11159704157.3006, 11159704157.3009, 11159704157.3006,
 

Jiande

Jiande Wang
New Member
but I found topo file can be generated without vgrid file, this is what I did
make_topog --mosaic ocean_mosaic.nc --topog_file OCCAM_p5degree.nc --topog_field TOPO --scale_factor -1 --output ocean_topog.nc --filter_topog
 

cermak

Rob Cermak
Member
Yes, I have seen make_topog work without a vgrid file.

Using GEBCO, I run into similar problems as seen in Does make_topog need MAXXGRID, nthreads? · Issue #35 · NOAA-GFDL/FRE-NCtools. No matter what value I provide for MAXXGRID or the number of processors or machine size, make_topog does not work. It works with no changes if I provide a vgrid file. For our purposes, we can ignore the auxiliary information that is generated with respect to the vgrid file. We just need the diagnosed topography file at this point for comparison.

So, using OCCAM_p5degree.nc with the example grid, does the ocean_mask behave in both programs? Or do you still see round off error?
 

Jiande

Jiande Wang
New Member
with OCCAM_p5degree.nc, If I use quick_mosic, then mask file will be 0 or 1, but with coupled_mosaic, I saw round off error.
what I am doing is generate a very coarse resolution (C48 atmos. with 4x4 degree ocean) coupled fixed files, can you repeat what I did ?
I put OCCAM_p5degree.nc and atmos. C48 tiled files at https://www.emc.ncep.noaa.gov/gc_wmb/wd20xw/JD/input.tar.gz for you to download.
for hgrid, this is what I did:
/make_hgrid --grid_type tripolar_grid --nxbnd 2 --nybnd 2 --xbnd -280,80 --ybnd -85,90 --nlon 144 --nlat 70 --grid_name ocean_hgrid --center c_cell
 

cermak

Rob Cermak
Member
This is not making use of the C48_grid.tile*.nc files or the C48_mosaic.nc that was in the tar file.

This command only results in a single tile:

Bash:
make_hgrid --grid_type tripolar_grid --nxbnd 2 --nybnd 2 --xbnd -280,80 --ybnd -85,90 --nlon 144 --nlat 70 --grid_name ocean_hgrid --center c_cell

Here are my steps so far:

Bash:
make_hgrid --grid_type tripolar_grid --nxbnd 2 --nybnd 2 --xbnd -280,80 --ybnd -85,90 --nlon 144 --nlat 70 --grid_name ocean_hgrid --center c_cell

cp ocean_hgrid.nc atmos_hgrid.nc

make_solo_mosaic --num_tiles 1 --dir ./ --mosaic_name ocean_mosaic --tile_file ocean_hgrid.nc
make_solo_mosaic --num_tiles 1 --dir ./ --mosaic_name atmos_mosaic --tile_file atmos_hgrid.nc

make_topog --mosaic ocean_mosaic.nc --topog_file OCCAM_p5degree.nc --topog_field TOPO --scale_factor -1 --output ocean_topog.nc --filter_topog

make_quick_mosaic --input_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc

mv ocean_mask.nc ocean_mask_quick.nc

make_coupler_mosaic --atmos_mosaic atmos_mosaic.nc --ocean_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc

mv ocean_mask.nc ocean_mask_coupler.nc

Code:
netcdf ocean_mask_quick {
dimensions:
        nx = 72 ;
        ny = 35 ;
variables:
        double mask(ny, nx) ;
                mask:standard_name = "ocean fraction at T-cell centers" ;
                mask:units = "none" ;

// global attributes:
                :grid_version = "0.2" ;
                :code_version = "$Name:  $" ;
                :history = "make_quick_mosaic --input_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc" ;
data:

 mask =
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,

Code:
netcdf ocean_mask_coupler {
dimensions:
        nx = 72 ;
        ny = 35 ;
variables:
        double mask(ny, nx) ;
                mask:standard_name = "ocean fraction at T-cell centers" ;
                mask:units = "none" ;
        double areaO(ny, nx) ;
                areaO:standard_name = "ocean grid area" ;
                areaO:units = "none" ;
        double areaX(ny, nx) ;
                areaX:standard_name = "ocean exchange grid area" ;
                areaX:units = "none" ;

// global attributes:
                :grid_version = "0.2" ;
                :code_version = "$Name: fre-nctools-bronx-10 $" ;
                :history = "make_coupler_mosaic --atmos_mosaic atmos_mosaic.nc --ocean_mosaic ocean_mosaic.nc --ocean_topog ocean_topog.nc" ;
data:

 mask =
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 

Jiande

Jiande Wang
New Member
but for me the final purpose is to use that in coupled run so in coupled_masaic step I did
make_coupler_mosaic --atmos_mosaic C48_mosaic.nc --ocean_mosaic ocean_mosaic.nc --mosaic_name mosaic --ocean_topog ocean_topog.nc --mosaic_name grid_spec

so from what you did, the mask round off will not happen if use atmos. hgrid as the same as ocean
 

cermak

Rob Cermak
Member
So, I think that is our answer. The C48 grid for the atmosphere is not exactly the same as the ocean_hgrid. I think you are probably safe to proceed with the ocean_mask.nc originally generated using the C48 grid.

I see what you see when I use the C48 grid for the atmospheric mosaic.
Code:
netcdf ocean_mask_coupler {
dimensions:
        nx = 72 ;
        ny = 35 ;
variables:
        double mask(ny, nx) ;
                mask:standard_name = "ocean fraction at T-cell centers" ;
                mask:units = "none" ;
        double areaO(ny, nx) ;
                areaO:standard_name = "ocean grid area" ;
                areaO:units = "none" ;
        double areaX(ny, nx) ;
                areaX:standard_name = "ocean exchange grid area" ;
                areaX:units = "none" ;

// global attributes:
                :grid_version = "0.2" ;
                :code_version = "$Name: fre-nctools-bronx-10 $" ;
                :history = "make_coupler_mosaic --atmos_mosaic C48_mosaic.nc --ocean_mosaic ocean_mosaic.nc --mosaic_name mosaic --ocean_topog ocean_topog.nc --mosaic_name grid_spec" ;
data:

 mask =
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.00000000000002,
    0.999999999999996, 1.00000000000008, 0.999999999999885,
    0.999999999999917, 1.00000000000017, 0.999999999999883, 1.00000000000012,
    0.999999999999924, 0.999999999999904, 0.999999999999901, 1.0000000000001,
 

praveenvk

Praveen
New Member
I was going through above steps and trying to reproduce the files.

Noticed that the make_topog and the remaining steps gives HALF the resolution of input ocean_hgrid file
Is there any specific reason for that? the topog file looks too coarse.
 

praveenvk

Praveen
New Member
I was going through above steps and trying to reproduce the files.

Noticed that the make_topog and the remaining steps gives HALF the resolution of input ocean_hgrid file
Is there any specific reason for that? the topog file looks too coarse.
Ohh Yeah got it. Its the default refinement factor =2
 

sajidh

Sajidh C K
New Member
Yes, I have seen make_topog work without a vgrid file.

Using GEBCO, I run into similar problems as seen in Does make_topog need MAXXGRID, nthreads? · Issue #35 · NOAA-GFDL/FRE-NCtools. No matter what value I provide for MAXXGRID or the number of processors or machine size, make_topog does not work. It works with no changes if I provide a vgrid file. For our purposes, we can ignore the auxiliary information that is generated with respect to the vgrid file. We just need the diagnosed topography file at this point for comparison.

So, using OCCAM_p5degree.nc with the example grid, does the ocean_mask behave in both programs? Or do you still see round off error?
Dear sir,
I have been trying to use the FRE-NCtools to create grids and i am facing issues while using bathymetric files of higher resolution other that OCCAM_p5degree.nc to create topography, is there any workaround for this.
 

praveenvk

Praveen
New Member
I followed the following page and solved my problem.

You have to recompile the FRE-NCtools by modifying the values for MAXXGRID to a higher value in FRE-NCtools/tools/libfrencutils/create_xgrid.h file.
May be as @cermak suggested, use ocean_vgrid.nc while creating ocean_topog.nc file may also solve the problem.

Cheers
 

sajidh

Sajidh C K
New Member
I followed the following page and solved my problem.

You have to recompile the FRE-NCtools by modifying the values for MAXXGRID to a higher value in FRE-NCtools/tools/libfrencutils/create_xgrid.h file.
May be as @cermak suggested, use ocean_vgrid.nc while creating ocean_topog.nc file may also solve the problem.

Cheers
Yes, I had tried the same. but i am getting segmentation fault (core dumped), please note that i am working on my laptop. Anyhelp regarding this is greatly appreciated.
Regards
 

sajidh

Sajidh C K
New Member
I followed the following page and solved my problem.

You have to recompile the FRE-NCtools by modifying the values for MAXXGRID to a higher value in FRE-NCtools/tools/libfrencutils/create_xgrid.h file.
May be as @cermak suggested, use ocean_vgrid.nc while creating ocean_topog.nc file may also solve the problem.

Cheers
Thank you, i bumped the MAXXGRID to 1e8 and now it's working. earlier i put 1e10 and that was causing the segmentation fault.
 

sajidh

Sajidh C K
New Member
Note that MOM6 proper does not actually read the mask file. It figures out the mask based on ocean_topog.nc and MASKING_DEPTH. Still, other components might read it.
Could you please provide some clarification on this?. It might sound trivial but i have few doubts.
1) So if i needed to mask out regions, should i make edits in the topography file as well as mask file?.
2) Would i need to change anything in the mosaic grids once the masking is done.

Regards
 
Top