model2roms icon indicating copy to clipboard operation
model2roms copied to clipboard

Problems with soda3.3.2_5dy_ocean_reg dataset,

Open gorsol opened this issue 3 years ago • 1 comments

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?

gorsol avatar Sep 24 '21 19:09 gorsol

Hi,

Your code may be correct but it depends on the structure of the SODA 5 day files. Does each file only contain one tilmestep ? You are suggesting that based on the zero index for time in your slicing: [0,:,:,:]. Perhaps you could send me the structure of your file using "ncdump -h soda_filename.nc”.   Also, what suggests that the result files are inconsistent?

Cheers, Trond On Sep 24, 2021, 12:12 PM -0700, Gorka Solana @.***>, wrote:

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? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

trondkr avatar Sep 28 '21 16:09 trondkr