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

metgrid.exe no running after using W2W geogrid files. #131

Open
Lagnajee opened this issue Aug 30, 2024 · 7 comments
Open

metgrid.exe no running after using W2W geogrid files. #131

Lagnajee opened this issue Aug 30, 2024 · 7 comments

Comments

@Lagnajee
Copy link

Describe your issue

Hello all, i am also facing the issue wgile running metgrid. However i have replace the geo_em.d0*.nc files with the W2W generated nc files and replaced as by procedure. Do i need to change something in the geog_data_path? Please let me know...

I am having this error "Processing domain 1 of 4 | ERROR: Couldn't open file ./geo_em.d01.nc for input."

w2w --version

w2w 0.5.0

nc-config --all

This netCDF 4.8.1 has been built with the following features: 

  --cc            -> /usr/bin/cc
  --cflags        -> -I/usr/include -I/usr/include/hdf5/serial
  --libs          -> -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf
  --static        -> -lhdf5_hl -lhdf5 -lcrypto -lcurl -lpthread -lsz -lz -ldl -lm

  --has-c++       -> no
  --cxx           -> 

  --has-c++4      -> no
  --cxx4          -> 

  --has-fortran   -> yes
  --fc            -> gfortran
  --fflags        -> -I/usr/include -I/usr/include
  --flibs         -> -L/usr/lib/x86_64-linux-gnu -lnetcdff -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf -lm
  --has-f90       -> 
  --has-f03       -> yes

  --has-dap       -> yes
  --has-dap2      -> yes
  --has-dap4      -> yes
  --has-nc2       -> yes
  --has-nc4       -> yes
  --has-hdf5      -> yes
  --has-hdf4      -> no
  --has-logging   -> no
  --has-pnetcdf   -> no
  --has-szlib     -> yes
  --has-cdf5      -> yes
  --has-parallel4 -> no
  --has-parallel  -> no
  --has-nczarr    -> yes

  --prefix        -> /usr
  --includedir    -> /usr/include
  --libdir        -> /usr/lib/x86_64-linux-gnu
  --version       -> netCDF 4.8.1

Installed Packages

numpy==1.23.1

Traceback

No response

@dargueso
Copy link
Collaborator

When do you get this error? Running metgrid.exe? It looks like you haven't copied the geo_em files to the WPS folder, could it be? Because it is complaining that it doesn't find the file at all...

@Lagnajee
Copy link
Author

Lagnajee commented Sep 4, 2024

@dargueso i have renamed geo_em.d01_41.nc to geo_em.d01.nc...... similarly for 2nd and 3rd domain and geo_em.d04_LCZ_params.nc to geo_em.d04.nc. I have removed the original geo_em files and only keep those renamed files made through W2W in the WPS directory.
I am getting this error while running the metgrid.exe

@Lagnajee
Copy link
Author

Lagnajee commented Sep 7, 2024

@dargueso sisnt get any solution till now. Please let me know if there are any possible solutions

@dargueso
Copy link
Collaborator

dargueso commented Sep 7, 2024

Can you open the file with ncview or ncdump to inspect it? Because it is complaining it can even open it

@Lagnajee
Copy link
Author

Lagnajee commented Sep 7, 2024

yes i can open all the geogrid files with ncview and also run ncdump and inspect

@Lagnajee
Copy link
Author

Lagnajee commented Sep 7, 2024

&share
wrf_core = 'ARW'
max_dom = 4
start_date = '2022-10-06_00:00:00', '2022-10-06_00:00:00', '2022-10-06_00:00:00', '2022-10-06_00:00:00'
end_date = '2022-10-10_00:00:00', '2022-10-10_00:00:00', '2022-10-10_00:00:00', '2022-10-10_00:00:00'
interval_seconds = 3600
io_form_geogrid = 2
debug_level = 0
/

&geogrid
parent_id = 1, 1, 2, 3
parent_grid_ratio = 1, 3, 3, 3
i_parent_start = 1, 20, 40, 124
j_parent_start = 1, 20, 39, 135
e_we = 98, 172, 295, 157
e_sn = 100, 154, 265, 148
geog_data_res = 'default', 'default', 'default', 'default'
dx = 30000,
dy = 30000,
map_proj = 'mercator',
ref_lat = 17.330,
ref_lon = 78.464,
truelat1 = 16.007,
truelat2 = 00.0,
stand_lon = 78.4,
pole_lat = 90
pole_lon = 0

geog_data_path = '/home/lagnajeet/jasper-1.900.1/Build_WRF/WPS_GEOG'
opt_geogrid_tbl_path = './geogrid'
/

&ungrib
out_format = 'WPS'
prefix = 'PL'
/

&metgrid
fg_name = 'PL','SFC'
io_form_metgrid = 2
opt_metgrid_tbl_path = './metgrid'
/
This is my namelist file

@ZYFno996
Copy link

I found the reason. WPS default nc file is NETCDF3_64BIT_OFFSET data model and NETCDF3 format file. But w2w nc file is NETCDF4 data model, HDF5 format file. Read .nc file by python library netCDF can catch this information. You need to write another python script to convert these formats as follows and then there will be no problems to run metgrid.exe.

  1. Read by xarray:
    ds=xr.open_dataset(r"[W2W FILENAME]")
  2. Rewrite files:
    ds.to_netcdf(r"[CONVERTED W2W FILENAME]",format="NETCDF3_64BIT")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants