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

Status
Not open for further replies.

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.
 

yongsheng zheng

Yongsheng zheng
Member
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.
Hello!

How to solve this problem? thank you!

Yongsheng
 

yongsheng zheng

Yongsheng zheng
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
Hi oleson,

I used CESM1.2.2 to create the B1850C5CN case of T31_g37. I checked my domain file and surface data and found that their latitude and longitude ranges were the same, which were -87.2 -- 87.2. Therefore, the error difference is reported as surfrd_get_data: surfdata/fatmgrid lon/lat mismatch error
0.000000000000000E+000 2.84090544413716. So how do I solve this problem?

Yongsheng
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
Your latitudes don't agree with a maximum mismatch of 2.84090544413716. So you need to look at your latitudes in your domain file and surface dataset file.
 

yongsheng zheng

Yongsheng zheng
Member
I have checked the ncdata file cami_0000-01-01_48x96_L30_c100426.nc, which is also -87.2 to 87.2, which is consistent with our fsurdat.
 

slevis

Moderator
Staff member
@oleson suggested comparing the domain file and fsurdat file. The cami file that you looked at is an initial conditions file I think.
 

xiaoxiaokuishu

Ru Xu
Member
@oleson suggested comparing the domain file and fsurdat file. The cami file that you looked at is an initial conditions file I think.
Hi, Slevis,

I create surf and domainfiles use CTSM5.1,

./subset_data point --lat 55.5 --lon 11.6 --site DK_SOR --dompft 8 --pctpft 100 --create-surface --create-domain --create-datm --datm-syr 2000 --datm-eyr 2000 --create-user-mods --inputdata-dir /work/n02/n02/ruxu/cesm/CESM/cesm_inputdata --outdir /work/n02/n02/ruxu/cesm/CESM/cesm_inputdata/my_data_ctsm5.1 --overwrite

then I show the lat and lon of this points, for the surfdata it is:
surf.lsmlon 11.6
surf.lsmlat 55.5

but for the domain files, it is

lat is 55.13089005
lon is 11.25.

I did not know why this mismatch happens... do you have offical samples, i will check the difference?
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I imagine it might be because the domain file contains the lat/lon of the point that is extracted from the global dataset, while the surface dataset contains the lat/lon you specified. However, the domain file is not longer used in CTSM5.1 moving forward.
If you want to run CLM5, you can do that within a ctsm5.1, ctsm5.2, ctsm5.3 checkout.
For example, this case worked for me using a ctsm5.1.dev174 checkout:

./create_newcase --case clm50_ctsm51d174_DK-SOR_2000 --res CLM_USRDAT --compset 2000_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_SROF_SGLC_SWAV --user-mods-dirs /glade/derecho/scratch/oleson/DK-SOR_ctsm51d174/user_mods/ --run-unsupported

It uses surface data generated from:

./subset_data point --lat 55.5 --lon 11.6 --site DK_SOR --dompft 8 --pctpft 100 --create-surface --create-domain --create-user-mods --outdir /glade/derecho/scratch/oleson/DK-SOR_ctsm51d174 --overwrite
 

xiaoxiaokuishu

Ru Xu
Member
I imagine it might be because the domain file contains the lat/lon of the point that is extracted from the global dataset, while the surface dataset contains the lat/lon you specified. However, the domain file is not longer used in CTSM5.1 moving forward.
If you want to run CLM5, you can do that within a ctsm5.1, ctsm5.2, ctsm5.3 checkout.
For example, this case worked for me using a ctsm5.1.dev174 checkout:

./create_newcase --case clm50_ctsm51d174_DK-SOR_2000 --res CLM_USRDAT --compset 2000_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_SROF_SGLC_SWAV --user-mods-dirs /glade/derecho/scratch/oleson/DK-SOR_ctsm51d174/user_mods/ --run-unsupported

It uses surface data generated from:

./subset_data point --lat 55.5 --lon 11.6 --site DK_SOR --dompft 8 --pctpft 100 --create-surface --create-domain --create-user-mods --outdir /glade/derecho/scratch/oleson/DK-SOR_ctsm51d174 --overwrite
Hi,Oleson

I can only use CLM5.0 version to make simulation (CTSM did not work on Archer2 for me), so I have to use domain files, as tthe output of domainfile/surface are mismatch from CTSM, can I manully modify the domainfiles lat and lon, to make it the same as in surfdata.

Best
Ru
 
Status
Not open for further replies.
Top