error in plotting bathymetry at rho-points from history file

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
nma

error in plotting bathymetry at rho-points from history file

#1 Unread post by nma »

Dear friends,

I have been trying to utilize ROMS/TOMS plotting package to plot some of my results. So have been following the instructions provided in the wikiroms.

I started with the simpler varaible, bathymetry at RHO-points, which has following details under varid.dat file:
059,'IDBTHR',1,T,'h','-', 'Bathymetry at RHO-points (m)'

I am trying to use the history output file to read this 2-D data:
double h(eta_rho, xi_rho) ;
h:long_name = "bathymetry at RHO-points" ;
h:units = "meter" ;
h:coordinates = "lon_rho lat_rho" ;
h:field = "bath, scalar" ;

Accordingly my ccnt_bathy.in file looks like this:
1996 -1 : year and starting year-day (use yearday<0, for no time label)
ROMS 3.0
South Pacific
1/2 Degree Resolution
Bathymetry (h, m)
1 NFIELDS: number of fields to plot. Line below, field(s) types:
59 field identification: FLDID(1:NFIELDS)
1 NLEVELS: number of levels and/or depths to plot (0 for all levels)
0 levels (>0) or depths (<0) to plot: FLDLEV(1:NLEVELS)
-1 FRSTD : first day to plot
-1 LASTD : last day to plot
0 DSKIP : plot every other DSKIP days (0.0 plot at its own time frequency)
1 FINDX : forecast record to process, if any (atmospheric files only).
0 VINTRP : vertical interpolation scheme: 0=linear, 1:cubic splines
-6000 PMIN : field minimum value for color palette (0.0 for default)
1000 PMAX : field maximum value for color palette (0.0 for default)
1 ICNT : draw contours between color bands: 0=no, 1=yes
0.0 ISOVAL : iso-surface value to process (see below)
1.2 VLWD : vector line width (1.0 for default)
4.0 VLSCL : vector length scale (1.0 for default)
2 IVINC : vector grid sampling in the X-direction (1 for default)
1 JVINC : vector grid sampling in the Y-direction (1 for default)
-2 IREF : secondary or reference field option (see below)
25 IDOVER : overlay field identification (for IREF=1,2 only)
1 LEVOVER: level of the overlay field (set to 0 if same as current FLDLEV)
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)
2.0 LGRID : Desired longitude/latitude grid spacing (degrees)
2 IPROJ : map projection (see below).
0.0 PLON : projection Pole longitude (west values are negative).
0.0 PLAT : projection Pole latitude (south values are negative).
0.0 ROTA : projection rotation angle (clockwise; degrees).
0 LMSK : flag to color mask land: [0] no, [1] yes
-1 NPAGE : number of plots per page (currently 1, 2, or 4)
T READGRD: logical switch to read in positions from grid NetCDF file.
F PLTLOGO: logical switch draw Logo.
F WRTHDR : logical switch to write out the plot header titles.
F WRTBLAB: logical switch to write out the plot bottom title.
F WRTRANG: logical switch to write out data range values and CI.
F WRTFNAM: logical switch to write out input primary filename.
F WRTDATE: logical switch to write out current date.
T CST : logical switch to read and plot coastlines and islands.
-10.0 10.0 : bottom and top map latitudes (south values are negative).
110.0 150.0 : left and right map longitudes (west values are negative).

/n1/nma/Desktop/Softwares/myroms/Plot/Data/varid.dat
/n1/nma/Desktop/Softwares/myroms/Plot/Palettes/gebco1.pal1.pal
/n1/nma/Desktop/Softwares/myroms/resfiles/07-sp-res/default.cnt
/n1/nma/Desktop/Softwares/myroms/resfiles/07-sp-res/sp_his.nc
/n1/nma/Desktop/Softwares/myroms/resfiles/07-sp-res/sp_his.nc
/n1/nma/Desktop/Softwares/myroms/input_files/ncfiles/south_pacific_grid.nc
/n1/nma/Desktop/Softwares/myroms/Plot/Data/global_crude.cst
!svn $Id: ccnt.in 538 2011-03-01 17:37:44Z arango $
!========================================================= Hernan G. Arango ===
! Copyright (c) 2002-2011 The ROMS/TOMS Group ===
! Licensed under a MIT/X style license ===
! See License_ROMS.txt ===
!==============================================================================
!

*** Above FILENAMES:

1st line: input; variables ID file.
2nd line: input; color palette file.
3rd line: input; internal plotting parameters.
4th line: input; primary NetCDF file.
5th line: input; secondary NetCDF file.
6th line: input; grid NetCDF file.
7th line: input; coastlines file.
........................................................................
...............................................................

Before issueing the ccnt command, I checked the following:
[nma@nilima 07-sp-res]$ which ccnt
/n1/nma/Desktop/Softwares/myroms/Plot/bin/ccnt
[nma@nilima 07-sp-res]$ which idt
/n1/nma/Desktop/Softwares/ncl/bin/idt
[nma@nilima 07-sp-res]$ printenv NCARG_ROOT
/n1/nma/Desktop/Softwares/ncl

However I get following error:
[nma@nilima 07-sp-res]$ ccnt < ccnt_bathy.in
At line 717 of file ccnt.f90
Fortran runtime error: No such file or directory


The line#717 at ccnt.f90 is shown in blue and is related to varid:
!-----------------------------------------------------------------------
! Read in variables IDs.
!-----------------------------------------------------------------------
!
OPEN (inpvid,file=fname(0),form='formatted',status='old')

................................................................................

I believe all paths are correct. I am using history file as primary as well as secondary file. The grid file and its path are alright. Both varid.dat and ccnt_bathy.in files show the varid for "bathymetry at RHO-points" as 59, then why the error shows incorrect varid for h?
I could not find out where am I going wrong!

thanks for any hint in this regard...

regards, nilima

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

Re: error in plotting bathymetry at rho-points from history

#2 Unread post by kate »

Try omitting the blank line before your filenames. It's picky that way.

nma

Re: error in plotting bathymetry at rho-points from history

#3 Unread post by nma »

Thanks Kate for this trick...it worked fine :)

As this simple 2-D bathymetry could be plotted, so now I tried to plot 4-D temperature...
With minute changes in the ccnt_temp.in file (varid, colour range, etc.), I tried to do the same for temperature.
My temperature field that is saved in history file is a 4-D array. However when I check varid.dat file, there exist the following:

023,'IDTEMP',1,F,'temp','-', 'Potential Temperature (C)'
024,'IDSALT',1,F,'salt','-', 'Salinity (PSU)'


I am interested in plotting temperature at different vertical layers at different ocean-time. How can I make it possible?

Just for curiosity I tried to plot temperature with varid=23 and although ccnt < ccnt_temp.in completed its run, but is showing erroneous range for temp (shown below):

[nma@nilima 07-sp-res]$ ccnt < ccnt_temp.in

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

/n1/nma/Desktop/Softwares/myroms/resfiles/07-sp-res/sp_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= 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= 25] density anomaly
[ID= 38] depth of oceanic surface boundary layer
[ID= 41] vertical viscosity coefficient
[ID= 42] temperature vertical diffusion coefficient
[ID= 43] salinity vertical diffusion coefficient
[ID=124] surface net heat flux
[ID= 68] surface u-momentum stress
[ID= 69] surface v-momentum stress

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

0.000000 5.000000 10.00000 15.00000 20.00000
25.00000 30.00000 35.00000 40.00000 45.00000
50.00000 55.00000 60.00000 65.00000 70.00000
75.00000 80.00000 85.00000 90.00000 95.00000
100.0000 105.0000 110.0000 115.0000 120.0000
125.0000 130.0000 135.0000 140.0000 145.0000
150.0000 155.0000 160.0000 165.0000 170.0000
175.0000 180.0000 185.0000 190.0000 195.0000
200.0000 205.0000 210.0000 215.0000 220.0000
225.0000 230.0000 235.0000 240.0000 245.0000
250.0000 255.0000 260.0000 265.0000 270.0000
275.0000 280.0000 285.0000 290.0000 295.0000
300.0000 305.0000 310.0000 315.0000 320.0000
325.0000 330.0000 335.0000 340.0000 345.0000
350.0000 355.0000 360.0000 365.0000 370.0000
375.0000 380.0000 385.0000 390.0000 395.0000
400.0000 405.0000 410.0000 415.0000 420.0000
425.0000 430.0000 435.0000 440.0000 445.0000
450.0000 455.0000 460.0000 465.0000 470.0000
475.0000 480.0000 485.0000 490.0000 495.0000
500.0000 505.0000 510.0000 515.0000 520.0000
525.0000 530.0000 535.0000 540.0000 545.0000
550.0000 555.0000 560.0000 565.0000 570.0000
575.0000 580.0000 585.0000 590.0000 595.0000
600.0000 605.0000 610.0000 615.0000 620.0000
625.0000 630.0000 635.0000 640.0000 645.0000
650.0000 655.0000 660.0000 665.0000 670.0000
675.0000 680.0000 685.0000 690.0000 695.0000
700.0000 705.0000 710.0000 715.0000 720.0000
725.0000 730.0000 735.0000 740.0000 745.0000
750.0000 755.0000 760.0000 765.0000 770.0000
775.0000 780.0000 785.0000 790.0000 795.0000
800.0000 805.0000 810.0000 815.0000 820.0000
825.0000 830.0000 835.0000 840.0000 845.0000
850.0000 855.0000 860.0000 865.0000 870.0000
875.0000 880.0000 885.0000


Parameters:

number of points (Lr,Mr,Nr) = 227 199 32
basin dimensions (Lx,Le) = 8598.404 12556.559
map coordinates (Rlon,Llon) = 110.000 150.000
(Blat,Tlat) = -10.000 10.000
map projection = Mercator

temp Rec = 00001 Min = -1.88000000E+00 Max = 9.99999993E+36

Field Diagnostics:

Day = 0.000
Field type = Potential Temperature (C)
Depth = 0.00 m
Number of points = 0
Minimum = 1.00000004E+35 ( 1, 1 )
Maximum = -1.00000004E+35 ( 1, 1 )
Mean = 1.00000004E+35
RMS = 1.00000004E+35
Average Deviation = 1.00000004E+35
Variance = 1.00000004E+35
Standard Deviation = 1.00000004E+35
Skewness = 1.00000004E+35
Kurtosis = 1.00000004E+35


CNTCOLOR - real workspace used: 600 given: 1000000
- integer workspace used: 300 given: 5000000
- space used in area mask: 4250 given: 5000000

Plotted frame: 00001

DONE


Could you please help me to plot temperature field at different layers and different time steps from history (or average) file...

thanks and regards, nilima

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

Re: error in plotting bathymetry at rho-points from history

#4 Unread post by kate »

Did you get any plot at all?

To get all the levels and all the records, set NLEVELS, FRSTD and LASTD like:

Code: Select all

0     NLEVELS: number of levels and/or depths to plot (0 for all levels)
-100           levels (>0) or depths (<0) to plot: FLDLEV(1:NLEVELS)
0     FRSTD  : first day to plot
0     LASTD  : last day to plot
In the code shown here, the second line should be ignored because you've already told it to plot all levels (sigma levels).

To be perfectly honest, I am transitioning from this package to Python because of map drawing wackiness. It's a question of modifying ancient Fortran or learning and struggling with something different. I think most have gone down the Matlab road for plotting.

nma

Re: error in plotting bathymetry at rho-points from history

#5 Unread post by nma »

Thanks very much Kate..it works that way! In the previous trial, there was no plot.
Yes, also trying to utilize matlab..
I need another hint to properly define the longitudinal range:
While working with large south pacific domain, the plot remains ok when the longitudinal range is smaller (between 120.0°E and 180.0°E). However it is absurd when I try to plot a larger domain (120.0°E and 220°E) that extends 40° longitude_Westward after 180°E.
Lon_left=120.0°E Lon_right=220.0°E or -140.0°W
What shall I use as Lon_right?
thanks and regards, nilima

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

Re: error in plotting bathymetry at rho-points from history

#6 Unread post by kate »

Try adjusting PLON to be somewhere between your east and west longitude. Say, west=120, east=220, then PLON should be anywhere in between.

nma

Re: error in plotting bathymetry at rho-points from history

#7 Unread post by nma »

Thanks Kate, I could get the entire plot now.
regards, nilima

Post Reply