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

Problems with soda3.3.2_5dy_ocean_reg dataset, #15

Open
gorsol opened this issue Sep 24, 2021 · 1 comment
Open

Problems with soda3.3.2_5dy_ocean_reg dataset, #15

gorsol opened this issue Sep 24, 2021 · 1 comment

Comments

@gorsol
Copy link

gorsol commented Sep 24, 2021

Dear Tron:

Thanks in advance to share, maintain and support the model2roms code.

I´m try to make the ROMS forcing files with “soda3.3.2_5dy_ocean_reg” dataset, downloaded from:

http://dsrs.atmos.umd.edu/DATA/soda3.3.2/REGRIDED/ocean/

After configure the configM2R.py file, with the next parameters:

  • self.time_frequency_inputdata = "5days"
  • self.ocean_indata_type = 'SODA3_5DAY'
  • self.fillvaluein = -1.e+20 (extracted from the downloaded dataset)

and the proper's define_ocean_forcing_data_path, define_roms_grid_path and the roms out grid stretching properties,

when I run the, runM2R.py file, there next error appear:

File "/Work/Python/model2roms/model2roms.py", line 274, in get_3d_data
str(confM2R.input_varnames[varN]), float(data.min()), float(data.max())))

UnboundLocalError: local variable 'data' referenced before assignment

I check the “get_3d funtion” in the model2roms.py file, and realize that there is not any option to mach with the “confM2R.ocean_indata_type == "SODA3_5DAY"” case. So I added the next code in the model2roms.py :

`	   if confM2R.ocean_indata_type == "SODA3_5DAY":
                data = cdf.variables[confM2R.input_varnames[varN]][0, :, :, :]
	        data = np.where(data.mask, confM2R.fillvaluein, data)_

`
All runs ok, with no errors, but I’m not sure about the solution, the result files are inconsistent. Can you confirm that the added code is right? Any other suggestion?

@trondkr
Copy link
Owner

trondkr commented Sep 28, 2021 via email

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