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

FMS version 1 data type errors; no land points #22

Open
jr3cermak opened this issue May 11, 2022 · 5 comments
Open

FMS version 1 data type errors; no land points #22

jr3cermak opened this issue May 11, 2022 · 5 comments
Assignees
Labels
inwork should appear in a release soon

Comments

@jr3cermak
Copy link
Collaborator

gridtools rel 0.3.3 does not work for building a small test problem for FMS version 1.0. Currently debugging proper data types for ocean_hgrid, mosaic and exchange grid files.

@jr3cermak jr3cermak self-assigned this May 11, 2022
@jr3cermak jr3cermak changed the title FMS version 1 data type errors FMS version 1 data type errors; no land points May 11, 2022
@jr3cermak
Copy link
Collaborator Author

Gridtools will create all three exchange files by default:

$ ncdump mosaic.nc 
netcdf mosaic {
dimensions:
	string = 255 ;
	nfile_aXo = 1 ;
	nfile_aXl = 1 ;
	nfile_lXo = 1 ;
variables:
	char atm_mosaic_dir(string) ;
		atm_mosaic_dir:standard_name = "directory_storing_atmosphere_mosaic" ;
	char atm_mosaic_file(string) ;
		atm_mosaic_file:standard_name = "atmosphere_mosaic_file_name" ;
	char atm_mosaic(string) ;
		atm_mosaic:standard_name = "atmosphere_mosaic_name" ;
	char lnd_mosaic_dir(string) ;
		lnd_mosaic_dir:standard_name = "directory_storing_land_mosaic" ;
	char lnd_mosaic_file(string) ;
		lnd_mosaic_file:standard_name = "land_mosaic_file_name" ;
	char lnd_mosaic(string) ;
		lnd_mosaic:standard_name = "land_mosaic_name" ;
	char ocn_mosaic_dir(string) ;
		ocn_mosaic_dir:standard_name = "directory_storing_ocean_mosaic" ;
	char ocn_mosaic_file(string) ;
		ocn_mosaic_file:standard_name = "ocean_mosaic_file_name" ;
	char ocn_mosaic(string) ;
		ocn_mosaic:standard_name = "ocean_mosaic_name" ;
	char ocn_topog_dir(string) ;
		ocn_topog_dir:standard_name = "directory_storing_ocean_topog" ;
	char ocn_topog_file(string) ;
		ocn_topog_file:standard_name = "ocean_topog_file_name" ;
	char aXo_file(nfile_aXo, string) ;
		aXo_file:standard_name = "atmXocn_exchange_grid_file" ;
	char aXl_file(nfile_aXl, string) ;
		aXl_file:standard_name = "atmXlnd_exchange_grid_file" ;
	char lXo_file(nfile_lXo, string) ;
		lXo_file:standard_name = "lndXocn_exchange_grid_file" ;

// global attributes:
		:grid_version = "0.2" ;
		:code_version = "ESMG/gridtools: 0.3.2+e933cc5" ;
		:history = "2022-05-11: gridtools.grid.mom6.convert_ROMS_to_MOM6 + kwargs" ;
data:

 atm_mosaic_dir = "./" ;

 atm_mosaic_file = "ocean_mosaic.nc" ;

 atm_mosaic = "atmos_mosaic" ;

 lnd_mosaic_dir = "./" ;

 lnd_mosaic_file = "ocean_mosaic.nc" ;

 lnd_mosaic = "land_mosaic" ;

 ocn_mosaic_dir = "./" ;

 ocn_mosaic_file = "ocean_mosaic.nc" ;

 ocn_mosaic = "ocean_mosaic" ;

 ocn_topog_dir = "./" ;

 ocn_topog_file = "ocean_topog.nc" ;

 aXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;

 aXl_file =
  "atmos_mosaic_tile1Xland_mosaic_tile1.nc" ;

 lXo_file =
  "land_mosaic_tile1Xocean_mosaic_tile1.nc" ;
}

If there are no land points, gridtools should not create these exchange files.

