Generating initial file

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
venuscheung

Generating initial file

#1 Unread post by venuscheung »

Hey there, I am trying to generate initial file for ROMS using data in HYCOM, yet some error comes out.

[snd2@d2-ocean roms_clm]$ matlab -nodisplay -nosplash -nodesktop -r "runsnd2/COAWST/Tools/mfiles/roms_clm/roms_master_climatology_coawst_mw.m');

< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016a (9.0.0.341360) 64-bit (glnxa64)
February 11, 2016


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.


modelgrid =

/home/snd2/COAWST/task/ROMS_WW3_cs/ROMS/grid13_gebco_smooth4.nc

getting roms grid, hycom grid, and overlapping indices
Undefined function or variable 'get_ijrg'.

Error in roms_master_climatology_coawst_mw (line 57)
[gn, clm]=get_ijrg(url, modelgrid, theta_s, theta_b, Tcline, N, Vtransfo
Vstretching);


Error in run (line 96)
evalin('caller', [script ';']);

>> exit
Attachments
roms_master_climatology_coawst_mw.m
(6.68 KiB) Downloaded 276 times

venuscheung

Re: Generating initial file

#2 Unread post by venuscheung »

and I have checked get_ijrg.m did exist in the working directory

venuscheung

Re: Generating initial file

#3 Unread post by venuscheung »

Here's the update version of the matlab file
Attachments
roms_master_climatology_coawst_mw.m
(6.6 KiB) Downloaded 315 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Generating initial file

#4 Unread post by jcwarner »

well, if the get_ijrg m file exists, and your matlab can not find it,
then maybe it has to deal with the paths for matlab. maybe you need to set all the Tools/ folder to be in your matlab path??
-j

venuscheung

Re: Generating initial file

#5 Unread post by venuscheung »

thank you. I have solved the problem but another problem occurs.

the following error was generated when I tried to create initial file by a restart file

grid_file =

/home/snd2/COAWST/task/ROMS_WW3_cs/ROMS/input/grid13_gebco_smooth4.nc

Initializing zeta
Initializing u, v, ubar, and vbar
Initializing temp and salt
Initializing suspended sediments.
Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2083)
Could not find variable or group 'sand_01' in file.

Error in internal.matlab.imagesci.nc/read (line 593)
[gid, varid] = getGroupAndVarid(this, location);

Error in ncread (line 58)
vardata = ncObj.read(varName, varargin{:});

Error in create_roms_init (line 234)
zz=ncread(data_file,['sand_',count],[1 1 1 tidx],[Inf Inf Inf 1]);


Error in run (line 96)
evalin('caller', [script ';']);

May I ask where should I change in the matlab script
Attachments
create_roms_init_qck.m
(17.04 KiB) Downloaded 286 times

chegermiller
Posts: 5
Joined: Sat Jul 14, 2012 2:04 am
Location: University of California at Santa Cruz

Re: Generating initial file

#6 Unread post by chegermiller »

Hi,

This is because you have defined NNS = 1 in creat_roms_init_qck.m on line 179, but there isn't sediment variable information in the data_file '/home/snd2/cs/cs_trial_restart/ocean_rst.nc'.

If you don't need to initialize sediment variables, set NNS = 0.

Christie

venuscheung

Re: Generating initial file

#7 Unread post by venuscheung »

How about if bed thickness? Where can I close this option?

venuscheung

Re: Generating initial file

#8 Unread post by venuscheung »

I have solved the problem, Thank you for your help

zhengyx
Posts: 10
Joined: Wed Nov 28, 2018 3:00 pm
Location: Shanghai typhoon institute

Re: Generating initial file

#9 Unread post by zhengyx »

hello, have you generated initial file for ROMS using data in HYCOM successfully? while can I download *.m files you mentioned ? eg. roms_master_climatology_coawst_mw.m ,get_ijrg.m and so on

Post Reply