Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

ERROR Xsrc not monotonic

MrIgnition

Member
I observed this error "ERROR Xsrc not monotonic" in my datm log file. The last file checked was topodata_0.9x1.25_USGS_070110_stream_c151201.nc. I did not make any modifications to this file. I only changed my atmospheric forcing. I have used other forcings before but I never saw this error. What could be the cause of this?

I initially thought the model did not like the fact that my forcing dataset was regional, I went ahead and extended it to global including the atm domain file, but the error persists. What could i have done wrongly here.

Here is my datm log.
cat atm.log.4264673.210826-094208
(datm_comp_init) decomp = 1d
(datm_comp_init) iradsw = 1
(datm_comp_init) factorFn = null
(datm_comp_init) restfilm = undefined
(datm_comp_init) restfils = undefined
(datm_comp_init) presaero = T
(datm_comp_init) force_prognostic_true = F
(datm_comp_init) wiso_datm = F
(datm_comp_init) inst_index = 1
(datm_comp_init) inst_name = ATM
(datm_comp_init) inst_suffix =
(shr_strdata_readnml) reading input namelist file: datm_in
(shr_stream_init) Reading file user_datm.streams.txt.CLMGSWP3v1.Precip
(shr_file_freeUnit) unit 97 was not in use
(shr_stream_init) Reading file user_datm.streams.txt.CLMGSWP3v1.Solar
(shr_file_freeUnit) unit 97 was not in use
(shr_stream_init) Reading file user_datm.streams.txt.CLMGSWP3v1.TPQW
(shr_file_freeUnit) unit 97 was not in use
(shr_stream_init) Reading file datm.streams.txt.presaero.clim_2000
(shr_file_freeUnit) unit 97 was not in use
(shr_stream_init) Reading file datm.streams.txt.topo.observed
(shr_file_freeUnit) unit 97 was not in use
(datm_comp_init) datm datamode = CLMNCEP
(shr_strdata_init) stream 1
(shr_strdata_init) filePath = 1
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/
(shr_strdata_init) fileName = 1
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/domain.lnd.388x402_RCP26.22km.c210623.nc
(shr_strdata_init) timeName = 1 time
(shr_strdata_init) lonName = 1 xc
(shr_strdata_init) latName = 1 yc
(shr_strdata_init) hgtName = 1 unknownname
(shr_strdata_init) maskName = 1 mask
(shr_strdata_init) areaName = 1 area
(shr_strdata_init) stream 2
(shr_strdata_init) filePath = 2
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/
(shr_strdata_init) fileName = 2
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/domain.lnd.388x402_RCP26.22km.c210623.nc
(shr_strdata_init) timeName = 2 time
(shr_strdata_init) lonName = 2 xc
(shr_strdata_init) latName = 2 yc
(shr_strdata_init) hgtName = 2 unknownname
(shr_strdata_init) maskName = 2 mask
(shr_strdata_init) areaName = 2 area
(shr_strdata_init) stream 3
(shr_strdata_init) filePath = 3
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/
(shr_strdata_init) fileName = 3
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/atm_forcing.datm7.RCP26.c210729
/CLM1PT_data/domain.lnd.388x402_RCP26.22km.c210623.nc
(shr_strdata_init) timeName = 3 time
(shr_strdata_init) lonName = 3 xc
(shr_strdata_init) latName = 3 yc
(shr_strdata_init) hgtName = 3 unknownname
(shr_strdata_init) maskName = 3 mask
(shr_strdata_init) areaName = 3 area
(shr_strdata_init) stream 4
(shr_strdata_init) filePath = 4
/p/scratch/cjicg41/bamidele/inputdata/atm/cam/chem/trop_mozart_aero/aero/
(shr_strdata_init) fileName = 4
/p/scratch/cjicg41/bamidele/inputdata/atm/cam/chem/trop_mozart_aero/aero/aeroso
ldep_WACCM.ensmean_monthly_hist_1849-2015_0.9x1.25_CMIP6_c180926.nc
(shr_strdata_init) timeName = 4 time
(shr_strdata_init) lonName = 4 lon
(shr_strdata_init) latName = 4 lat
(shr_strdata_init) hgtName = 4 unknownname
(shr_strdata_init) maskName = 4 mask
(shr_strdata_init) areaName = 4 area
(shr_strdata_init) stream 5
(shr_strdata_init) filePath = 5
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/topo_forcing/
(shr_strdata_init) fileName = 5
/p/scratch/cjicg41/bamidele/inputdata/atm/datm7/topo_forcing/topodata_0.9x1.25_
USGS_070110_stream_c151201.nc
(shr_strdata_init) timeName = 5 time
(shr_strdata_init) lonName = 5 LONGXY
(shr_strdata_init) latName = 5 LATIXY
(shr_strdata_init) hgtName = 5 unknownname
(shr_strdata_init) maskName = 5 mask
(shr_strdata_init) areaName = 5 area
(shr_strdata_init) calling shr_dmodel_mapSet for fill
(shr_strdata_init) calling shr_dmodel_mapSet for remap
(shr_map_checkGrids_global) ERROR Xsrc not monotonic 1 0.2500000000000 0.2500000000000
(shr_map_checkGrids_global) ERROR Ysrc not regular lat,lon 134 706 64.25000000000 64.75000000000
ERROR: ('shr_map_checkGrids_global') ERROR
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I think that the error is reporting that the atmospheric forcing domain is not on a regular grid. E.g., all the latitude coordinates are not the same at a given longitude.
 

