Project

General

Profile

cdfScanVarAttr Variable not found - >lons< error

Added by ep gupal over 1 year ago

I am trying to regrid a file that depends on nCell dimensional variable into latitude and longitude dimensions. But it is giving an error of


Warning (cdfScanVarAttr): NetCDF: Variable not found - >lons<
Warning (cdfScanVarAttr): NetCDF: Variable not found - >lats<

If I understand correctly, above error only occurs when there is a variable that depends on 'lons' or 'lats'. But my data nor the grid file depends on any of those dimensional variables.

Below are the commands that I am using

1. for creating weights

cdo gendis,od.grid.nc -setgrid,mpas.grid.nc pr_15mn_MPAS-3km_DW-ATM_r1i1p1f1_2d_gn_20200121000000-20200121234500.nc mpas.wgt.nc

-> I get the above error messages for this command

2. remapping data file in to 1 degree latitude longitude grid

cdo -remap,od.grid.nc,mpas.wgt.nc pr_15mn_MPAS-3km_DW-ATM_r1i1p1f1_2d_gn_20200121000000-20200121234500.nc pr_15mn_MPAS-3km_DW-ATM_r1i1p1f1_2d_gn_20200121000000-20200121234500.od.nc

-> I not only get the above error messages for this command, but also the remapping does not work.

Why is this happening?

Below are the headers of the grid description file, grid file, and data sample file.

1. Grid description file

@# gridID 1 #
gridtype = lonlat
gridsize = 64800
xsize = 360
ysize = 180
xname = lon
xlongname = "longitude"
xunits = "degrees_east"
yname = lat
ylongname = "latitude"
yunits = "degrees_north"
xfirst = -179.95
xinc = 1
yfirst = -89.95
yinc = 1@

2. Grid file

netcdf mpas.grid {
dimensions:
nCells = 41943042 ;
nEdges = 125829120 ;
nVertices = 83886080 ;
maxEdges = 6 ;
maxEdges2 = 12 ;
TWO = 2 ;
vertexDegree = 3 ;
variables:
float latCell(nCells) ;
latCell:units = "radian" ;
latCell:bounds = "latCell_bnds" ;
latCell:standard_name = "latitude" ;
float lonCell(nCells) ;
lonCell:units = "radian" ;
lonCell:bounds = "lonCell_bnds" ;
lonCell:standard_name = "longitude" ;
float latVertex(nVertices) ;
latVertex:units = "radian" ;
latVertex:bounds = "latVertex_bnds" ;
latVertex:standard_name = "latitude" ;
float lonVertex(nVertices) ;
lonVertex:units = "radian" ;
lonVertex:bounds = "lonVertex_bnds" ;
lonVertex:standard_name = "longitude" ;
float areaCell(nCells) ;
areaCell:coordinates = "lonCell latCell" ;
float areaTriangle(nVertices) ;
areaTriangle:coordinates = "lonVertex latVertex" ;
float lonCell_bnds(nCells, maxEdges) ;
float latCell_bnds(nCells, maxEdges) ;
float lonVertex_bnds(nVertices, vertexDegree) ;
float latVertex_bnds(nVertices, vertexDegree) ;
}

3. Sample data file

@netcdf pr_15mn_MPAS-3km_DW-ATM_r1i1p1f1_2d_gn_20200121000000-20200121234500 {
dimensions:
xtime = UNLIMITED ; // (96 currently)
nCells = 41943042 ;
variables:
double xtime(xtime) ;
xtime:standard_name = "time" ;
xtime:long_name = "Model valid time" ;
xtime:units = "minutes since 2020-1-21 00:00:00" ;
xtime:calendar = "proleptic_gregorian" ;
xtime:axis = "T" ;
float pr(xtime, nCells) ;
pr:long_name = "accumulated total grid-scale precipitation" ;
pr:units = "mm" ;
pr:cell_methods = "Time: mean" ;
pr:standard_name = "precipitation_flux" ;
pr:origin = "rainnc" ;
pr:coordinates = "lons lats" ;

// global attributes:
:CDI = "Climate Data Interface version 2.0.4 (https://mpimet.mpg.de/cdi)" ;
:source = "MPAS" ;
:Conventions = "MPAS" ;
:model_name = "mpas" ;
:core_name = "atmosphere" ;
:git_version = "v6.1-502-gcded7e32-dirty" ;
:on_a_sphere = "YES" ;
:sphere_radius = 6371229.f ;
:is_periodic = "NO" ;
:x_period = 0.f ;
:y_period = 0.f ;
:history = "Sat Jun 18 16:09:23 2022: cdo -s -P 2 -f nc4 -z zip -r -splitname,swap -settaxis,2020-01-21,00:00:00,15min -setattribute,grid_file_path=/work/ka1081/DYAMOND_WINTER/NCAR/MPAS-3.7km/DW-ATM/atmos/fx/gn/grid.nc,pr@standard_name=precipitation_flux,pr@origin=rainnc,pr@coordinates=lons lats -chvar,rainnc,pr [ -cat /work/bk1040/DYAMOND/.input_winter_data/MPAS_3.75km/2d/rainnc.2020-01-21.nc ] _15mn_MPAS-3km_DW-ATM_r1i1p1f1_2d_gn_20200121000000-20200121234500\nmpirun -n 18432 ./atmosphere_model" ;
:parent_id = "59nuhuiy1s\nrwws7w16u3\n" ;
:mesh_spec = "0.0" ;
:config_time_integration = "SRK3" ;
:config_time_integration_order = 2 ;
:config_dt = 20.f ;
:config_calendar_type = "gregorian" ;
:config_start_time = "2020-01-20_00:00:00" ;
:config_stop_time = "none" ;
:config_run_duration = "1_00:00:00" ;
:config_split_dynamics_transport = "YES" ;
:config_number_of_sub_steps = 2 ;
:config_dynamics_split_steps = 3 ;
:config_h_mom_eddy_visc2 = 0.f ;
:config_h_mom_eddy_visc4 = 0.f ;
:config_v_mom_eddy_visc2 = 0.f ;
:config_h_theta_eddy_visc2 = 0.f ;
:config_h_theta_eddy_visc4 = 0.f ;
:config_v_theta_eddy_visc2 = 0.f ;
:config_horiz_mixing = "2d_smagorinsky" ;
:config_len_disp = 3750.f ;
:config_visc4_2dsmag = 0.05f ;
:config_del4u_div_factor = 10.f ;
:config_w_adv_order = 3 ;
:config_theta_adv_order = 3 ;
:config_scalar_adv_order = 3 ;
:config_u_vadv_order = 3 ;
:config_w_vadv_order = 3 ;
:config_theta_vadv_order = 3 ;
:config_scalar_vadv_order = 3 ;
:config_scalar_advection = "YES" ;
:config_positive_definite = "NO" ;
:config_monotonic = "YES" ;
:config_coef_3rd_order = 0.25f ;
:config_smagorinsky_coef = 0.125f ;
:config_mix_full = "YES" ;
:config_epssm = 0.1f ;
:config_smdiv = 0.1f ;
:config_apvm_upwinding = 0.f ;
:config_h_ScaleWithMesh = "YES" ;
:config_num_halos = 2 ;
:config_zd = 22000.f ;
:config_xnutr = 0.2f ;
:config_mpas_cam_coef = 0.f ;
:config_rayleigh_damp_u = "NO" ;
:config_rayleigh_damp_u_timescale_days = 2.f ;
:config_number_rayleigh_damp_u_levels = 6 ;
:config_apply_lbcs = "NO" ;
:config_restart_timestamp_name = "restart_timestamp" ;
:config_pio_num_iotasks = 512 ;
:config_pio_stride = 36 ;
:config_block_decomp_file_prefix = "x1.41943042.graph.info.part." ;
:config_number_of_blocks = 0 ;
:config_explicit_proc_decomp = "NO" ;
:config_proc_decomp_file_prefix = "graph.info.part." ;
:config_do_restart = "NO" ;
:config_do_DAcycling = "NO" ;
:config_print_global_minmax_vel = "YES" ;
:config_print_detailed_minmax_vel = "YES" ;
:config_print_global_minmax_sca = "NO" ;
:config_IAU_option = "off" ;
:config_IAU_window_length_s = 21600.f ;
:config_jedi_da = "NO" ;
:input_soil_data = "STAS" ;
:input_soil_temperature_lag = 140 ;
:num_soil_layers = 4 ;
:months = 12 ;
:noznlev = 59 ;
:config_frac_seaice = "YES" ;
:config_sfc_albedo = "YES" ;
:config_sfc_snowalbedo = "YES" ;
:config_sst_update = "NO" ;
:config_sstdiurn_update = "YES" ;
:config_deepsoiltemp_update = "NO" ;
:config_o3climatology = "YES" ;
:config_microp_re = "YES" ;
:config_ysu_pblmix = "NO" ;
:config_n_microp = 1 ;
:config_radtlw_interval = "00:15:00" ;
:config_radtsw_interval = "00:15:00" ;
:config_conv_interval = "none" ;
:config_pbl_interval = "none" ;
:config_greeness_update = "24:00:00" ;
:config_bucket_update = "none" ;
:config_physics_suite = "convection_permitting" ;
:config_microp_scheme = "mp_thompson" ;
:config_convection_scheme = "cu_ntiedtke" ;
:config_lsm_scheme = "noah" ;
:config_pbl_scheme = "bl_mynn" ;
:config_gwdo_scheme = "bl_ysu_gwdo" ;
:config_radt_cld_scheme = "cld_fraction_thompson" ;
:config_radt_lw_scheme = "rrtmg_lw" ;
:config_radt_sw_scheme = "rrtmg_sw" ;
:config_sfclayer_scheme = "sf_mynn" ;
:config_gfconv_deepc = "YES" ;
:config_gfconv_midlc = "YES" ;
:config_gfconv_shalc = "YES" ;
:config_gfconv_closure_deepc = 0 ;
:config_gfconv_closure_midlc = 0 ;
:config_gfconv_closure_shalc = 0 ;
:config_gfconv_closure_deep = 0 ;
:config_gfconv_closure_shallow = 8 ;
:config_mynn_closure = 2 ;
:config_mynn_cloudpdf = 2 ;
:config_mynn_edmf = 1 ;
:config_mynn_mixscalars = 1 ;
:config_bucket_radt = 1.e+09f ;
:config_bucket_rainc = 100.f ;
:config_bucket_rainnc = 100.f ;
:config_oml1d = "YES" ;
:config_oml_hml0 = 0.f ;
:config_oml_gamma = 0.14f ;
:config_oml_relaxation_time = 432000.f ;
:config_lightning_flash = "NO" ;
:config_sounding_interval = "01:00:00" ;
:file_id = "6t10t3cr4b" ;
:grid_file_path = "/work/ka1081/DYAMOND_WINTER/NCAR/MPAS-3.7km/DW-ATM/atmos/fx/gn/grid.nc" ;
:CDO = "Climate Data Operators version 2.0.4 (https://mpimet.mpg.de/cdo)" ;
:cdo_openmp_thread_number = 2 ;
}@


Replies (2)

RE: cdfScanVarAttr Variable not found - >lons< error - Added by Karin Meier-Fleischer over 1 year ago

Hi EP,

there is an attribute coordinates for the variable pr that points to 'lons lats'.

pr:coordinates = "lons lats" ;

You can delete the attribute with NCO's ncatted:

ncatted -O -a coordinates,pr,d,, infile.nc

Then run again your CDO computations. Hope this will help.

RE: cdfScanVarAttr Variable not found - >lons< error - Added by ep gupal over 1 year ago

Thank you for your reply.

Deleting the 'coordinate' attirubutes from the sample data file indeed got rid of the error messages when genering the weight file. Unfortunately, I am getting hit by another error message during the remap process.

cdo remap (Abort): Unsupported generic coordinates (Variable: pr)!

I don't get this because we just generated the weight from the same sample data file. Why is it complaining about not being the correct coordinates?

    (1-2/2)