Hi ,

I'm wondering whether if i can creating initial file(ICMSH${expid}INIT) from existing NetCDF files?

I would like to design some sensitivity experiments, so i wont to create the initial file by NetCDF, i have tried to convert the *.nc to *.grb and replace the variables in existing initial file, but it didn't work, could some one tell me how to do it?

Best regards,

Zhenqian


wangzhenqian@wangzhenqiandeMacBook-Pro 19900101 % cdo replace ICMSHECE3INIT T255_no_TP300_mulc9.8_chname.grb 123 

cdo    replace (Warning): Variable Z not found!

cdo    replace: Processed 3642358 values from 42 variables over 2 timesteps [0.03s 9640KB].

2 Comments

  1. Hi Zhenqian,

    I have not used the cdo replace command so I am not sure how it matches the fields between two grib files. Is your replacement field in spectral format as the ICMSH file contains the prognostic fields in spectral format.

    Personally I would do this in several steps using the ECMWF ecCodes grib tools.  You can do a 'smart copy' with the 'grib_copy' command line tool to split the ICMSH file into 1 file per variable, then simply 'cat' the files back together again but this time with your replacement 'z' file.  Unlike netcdf files, GRIB files can have fields in any order as each grib message is self describing.

    Something like:

    grib_copy ICMSHECE3INIT  "[shortName].ecgrb"
    rm z.grb    #  or rename it
    cat T255*chname.grb *.ecgrb  > new.grb

    Then I suggest using the 'grib_set' command to make sure the attributes of the new grib z field match the original.

    Cheers.

  2. Hi Glenn Carver,

    Thank you for your answer.

    I haven't used ecCodes, I will learn this tool later. Does this tool could modified variable's value?

    Best regards,

    Zhenqian