Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error #201

Open
q1165600785 opened this issue Mar 12, 2025 · 4 comments
Open

Runtime Error #201

q1165600785 opened this issue Mar 12, 2025 · 4 comments

Comments

@q1165600785
Copy link

I originally posted my question here, but they don't seem to work with the region-mom6 workflow, so I'm looking for a solution here

CROCODILE-CESM#52

mom-ocean/MOM6#1657

@navidcy Professor, do you have time to help me figure out what caused the time error?

@q1165600785
Copy link
Author

import netCDF4  as nf 

def nf_read():
    path_obs=r'./mom6_run_directories/jbrangge3/INPUT/forcing_obc_segment_001.nc'
    ds = nf.Dataset(path_obs)   
    # print(ds)
    # variable_names = ds.variables.keys()  # 变量名,类似于该数据的属性
    # print(len(variable_names), variable_names)
    print(ds.variables['time'])
    print(ds.variables['time'][:])
    print(ds.variables['time'][0])
if  __name__ ==    '__main__':
    nf_read()

<class 'netCDF4.Variable'>
float64 time(time)
_FillValue: nan
calendar: julian
units: days since 2003-01-01 00:00:00
unlimited dimensions: time
current shape = (5,)
filling on
[0. 1. 2. 3. 4.]
0.0

Professor, I found the problem. The timeline was accidentally set wrong. I think this is the reason.

@q1165600785
Copy link
Author

netCDF4  as nf 

def nf_read():
    path_obs=r'./mom6_run_directories/jbrangge3/INPUT/forcing_obc_segment_001.nc'
    ds = nf.Dataset(path_obs)   
    # print(ds)
    # variable_names = ds.variables.keys()  # 变量名,类似于该数据的属性
    # print(len(variable_names), variable_names)
    print(ds.variables['time'])
    print(ds.variables['time'][:])
    print(ds.variables['time'][0])
if  __name__ ==    '__main__':
    nf_read()

<class 'netCDF4.Variable'>
float64 time(time)
_FillValue: nan
calendar: julian
units: days since 2003-01-01 00:00:00
unlimited dimensions: time
current shape = (5,)
filling on
[0. 1. 2. 3. 4.]
0.0

Professor, I found the problem. The timeline was accidentally set wrong. I think this is the reason.

I think the time was accidentally set wrong when the file was generated. Is this a bug?

@manishvenu
Copy link
Collaborator

Hey @q1165600785,

Just a quick aside, the 0-5 on the time just means 0-5 days since 2003-01-01, that should be correct.

@q1165600785
Copy link
Author

q1165600785 commented Mar 14, 2025

@manishvenu Hello, teacher. If you have time, could you help me find out what the problem is? I only know that there is a problem with the time, but I don't know how to slove the problem.

I uploaded the generated files
File address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants