Skip to content

Conversation

Dengda98
Copy link
Owner

Before this PR, the static results are written into stdout, and ASCII format is inconvenient for code maintainance.
NetCDF format perfectly matched the static results, since I use -X and -Y to define the 2D grid instead the 1D distance array in dynamic case.

ncdump -h looks like,

$ ncdump -h stgrn.nc 
netcdf stgrn {
dimensions:
        north = 21 ;
        east = 21 ;
variables:
        double north(north) ;
        double east(east) ;
        double EXZ(north, east) ;
        double EXR(north, east) ;
        double VFZ(north, east) ;
        double VFR(north, east) ;
        double HFZ(north, east) ;
        double HFR(north, east) ;
        double HFT(north, east) ;
        double DDZ(north, east) ;
        double DDR(north, east) ;
        double DSZ(north, east) ;
        double DSR(north, east) ;
        double DST(north, east) ;
        double SSZ(north, east) ;
        double SSR(north, east) ;
        double SST(north, east) ;

// global attributes:
                :src_va = 4. ;
                :src_vb = 2.7 ;
                :src_rho = 2.5 ;
                :rcv_va = 4. ;
                :rcv_vb = 2.7 ;
                :rcv_rho = 2.5 ;
                :calc_upar = 0 ;
}

However, common pre-built binary NetCDF only have dynamic library, while static library is needed to build PyGRT. After much consideration, I still decide to build the static libnetcdf.a from source in Github Workflow. During the whole process, there are many dependency issues, directly solving with lots of jobs makes the workflow .yaml file looks dirty. Therefore I saved the final built packages and upload them to another repo (my blog....), and the corresponding jobs become a simple downloading job. Same operations applied to FFTW.

Now the static results are classical NetCDF format, and can be easily plot via GMT.

@Dengda98 Dengda98 marked this pull request as ready for review September 19, 2025 15:42
@Dengda98 Dengda98 added the enhancement New feature or request label Sep 19, 2025
@Dengda98 Dengda98 merged commit 0490a00 into main Sep 19, 2025
2 checks passed
@Dengda98 Dengda98 deleted the static_netcdf branch September 19, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant