Error to plot by the ROMS plotting package

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Error to plot by the ROMS plotting package

#1 Unread post by agpc »

Hi everyone,
I've compiled successfully the roms plot package and there are four programs, including ccnt, cnt, csec and sec in the PLT_BINDIR.
When I used this package to plot the ROMS output, it reported that:

Code: Select all

[cloud@igplogin ROMS_output]$ ./csec < csec.in 
At line 576 of file csec.f90 (unit = 5, file = 'stdin')
Fortran runtime error: Bad integer for item 1 in list input
And I found this line in the csec.f90 file:
READ (stdinp,*) nfields
Here is my csec.in file:

Code: Select all

2016 -1  :  year and starting year-day (use yearday<0, for no time label)
ROMS 3.0
!Wind-Driven Upwelling/Downwelling over a Periodic Channel
ROMS output
Time-averaged fields
Potential Temperature (C), salinity, u, v, w, omega
1    NFIELDS: number of fields to plot. Line below, field(s) types:
122  field identification: FLDID(1:NFIELDS).
0     FRSTD  : first day (>0) or time record (<0) to plot
0     LASTD  : last day (>0) or time record (<0) to plot
0     DSKIP  : plot every other DSKIP days (see below)
1     FINDX  : forecast record to process, if any (atmospheric files only).
2     ISECPOS: section positions: [0] grid units, [1] Cartesian, [2] spherical
21    XSEC1  : starting section X-position (grid units, or km, or degrees).
110     YSEC1  : starting section Y-position (grid units, or km, or degrees).
21    XSEC2  : ending section X-position (grid units, or km, or degrees).
160    YSEC2  : ending section Y-position (grid units, or km, or degrees).
1.0   DELS   : section horizontal grid spacing (km or degrees).
0     SZTOP  : shallowest section depth to consider (meters).
150   SZBOT  : deepest section depth to consider (meters).
16    KMS    : number of refiment section levels between SZTOP and SZBOT.
0     VINTRP : vertical interpolation: [0] linear, [1] cubic splines.
250.0   PMIN   : field minimum value for color palette (0.0 for default).
300.0   PMAX   : field maximum value for color palette (0.0 for default).
1     ICNT   : draw contours between color bands: 0=no, 1=yes.
0     IREF   : secondary or reference field option (see below).
26    IDOVER : overlay field identification (for IREF=1,2 only).
0.0   RMIN   : overlay field minimum value to consider (0.0 for default).
0.0   RMAX   : overlay field maximum value to consider (0.0 for default).
1     NPAGE  : number of plots per page (currently 1, 2, or 4).
1     IFILL  : mask area below water column: [0] no, [1] yes.
F     READGRD: logical switch to read in positions from grid NetCDF file.
F     PLTLOGO: logical switch Logo.
T     WRTHDR : logical switch to write out the plot header titles.
T     WRTBLAB: logical switch to write out the plot bottom title.
T T   WRTRANG: logical switch to write out data/overlay range values and CI.
F     WRTFNAM: logical switch to write out input primary filename.
F     WRTDATE: logical switch to write out current date.
/work/users/cloud/user/manh/anaconda3/plot/Data/varid.dat
/work/users/cloud/user/manh/anaconda3/plot/Palettes/jet120.pal
/work/users/cloud/user/manh/anaconda3/plot/Data/default.cnt
cean_avg1_00001.nc
ocean_hist1_00001.nc
Please help me to address it. Any suggestion is appreciated!
Thank all,

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#2 Unread post by robertson »

I'm guessing you have a typo near the bottom:

cean_avg1_00001.nc

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#3 Unread post by agpc »

Hi Robertson,
After I changed the error which you mentioned, the error still happened.

Code: Select all

[cloud@igplogin ROMS_output]$ ./csec < csec.in 
At line 576 of file csec.f90 (unit = 5, file = 'stdin')
Fortran runtime error: Bad integer for item 1 in list input

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#4 Unread post by robertson »

You need to completely remove the line:

Code: Select all

!Wind-Driven Upwelling/Downwelling over a Periodic Channel
The plotting package is expecting "nfields" to be line 6. There can't be any missing or commented lines until line 45 and the order matters.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#5 Unread post by agpc »

Hi Robertson,
Thank you for your reply.
Following your suggestion, I can fix the last error.
However, I had a problem:

Code: Select all

[cloud@igplogin ROMS_output]$ ./csec < csec.in 

  Plottable Fields in Primary NetCDF File: 
  ---------------------------------------

          ocean_avg1_00001.nc


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x2B3634E05697
#1  0x2B3634E05CDE
#2  0x2B363589833F
#3  0x2B36306B025A
#4  0x2B3639113229
#5  0x2B363144D6F5
#6  0x44854A in what_flds_
Segmentation fault
Please help me to solve it.
Thank you again.

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#6 Unread post by robertson »

You could try building the plotting package with PLT_DEBUG turned on. That might give you a better idea where the error is occurring. Building with debug will not replace your existing csec, etc. but will instead create a csecG, etc. in the MY_PROJECT_DIR, which is usually the directory you execute build_plt.* from.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#7 Unread post by agpc »

Hi Robertson,
Following your recommend, I've recompile this package with PLT_DEBUG turned on.
However, I had the same problem with the last post.

Code: Select all

[cloud@igplogin ROMS_output]$ ./csecG < csec.in 

  Plottable Fields in Primary NetCDF File: 
  ---------------------------------------

          ocean_avg1_00001.nc


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7FA9A4362697
#1  0x7FA9A4362CDE
#2  0x7FA9A385E33F
#3  0x7FA9A8A4325A
#4  0x7FA9A14EAE79
#5  0x7FA9A7A1C0F8
#6  0x44853A in what_flds_
Segmentation fault

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Error to plot by the ROMS plotting package

#8 Unread post by kate »

You need to clean out the old build and start fresh. Getting that error in debug mode should give you more useful information than that.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#9 Unread post by agpc »

Hi Kate,
I've refreshed and recompiled the ROMS plotting package. And the problem I got is:

Code: Select all

[cloud@igplogin ROMS_output]$ ./csecG < csec.in 

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x2AFD81A82697
#1  0x2AFD81A82CDE
#2  0x2AFD8251533F
#3  0x2AFD7D32B4D5
#4  0x2AFD85D901FB
#5  0x2AFD7E0CA6F5
#6  0x4496B6 in opencdf_ at opencdf.f90:1922 (discriminator 4)
#7  0x408358 in get_parm_ at csec.f90:784
#8  0x408821 in MAIN__ at csec.f90:227
Segmentation fault
The line 227 of the csec.f90 program is

Code: Select all

 IF ((f3(i).gt.spval0).or.(f1(i).gt.spval0)) THEN
The line 784 of the csec.f90 program is

Code: Select all

CALL opencdf (fname(3),fname(4),fname(5))
The line 1922 of the opencdf.f90 program is

Code: Select all

          status=nf_inq_var(ncid1,varid,varnam(i),vartyp,nvdims(i),     &
     &                      vdims(1,i),nvatts)
Please help me to address it.
Many thanks,

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#10 Unread post by robertson »

Is it possible that when the plotting package runs it's actually using a different NetCDF than you compiled with? If you are running Linux type:

Code: Select all

ldd /path/to/csecG
with /path/to replaced by the correct path to csecG. Make sure that the libnetcdf listed by the ldd command is the one you compiled against.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#11 Unread post by agpc »

Hi Robertson,
I used your command and this is my result:

Code: Select all

