Ocean File, surfzone, sea salt

How do I create an OCEAN file for my CMAQ simulation?

The CMAQ OCEAN file is used by the CCTM to define surfzone and open ocean grid cells in the calculation of sea salt emissions. The file contains two variables: OPEN, and SURF. The OPEN variable defines open ocean cells. It represents the fraction of an ocean grid cell’s area that is further than 50 m from the shoreline. The SURF variable defines surf zone cells. It represents the fraction of an ocean grid cell’s area that is within 50m of the shore, not including bays and inlets.

The Spatial Allocator can be used to generate an OCEAN file. The alloc_surf_zone_to_oceanfile script in the Spatial Allocator distribution is an example of how to create an OCEAN file using the allocate mode of the software. The inputs to the script are an I/O API grid description file and a Shapefile that defines the surf zone. The Shapefile contains an integer attribute called Type. Type 2 = land and Type 3 = surfzone. The Surrogate Tool converts this Shapefile to a netCDF OCEAN file on the modeling grid defined in the grid description file. There is a surf zone Shapefile for North America packaged with the Spatial Allocator (see the Download Sample Data table in the Spatial Allocator 3.6 downloads area under the CMAS Center software clearinghouse).

The biggest issue for generating an OCEAN file outside of North America is the surf zone Shapefile. This file needs to be created for each new region of the world where CMAQ is being applied. There is no standarized process for creating this Shapefile. Basically you have to mask the locations in the Shapefile within 50m of the land boundary as the surfzone by assigning the attribute Type = 3 to these areas on the map. See the North American Shapfile as an example.

1 Like

Following instructions above, I am using the Spatial-Allocator/scripts/alloc_surf_zone_to_oceanfile.csh script with surfzone_poly_st.* set of input files to generate an OCEAN file for the 36US3 domain, but the batch script seems to be stuck after the standard output below:

limit stacksize unlimited
source /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/bin/sa_setup.csh
setenv SA_HOME /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator
setenv PROJDIR /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/src/libs/proj-4.9.3/local
setenv PROJ_LIB /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/src/libs/proj-4.9.3/local/share/proj
setenv PROJ_LIBRARY /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/src/libs/proj-4.9.3/local/lib
setenv PROJ_INCLUDE /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/src/libs/proj-4.9.3/local/include
LD_LIBRARY_PATH: Undefined variable.
setenv DEBUG_OUTPUT Y
setenv EXE /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/bin/64bits/allocator.exe
setenv DATADIR /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/data
setenv OUTPUT /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/output
setenv MIMS_PROCESSING ALLOCATE
setenv TIME time
setenv GRIDDESC /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/data/GRIDDESC
setenv INPUT_FILE_NAME /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/data/surfzone_poly_st/surfzone_poly_st
setenv INPUT_FILE_TYPE ShapeFile
setenv INPUT_FILE_MAP_PRJN +proj=lcc,+lat_1=33,+lat_2=45,+lat_0=40,+lon_0=-97
setenv INPUT_FILE_ELLIPSOID +a=6370000.0,+b=6370000.0
setenv ALLOCATE_ATTRS TYPE
setenv ALLOC_MODE_FILE ALL_AREAPERCENT
setenv ALLOC_ATTR_TYPE SURF_ZONE
setenv OUTPUT_FILE_TYPE IoapiFile
setenv OUTPUT_GRID_NAME 36US3
setenv OUTPUT_FILE_MAP_PRJN +proj=lcc,+lat_1=33,+lat_2=45,+lat_0=40,+lon_0=-97
setenv OUTPUT_FILE_ELLIPSOID +a=6370000.0,+b=6370000.0
setenv OUTPUT_FILE_NAME /proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/output/ocean_file_myUS36k.ncf
/proj/MYLIB_PROJ/spatial_allocator_18jan2020/Spatial-Allocator/bin/64bits/allocator.exe
WARNING: Environment variable: MAX_INPUT_FILE_SHAPES, not set
WARNING: Environment variable: OVERLAY_TYPE, not set
WARNING: Environment variable: MAX_LINE_SEG, not set
WARNING: Environment variable: MAX_LINE_SEG, not set

This happened for both 32bit and 64bit allocator.exe - what could possibly cause this?

It may be that the spatial allocator run takes a very long time. Did you verify that it was running and using using %CPU and %MEM using the top command (assuming you are running interactively), or the qstat -u username command if submitted to the queue.

top

Sorry I didn’t update this post - actually it took a very long time without any response and then gave the output files all of a sudden. Thanks @lizadams !

1 Like