Changeset 3648 for trunk/LMDZ.MARS


Ignore:
Timestamp:
Feb 26, 2025, 9:55:23 AM (4 months ago)
Author:
jbclement
Message:

Mars PCM:
Skipping non-numeric variables in the analysis of NetCDF files.
JBC

Location:
trunk/LMDZ.MARS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/changelog.txt

    r3619 r3648  
    47734773== 11/02/2025 == JBC
    47744774Addition of 'zdqsdif_ssi_tot", the total flux with sub-surface water ice, in the "startfi.nc" file. Only used under paleoclimate flag.
     4775
     4776== 26/02/2025 == JBC
     4777Skipping non-numeric variables in the analysis of NetCDF files.
  • trunk/LMDZ.MARS/util/analyse_netcdf.py

    r3465 r3648  
    8080    for variable_name in dataset.variables:
    8181        variable = dataset.variables[variable_name]
    82         analyze_variable(variable)
     82        if np.issubdtype(variable[:].dtype,np.number):
     83            analyze_variable(variable)
     84        else:
     85            print(f"\nSkipping non-numeric variable: {variable.name}")
    8386   
    8487    # Close the NetCDF file
     
    8790### Call the main function
    8891analyze_netcdf()
    89 
Note: See TracChangeset for help on using the changeset viewer.