[cloud@igplogin src]$ ldd csecG 
	linux-vdso.so.1 =>  (0x00007fff491b3000)
	/work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libirc.so (0x00002b57bb3c2000)
	libX11.so.6 => /lib64/libX11.so.6 (0x00002b57bb639000)
	libcairo.so.2 => /lib64/libcairo.so.2 (0x00002b57bb977000)
	libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00002b57bbcae000)
	libpng15.so.15 => /lib64/libpng15.so.15 (0x00002b57bbf6d000)
	libnetcdff.so.6 => /work/apps/intel_2016/netcdf/4.3.3.1/lib/libnetcdff.so.6 (0x00002b57bc198000)
	libnetcdf.so.7 => /work/apps/intel_2016/netcdf/4.3.3.1/lib/libnetcdf.so.7 (0x00002b57bc7c5000)
	libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00002b57bfb4a000)
	libm.so.6 => /lib64/libm.so.6 (0x00002b57bfe6c000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b57c016e000)
	libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00002b57c0384000)
	libc.so.6 => /lib64/libc.so.6 (0x00002b57c05c0000)
	libxcb.so.1 => /lib64/libxcb.so.1 (0x00002b57c098d000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002b57c0bb5000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b57c0db9000)
	libpixman-1.so.0 => /lib64/libpixman-1.so.0 (0x00002b57c0fd5000)
	libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00002b57c127e000)
	libEGL.so.1 => /lib64/libEGL.so.1 (0x00002b57c14c0000)
	libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x00002b57c16d4000)
	libxcb-render.so.0 => /lib64/libxcb-render.so.0 (0x00002b57c18d8000)
	libXrender.so.1 => /lib64/libXrender.so.1 (0x00002b57c1ae6000)
	libXext.so.6 => /lib64/libXext.so.6 (0x00002b57c1cf1000)
	libz.so.1 => /work/apps/intel_2016/zlib/1.2.8/lib/libz.so.1 (0x00002b57c1f03000)
	libGL.so.1 => /lib64/libGL.so.1 (0x00002b57c211e000)
	librt.so.1 => /lib64/librt.so.1 (0x00002b57c23aa000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00002b57c25b2000)
	libmfhdf.so.0 => /work/apps/intel_2016/hdf/4.2.11/lib/libmfhdf.so.0 (0x00002b57c27c2000)
	libdf.so.0 => /work/apps/intel_2016/hdf/4.2.11/lib/libdf.so.0 (0x00002b57c29f1000)
	libjpeg.so.9 => /work/apps/intel_2016/jpeg/9b/lib/libjpeg.so.9 (0x00002b57c2cad000)
	libhdf5_hl.so.10 => /work/apps/intel_2016/hdf5/2.8.15p1/lib/libhdf5_hl.so.10 (0x00002b57c2f30000)
	libhdf5.so.10 => /work/apps/intel_2016/hdf5/2.8.15p1/lib/libhdf5.so.10 (0x00002b57c3157000)
	libsz.so.2 => /work/apps/intel_2016/szip/2.1/lib/libsz.so.2 (0x00002b57c36fa000)
	libcurl.so.4 => /lib64/libcurl.so.4 (0x00002b57c3916000)
	libifport.so.5 => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libifport.so.5 (0x00002b57c3b7f000)
	libifcore.so.5 => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libifcore.so.5 (0x00002b57c3dad000)
	libimf.so => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libimf.so (0x00002b57c4111000)
	libsvml.so => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libsvml.so (0x00002b57c46af000)
	libintlc.so.5 => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002b57c6036000)
	libirng.so => /work/apps/intel/compiler/2020/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libirng.so (0x00002b57c62ad000)
	/lib64/ld-linux-x86-64.so.2 (0x00002b57bb19e000)
	libXau.so.6 => /lib64/libXau.so.6 (0x00002b57c6617000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002b57c681b000)
	libuuid.so.1 => /lib64/libuuid.so.1 (0x00002b57c6a45000)
	libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00002b57c6c4a000)
	libGLX.so.0 => /lib64/libGLX.so.0 (0x00002b57c6f00000)
	libidn.so.11 => /lib64/libidn.so.11 (0x00002b57c7132000)
	libssh2.so.1 => /lib64/libssh2.so.1 (0x00002b57c7365000)
	libssl3.so => /lib64/libssl3.so (0x00002b57c758f000)
	libsmime3.so => /lib64/libsmime3.so (0x00002b57c77e1000)
	libnss3.so => /lib64/libnss3.so (0x00002b57c7a08000)
	libnssutil3.so => /lib64/libnssutil3.so (0x00002b57c7d35000)
	libplds4.so => /lib64/libplds4.so (0x00002b57c7f65000)
	libplc4.so => /lib64/libplc4.so (0x00002b57c8169000)
	libnspr4.so => /lib64/libnspr4.so (0x00002b57c836e000)
	libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00002b57c85ac000)
	libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00002b57c87f9000)
	libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00002b57c8ae2000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002b57c8d15000)
	liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00002b57c8f19000)
	libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00002b57c9128000)
	libssl.so.10 => /lib64/libssl.so.10 (0x00002b57c937d000)
	libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00002b57c95ef000)
	libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00002b57c9a51000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002b57c9c61000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x00002b57c9e65000)
	libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00002b57ca07e000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00002b57ca29b000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b57ca4c2000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00002b57ca6f9000)
	libfreebl3.so => /lib64/libfreebl3.so (0x00002b57ca95b000)
I think it is definitely my netcdf library which I compile this package.

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#12 Unread post by robertson »

It looks like the netcdf and HDF5 you are linking with were compiled with a much older (2016) Intel compiler than you are using to compile the plotting package (2020). Do you have access to the Intel 2016 compiler? If so, try compiling the plotting package with that version instead.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#13 Unread post by agpc »

Hi Robertson,
I've tried to use the netcdf library with version 2016, however, it still failed.
I attach the compilers file in this post.
Please help me to find the solution for this.
Thank you!
Attachments
Linux-gfortran.mk
(2.52 KiB) Downloaded 777 times

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#14 Unread post by robertson »

I also just noticed that your csecG executable seems to be link to libgfortran as well. Perhaps your version of NCAR Graphics was built with gfortran instead of the Intel compilers. What is your NCARG_ROOT environment variable set to?

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#15 Unread post by agpc »

Hi Robertson,
I think my NCARG_ROOT environment variable set to gfortran (GNU). I'm not sure about that, so can you tell me how to examine it.

Code: Select all

[cloud@igplogin src]$ printenv NCARG_ROOT
/work/apps/gnu_4.8.5/ncl_ncarg/6.3.0

User avatar
arango
Site Admin
Posts: 1368
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Error to plot by the ROMS plotting package

#16 Unread post by arango »

Wow, are you really asking how Linux works? No wonder why you are having so many troubles at every step in your application. We have lots of posts in this forum from you. I am expecting users that select ocean modeling as a carrier or hobby to be more curious and familiar with computers. By the way, have you ever heard about search engines like GooGle? For example, if you search for how to set and list environment variables in Linux in Google, you find out lots of links for answering the question yourself. We are busy and don't have much time to pay attention to everything that you post in this forum.

By the way, since Google's creation in 1998, I am an avid user of this excellent search engine. Every error that I get from compiling, executing, and error from computers of any kind I cut and paste in Google to get more information. For your information, I have been playing with ocean models since 1990. We are not supposed to know about everything but an ocean modeler needs to be curious and resourceful. Otherwise, we are in the wrong business.

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Error to plot by the ROMS plotting package

#17 Unread post by robertson »

Using an NCL/NCARG built with the system's gnu (4.8.5) is very unlikely to work with a NetCDF/HDF5 and ROMS plotting package compiled with Intel compilers. You have 2 options, find or compile NCL/NCARG with the Intel compilers or find or compile NetCDF/HDF5 with the GNU 4.8.5 compilers.

agpc
Posts: 63
Joined: Mon Jul 27, 2020 7:44 pm
Location: Applied Geophysics Center (AGPC)

Re: Error to plot by the ROMS plotting package

#18 Unread post by agpc »

Hi Robertson,
Thank you for your explanation.
I've used the "module purge" command to clear all of my environment variables, then I loaded the netcdf, hdf5, NCAR_ROOT libaries with GNU compilers and recompiled this package. Finally, I could run it successfully.

Code: Select all

[cloud@igplogin ROMS_output]$ ./csecG < csec.in 

  Plottable Fields in Primary NetCDF File: 
  ---------------------------------------

          ocean_hist1_00001.nc

 [ID= 59] bathymetry at RHO-points
 [ID= 66] Coriolis parameter at RHO-points
 [ID= 57] curvilinear coordinate metric in XI
 [ID= 58] curvilinear coordinate metric in ETA
 [ID= 56] angle between XI-axis and EAST
 [ID= 21] free-surface
 [ID= 13] vertically integrated u-momentum component
 [ID= 14] vertically integrated v-momentum component
 [ID=  1] u-momentum component
 [ID=  2] v-momentum component
 [ID= 19] vertical momentum component
 [ID= 20] S-coordinate vertical momentum component
 [ID= 23] potential temperature
 [ID= 24] salinity
 [ID= 41] vertical viscosity coefficient
 [ID= 68] surface u-momentum stress
 [ID= 69] surface v-momentum stress
 [ID= 76] bottom u-momentum stress
 [ID= 77] bottom v-momentum stress

  Available Times: 
  ---------------

   57678.00    


  Parameters: 

      number of points (im,jm,km) =  390 286  1[img][/img]6
         basin dimensions (Lx,Ly) =   7202.094  5276.597

  
     temp          Rec = 00001 Min = -1.12582579E-01 Max =  3.46232872E+01

 GET_SCOOR: starting/ending points out of bounds
            in cross-section specification. 
            Check (XSEC1,YSEC1) and (XSEC2,YSEC2).
Although the image is black which mean I have something wrong in my input. So, I will dig in this program.
Thank you very much for your help.
Attachments
Capture.PNG
Capture.PNG (8.38 KiB) Viewed 44172 times

Post Reply