I'm running a standard CAM, but trying to use cyclical dates for the chemistry:
&chem_surfvals_nl
flbc_type = 'CYCLICAL'
flbc_cycle_yr = 2014
flbc_file = '/glade/p/cesmdata/cseg/inputdata/atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180926.nc'
There are 266 dates (yearly) in that file.
The last is 20150702.
It fails in mo_flbc.F90 because it finds the first year (2014)
then searches for the next date which has a different year,
but then subtracts 1 from that index (~ line 297),
which yields the index of the first date.The indices need to differ by at least 2,
so it seems to be assuming that, after the first date,
there will be multiple dates with the same year.
Is that necessary for the rest of the interpolation(?)
algorithm?
Even if it didn't subtract 1, it would still fail in my case.
case( 'CYCLICAL' )
yr = flbc_timing%cycle_yr
do n = 1,ntimes
if( yr == dates(n)/10000 ) then
exit
end if
end do
tim_ndx(1) = n
do n = tim_ndx(1),ntimes
if( yr /= dates(n)/10000 ) then
exit
end if
end do
tim_ndx(2) = n - 1
if( (tim_ndx(2) - tim_ndx(1)) < 2 ) then
write(iulog,*) 'flbc_inti: cyclical lb conds require at least two time points'
write(iulog,*) ' tim_ndx = ',tim_ndx(1),tim_ndx(2),' dates = ',dates(n-1),dates(n),' ntimes = ',ntimes
call endrun
end if
1: tim_ndx = 265 265 dates = 20140702 20150702 ntimes = 266If yearly data is not usable, there should be a note in the namelist html page about that.Thanks for any insight.Kevin
&chem_surfvals_nl
flbc_type = 'CYCLICAL'
flbc_cycle_yr = 2014
flbc_file = '/glade/p/cesmdata/cseg/inputdata/atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180926.nc'
There are 266 dates (yearly) in that file.
The last is 20150702.
It fails in mo_flbc.F90 because it finds the first year (2014)
then searches for the next date which has a different year,
but then subtracts 1 from that index (~ line 297),
which yields the index of the first date.The indices need to differ by at least 2,
so it seems to be assuming that, after the first date,
there will be multiple dates with the same year.
Is that necessary for the rest of the interpolation(?)
algorithm?
Even if it didn't subtract 1, it would still fail in my case.
case( 'CYCLICAL' )
yr = flbc_timing%cycle_yr
do n = 1,ntimes
if( yr == dates(n)/10000 ) then
exit
end if
end do
tim_ndx(1) = n
do n = tim_ndx(1),ntimes
if( yr /= dates(n)/10000 ) then
exit
end if
end do
tim_ndx(2) = n - 1
if( (tim_ndx(2) - tim_ndx(1)) < 2 ) then
write(iulog,*) 'flbc_inti: cyclical lb conds require at least two time points'
write(iulog,*) ' tim_ndx = ',tim_ndx(1),tim_ndx(2),' dates = ',dates(n-1),dates(n),' ntimes = ',ntimes
call endrun
end if
1: tim_ndx = 265 265 dates = 20140702 20150702 ntimes = 266If yearly data is not usable, there should be a note in the namelist html page about that.Thanks for any insight.Kevin