Skip to content

Loading/Units: Read units from land-sea mask file and adjust

Currently, the Loading module assumes that the land-sea mask file has the following characteristics:

  • 'sftof' as the variable name
  • Corresponds to the Sea area fraction, with 0 being all-land
  • Is in units of %, with a range of 100 to 0

However, there could be land-sea mask files where the variable corresponds to the land fraction, and/or the range is [0, 1].

Ideally, the modules/Loading/R/load_tas_tos.R script should be able to handle this by reading the units of the land-sea mask file and modifying the array if necessary.

Here is an example of the metadata for /esarchive/exp/meteofrance/system8c3s/constant/sftof/sftof.nc:

ncdump -h /esarchive/exp/meteofrance/system8c3s/constant/sftof/sftof.nc
netcdf sftof {
dimensions:
	lat = 180 ;
	lon = 360 ;
variables:
	double lat(lat) ;
		lat:standard_name = "latitude" ;
		lat:long_name = "latitude" ;
		lat:units = "degrees_north" ;
		lat:axis = "Y" ;
	double lon(lon) ;
		lon:standard_name = "longitude" ;
		lon:long_name = "longitude" ;
		lon:units = "degrees_east" ;
		lon:axis = "X" ;
	float sftof(lat, lon) ;
		sftof:code = 172 ;
		sftof:_FillValue = -9.e+33f ;
		sftof:missing_value = -9.e+33f ;
		sftof:cell_methods = "time: mean" ;
		sftof:long_name = "Sea Area Percentage" ;
		sftof:comment = "Percentage of horizontal area occupied by ocean." ;
		sftof:standard_name = "sea_area_fraction" ;
		sftof:units = "%" ;

And an example with different units:

/esarchive/exp/ukmo/glosea6_system602-c3s/constant/sftof> nord3_singu_es ncdump -h sftof.nc.backup
netcdf sftof.nc {
dimensions:
	number = 7 ;
	lat = 180 ;
	lon = 360 ;
variables:
	double sftof(lat, lon) ;
		sftof:_FillValue = -32767. ;
		sftof:long_name = "Land-sea mask" ;
		sftof:missing_value = -32767s ;
		sftof:standard_name = "land_binary_mask" ;
		sftof:units = "(0 - 1)" ;
	float lat(lat) ;
		lat:units = "degrees_north" ;
		lat:long_name = "latitude" ;
	float lon(lon) ;
		lon:units = "degrees_east" ;
		lon:long_name = "longitude" ;

Victòria