MrIgnition

Member
Thanks for the reply, Kindly look at my atm domain header.
ni = 1440 ;
nj = 720 ;
nv = 4 ;
variables:
float lon(ni) ;
lon:standard_name = "longitude" ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
float lat(nj) ;
lat:standard_name = "latitude" ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double xc(nj, ni) ;
xc:long_name = "longitude of grid cell center" ;
xc:units = "degrees_east" ;
xc:mode = "time-invariant" ;
double yc(nj, ni) ;
yc:long_name = "latitude of grid cell center" ;
yc:units = "degrees_north" ;
yc:mode = "time-invariant" ;
double xv(nv, nj, ni) ;
xv:long_name = "longitude of grid cell vertices" ;
xv:units = "degrees_east" ;
xv:mode = "time-invariant" ;
double yv(nv, nj, ni) ;
yv:long_name = "latitude of grid cell vertices" ;
yv:units = "degrees_east" ;
yv:mode = "time-invariant" ;
int mask(nj, ni) ;
mask:long_name = "domain mask" ;
mask:units = "unitless" ;
mask:mode = "time-invariant" ;
double area(nj, ni) ;
area:long_name = "area of grid cell in radians squared" ;
area:units = "area" ;
area:mode = "time-invariant" ;

I actually regridded my forcing dataset from 0.22deg resolution to approximately 0.25deg (lonlat-regular) and used the forcing grid produce the domain file just to eliminate doubts about the error.
now it shows
(shr_map_checkGrids_global) ERROR Xsrc not monotonic 1 0.2500000000000 0.2500000000000
ERROR: ('shr_map_checkGrids_global') ERROR

No more reference to Ysrc.
I still don't get how not being monotonic is measured if 1440/720 gives 2 without a remainder
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
This code in cime/src/share/util/shr_map_mod.F90 seems to be where the error is triggered:

!--- check that Xsrc is monotonically increasing for bilinear ---
flag = .false.
i = 1
do while (i < nis .and. .not.flag)
if (((Xsrc(nis,1) > Xsrc(1,1)) .and. (Xsrc(i+1,1) <= Xsrc(i,1))) .or. &
((Xsrc(nis,1) < Xsrc(1,1)) .and. (Xsrc(i+1,1) >= Xsrc(i,1)))) then
write(s_logunit,F05) 'ERROR Xsrc not monotonic ',i,Xsrc(i+1,1),Xsrc(i,1)
flag = .true.
error = .true.
endif
i = i+1
enddo

The error output indicates that for i=1, Xsrc(i+1,1) = Xsrc(i,1) = 0.25
I'm not terribly familiar with this code, but I assume this means that your first two longitude values are both 0.25 and therefore are not monotonically increasing...?
 

MrIgnition

Member
My own challenge was a little bit peculiar and that was what led to the issue. Now, to avoid such issues, I make use of the land domain file (domain.lnd.”your gridname”_”your gridname”) as my atmospheric domain file in the user_datm.streams file. You may want to regrid your forcing to the domain file resolution if you like. It gets done anyway through your "mapalgo" setting in the user_nl_datm file.
 
Top