Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Can not compile read_wrf_nc.f

zmm

New member
When I want to modify wrfinput_d01(eg.SST=SST+2), I think I should use read_wrf_nc. But when I want to compile, there are many errors. I cannot solve them so I hope to get help !
屏幕截图 2022-08-06 231742.png
屏幕截图 2022-08-06 231805.png
 
Last edited:
Using "gfortran ..." to compile also appears these errors. Ubuntu version is 18.04.5, Netcdf version is 4.1.3.
 
Hi,
The errors you're seeing are specific to netcdf. It seems that perhaps netcdf is not in your environmental path, or that the netcdf that is in your path was not built with the compiler(s) you're trying to use. Make sure you that you have built netcdf with the exact compiler (and version of that compiler) that you're trying to use, and that you have your path pointing to the correct netcdf.
 
Hi,
The errors you're seeing are specific to netcdf. It seems that perhaps netcdf is not in your environmental path, or that the netcdf that is in your path was not built with the compiler(s) you're trying to use. Make sure you that you have built netcdf with the exact compiler (and version of that compiler) that you're trying to use, and that you have your path pointing to the correct netcdf.
Thank you for your advice. I just checked the ones you mentioned. Too bad I still can't solve the problem.
1. My NetCDF has been already on my path (Figure 1).
2. I used gfortran to build my NetCDF, and there is only one version of my gfortran (Figs. 2 & 3)
3. Thanks for your advice, I tried compiling read_WRF_nc.f by using gfortran, but it still has these errors (Figure 4).
Looking forward to your opinions and possible solutions! Thank you very much!
 

Attachments

  • 屏幕截图 2022-08-10 231819.png
    屏幕截图 2022-08-10 231819.png
    13 KB · Views: 11
  • 屏幕截图 2022-08-10 231630.png
    屏幕截图 2022-08-10 231630.png
    50.2 KB · Views: 11
  • 屏幕截图 2022-08-10 231749.png
    屏幕截图 2022-08-10 231749.png
    19 KB · Views: 10
  • 屏幕截图 2022-08-10 231708.png
    屏幕截图 2022-08-10 231708.png
    108.9 KB · Views: 10
Per the screenshots you attached, it does look like you have everything installed. I'm not sure why it's unable to find the netcdf correctly. Are you using a dual-booted system (e.g., Windows machine with Linux installed parallel to Windows)? If so, there could be some issues with the paths overlapping or not able to be located. I would suggest reaching out to a systems administrator at your institution to see if they have any thoughts.

As an alternative, you could use an NCL program to modify your file. Take a look at this presentation and, in particular, starting with slide 40.
 
Per the screenshots you attached, it does look like you have everything installed. I'm not sure why it's unable to find the netcdf correctly. Are you using a dual-booted system (e.g., Windows machine with Linux installed parallel to Windows)? If so, there could be some issues with the paths overlapping or not able to be located. I would suggest reaching out to a systems administrator at your institution to see if they have any thoughts.

As an alternative, you could use an NCL program to modify your file. Take a look at this presentation and, in particular, starting with slide 40.
Thanks for your advice!
 
hi, maybe u can try this method, and this works for me:
gfortran read_wrf_nc.f90 -o read_wrf_nc.exe -I/Software/netcdf-fortran-4.4.5/include -L/Software/netcdf-fortran-4.4.5/lib -lnetcdff -lnetcdf
 
Top