PCMDI / cmor

Climate Model Output Rewriter
BSD 3-Clause "New" or "Revised" License
51 stars 32 forks source link

Antarctic and Greenland grids #82

Closed martinjuckes closed 7 years ago

martinjuckes commented 8 years ago

The CMIP6 ISMIP6 request includes a request for some data on 2 polar stereographic grids, http://websrv.cs.umt.edu/isis/index.php/Present_Day_Greenland http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica

How would this be best represented in the tables? I could, for instance, create 2 new pairs of coordinates, "(Xgre,Ygre)" for Greenland and "(Xant, Yant)" for Antarctica? Are there particular attributes or directives that need to be used for polar stereographic grids?

dnadeau4 commented 8 years ago

CMOR already has this projections following the CF-1 convention. (ncdump -h at the bottom from a similar netcdf file.)

Do you have some data I could use? _After reading more about this, I would to write a polar_stereographic example._

The python script reads in the input data and creates a grid using the latitude and longitude coordinates as well as the latitude and longitude vertices(bounds).

Later, the following parameters(values) need to be passed to cmor.set_grid_mapping for "polar_stereographic" projection.


Example:

I found a "lambert conformal conic" projection example in the Test directory which could be enhanced for polar stereographic.

Lambert Conformal Conic example

....
myaxes[0] = cmor.axis(table_entry = 'y',
                      units = 'm',
                      coord_vals = y)
myaxes[1] = cmor.axis(table_entry = 'x',
                      units = 'm',
                      coord_vals = x)

grid_id = cmor.grid(axis_ids = myaxes[:2],
                    latitude = lat_coords,
                    longitude = lon_coords,
                    latitude_vertices = lat_vertices,
                    longitude_vertices = lon_vertices)
print 'got grid_id:',grid_id
myaxes[2] = grid_id

mapnm = 'lambert_conformal_conic'
params = [ "standard_parallel1",
           "longitude_of_central_meridian","latitude_of_projection_origin",
           "false_easting","false_northing","standard_parallel2" ]
punits = ["","","","","","" ]
pvalues = [-20.,175.,13.,8.,0.,20. ]
cmor.set_grid_mapping(grid_id=myaxes[2],
                      mapping_name = mapnm,
                      parameter_names = params,
                      parameter_values = pvalues,
                      parameter_units = punits)

cmor.set_table(tables[1])
myaxes[3] = cmor.axis(table_entry = 'time',
                      units = 'months since 1980')

pass_axes = [myaxes[3],myaxes[2]]
myvars[0] = cmor.variable( table_entry = 'hfls',
                           units = 'W m-2',
                           axis_ids = pass_axes,
                           positive = 'down',
                           original_name = 'HFLS',
                           history = 'no history',
                           comment = 'no future'
                           )
for i in range(ntimes):
    data2d = read_2d_input_files(i, varin2d[0], lat,lon)
    print 'writing time: ',i,Time[i],data2d.shape,data2d
    print Time[i],bnds_time[2*i:2*i+2]
    cmor.write(myvars[0],data2d,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2])
cmor.close()

ncdump -h hfls_Amon_piControl_NICAM_r1i1p1f1_gn_198001-198002.nc
netcdf hfls_Amon_piControl_NICAM_r1i1p1f1_gn_198001-198002 {
dimensions:
    time = UNLIMITED ; // (3 currently)
    y = 3 ;
    x = 4 ;
    bnds = 2 ;
    vertices = 4 ;
variables:
    double time(time) ;
        time:bounds = "time_bnds" ;
        time:units = "days since 1980" ;
        time:calendar = "360_day" ;
        time:axis = "T" ;
        time:long_name = "time" ;
        time:standard_name = "time" ;
    double time_bnds(time, bnds) ;
    double y(y) ;
        y:units = "m" ;
        y:axis = "Y" ;
        y:long_name = "y coordinate of projection" ;
        y:standard_name = "projection_y_coordinate" ;
    double x(x) ;
        x:units = "m" ;
        x:axis = "X" ;
        x:long_name = "x coordinate of projection" ;
        x:standard_name = "projection_x_coordinate" ;
    int lambert_conformal_conic ;
        lambert_conformal_conic:grid_mapping_name = "lambert_conformal_conic" ;
        lambert_conformal_conic:standard_parallel = -20., 20. ;
        lambert_conformal_conic:longitude_of_central_meridian = 175. ;
        lambert_conformal_conic:latitude_of_projection_origin = 13. ;
        lambert_conformal_conic:false_easting = 8. ;
        lambert_conformal_conic:false_northing = 0. ;
    float latitude(y, x) ;
        latitude:standard_name = "latitude" ;
        latitude:units = "degrees_north" ;
        latitude:bounds = "vertices_latitude" ;
    float longitude(y, x) ;
        longitude:standard_name = "longitude" ;
        longitude:units = "degrees_east" ;
        longitude:bounds = "vertices_longitude" ;
    float vertices_latitude(y, x, vertices) ;
        vertices_latitude:units = "degrees_north" ;
    float vertices_longitude(y, x, vertices) ;
        vertices_longitude:units = "degrees_east" ;
    float hfls(time, y, x) ;
        hfls:standard_name = "surface_upward_latent_heat_flux" ;
        hfls:long_name = "Surface Upward Latent Heat Flux" ;
        hfls:units = "W m-2" ;
        hfls:original_name = "HFLS" ;
        hfls:history = "no history 2016-07-19T23:41:38Z altered by CMOR: Changed sign. 2016-07-19T23:41:38Z altered by CMOR: Converted type from \'d\' to \'f\'." ;
        hfls:comment = "no future" ;
        hfls:cell_methods = "area: areacella" ;
        hfls:cell_measures = "time: mean" ;
        hfls:grid_mapping = "lambert_conformal_conic" ;
        hfls:coordinates = "latitude longitude" ;
...
martinjuckes commented 8 years ago

I've asked Sophie Nowicki (lead of ISMIP6, the source of this requirement) for a sample grid. The request will be for data on specified grid, so I would like to include at least the specified X and Y coordinates in the request tables and the corresponding CV. This would mean having a specific grid, e.g. "xgre" and "ygre" for Greenland, rather than using the generic "x" and "y". To specify all the latitude and longitude points of the grid in json would also be possible, but it might make more sense to do it in a NetCDF template file ... what do you think?

sophienowicki commented 8 years ago

Hello! here is an example of a time varying Greenland file for the field orog. https://www.dropbox.com/s/ugzw3ctjth14vab/orog_GIS_LGGE_ELMER2_asmb.nc?dl=0

Additional examples for Greenland and an example of Antarctica are available on the SeaRISE website, and I can dig out an more examples: Greenland: see netcdf "Greenland_5km_v1.1.nc " in http://websrv.cs.umt.edu/isis/index.php/Present_Day_Greenland

Antarctica: see netcdf " Antarctica_5km_dev1.0.nc" at bottom of http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica

Let me know if this helps, and no problems for ISMIP6 to use xgre and ygre if it makes your life easier. Many thanks, Sophie

sophienowicki commented 8 years ago

I should have added that the file orog_GIS_LGGE_ELMER2_asmb.nc is what the ice sheet models that are taking part of our first ISMIP6 experiment are providing, so if there are ways that we can improve upon our netcdf, please let us know!

Many thanks,

Sophie

dnadeau4 commented 8 years ago

Sophie,

To make the following output CMIP6 file even better for orog... Could you create the latitude_vertices and longitude_vertices (which are the lat/lon boundaries)?

If you look at my python program in dropbox I took the lat/lon/x/y coordinates from the _Greenland_5kmv1.1.nc file and the data from _orog_GIS_LGGE_ELMER2asmb.nc respectively.

I added the xgre and ygre axes in the CMIP6_grids.json file, (not in committed in github yet).

Please try to run the CMOR polar stereographic example. You can download it from my dropbox. I could not find your institution in the registered institution_id for CMIP6, so I used IPSL for now. A lot of the global attributes are being changed by Karl as I am writing this.... I set piControl-withism which seems to have changed in a more recent version of the control vocabulary file.


CMOR Warnings for 'orog'

Maybe I did not use the right table. I used the CMIP6_fx.json which is a fixed file (constant). It seems that the orog values are less than -700 and longitude have values less than 0.

python 
Tables ids: [0, 1]

C Traceback:
In function: cmor_grid
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Warning: it is recommended you pass the latitude bounds values when defining a grid
!
!!!!!!!!!!!!!!!!!!!!!!!!!

C Traceback:
In function: cmor_grid
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Warning: it is recommended you pass the longitude bounds values when defining a grid
!
!!!!!!!!!!!!!!!!!!!!!!!!!

got grid_id: -100

C Traceback:
In function: cmor_write_var_to_file
! called from: cmor_create_var_attributes
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Warning: Invalid value(s) detected for variable 'longitude' (table: grids): 167680 values were lower than minimum valid value (0). Minimum encountered bad value (-92.13) was at (axis: index/value): ygre: 560/-6e+05 xgre: 0/-8e+05
!
!!!!!!!!!!!!!!!!!!!!!!!!!

C Traceback:
In function: cmor_write_var_to_file
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Warning: Invalid value(s) detected for variable 'orog' (table: fx): 81805 values were lower than minimum valid value (-700). Minimum encountered bad value (-1e+06) was at (axis: index/value): ygre: 0/-3.4e+06 xgre: 0/-8e+05
!
!!!!!!!!!!!!!!!!!!!!!!!!!

Here is the ncdump -h

netcdf orog_fx_piControl-withism_IPSL_r1i1p1f1_gn {
dimensions:
    ygre = 561 ;
    xgre = 301 ;
    bnds = 2 ;
variables:
    double ygre(ygre) ;
        ygre:units = "m" ;
        ygre:axis = "Y" ;
        ygre:long_name = "y coordinate of projection" ;
        ygre:standard_name = "projection_y_coordinate" ;
    double xgre(xgre) ;
        xgre:units = "m" ;
        xgre:axis = "X" ;
        xgre:long_name = "x coordinate of projection" ;
        xgre:standard_name = "projection_x_coordinate" ;
    int polar_stereographic ;
        polar_stereographic:grid_mapping_name = "polar_stereographic" ;
        polar_stereographic:standard_parallel = 71. ;
        polar_stereographic:latitude_of_projection_origin = 90. ;
        polar_stereographic:false_easting = 0. ;
        polar_stereographic:false_northing = 0. ;
        polar_stereographic:straight_vertical_longitude_from_pole = -39. ;
        polar_stereographic:scale_factor_at_projection_origin = 1. ;
    float latitude(ygre, xgre) ;
        latitude:standard_name = "latitude" ;
        latitude:units = "degrees_north" ;
    float longitude(ygre, xgre) ;
        longitude:standard_name = "longitude" ;
        longitude:units = "degrees_east" ;
    float orog(ygre, xgre) ;
        orog:standard_name = "surface_altitude" ;
        orog:long_name = "Surface Altitude" ;
        orog:comment = "The surface called \'surface\' means the lower boundary of the atmosphere. Altitude is the (geometric) height above the geoid, which is the reference geopotential surface. The geoid is similar to mean sea level." ;
        orog:units = "m" ;
        orog:cell_methods = "area: areacella" ;
        orog:grid_mapping = "polar_stereographic" ;
        orog:coordinates = "latitude longitude" ;

// global attributes:
        :Conventions = "CF-1.6 CMIP-6.0" ;
        :activity_id = "ISMIP6" ;
        :additional_source_type = "AER CHEM BGM" ;
        :branch_method = "standard" ;
        :branch_time = 0. ;
        :comment = "asmb experiment for InitMIP" ;
        :contact = "Fabien Gillet-Chaulet (gillet-chaulet@lgge.obs.ujf-grenoble.fr)" ;
        :creation_date = "2016-07-20T22:59:09Z" ;
        :data_specs_version = "01.beta.30" ;
        :experiment = "preindustrial control with interactive ice sheet" ;
        :experiment_id = "piControl-withism" ;
        :forcing_index = 1 ;
        :frequency = "fx" ;
        :further_info_url = "http://furtherinfo.es-doc.org/CMIP6.IPSL.IPSL.piControl-withism.none.r1i1p1f1" ;
        :grid = "Polar Stereographic" ;
        :grid_label = "gn" ;
        :grid_resolution = "5 km" ;
        :history = "orog was conservatively regridded to a 5km grid using the \'cdo remapycon\' utility. More details on the remapycon utility can be found here: https://code.zmaw.de/projects/cdo or by typing \'cdo -h remapycon\' at the command prompt ; 2016-07-20T22:59:09Z CMOR rewrote data to be consistent with CF standards and CMIP6 requirements." ;
        :initialization_index = 1 ;
        :institution = "Institut Pierre Simon Laplace, Paris, France" ;
        :institution_id = "IPSL" ;
        :mip_era = "CMIP6" ;
        :physics_index = 1 ;
        :product = "output" ;
        :realization_index = 1 ;
        :realm = "ocean" ;
        :source = "IPSL:" ;
        :source_id = "IPSL" ;
        :source_type = "AOGCM ISM" ;
        :sub_experiment = "none" ;
        :sub_experiment_id = "none" ;
        :table_id = "fx" ;
        :table_info = "Creation Date:(05 July 2016) MD5:2690a11871ad52ac1519dfa6eb903c94" ;
        :title = "IPSL model output prepared for CMIP6" ;
        :tracking_id = "649fc5b7-b174-4050-a411-5d59df2bd279" ;
        :variable_id = "orog" ;
        :variant_label = "r1i1p1f1" ;
        :license = "CMIP6 model data produced by <Your CentreName> is licensed under a Creative Commons Attribution \'NonCommercial Share Alike\' 4.0 International License (http://creativecommons.org/licenses/by/4.0/). Use of the data should be acknowledged following guidelines found at <what URL???> The data is hosted via the Earth System Grid Federation. Permissions beyond the scope of this license may be available at http://pcmdi.org/cmip5/terms-of-use.   Individuals using this data should register at ??? to receive notice of selected categories of errata and updates. Further information about this data, including some limitations, can be found at ???. The data producers and data providers make no warranty, either express or implied, including but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law." ;
        :cmor_version = "3.1.2" ;
sophienowicki commented 8 years ago

Hi Denis,

Just to make sure that I understand properly what you want us to do, so that we do what you ask!

Matt will help me with this, I dont know how to invite him to the conversation but I send him the link, so he can see it. If he could be invited to the conversation, his email is matthew.a.beckley@nasa.gov.

I understand that you want us to alter the "orog*" file that we had send you to include latitude, longitude and latitude_vertices and longitude_vertices (ensuring that longitude are positive, so that CMOR does not complain). I assume that it also mean that we need to alter polar_stereographic:straight_vertical_longitude_from_pole = -39. ; to the positive equivalent. Unless you wanted us to alter only Greenland_5km_v1.1.nc? (Matt you can find it on the SeaRISE wiki)

Do you also want us to alter the x and y coordinates to be called xgre and ygre?

I am then not too sure what you want us to do when you write "Please try to run the CMOR polar stereographic example." We have never dealt with CMOR before...

Otherwise, we have looked at the file that you created and it is a little funny, but perhaps this is due to the complaints of -ve longitude

For the institution id, this is because the file was made by one of university participants, so indeed many ice sheet modelers are not yet in "institution id". How should I ask them to be added to the list? Or maybe it is simpler that we send someone a compiled list (otherwise you will be getting ~15-20 entries).

Many thanks and apologies for being confused...

Sophie

mattbeckley commented 8 years ago

Hi this is Matt,

I just looked at the test_python_polar_stereo.py code and it looks like you want us to run the code in order to test that it works. I can certainly do that, and I see that I can download the cmor python library from homebrew, and I'll poke around to get the cdms2 library.

dnadeau4 commented 8 years ago

Matthew,

You can easily create an anaconda environment in your user account. The installation section of cmor documentations should get you going.

http://cmor.llnl.gov/mydoc_cmor3_conda/

For the test you will need to download some tables

  1. Download
dnadeau4 commented 8 years ago

@mantbe @sophienowicki

I would like you to include the lat/lon vertices in your netdf files which is helpful for some applications. It gives the boundaries of each grid points.

I assume that it also mean that we need to alter polar_stereographic:straight_vertical_longitude_from_pole = -39. ; to the positive equivalent. Unless you wanted us to alter only Greenland_5km_v1.1.nc? (Matt you can find it on the SeaRISE wiki)

Actually CMOR likes to have it's longitude from 0-360. I don't know if that is possible with polar stereographic projection. If not, we can ignore the longitude <0 warnings that is displayed by CMOR.

Do you also want us to alter the x and y coordinates to be called xgre and ygre?

This was a request from @martinjuckes he wants to change x,y to xgre,ygre for greenland and xant, yant for Antarctica. It is not a CF-1 requirements. If you use CMOR to convert your file for ESGF publication, it will alter them automatically depending of your cmor_axis call.

I am then not too sure what you want us to do when you write "Please try to run the CMOR polar stereographic example." We have never dealt with CMOR before...

Do you want to publish your files for CMIP6 using ESGF? That is mainly what CMOR is for... NASA GSFC has a node at NCCS where I used to work. Laura Carriere could help @mantbe to publish your files there if this what you want.

Otherwise, we have looked at the file that you created and it is a little funny, but perhaps this is due to the complaints of -ve longitude

I have not changed the data, so I am a little bit perplex. I will try to take a look deeper using some softwares.

For the institution id, this is because the file was made by one of university participants, so indeed many ice sheet modelers are not yet in "institution id". How should I ask them to be added to the list? Or maybe it is simpler that we send someone a compiled list (otherwise you will be getting ~15-20 entries).

Send an request to: cmor@listserv.llnl.gov You will find all registered activities, experiments and institutions here: http://cmor.llnl.gov/mydoc_cmor3_CV/

Let me know if I can be of more help, I would like your files to be published in ESGF for CMIP6 if this is also your wish.

mattbeckley commented 8 years ago

Hi,

Is there an updated CMIP6_grids.json somewhere? I installed cmor successfully, and I copied over the files:

https://github.com/PCMDI/cmor/blob/master/TestTables/CMIP6_Omon.json and https://github.com/PCMDI/cmor/blob/master/TestTables/CMIP6_CV.json to the Tables dir.

But I am getting a warning and then a couple of errors.

When I get to the line: grid_table = cmor.load_table("CMIP6_grids.json")

I get the following warning:

! Warning: table: , This keyword: cf_version value (table: , This keyword: cf_version) is not a valid table header entry.! Use the user input JSON file to add custom attributes.

When I get to the line: myaxes[0] = cmor.axis(table_entry = 'ygre', units = 'm', coord_vals = y)

The program crashes with the error:

!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Error: Could not find all axes for this variable. ! Check that all your axes name matches the ones found in ! the table grids. ! ! !!!!!!!!!!!!!!!!!!!!!!!!!

C Traceback: ! In function: cmor_treat_axis_values ! called from: cmor_axis !

!!!!!!!!!!!!!!!!!!!!!!!!! ! ! Error: axis 0 (ygre, table: grids): cmor and user units are ! incompatible: and m ! !!!!!!!!!!!!!!!!!!!!!!!!!

However, I changed the variable names and attributes to match the json files, but I still get the error. Any help you could provide would be greatly appreciated.

Thanks for your time,

matt.

Below is a ncdump of the input netcdf if that helps.

netcdf orog_GIS_LGGE_ELMER2_asmb_V5 { dimensions: y = 561 ; x = 301 ; time = UNLIMITED ; // (21 currently) nv4 = 4 ; variables: double lon(y, x) ; lon:_CoordinateAxisType = "Lon" ; lon:bounds = "lon_bnds" ; lon:long_name = "longitude" ; lon:standard_name = "longitude" ; lon:units = "degrees_east" ; float orog(time, y, x) ; orog:_FillValue = -999999.f ; orog:grid_maxpping = "mapping" ; orog:missing_value = -999999. ; orog:standard_name = "surface_altitude" ; orog:units = "m" ; double time(time) ; time:axis = "T" ; time:standard_name = "time" ; double lon_bnds(y, x, nv4) ; double lat(y, x) ; lat:standard_name = "latitude" ; lat:long_name = "latitude" ; lat:units = "degrees_north" ; lat:_CoordinateAxisType = "Lat" ; lat:bounds = "lat_bnds" ; double lat_bnds(y, x, nv4) ; char mapping ; mapping:ellipsoid = "WGS84" ; mapping:false_easting = 0. ; mapping:false_northing = 0. ; mapping:grid_mapping_name = "polar_stereographic" ; mapping:latitude_of_projection_origin = 90. ; mapping:standard_parallel = 71. ; mapping:straight_vertical_longitude_from_pole = 321 ; float xgre(x) ; xgre:axis = "X" ; xgre:long_name = "X-coordinate in Cartesian system" ; xgre:standard_name = "projection_x_coordinate" ; xgre:units = "m" ; float ygre(y) ; ygre:axis = "Y" ; ygre:long_name = "Y-coordinate in Cartesian system" ; ygre:standard_name = "projection_y_coordinate" ; ygre:units = "m" ;

dnadeau4 commented 8 years ago

@mantbe this is great! You can find the cmip6_grids.json here: https://github.com/PCMDI/cmip6-cmor-tables/tree/master/Tables (I just merged a patch).

It seems that the cf_version 1.6 was some left over key:value from a previous version. CMOR is telling you that it found it, but does not know what to do with it, since I deleted that code. As for xgre and ygre, just cut/paste the "x": and "y": in the cmip6_grids.json and rename it. @martinjuckes gave me a new database version 01.beta.31, but it crashed my system last night.

mattbeckley commented 8 years ago

Thanks for the quick reply! that fixed the problem....sort of :) The code runs successfully (well, no errors, but two warnings). The problem is the output is doing something strange in that it is mixing the lat/lons and the X/Y values. I've attached a plot of how it plots in panoply. You can see that it seems to use the Y coordinates for the xaxis and longitudes for the Y axis.

Hopefully it is something I am doing, but in playing around, I haven't been able to get it gridded properly.

output

sophienowicki commented 8 years ago

Hi Denis,

Thanks for your answers! Below are some answers to your questions: yes the aim is that all ISMIP6 standalone model runs become stored as part the CMIP6 archive, so we will contact our participants and get them registered.

Many thanks for your all your help,

Sophie

dnadeau4 commented 8 years ago

In panoply if you click "Grid" and then "Swap B/T" in the Y Axis section, the pictures looks better. but the whole picture is not displayed in Y only. If you select Units: "Grid point index", you can see all Greenland. Not sure what to do about this.

dnadeau4 commented 8 years ago

@mantbe Can you provide me with your input file orog_GIS_LGGE_ELMER2_asmb_V5.nc? It has the lat_bound and lon_bounds, I could try to display the result in UVCDAT. It should do a better job than Panoply for projections. I also change the cmor_variable call in my program to pass the missing_value

data = f['orog'][0,:]
myvars[0] = cmor.variable( table_entry = te,
                           units = u,
                           axis_ids = pass_axes,
                           missing_value = data.missing,
                           history = '',
                           comment = ''
                           )
cmor.write(myvars[0], data)
cmor.close()
mattbeckley commented 8 years ago

Hi Denis,

Attached is my latest version of the orog file. It was fairly large, so it is on dropbox, but you can download it via the link below. It includes the lat_bounds and lon_bounds that are output from the cdo regridding process.

I was able to plot it in Panoply as you suggested, but it seems like there is something wrong with the way the code is assigning the axes. I plotted the data in matplotlib independently and it looks correct, so the code is reading in the data fine. It seems like either in the axes definition or the gridding step it is mixing lat/lons and polar stereographic coordinates?

And good to know about the "missing_value" keyword. To get around this, I set all bad values to 0 in the attached file.

Thanks for all your help!

matt.

https://www.dropbox.com/s/ry2jb0temqtw5bf/orog_GIS_LGGE_ELMER2_asmb_V6.nc?dl=0

dnadeau4 commented 8 years ago

With your know file I was able to create a nice picture using UVCDAT. It seems that for projection, the longitude needs to be from -180,180. The documentation says that polar_stereographic:straight_vertical_longitude_from_pole is from -180 to 180.

Here is the UVCDAT results. I got.

orog_fx_piControl-withism_IPSL_r1i1p1f1_gn.nc.pdf

sophienowicki commented 8 years ago

Yeah!!! thanks for not giving up on us!

If Matt prepares a file for antartica (with longitude from -180, 180) and lat_bound and lon_bound, would the current files/tables etc in CMOR work?

An example of the Antarctic grid would be: " Antarctica_5km_dev1.0.nc" at bottom of http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica

Thanks again,

Sophie

dnadeau4 commented 8 years ago

@sophienowicki it will work the same. I just found a problem with grids in CMOR, I will work on it this week and hopefully give you a new point release next week. It seems that the lat/lon/lat_vertices/lon_vertices are not saved. This is why the pdf does not have lat/lon axes.

dnadeau4 commented 8 years ago

@mantbe @sophienowicki I have a new netcdf file in my dropbox This time it seems that I got it right. Here is the latest pdf with lat/lon projection. orog_fx_piControl-withism_IPSL_r1i1p1f1_gn.pdf

mattbeckley commented 8 years ago

@dnadeau4 that's great! Thanks for looking into that, and glad it is working.

martinjuckes commented 8 years ago

Great to see these things getting sorted out -- I also plotted the file with ncview and it came out fine. I ran the CF checker on orog_fx_piControl-withism_IPSL_r1i1p1f1_gn.nc and picked up one trivial mistake: cell_methods: areacella is incorrect. cell_measures: areacella would be correct from a CF perspective ... but I think we want to use areacellg here. I'll raise a new issue on that topic.

taylor13 commented 8 years ago

I've been away for a week, and should have commented before I left. I think we're doing more than is called for here.

CMOR can already handle polar stereographic grids, so no changes should be necessary (unless there are bugs in CMOR).

CMOR has never before checked that all the coordinate values of a grid are correctly defined, even for the WIP mandated standard 1x1 deg. grid. I don't think CMOR should be enhanced at this time to be able to do this, so the data request should not include a list of the requested coordinate values. [Note that including this enhancement breaks backward compatibility.]

The current CMOR output on polar stereographic grids contains all the information needed to plot them. There is no need for a change in the long name describing the coordinates.

Because of the above, there is no need to define new coordinates Xgre, Ygre, or Xant and Yant. The currently defined "x" and "y" coordinates suffice.

Except in the case of global latxlon grids, I don't think it is essential that longitude values be in the range 0 to 360.

In CMIP5, orog_fx was defined globally. I'm not sure what's needed for the "withism" simulations. Is orog_fx defined globally, but reported only over the region around Greenland? Or is orog defined by the ice-sheet model in the region of greenland and then interpolated to a different grid for the atmospheric model? If the first case is true, then I think grid cell area should be stored in areacella, but the grid_label used for both orog_fx and areacella should be gr1 (or gr2, or ...) to distinguish these files from the global output files. If the second case is true, and special grid is defined for the ice sheet model, then I think the grid cell area should be stored in a new variable "areacellg" ("g" for glacier), and I think orog_fx and areacellg should both have grid labels = "gn", "gr", "gr1", "gr2" .... , as appropriate ("gn" if the polar stereographic grid is the native grid used by the ice-sheet model; "gr" if the native ice sheet model grid is not used to report output, but instead the polar stereographic grid is used; "gr1" (or 2 or 3 ...) if output is reported both on the native grid and on the polar stereographic grid.)

[The above seems a bit complicated. Can someone simplify?]

Concerning "missing values". Originally, a value of -999999. was specified, and CMOR will change those values to 1.e20. At some point the input missing values were changed to 0 . Again CMOR changes those to 1.e20. This is all good (except missing_value and _FillValue must be of the same type as the variable to be recognized by the netCDF library; so the integer value of 0 should be replaced by a float value of 0.). Moreover, it is good practice for the missing_value to be outside the normal range of acceptable values. -999999. is o.k., but 0. should be avoided. CMOR will change either of these to 1.e20. Finally, you might consider whether orography values over the ocean are really "missing" or if they should indeed be assigned a value of 0. (not missing). A plot of orog then would have values of 0. over the ocean rather than missing.

dnadeau4 commented 8 years ago

@taylor13

dnadeau4 commented 7 years ago

Since we don't have any comments on this issue for a long time, I will close it. Feel free to re-open.