FRE-ncTools:

$ ncdump mosaic.nc 
netcdf mosaic {
dimensions:
	string = 255 ;
	nfile_aXo = 1 ;
	nfile_lXo = 1 ;
variables:
	char atm_mosaic_dir(string) ;
		atm_mosaic_dir:standard_name = "directory_storing_atmosphere_mosaic" ;
	char atm_mosaic_file(string) ;
		atm_mosaic_file:standard_name = "atmosphere_mosaic_file_name" ;
	char atm_mosaic(string) ;
		atm_mosaic:standard_name = "atmosphere_mosaic_name" ;
	char lnd_mosaic_dir(string) ;
		lnd_mosaic_dir:standard_name = "directory_storing_land_mosaic" ;
	char lnd_mosaic_file(string) ;
		lnd_mosaic_file:standard_name = "land_mosaic_file_name" ;
	char lnd_mosaic(string) ;
		lnd_mosaic:standard_name = "land_mosaic_name" ;
	char ocn_mosaic_dir(string) ;
		ocn_mosaic_dir:standard_name = "directory_storing_ocean_mosaic" ;
	char ocn_mosaic_file(string) ;
		ocn_mosaic_file:standard_name = "ocean_mosaic_file_name" ;
	char ocn_mosaic(string) ;
		ocn_mosaic:standard_name = "ocean_mosaic_name" ;
	char ocn_topog_dir(string) ;
		ocn_topog_dir:standard_name = "directory_storing_ocean_topog" ;
	char ocn_topog_file(string) ;
		ocn_topog_file:standard_name = "ocean_topog_file_name" ;
	char aXo_file(nfile_aXo, string) ;
		aXo_file:standard_name = "atmXocn_exchange_grid_file" ;
	char lXo_file(nfile_lXo, string) ;
		lXo_file:standard_name = "lndXocn_exchange_grid_file" ;

// 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:

 atm_mosaic_dir = "./" ;

 atm_mosaic_file = "atmos_mosaic.nc" ;

 atm_mosaic = "atmos_mosaic" ;

 lnd_mosaic_dir = "./" ;

 lnd_mosaic_file = "atmos_mosaic.nc" ;

 lnd_mosaic = "atmos_mosaic" ;

 ocn_mosaic_dir = "./" ;

 ocn_mosaic_file = "ocean_mosaic.nc" ;

 ocn_mosaic = "ocean_mosaic" ;

 ocn_topog_dir = "./" ;

 ocn_topog_file = "ocean_topog.nc" ;

 aXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;

 lXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;
}

@jr3cermak
Copy link
Collaborator Author

Fix handling of tile variable so it is NC_CHAR type instead of string.

$ ncdump -h ocean_hgrid_t.nc 
netcdf ocean_hgrid_t {
dimensions:
	nyp = 9 ;
	nxp = 9 ;
	string = 5 ;
	nx = 8 ;
	ny = 8 ;

	char tile(string) ;

data:

 tile = "tile1" ;
}

@jr3cermak
Copy link
Collaborator Author

With land points:

$ ncdump mosaic.nc 
netcdf mosaic {
dimensions:
	string = 255 ;
	nfile_aXo = 1 ;
	nfile_aXl = 1 ;
	nfile_lXo = 1 ;
variables:
	char atm_mosaic_dir(string) ;
		atm_mosaic_dir:standard_name = "directory_storing_atmosphere_mosaic" ;
	char atm_mosaic_file(string) ;
		atm_mosaic_file:standard_name = "atmosphere_mosaic_file_name" ;
	char atm_mosaic(string) ;
		atm_mosaic:standard_name = "atmosphere_mosaic_name" ;
	char lnd_mosaic_dir(string) ;
		lnd_mosaic_dir:standard_name = "directory_storing_land_mosaic" ;
	char lnd_mosaic_file(string) ;
		lnd_mosaic_file:standard_name = "land_mosaic_file_name" ;
	char lnd_mosaic(string) ;
		lnd_mosaic:standard_name = "land_mosaic_name" ;
	char ocn_mosaic_dir(string) ;
		ocn_mosaic_dir:standard_name = "directory_storing_ocean_mosaic" ;
	char ocn_mosaic_file(string) ;
		ocn_mosaic_file:standard_name = "ocean_mosaic_file_name" ;
	char ocn_mosaic(string) ;
		ocn_mosaic:standard_name = "ocean_mosaic_name" ;
	char ocn_topog_dir(string) ;
		ocn_topog_dir:standard_name = "directory_storing_ocean_topog" ;
	char ocn_topog_file(string) ;
		ocn_topog_file:standard_name = "ocean_topog_file_name" ;
	char aXo_file(nfile_aXo, string) ;
		aXo_file:standard_name = "atmXocn_exchange_grid_file" ;
	char aXl_file(nfile_aXl, string) ;
		aXl_file:standard_name = "atmXlnd_exchange_grid_file" ;
	char lXo_file(nfile_lXo, string) ;
		lXo_file:standard_name = "lndXocn_exchange_grid_file" ;

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

 atm_mosaic_dir = "./" ;

 atm_mosaic_file = "atmos_mosaic.nc" ;

 atm_mosaic = "atmos_mosaic" ;

 lnd_mosaic_dir = "./" ;

 lnd_mosaic_file = "land_mosaic.nc" ;

 lnd_mosaic = "land_mosaic" ;

 ocn_mosaic_dir = "./" ;

 ocn_mosaic_file = "ocean_mosaic.nc" ;

 ocn_mosaic = "ocean_mosaic" ;

 ocn_topog_dir = "./" ;

 ocn_topog_file = "ocean_topog.nc" ;

 aXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;

 aXl_file =
  "atmos_mosaic_tile1Xland_mosaic_tile1.nc" ;

 lXo_file =
  "land_mosaic_tile1Xocean_mosaic_tile1.nc" ;
}

There are two possible modes of operation. If it is known that no land points exist, we can exclude the --land_mosaic option and get a second possible solution.

Without land points:

$ ncdump mosaic.nc 
netcdf mosaic {
dimensions:
	string = 255 ;
	nfile_aXo = 1 ;
	nfile_lXo = 1 ;
variables:
	char atm_mosaic_dir(string) ;
		atm_mosaic_dir:standard_name = "directory_storing_atmosphere_mosaic" ;
	char atm_mosaic_file(string) ;
		atm_mosaic_file:standard_name = "atmosphere_mosaic_file_name" ;
	char atm_mosaic(string) ;
		atm_mosaic:standard_name = "atmosphere_mosaic_name" ;
	char lnd_mosaic_dir(string) ;
		lnd_mosaic_dir:standard_name = "directory_storing_land_mosaic" ;
	char lnd_mosaic_file(string) ;
		lnd_mosaic_file:standard_name = "land_mosaic_file_name" ;
	char lnd_mosaic(string) ;
		lnd_mosaic:standard_name = "land_mosaic_name" ;
	char ocn_mosaic_dir(string) ;
		ocn_mosaic_dir:standard_name = "directory_storing_ocean_mosaic" ;
	char ocn_mosaic_file(string) ;
		ocn_mosaic_file:standard_name = "ocean_mosaic_file_name" ;
	char ocn_mosaic(string) ;
		ocn_mosaic:standard_name = "ocean_mosaic_name" ;
	char ocn_topog_dir(string) ;
		ocn_topog_dir:standard_name = "directory_storing_ocean_topog" ;
	char ocn_topog_file(string) ;
		ocn_topog_file:standard_name = "ocean_topog_file_name" ;
	char aXo_file(nfile_aXo, string) ;
		aXo_file:standard_name = "atmXocn_exchange_grid_file" ;
	char lXo_file(nfile_lXo, string) ;
		lXo_file:standard_name = "lndXocn_exchange_grid_file" ;

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

 atm_mosaic_dir = "./" ;

 atm_mosaic_file = "atmos_mosaic.nc" ;

 atm_mosaic = "atmos_mosaic" ;

 lnd_mosaic_dir = "./" ;

 lnd_mosaic_file = "land_mosaic.nc" ;

 lnd_mosaic = "land_mosaic" ;

 ocn_mosaic_dir = "./" ;

 ocn_mosaic_file = "ocean_mosaic.nc" ;

 ocn_mosaic = "ocean_mosaic" ;

 ocn_topog_dir = "./" ;

 ocn_topog_file = "ocean_topog.nc" ;

 aXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;

 lXo_file =
  "land_mosaic_tile1Xocean_mosaic_tile1.nc" ;
}

