[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #UGV-181225]: Netcdf and fortran



Hello,

This is the correct email address, and hopefully we will be able to sort this 
out.  How large are the large-size arrays you are working with?

I'm unfamiliar with the 'mcmodel=medium' flag when compiling Fortran, but I was 
able to learn a bit about it (primarily from the following link:  
https://stackoverflow.com/questions/12916176/gfortran-for-dummies-what-does-mcmodel-medium-do-exactly).
  This is clearly an issue related to memory allocation, and suggests that 
perhaps the size of the large array you are working with might be problematic.  
I'm uncertain why using `mcmodel=medium` would be problematic with a small 
array, and it makes me curious if there is an underlying issue with the logic 
(start + count) in the code linked to the Fortran library.  I'm not 
particularly proficient with Fortran, but if you can provide the Fortran code I 
can attempt to compile and run it here to try to diagnose what is happening.  
I'm also curious, have you attempted to compile and run the code using gfortran 
instead of the pgi compilers? I'm curious if there would be a different in the 
observed behavior.

-Ward


> Dear Sir/Madam,
> 
> I have a question related to using netcdf and fortran compiler. On the 
> webpage (https://www.unidata.ucar.edu/software/netcdf/#help),
> I only see the option to request support for C-based or Java netcdf library. 
> I am not sure if that is the correct email I should send my question to.
> 
> I am using pgi/17.3 and netcdf/4. Since I need to deal with many large-size 
> arrays, I add “-mcmodel=medium” as an option for compiling.
> Here is my script for compiling:
> 
> 
> #/bin/csh
> 
> source /etc/profile.d/modules.csh
> 
> module load pgi/17.3
> 
> module load netcdf/4
> 
> pgf90 $1.f90 -mcmodel=medium -I$INC_NETCDF -R$LIB_NETCDF -L$LIB_NETCDF 
> -lnetcdff -o $1
> 
> 
> If I don’t use this option, I get the following error message:
> 
> 
> /tmp/pgf90emSemwz2qiRh.o: In function `MAIN_':
> 
> /net/fs05/d1/xgao/cesm2/Analyses/GSWP3/forcing/Monthly/script/./Vars_trend_sigtest_0.5.f90:46:(.text+0x3c8):
>  relocation truncated to fit: R_X86_64_32S against `.bss'
> 
> /net/fs05/d1/xgao/cesm2/Analyses/GSWP3/forcing/Monthly/script/./Vars_trend_sigtest_0.5.f90:51:(.text+0x523):
>  relocation truncated to fit: R_X86_64_32S against `.bss'
> 
> /net/fs05/d1/xgao/cesm2/Analyses/GSWP3/forcing/Monthly/script/./Vars_trend_sigtest_0.5.f90:51:(.text+0x6af):
>  relocation truncated to fit: R_X86_64_32S against `.bss'
> 
> If I use this option, I can compile the code but I always get the following 
> error message when I run the executable,
> 
> 
> 
> NetCDF: Start+count exceeds dimension bound
> 
> I also tested reading a small array and found that “-mcmodel=medium” option 
> does cause the issue when running the executable (the same error message as 
> above). But I can run it without the option (since it is a small array).
> 
> I am wondering if there is an solution for my issue or any other alternative 
> to get around the issue?
> 
> Thanks,
> 
> Xiang
> 
> 
> 


Ticket Details
===================
Ticket ID: UGV-181225
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.