how to use roms plot package?

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
leonjld
Posts: 51
Joined: Fri Feb 27, 2004 6:30 pm
Location: NOAA/NESDIS/STAR

how to use roms plot package?

#1 Post by leonjld » Sun Nov 25, 2007 6:03 pm

I have finished compilation and there are several executable files such as 'cnt' 'ccnt' 'csec', etc. But I don't know how to use these for plotting?

debcox
Posts: 15
Joined: Tue Mar 09, 2004 3:21 pm
Location: University of New South Wales, Australia

Re: how to use roms plot package?

#2 Post by debcox » Mon Nov 26, 2007 2:29 am

Hi,

There should also be sample input files for each program, named cnt.in, csec.in etc.

Edit the appropriate input file and if you are using Unix/Linux, you can run the executable with input from the .in file using the command

cnt < cnt.in

or similar.

regards,
Deborah

leonjld
Posts: 51
Joined: Fri Feb 27, 2004 6:30 pm
Location: NOAA/NESDIS/STAR

#3 Post by leonjld » Mon Nov 26, 2007 4:01 pm

thanks Deborah. I managed to make it partially work. However, there is another problem. When I modified the cnt.in and tried to output my test run using upwelling case (predefined in ROMS), it generated the following error:

GET_NC2DAT - error while reading variable: temp
NetCDF: Index exceeds dimension bound

Execution abnormally terminated in module: GET_NC2DAT

Since the upwelling case does not have grid file, I modified the cnt.in so it will not read grid file and coastline file. But I don't know how to do with the LGRID and the range of latitude and longitude, so I just specified LGRID=0.1 and the range to 0.0~90.0 for both latitude and longitude.



______________________________________________________________

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

ocean_his.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= 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

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

0.000000 0.2500000 0.5000000 0.7500000 1.000000
1.250000 1.500000 1.750000 2.000000 2.250000
2.500000 2.750000 3.000000 3.250000 3.500000
3.750000 4.000000 4.250000 4.500000 4.750000
5.000000


Parameters:

number of points (Lr,Mr,Nr) = 43 82 16
basin dimensions (Lx,Le) = 41.000 80.000


Field Diagnostics:

Day = 0.000
Field type = Potential Temperature (C)
Model level = 1
Number of points = 3526
Minimum = 1.45064764E+01 ( 1, 29 )
Maximum = 1.87151108E+01 ( 1, 1 )
Mean = 1.53662481E+01
RMS = 1.54259357E+01
Average Deviation = 1.08849454E+00
Variance = 1.83655632E+00
Standard Deviation = 1.35519600E+00
Skewness = 1.44651937E+00
Kurtosis = 3.58500385E+00


CNTPACK - real workspace used: 1690 given: 1000000
- integer workspace used: 20 given: 5000000

Plotted frame: 00001


GET_NC2DAT - error while reading variable: temp
NetCDF: Index exceeds dimension bound

Execution abnormally terminated in module: GET_NC2DAT

debcox
Posts: 15
Joined: Tue Mar 09, 2004 3:21 pm
Location: University of New South Wales, Australia

Re: how to use roms plot package?

#4 Post by debcox » Fri Nov 30, 2007 2:07 am

If there is no separate grid file, you should set the main output file ocean_his.nc as the grid file in cnt.in.

Set all of the top, bottom, left and right map coordinates to zero to plot the full horizontal domain.

It is difficult to know exactly what your problem is without seeing the whole of your input file. Could you be trying to plot more time steps than are in the results file?

Deborah

rouf

Re: how to use roms plot package?

#5 Post by rouf » Fri Jul 11, 2008 9:26 am

I download and compile the plotting package following https://www.myroms.org/wiki/index.php/P ... stallation.
I am trying to make contour plot following the tutorial. In that case, I edit the ccnt_hraw.in file where at the end i include ocean_his.nc (output of upwelling test case) as fourth, fifth, and sixth file according to suggestions mentioned in this thread. But what about seventh file ie., coastline file? Here there will also be ocean_his.nc?

Another quarry is I am not finding the fort.35. where it supposed to be?

Looking for someones help
Rouf

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

Re: how to use roms plot package?

#6 Post by robertson » Fri Jul 11, 2008 2:59 pm

The coastline is not needed when plotting the upwelling test case. You should set CST to F in your .in file so the plotting package will ignore the 7th input file. I have tried to make this a little clearer in the tutorial.

Sorry for the lack of clarity regarding the fort.35 file. There is not a fort.35 file distributed with the plotting package. That said, you only need a fort.35 file if you wish to draw lines or shapes on your plots. If you don't want to draw anything on you plots then you should set IREF to 0. I have also updated the tutorial to further explain the fort.35 file and IREF.

good luck

rouf

Re: how to use roms plot package?

#7 Post by rouf » Sat Jul 12, 2008 4:37 am

Dear Robertson,
I am using cygwin for running roms. According to the tutorial I set CST to F in ccnt_hraw.in file and set IREF to 0. I also set the end portion of the file like following way:

Code: Select all

/home/MuhammadAbdurRouf/plot/Data/varid.dat
/home/MuhammadAbdurRouf/plot/Palettes/natlan1.pal
/home/MuhammadAbdurRouf/plot/Data/default.cnt
ocean_his.nc 
ocean_his.nc 
ocean_his.nc 
ocean_his.nc 
and when I put the command like

Code: Select all

ccnt <ccnt_hraw.in
it shows following error

Code: Select all

GET_NC2DAT - cannot inquiring ID for variable: hraw
NetCDF: Variable not found    
Execution abnormally terminated in module: GET_NC2DAT
My executable file was ccntG.exe. But I rename as ccnt.exe. Is it the same way you did? Where do u find the ccnt_temp.in? As per the tutorial, I copy ccnt.in to ccnt_hraw.in and edit. and got the above error.

Pls help me
Rouf

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

Re: how to use roms plot package?

#8 Post by kate » Mon Jul 14, 2008 5:58 pm

It told you that you asked to plot a variable called hraw which is not in the file you gave it to plot. In the output to ccnt, there should be a chunk like this:

Code: Select all

[ID= 66] Coriolis parameter at RHO-points
[ID= 57] curvilinear coordinate metric in XI
[ID= 58] curvilinear coordinate metric in ETA
[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
This gives you the codes (ID) of the fields that it found in the file. Line 6 of ccnt.in has how many fields to plot and line 7 contains the list. For instance:

Code: Select all

10     NFIELDS: number of fields to plot. Line below, field(s) types:
21 1 2 23 24 44 45 50 51 53 19 124 125 126 127 128
Note that I told it to plot ten fields, but have more than ten ID's there. The 11th and beyond are ignored. Clear as mud?

rouf

Re: how to use roms plot package?

#9 Post by rouf » Fri Aug 08, 2008 9:51 am

I am stuck with the plotting package. For a cross-section plot I follow the tutorial with upwelling test case but at the end it shows following error

Code: Select all

MuhammadAbdurRouf@ROUF ~/myplot
$ which csecG
/roms/Projects/Upwelling/csecG

MuhammadAbdurRouf@ROUF ~/myplot
$ which idt
/usr/local/bin/idt

MuhammadAbdurRouf@ROUF ~/myplot
$ printenv NCARG_ROOT
/usr/local/

MuhammadAbdurRouf@ROUF ~/myplot
$ csecG <csec_upwelling.in
open: No such file or directory
apparent state: unit 10 named /home/MuhammadAbdurRouf/plot/Data/varid.dat
lately writing sequential formatted external IO
Segmentation fault (core dumped)
Please help me with your kind suggestion.

M.A-Rouf

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

Re: how to use roms plot package?

#10 Post by kate » Mon Aug 11, 2008 3:58 pm

Code: Select all

open: No such file or directory
apparent state: unit 10 named /home/MuhammadAbdurRouf/plot/Data/varid.dat
In your input file, you provide locations for several input files. varid.dat is one of those. It says that you don't have this file where you told it to look. Is it right?

rouf

Re: how to use roms plot package?

#11 Post by rouf » Wed Aug 13, 2008 10:49 am

Dear Kate,
varid.dat is in the exact location where i addressed. But surprisingly the following error comes
No such file or directory
apparent state: unit 10 named /home/MuhammadAbdurRouf/plot/Data/varid.dat
Is there anything wrong with following error message or somewhere else?
lately writing sequential formatted external IO
Segmentation fault (core dumped)
Rouf

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

Re: how to use roms plot package?

#12 Post by kate » Wed Aug 13, 2008 7:12 pm

If that file exists and is readable, I have no idea what is wrong. I see you are running the one compiled for debugging. Does this mean that you are prepared to run it in the debugger to see what's what? That's what I would do next. Beware that these programs aren't the easiest to follow.

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

Re: how to use roms plot package?

#13 Post by arango » Wed Aug 13, 2008 9:53 pm

There is step-by-step instructions in :arrow: wikiROMS showing how to use the plotting package. It seems to me that you are not following the instructions correctly. We have a lot of users that have used this package right away without problems. Perhaps, you edited the input script incorrectly and deleted an input line by accident. This plotting package is very simple to run. You have posted several messages about plotting in this forum for either the ROMS plotting package or the matlab scripts and you had problems at every step.

:idea: I will recommend to find someone at your institution to advise you about basic technical computer skills. You meed such skills to run a complex model like ROMS successfuly on your scientific application.

njarry
Posts: 7
Joined: Tue Jan 08, 2008 3:57 pm
Location: ACRI-IN

Re: how to use roms plot package?

#14 Post by njarry » Wed Apr 08, 2009 7:31 am

Hi everyone,

I'm working on the lake_signell test case (run OK) and plotting my results with NCARG.

If the option SED_MORPH is not activated in my lake_signell.h, ccnt < ccnt.in is OK and I can plot the bathymetry "h" (which is not evolving)

But I would like to visualize the bathymetry and its evolution through the time, so I activated the SED_MORPH option.
Then, when I issue the ccnt < ccnt.in I have an error message telling me that bathymetry does not belong to the plottable fields so I can't visualize it.
I saw when SED_MORPH is activated, the variable "bath" contains the changing bathymetry but "bath" does not belong to the plottable fields, according to the error message.


Does anyone have an idea ?

Thank you

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

Re: how to use roms plot package?

#15 Post by kate » Wed Apr 08, 2009 10:38 pm

The plotting code has a file somewhat like varinfo.dat, but called varid.dat. Check the attributes on bath/h and change them to match zeta, i.e., is time variant.

feroda

Re: how to use roms plot package?

#16 Post by feroda » Mon Apr 13, 2009 4:09 pm

Can plotting package plot zeta(time,y,x) along constant y or x?

cnt is for horizontal(y,x) plot, while sec is for vertical (z,y) or (z,x) plot.
I want to do a space one dimensional plot along x or y section, how to do it?

Thanks

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

Re: how to use roms plot package?

#17 Post by kate » Mon Apr 13, 2009 4:38 pm

I expect that if anyone here has such a code, it would be in Matlab. The Fortran plotting package won't do it, though you could write such a program. If I were to do it, I'd start over in some other language.

njarry
Posts: 7
Joined: Tue Jan 08, 2008 3:57 pm
Location: ACRI-IN

Re: how to use roms plot package?

#18 Post by njarry » Thu Apr 16, 2009 10:13 am

Hi,

I would like to plot the "suspended non cohesive sediment concentration".

I checked I have " Hout (isand) == T ! suspended concentration " in my sediment.in, so I guess the suspended concentration is written in my output history file.

But I do not manage to plot it because in the varid.dat there isn't any line concerning suspended non cohesive sediment concentration.

Whereas in my varinfo.dat, I have the variable :

'sand_' ! Input/Output
'suspended noncohesive sediment'
'kilogram meter-3' ! [kg/m3]
'sand_, scalar, series'
'ocean_time'
'idTvar(isand(i))'
'r3dvar'
1.0d0


So I tried to add a line like :

393,'IDSAND',1,T,'sand_','-', 'suspendend non cohesive sediment'

to my varid.dat with varying attributes but it does not work.

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

Re: how to use roms plot package?

#19 Post by kate » Thu Apr 16, 2009 5:38 pm

Have you done ncdump -h on the file you are trying to plot? Is the variable named sand_ in there? Or do you have sand_01, sand_02, mud_01, mod_02? Not that I know the sediment package at all, but that's something to check.

njarry
Posts: 7
Joined: Tue Jan 08, 2008 3:57 pm
Location: ACRI-IN

Re: how to use roms plot package?

#20 Post by njarry » Fri Apr 17, 2009 2:36 pm

Thank you Kate,

Doing a ncdump -h ocean_his.nc, I saw the variable was mud_01
So I add the following line to my varid.dat :

393,'IDTVAR',1,F,'mud_01','-' 'suspended cohesive sediment(kg/m3)'

Post Reply