When porting CESM onto Prof. YTQ’s account on SAS (School of Atmospheric Sciences) Computing Platform, we met a bunch of problems on dependency. We highly suspect the administrator did not use the identical compiler to build all libs. Thus we tried to build our own dependencies using exactly the same compiler.
While building the NetCDF fortran lib to bundle into the C lib, in configuring, we met the problem:
configure: error: cannot compute sizeof (off_t)
We are using the configuring command:
./configure --prefix=/wind1/home/qiaoyt/soft/netcdf-4331-intel15/ LDFLAGS="-L/wind1/home/qiaoyt/soft/netcdf-4331-intel15/lib" CPPFLAGS="-I/wind1/home/qiaoyt/soft/netcdf-4331-intel15/include" FC=ifort
It’s quite strenge because the sizeof any type of variable is 0 in the configuring output. I suspect the configure utility cannot locate the C lib correctly, so I added the environmental variable for LD_LIBRARY_PATH
in ~/.bashrc
:
export LD_LIBRARY_PATH=$LIB_NETCDF:$LD_LIBRARY_PATH
The configure utility passed after source the bashrc. It seems to be a bug of the configure utility in NetCDF-fortran lib to locate the C lib.
The model was successfully ported after we re-built every lib with the identical compiler.
Updated 2019-01-10
Wenxiu Zhong met PopLatLon error:
ls: cannot access map_*: No such file or directory (0) create_rmpPopFileName: file not recognized/found: map_gx1v6_to_1x1d_bilin_da_100716.nc (0) create_rmpPopFileName: dir searched: ./
This is actually the system cannot find the pop remap weight file. The file info can be found from the NCL official site, which is actually downloaded from the CESM official svn site.
After downloaded the files, export related environmental variable in ~/.bashrc
:
export NCL_POP_REMAP=$DIR_TO_POP_REMAP_FILE
source ~/.bashrc
and re-run the script.
Updated 2018-12-31
YT met segmentation fault error when using similar tech as in the UV Nudging experiment to conduct TP heatforcing experiments.
The segfault comes from the user-added call in phypkg.F90
:
call infld('tp', fh_tpmask, 'lon', 'lat', 1, pcols, begchunk, endchunk, &
tpmask, found, grid_map='PHYS')
According to wikipedia:
In computing, a segmentation fault (often shortened to segfault) or access violation is a fault, or failure condition, raised by hardware with memory protection, notifying an operating system (OS) the software has attempted to access a restricted area of memory (a memory access violation).
We believe the error comes from the infld
reading process. Somehow the program violates the memory access limit, such as using double to read byte, or reading after End-of-File.
However, the original code is copied from a previous F compset run, which was smoothly conducted. So we re-check the ad-hoc part:
!*** MOD START: infld TP mask and heating file
fh_tpmask=>tpmask_file_get_id()
call infld('tp', fh_tpmask, 'lon', 'lat', 1, pcols, begchunk, endchunk, &
tpmask, found, grid_map='PHYS')
The thing is that we read the file info (get the file handle) in a function from another module (cam_initfiles.F90
), and use the pointer to get the function handle in phypkg.F90
. In ` cam_initfiles.F90` we define:
function tpmask_file_get_id()
type(file_desc_t), pointer :: tpmask_file_get_id
tpmask_file_get_id => fh_tpmask
end function tpmask_file_get_id
Updated 2018-12-27