If it is known that no land points exist:

$ ncdump mosaic.nc 
netcdf mosaic {
dimensions:
	string = 255 ;
	nfile_aXo = 1 ;
	nfile_lXo = 1 ;
variables:
	char atm_mosaic_dir(string) ;
		atm_mosaic_dir:standard_name = "directory_storing_atmosphere_mosaic" ;
	char atm_mosaic_file(string) ;
		atm_mosaic_file:standard_name = "atmosphere_mosaic_file_name" ;
	char atm_mosaic(string) ;
		atm_mosaic:standard_name = "atmosphere_mosaic_name" ;
	char lnd_mosaic_dir(string) ;
		lnd_mosaic_dir:standard_name = "directory_storing_land_mosaic" ;
	char lnd_mosaic_file(string) ;
		lnd_mosaic_file:standard_name = "land_mosaic_file_name" ;
	char lnd_mosaic(string) ;
		lnd_mosaic:standard_name = "land_mosaic_name" ;
	char ocn_mosaic_dir(string) ;
		ocn_mosaic_dir:standard_name = "directory_storing_ocean_mosaic" ;
	char ocn_mosaic_file(string) ;
		ocn_mosaic_file:standard_name = "ocean_mosaic_file_name" ;
	char ocn_mosaic(string) ;
		ocn_mosaic:standard_name = "ocean_mosaic_name" ;
	char ocn_topog_dir(string) ;
		ocn_topog_dir:standard_name = "directory_storing_ocean_topog" ;
	char ocn_topog_file(string) ;
		ocn_topog_file:standard_name = "ocean_topog_file_name" ;
	char aXo_file(nfile_aXo, string) ;
		aXo_file:standard_name = "atmXocn_exchange_grid_file" ;
	char lXo_file(nfile_lXo, string) ;
		lXo_file:standard_name = "lndXocn_exchange_grid_file" ;

// 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:

 atm_mosaic_dir = "./" ;

 atm_mosaic_file = "atmos_mosaic.nc" ;

 atm_mosaic = "atmos_mosaic" ;

 lnd_mosaic_dir = "./" ;

 lnd_mosaic_file = "atmos_mosaic.nc" ;

 lnd_mosaic = "atmos_mosaic" ;

 ocn_mosaic_dir = "./" ;

 ocn_mosaic_file = "ocean_mosaic.nc" ;

 ocn_mosaic = "ocean_mosaic" ;

 ocn_topog_dir = "./" ;

 ocn_topog_file = "ocean_topog.nc" ;

 aXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;

 lXo_file =
  "atmos_mosaic_tile1Xocean_mosaic_tile1.nc" ;
}

@jr3cermak jr3cermak added the inwork should appear in a release soon label May 11, 2022
@jr3cermak
Copy link
Collaborator Author

jr3cermak commented May 11, 2022

  • Write test (expected failure) for regular grid with land but specify no land mosaic
  • Write test for regular grid with land points
  • Write test for regular grid without land points
  • Write test for specifying a grid that does not have land points

@jr3cermak
Copy link
Collaborator Author

Small toy grid problem proceeding further with fixes to the exp/rel033 branch.

jr3cermak added a commit that referenced this issue May 12, 2022
 - add tests to ensure issue #22 stays resolved
 - when no land points are in the ocean grid, skip writing atmos/land exchange file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inwork should appear in a release soon
Projects
None yet
Development

No branches or pull requests

1 participant