定义 z 维度 status = nf90_def_dim(ncid, zname, nz, zid) if (status /= NF90_NOERR) then print *, 'Error: cannot define dimension' stop endif ! 定义一个三维浮点变量,并指定它的类型和维度 status = nf90_def_var(ncid, varname, NF90_DOUBLE, [xid, yid, zid], varid) if (...
name=trim(dim_name), valueList=valueListR4, rc=rc); ESMF_ERR_RETURN(rc) ncerr = nf90_enddef(ncid=ncid); NC_ERR_STOP(ncerr) ncerr = nf90_put_var(ncid, dim_varid, values=valueListR4 ); NC_ERR_STOP(ncerr) ncerr = nf90_redef(ncid=ncid); NC_ERR_STOP(ncerr) deallocate(...
Added support for creating netCDF/HDF5 files with szip compression with new functions nf90_def_var_szip() and nf_def_var_szip(). SeeGithub #213. Corrected an issue where parallel netCDF-Fortran builds would fail despite the presense of MPI libraries/compiler/infrastructure. SeeGithub #208...
create netCDF dataset: enter define mode NF90_DEF_DIM ! define dimensions: from name and length NF90_DEF_VAR ! define variables: from name, type, dims NF90_PUT_ATT ! assign attribute values NF90_ENDDEF ! end definitions: leave define mode NF90_PUT_VAR ! provide values for variable ...
需要使用如下函数关闭打开的文件对象: •nc_close•nf_close•nf90_close ⚠️:在创建新文件时,如果定义的维度有记录维度...,那么要确保记录维度位于最左侧(⚠️:这里所说的最左侧是nc文件中变量的最左侧,但是在程序中定义变量的时候,使用nc_def_var等定义变量时,记录维度应该位于最右侧),否则会...
nf90_create(filename ,IOR(NF90_NETCDF4,NF90_MPIIO),ncid,comm=MPI_COMM_WORLD, info=MPI_INFO_NULL) status=nf90_def_dim(ncid, "x", NX, x_dimid) status=nf90_def_dim(ncid, "y", NY, y_dimid) dimids = (/ y_dimid, x_dimid /) status=nf90_def_var(ncid, "data", ...
nf90_def_dim( ncid, "Second", size(data,2), dim2 ) error = nf90_def_var( ncid, "MyData", nf90_int, [dim1, dim2], varid ) error = nf90_enddef( ncid ) error = nf90_put_var( ncid, varid, data ) write(*,*) 'Put var: ', error data = 0.0 error = nf90_get_...