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

mksurfdata crashes when compiled with ifort

Hi,

I want to run CLM3.5 for a single point. The Makefiles of the preprocessing programs mkgriddata and mksurfdata contain compiler options for pgf90, lf95, and pathf90. However, none of these compilers is available for me. Instead, I try to use the Intel Fortran Comiler ifort.

I can compile both programs with ifort adding

ifeq ($(FC),ifort)
FFLAGS = -c -I$(INC_NETCDF) $(CPPDEF) -extend_source -fpp
ifeq ($(DEBUG),TRUE)
FFLAGS += -CB
endif
LDFLAGS = -L$(LIB_NETCDF) -lnetcdf
endif

to the Makefiles. mkgriddata seems to work fine. However, if I run mksurfdata, the program crashes with a "segmentation fault". Obviously, the problem arises when processing the file mksrf_soitex.10level.nc. Here the last messages during the program execution:

Attempting to make %sand and %clay .....
(GETFIL): attempting to find local file mksrf_soitex.10level.nc
(GETFIL): using
/home/klaueckh/clm3.5/inputdata/lnd/clm2/rawdata/mksrf_soitex.10level.nc

(GETFIL): attempting to find local file mksrf_soitex.10level.nc
(GETFIL): using
/home/klaueckh/clm3.5/inputdata/lnd/clm2/rawdata/mksrf_soitex.10level.nc
read_domain read lon and lat dims
read_domain initialized domain
read_domain read LONGXY and LATIXY fields
read_domain read EDGE[NESW]
read_domain read LANDMASK
Segmentation fault

It seems to me that there is a problem with the elements of the variable "domain". If, for example, I add

write (*,*) domain%longxy

as line number 193 in creategridMod.F90, then all 720 x 360 longitudes for mksrf_pft.060929.nc, mksrf_lanwat.060929.nc, mksrf_fmax.070406.nc, and mksrf_glacier.060929.nc are printed out. Yet, if it comes to mksrf_soitex.10level.nc (4320 x 2160 values), the program stops again with "Segmentation fault".

I would be very grateful for a solution of this problem!

KlausE
 

slevis

Moderator
Staff member
Sounds as though you are working outside the limits of what we support. Unfortunately we must set limits to what we support.

Good luck with your work.

Sam Levis
CLM Community Liaison
 
Dear Thomas,

solution: In mksurfdata/creategridMod.F90, row 341 sqq., replace

if (.not.landfracset.and.maskset) then
landfracset = .true.
where (domain%mask(:,:) == 0)
domain%frac(:,:) = 0._r8 !ocean
elsewhere
domain%frac(:,:) = 1._r8 !land
endwhere
endif

by

if (fname.NE.mksrf_fsoitex) then

if (.not.landfracset.and.maskset) then
landfracset = .true.
where (domain%mask(:,:) == 0)
domain%frac(:,:) = 0._r8 !ocean
elsewhere
domain%frac(:,:) = 1._r8 !land
endwhere
endif

endif

Best wishes,

KlausE
 
Top