Error using Nesting tools with bulk files from ERA5

Hi everyone!
I hope you could help me with some issue that I found last night when I was using the nesting tools with a bulk file for an interanual simulation.

I have to do an interanual nested simulation of Golf of Mexico. I did a test, running a simulation with only one grid (pather) and al preprocessing and execution of CROCO model. All was great. I used ERA5 to download atmospheric forcing and Mercator to inicial conditions.

But when I decide to use nesting tools, especific nested_bulk function, the error appears:

>> start                                                                                                           10:40:54 
Add the paths of the different toolboxes
Arch : x86_64 - Matlab version : 2021b                         
Use of mexnc and loaddap in 64 bits.
>> nested_bulk('CROCO_FILES/croco_grd.nc.1','CROCO_FILES/croco_blk_ERA5_Y2005M01.nc','CROCO_FILES/croco_blk_ERA5_Y2005M01.nc.1')
                                                                                                                                  
bulk file for the embedded grid :CROCO_FILES/croco_blk_ERA5_Y2005M01.nc.1 using parent bulk file: CROCO_FILES/croco_blk_ERA5_Y2005
M01.nc                                                                                                                            
  
 Read in the embedded grid...
  
 Read in the parent bulk file... 
  
 Create the bulk file...
 No time reference
Warning:  ## close failed: CROCO_FILES/croco_blk_ERA5_Y2005M01.nc.1 
> In netcdf/close (line 20)
In create_nestedbulk (line 172)
In nested_bulk (line 74) 

 Do the interpolations...
 ## NetCDF file not opened: CROCO_FILES/croco_blk_ERA5_Y2005M01.nc.1
tair...
Assigning to 4 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.

Error in interpvar3d (line 52)
nc{varname}(tindex,:,:)=interp2(igrid_par,jgrid_par,var_par,...

Error in nested_bulk (line 103)
  interpvar3d(np,nc,igrd_r,jgrd_r,ichildgrd_r,jchildgrd_r,'tair',mask,tindex)

This surprised me because I had used this function before with bulk_files from GFS for forecasting and always works good.

The steps that I used to do for preprocessing:

  • Make pather grid
  • Make preprocessing files: bulk and initial files.
  • Make child grid
  • Use nested_initial and nested_bulk functions to create preprocessing files from pather files.

I tried to seach the root of the issue and i identified that inside nested_bulk.m in the next line it does not create the child bulk file. And then when the code wants to save data in that file, it does not exist.

% Create the bulk file
%
disp(' ')
disp(' Create the bulk file...')
create_nestedbulk(child_blk,parent_blk,child_grd,title,...
                   bulkt,bulkc)

I think that is not problem of nested routines because It works with bulk files from GFS. I tried to search some differences between bulk files from ERA5 and GFS and found that both have the same variable information.

ERA5 file hace all permitions of write and reading.
Are there any other information that we could see to identify the possible problem?

Thank you for your time and support.

Hi, It seems that there is a problem with the time variable in your parent bulk file. Could you check if the bulk_time variable and the cycle length attribute in the same variable exist and are correct?. Best regards

Hi, oarta1.

Thank you for you advice.

I checked the bulk_time variable and it have all properties that it has to have.

The problem was solved. I try to create a new configuration with same characteristics and I think that I could forget some step to do before because It works.

Its funny how CROCO can be so sensible to little changes.

Well, thats all.

Thank you.

1 Like

In relation to this, I’m wondering is it not possible to use the ONLINE cpp flag and the ERA5 data when using nesting? So that the you are using the ERA5 data at the native resolution. but reformatted (using the python croco tools to (i) download the data and (ii) reformat the units and filenames)

Hi, jvmcgovern.

I think you could do it, because I ran a nested simulation with ERA5 data.

The steps that I follow are:

  • Configure grid dimensions, date for interanual simulation and paths for a virtual enviroment to use python inside crocotools_param.m.
  • Inside era5_crocotools_param.py configure config name and directory, also the pediod of time to download data.
# General path
#
config_dir = 'path_to_my_run_dir/'            # must be the same than crocotools_param
config_name = 'Benguela_LR'

# Dates limits
#
year_start = 2005
month_start = 1
year_end = 2005
month_end = 3
#
# Year origin of time
#
Yorig=2000
  • Execute ERA5_request.py and ERA5_convert.py. In this step we have the information as you said.
  • The final step is execute in matlab “make_ERA5” function. This function do interpolation in the raw files to adapt it to our grid.

With this steps you obtain blk or frc files and you can execute nested functions on them.

Hi Eduardo,

Just to clarify, what I’m wondering is, do you need to carry out the “final step” if you are using the ONLINE cpp definition in cppdefs.h? This creates large croco_blk or croco_frc files that can consume a lot of disk space on bigger domains, so the ONLINE switch is useful to avoid using too much disk space (as the files resulting from ERA5_convert are enough for ONLINE to work if you’re not using AGRIF).

I hope this all makes sense.

Hello, I have had similar problems, and I found out that is a frequency problem, I changed the frequency of ERA5 data from 1 hour to 6 hour, and it worked.