在处理ERA5数据是,使用cd_string函数时,会出现一种bug
fatal:Argument type mismatch on argument (0) of (cd_string) can not coerce
原来是ERA5数据是整型的,官方time用的是“double”,所以需要进行处理:
valid_time = fi1->valid_time
tformat = "%Y-%N-%D %H:%M" ; replace format_string with the desired format string
nt = dimsizes(valid_time)
time2 = new(nt,"double")
time2 = todouble(valid_time)
time2@units = valid_time@units;
stime = cd_string(time2, tformat)