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 in surfdata/fatmgrid lon/lat mismatch error

sunweihao

19970130SWh
Member
Hi all,

I'm working on change land-sea distribution in the CESM2.1.3, I have generate new ocean domain file and land domain file, and mapping files.
The error happened in the run time, viewing the cesm log it says:

ENDRUN:
ERROR: ERROR in surfrdMod.F90 at line 384
ERROR: ERROR in surfrdMod.F90 at line 384
ERROR: surfdata/fatmgrid lon/lat mismatch error 5.684341886080801E-014
0.235602094240804

My question is how can I try to resolve this problem, why this problem happens?

Thanks,

SWH
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
The error is being generated from this code here in src/main/surfrdMod.F90:

rmaxlon = 0.0_r8
rmaxlat = 0.0_r8
do n = begg,endg
if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8))
elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8))
else
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)))
endif
rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n)))
enddo
if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then
write(iulog,*)' ERROR: surfdata/fatmgrid lon/lat mismatch error', rmaxlon,rmaxlat
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

So it seem like the latitudes (or at least one of the latitudes) in your domain (fatmgrid) file and your surface dataset don't agree, with a maximum difference of:

0.235602094240804

It looks like your longitudes agree:

5.684341886080801E-014
 

sunweihao

19970130SWh
Member
The error is being generated from this code here in src/main/surfrdMod.F90:

rmaxlon = 0.0_r8
rmaxlat = 0.0_r8
do n = begg,endg
if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8))
elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8))
else
rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)))
endif
rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n)))
enddo
if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then
write(iulog,*)' ERROR: surfdata/fatmgrid lon/lat mismatch error', rmaxlon,rmaxlat
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

So it seem like the latitudes (or at least one of the latitudes) in your domain (fatmgrid) file and your surface dataset don't agree, with a maximum difference of:

0.235602094240804

It looks like your longitudes agree:

5.684341886080801E-014
Thanks for your reply! This problem has been resolved, which is due to the generating domain file process. I missed some option, and the result file lat range is -89.7 ~ +89.7. This characteristic cause the mismatch between domain file and surface data.
 
Top