Ask Your Question

error with create_forcing.m

asked 2021-01-06 05:57:34 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >5 is welcome to improve it.

Hi everyone! I'm learning how to work with CROCO now, and I am facing a problem about how to create a forcing file in 360 days rather than 12 months.

The code runs well in the scale of 12 mouths, while returns warning "## close failed: G:\JS\croco_files\" in the scale of 360 days. The result is that I can't write my datas into the empty file next step. And if I comment out part of the code to reduce variables such as 'sustr','svstr' , the create_forcing.m will work well again. What's wrong with it? And how can I solve it?

Thanks for any useful help.


*( a file changing from create_forcing.m tha can run directly is following)


edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2021-01-21 07:46:47 +0100

Mengx gravatar image

It's a question with format of NetCDF. NetCDF-3 have a limit that can larger than 2G. So, change the format to NetCDF-4 can solve the question.

But I don't know how to do it in the preprocessing code of CROCO. As a substitude of file 'create_forcing.m', I write down a similar code. You can run the code according to your case first. Then run the code 'make_forcing.m' by commenting out the part of 'Create the forcing file'.

Mengx C:\fakepath\create_frc.m

edit flag offensive delete link more

answered 2021-01-06 14:35:36 +0100

andres gravatar image

It seems to me a memory issue with Matlab.

I've tried the file attached below and it works fine if I increase the gradually the value of

sms_time shf_time swf_time

(lines 34-36)

but when I try to increase

sst_time to 360 it gives me

Warning: ## close failed: C:\Users\dgeo\croco_tools\ In netcdf/close (line 20) In create_forcing_mengx (line 182)

and Matlab crashes, every time.

I can only increase the value of three dimensions at a time.

Hope this helps



edit flag offensive delete link more


Thanks for your help. That maybe a choice. There still have a question that a, even larger than the frc file, can produce successfully at the same time. It makes me confused.

Mengx gravatar imageMengx ( 2021-01-07 02:39:40 +0100 )edit

You try to do separate files, with three different variables each and then join them into one using NCO tools. It's a dirty trick but it might work...

andres gravatar imageandres ( 2021-01-07 02:58:50 +0100 )edit

I got it. Thanks for your advising.

Mengx gravatar imageMengx ( 2021-01-07 03:41:22 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-01-06 05:57:34 +0100

Seen: 93 times

Last updated: 4 hours ago