使用Fortran读取NETCDF3文件
使用gFortran 进行NetCDF文件的读取,需要netcdf库的支持。检查netcdf是否可用:
$ ncdump
如果提示不存在命令,就需要自己安装了,可以参考Compilling WRF 安装步骤。Note: 此处介绍的安装方法可能不再适用,请参考最新的NETCDF/HDF5安装说明 — 2023-11-15
使用F90脚本读取NC文件脚本内容如下,读取Hamawari-8 L2CLP文件的经纬度参数:
include 'netcdf.inc'!!main character*100 fnameout,tmpf,h8file,geoh8 logical alive!!!!H-8 参数 integer iopen,ioquire,iovar,latid,lonid,ncid,varid,len_file,ioclose integer, parameter :: dize=2401!定义维数 real*4 latitude(dize),longitude(dize)!!! open one h8-file for geolocat ...