roms.in

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

roms.in

#1 Unread post by fdaryabor »

Hi


1- I want run model for 1 year (2005), I decrease the time step but I have following error:

4175 2.41609 7.509198465E-03 1.3246625E+01 1.3254135E+01 4.8568477E+15 0
4176 2.41667 7.508518509E-03 1.3246628E+01 1.3254136E+01 4.8568477E+15 0

NF_FWRITE ERROR: nf_put_vara netCDF error code = 22

WRT_DIAG ERROR while writing variable 'temp_yadv' into diag file.
Time record: 30 netCDF error code 22
WRT_DIAG -- wrote diag fields into time record = 30 / 30
WRT_DIAG_AVG -- wrote diag_avg fields into time record = 29 / 29

MAIN - number of records written into history file(s): 24
number of records written into restart file(s): 0
number of records written into averages file(s): 23
number of records written into diags file(s): 30


number of records written into avg diags file(s): 29


ERROR: Abnormal termination: netCDF OUTPUT




2 -I send for you 'roms.in', please you checkup for me. I dont understand some of codes please you explain all used code in 'roms.in'

Best Regards
F.Daryabor


title:
South China Sea
time_stepping: NTIMES dt[sec] NDTFAST NINFO
630720 50 45 1
S-coord: THETA_S, THETA_B, Hc (m)
6.0d0 0.0d0 10.0d0
grid: filename
ROMS_FILES/roms_grd.nc
forcing: filename
ROMS_FILES/roms_frc.nc
bulk_forcing: filename
ROMS_FILES/roms_blk.nc
climatology: filename
ROMS_FILES/roms_clm.nc
boundary: filename
ROMS_FILES/roms_bry.nc
initial: NRREC filename
1
ROMS_FILES/roms_ini.nc
restart: NRST, NRPFRST / filename
630720 -1
ROMS_FILES/roms_rst.nc
history: LDEFHIS, NWRT, NRPFHIS / filename
T 180 0

ROMS_FILES/roms_his.nc
averages: NTSAVG, NAVG, NRPFAVG / filename
1 180 0
ROMS_FILES/roms_avg.nc

primary_history_fields: zeta UBAR VBAR U V wrtT(1:NT)
T T T T T 10*T
auxiliary_history_fields: rho Omega W Akv Akt Aks HBL HBBL Bostr
T T T T T F T T F

primary_averages: zeta UBAR VBAR U V wrtT(1:NT)
T T T T T 10*T
auxiliary_averages: rho Omega W Akv Akt Aks HBL HBBL Bostr
F T T F T F T T T


rho0:
1025.d0

lateral_visc: VISC2, VISC4 [m^2/sec for all]
0. 0.

tracer_diff2: TNU2(1:NT) [m^2/sec for all]
10*0.d0

bottom_drag: RDRG [m/s], RDRG2, Zob [m], Cdb_min, Cdb_max
0.0d-04 0.d-3 1.d-2 1.d-4 1.d-1

gamma2:
1.d0

sponge: X_SPONGE [m], V_SPONGE [m^2/sec]
100.e3 800.

nudg_cof: TauT_in, TauT_out, TauM_in, TauM_out [days for all]
1. 360. 10. 360.




diagnostics: ldefdia nwrtdia nrpfdia /filename
T 144 0
roms_diags.nc
diag_avg: ldefdia_avg ntsdia_avg nwrtdia_avg nprfdia_avg /filename
T 1 144 0
ROMS_FILES/roms_diags_avg.nc

diagnostics_bio: ldefdiabio nwrtdiabio nrpfdiabio /filename
T 20 0
roms_diagsbio.nc
diagbio_avg: ldefdiabio_avg ntsdiabio_avg nwrtdiabio_avg nprfdiabio_avg /filename
T 1 20 0
ROMS_FILES/roms_diagsbio_avg.nc

sediments: input file
sediment.in
sediment_history_fields: bed_thick bed_poros bed_fra(sand,silt)
T F T T

bbl_history_fields: Abed Hripple Lripple Zbnot Zbapp Bostrw
T F F T F T

floats: LDEFFLT, NFLT, NRPFFLT / inpname, hisname
T 6 0
floats.in
ROMS_FILES/floats.nc
float_fields: Grdvar Temp Salt Rho Vel
F F F F F

stations: LDEFSTA, NSTA, NRPFSTA / inpname, hisname
T 400 0
stations.in
ROMS_FILES/stations.nc
station_fields: Grdvar Temp Salt Rho Vel
T T T T T

psource: Nsrc Isrc Jsrc Dsrc Qbar [m3/s] Lsrc Tsrc
2
3 54 1 200. T T 5. 0.
3 40 0 200. T T 5. 0.

3- sometimes I off 'DIAGNOSTICS_TS' and DIAGNOSTIC_UV in cpp keys when I want run model for 1 year I face with this problem

MAIN: Abnormal termination: BLOWUP

4- can you tell me relationship between, 'ntimes', 'dt', 'ndtfast' , 'ninfo' , 'NRST', 'NWRT' and 'NAVG'. who I determine this variables for 1 year


Please you help and guide me
Best Regards
F.Daryabor

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

Re: roms.in

#2 Unread post by kate »

WRT_DIAG ERROR while writing variable 'temp_yadv' into diag file.
Time record: 30 netCDF error code 22
It looks to me like you've created 29 records of this field and it failed on the 30th write. Some possibilities:

1. You filled your disk
2. You filled your disk quota
3. You have a 2 GB limit on your file size and you're trying to exceed that.
4. You are trying to write a NaN

You should be able to figure out which of these it is by checking around.

For the rest, it's 5 PM on a Friday - maybe I'll get to it later. Hernan seriously tried to document all those things in the bottom of the roms.in file. Experimenting can also teach you what's what to some extent. Asking specific questions about unclear documentation is more likely to get you an answer.

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#3 Unread post by fdaryabor »

Hi
I check my file size,I have a 2 GB limit on system, my out put files 'roms_avg.nc','roms_his.nc' and 'roms_diags_avg.nc' are more 2 GB size, around 2.9 GB, How can I to exceed that?
can you guide me?

Best Regards
F.Daryabor

User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

Re: roms.in

#4 Unread post by shchepet »

F.Daryabor,

Based on the format of your roms.in file, and your working habits
(e.g. subdirectory named ROMS_FILES) you are using AGRIF ROMS.
This code has capability to arrange your output into sequence of
netCDF files, rather than single file with unlimited dimension.
This way you can avoid letting files grow beyond certain limit.
All you have to do is to specify NRPFHIS and/or NRPFAVG other
than zero. Look at keyword-block

Code: Select all

history: LDEFHIS, NWRT, NRPFHIS / filename
             T 180 0
             ROMS_FILES/roms_his.nc
You are asking to


LDEFHIS = T -- overwrite existing netCDF file with the same
name, if exists; AND also save your initial state
into history;

NWRT = 180 -- save one record every 180 time step;

NRPFHIS = 0 -- let unlimited dimension of you file netCDF file
grow indefinitely.


Prefix "NRPF" stands for "number of records per file". It must be an
integer number; 0 means infinity.

Suffix HIS -- history; AVG -- averages, RST -- restart; same rule
applies for all types of files, except in the case of restart
NRPRST may be negative. This activates recycling of records, for
example, to keep the last 6 records only, but record 7 overwrites
rec 1; rec. 8 overwrites 2, etc, set NRPRST = -6

For example, set

Code: Select all

history: LDEFHIS, NWRT, NRPFHIS / filename
             T 180 10
             ROMS_FILES/roms_his.nc
The code will create netCDF file named

ROMS_FILES/roms_his.0000.nc

and will write ten records into it, then it automatically
closes the file and created a new one,


ROMS_FILES/roms_his.0010.nc

where it puts next 10 records, and so on.

The index segment in file name .0000. .0010. .0020. is assigned
and handled automatically, so you do not have to do anything new in
you roms.in. The indexing is also handled automatically during
restart, so if you interrupted your run for whatever reason, and then
want to resume, but say you have file

ROMS_FILES/roms_his.0030.nc

with 6 records in it, and you want to continue filing this file
after restart, while keeping the existing records intact, all you
have to do is to set LDEFHIS to .false.: this makes the code to
check for existing file before creating a new one.

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#5 Unread post by fdaryabor »

Hi
Tank so much
Can you explain this cod 'NRREC' in initial: NRREC filename
1

Best Regards
F.Daryabor

User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

Re: roms.in

#6 Unread post by shchepet »

NRREC in keyword-block "initial" specifies record number within the
file from which you want to start simulation, say

Code: Select all

initial: NRREC  filename
          2
        rst.0000.nc
means that you have have file "rst.0000.nc" which contains several
records, and and you want to use record 2 as the initial condition.


NOTE: Depending on version of you code, it may, or may not have
EXACT_RESTART capability (activated by CPP-switch with same name).

EXACT_RESTART means that the restart file saves two consecutive records,
one time step apart from each other, so that when the code restarted, it
uses regular LF-AM3 algorithm for the first tome step, rather than Forward
Euler corrected by Trapezoidal Rule (hence FE-TR, also known as RK2).

The convention is that if exact restart is used, you must set NRREC to
point to the SECOND record in the pair of two consecutive records. The
rationale for this convention is backward compatibility with the previous
practices: the second record in the main (meaning "must have") which
corresponds to n-th step, while the first is optional and corresponds to
(n-1)th step.

So if you activate EXACT_RESTART and specify

Code: Select all

  initial: NRREC / filename
              1
                   ini.nc

  restart:        NRST, NRPFRST / filename
                   100     +4
                                   rst.nc
where "ini.nc" is created by outside tools (RomsTools, Matlab, etc, but
is is NOT a restart file ceeated by roms code) and run the model, it will
create series of restart files named rst.0000.nc, rst.0004.nc
rst.0008.nc, ...etc, each of which contains 4 records (at most, the latest
one may have two records) arranged in pairs, saving time steps to
files/records as follows:

Code: Select all

time step#     99    rec 1   of rst.0000.nc
              100    rec 2   of rst.0000.nc
              199    rec 3   of rst.0000.nc
              200    rec 4   of rst.0000.nc

              299    rec 1   of rst.0004.nc
              300    rec 2   of rst.0004.nc
              399    rec 3   of rst.0004.nc
              400    rec 4   of rst.0004.nc

              499    rec 1   of rst.0008.nc
              500    rec 2   of rst.0008.nc
  ...........................................
Then, suppose you want to restart from time step 400. You must specify

Code: Select all

initial: NRREC  filename
          4
               rst.0004.nc



If you do not activate EXACT_RESTART, or you code does not have this
option, then the outcome of "restart" block in "roms.in" exactly
as above is:

Code: Select all

time step#    100    rec 1   of rst.0000.nc
              200    rec 2   of rst.0000.nc
              300    rec 3   of rst.0000.nc
              400    rec 4   of rst.0000.nc

              500    rec 1   of rst.0004.nc
              600    rec 2   of rst.0004.nc
              700    rec 3   of rst.0004.nc
              800    rec 4   of rst.0004.nc

              900    rec 1   of rst.0008.nc
             1000    rec 2   of rst.0008.nc
  ...........................................
and to restart from time step 400 you must specify

Code: Select all

initial: NRREC  filename
          4
               rst.0000.nc

Note: there is a logical concept of "absolute record number" which
changes continuously throughout the sequence of output file, starting
from the very initial of run. The convention of naming of files follows
the rule

Code: Select all

  absolute_record_number =  file_number + record_number_within_the_file
So file numbering starts from 0, while record number within the file
start from 1 (as in Fortran NetCDF convention).

The absolute record numbers for the three principle types of output files,
restart, history, and averages, are saved into netCDF variable "time_step"
which is a structure of 4 integer numbers, and it also has the unlimited
dimension, check it using "ncdump"

int time_step(time, auxil)

where auxil=4, and time is unlimited dimension.
The meaning of the four numbers respectively are:

time_step_num abs_rst_rec_num abs_his_rec_num abs_avg_rec_num

Saving these four numbers allows ROMS to restart counting time steps
from what is in saved in restart file (then used as initial). It also
allows to restart naming sequence of the output files, so the names/record
record number of and interrupted-then-restarted run are exactly the same
as from continuous run starting from the same initial.

Explanation of the technical difference between "initial run" and
"restart run": initial files do not have variable "time_step" and
the four associated counters are set to default values of 0. During
a "restart run" these four are initialized to their past values.

In a rare situations you may want to use ROMS restart file as "initial",
say you use climatological forcing to spin-up the model, and then you want
to use the output restart as to initial file to run model using realistic
forcing. But you want to treat you new run and "new run", not a restart
run. Do do so, you MUST DESTROY netCDF variable "time_step" in you
restart file which you want to treat as initial. Rename it to be
something else, say use

ncrename restart_file_name.nc time_step Xime_step

(ncrename.F comes with AGRIF ROMS as a separate tool). Then the content
of what is now "Xime_step" will be ignored, and all counters, time step
and record numbers are initialized to 0.

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#7 Unread post by fdaryabor »

Tank so much
I need understand, how can I manually replace climatology data and wind forcing myself.
For example I need replace COADAS05 and QUIKSCAT, which file or code can do this way.
Best Regards
F.Daryabor

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#8 Unread post by fdaryabor »

Hi
I go to ncrename.F in Roms_Agrif but I can't do your guide, can you more explain me following guide

'Do do so, you MUST DESTROY netCDF variable "time_step" in you
restart file which you want to treat as initial. Rename it to be
something else, say use

ncrename restart_file_name.nc time_step Xime_step'

Best Regards
F.Daryabor

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

Re: roms.in

#9 Unread post by kate »

ncrename is one of the Netcdf operators: http://nco.sourceforge.net/
Its documentation can be found there.

User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

Re: roms.in

#10 Unread post by shchepet »

The "ncrename" I was was referring to belongs to a collection of several
basic "tools" designed to manipulate netCDF files (look at target/macro
tools/TOOLS in your Makefile for AGRIF ROMS; in order to use them, you must
compile them first, hence type "make tools" command; this creates several
executable files -> place them into your /home/your_username/bin directory,
and make sure to include it into PATH in .cshrc; then you can use them)
Most of these were introduced back in 1999 and are designed to work in
command-line mode, under the compile-once---use-forever principle.
The main purpose for them is provide you a way to quick (instant) way of
fixing minor compatibility issues (like you code expects time variable to
be named as "ocean_time", but Pierrick Matlab RomsTools you use to prepare
you initial file calls it "roms_time"). Or copying selected variables from
one netCDF file to another.

NCO Kate referring to is a more recent (but already out for several years)
comprehensive package which allows you to do a lot more, and is fairly
general. It also contains "ncrename" command with the same name, and
similar, but not identical purpose, and different rules of usage.

Yes, you can accomplish the same task by several different means: there are
many tools around.

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#11 Unread post by fdaryabor »

Hi
1- I typed "make tools" in '../Roms_tools/Roms_Agrif' directory for creates executable files but I face to this message:
Makefile:5: Makedefs: No such file or directory
make: *** No rule to make target `Makedefs'. Stop

I have only following execute files in Roms_Agrif directory
Makedefs.generic
Make.depend
Makefile
rename_cvs.csh
roms
initfloats.m
run_roms.csh
jobcomp

please you guide me.

2- ROMS automatically load input data but I want understand how can manually place climatology data and wind forcing for input.
For example I want use and place input data except COADAS05 and QUIKSCAT for ROMS, which file or code has capability for do it.

Best Regards
F.Daryabor

User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

Re: roms.in

#12 Unread post by shchepet »

Then you should use Makedefs.generic as Makedefs, or make your own,
depending on what type of computer, operating system, and FORTRAN/C
compilers you have.

I usually supply about 10...15 Makedefs.XXXX files, which are for
different machines and advise people how to create their own: basically
use a Makedefs.generic as a template and make sure that all macros
have meaningful definitions.

I know (but do not like this practice) that AGRIF people supply a shell
script to generate these macros automatically by autodetecting the
operating system, compilers, netCDF library, etc. This practice generally
falls in line with the standard Linux "configure --> make --> make install"
approach, in which you you just get the source code for a software package
you want to use as a black box, execute these command in sequence, and it
works.

So I presume, if you are able to successfully compile your code using
"jobcomp" script, then an appropriate file called Makedefs is already
created automatically somewhere within the compile directory generated
by jobcomp. Just find this file and save if for your records.

The reason that I do not like automatic scripts is that machines may
(and typically do) contain installations of multiple versions of
compilers, libraries, etc... and any automatic script contains just a
logical tests for presence of compilers/libraries in a pre-designed
sequence, which unavoidably sets precedence (e.g., once "gcc" compiler
is found, do not look further; suppose you want to use "icc" instead,
but it is up to designer of the script to deside which to try first
and which next. Some scripts are tunable --- you can setenv macros
before running configure, or supply arguments to it, but that defeats the
purpose: it becomes more complicated than to set them by hand. Same applies
for compiler flags: for ROMS you normally want to use a highly tuned
set of compiler flags rather than rely on defaults.

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#13 Unread post by fdaryabor »

Hi
Thank so much for anythings. I need use of ROMS_AGRIF results for my ph.d thesis for South China Sea.
In ROMS exist twin Compile directory '/home/ROMSTOOLS/Compile'
and
'/home/ROMSTOOLS/Roms_tools/Compile'
I find 'Makedefs' file within both of them.
I don't understand your aim 'saving the file for records', could you please tell me, how to do it?

Do I need to place executable files into my /home/my_username/bin directory and to include it into PATH in .cshrc?

Could you explain me, how supply several 'Makedefs.XXXX' files yourself.

Best Regards
F.Daryabor

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#14 Unread post by fdaryabor »

Hi
Could you specify me, which executable files must place into ../bin directory?
After place executable files into ../bin directory.
I must place ../bin path into PATH in .cshrc?

I check .cshrc that is include:

# .cshrc

# User specific aliases and functions

alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'


~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".cshrc" 9L, 102C



Best Regards
F.Daryabor

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#15 Unread post by fdaryabor »

Hi
I can't downloading full text your paper, namely 'A method for computing horizontal pressure-gradiant force in an ocean model with a non-aligned vertical coordinate. Journal of Geophysical Research 108 (C3),3090,2003' please kindly Could you send me
I need understand concept of 'hereafter SH91' in Spall and Holland (1991) paper, that is a suitable test case for embedding procedure. I can't downloading full text its,
'A Nested Primitive Equation Model for Oceanic Applications'

Could you explain concept it or send paper full text for me.

Best Regards
F.Daryabor

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: roms.in

#16 Unread post by fdaryabor »

Hi
When I execute 'jobcomp' automatically create 'Makedefs' in Compile directory you say me, 'Just find this file and save if for your records'. I don't understand concept of this sentence. Please kindly could more explain me.
I found your paper and was very useful for me
Thanks so much for anythings.

Best Regards
F.Daryabor

machaielder
Posts: 43
Joined: Wed Mar 18, 2015 3:40 pm
Location: Universidade Federal Fluminense

Re: roms.in

#17 Unread post by machaielder »

Hello Nark and Kate

I am having the problem discussed here; I could find out that it is not related to disk space because it happens only when I define BBL;

the error is :

137 0.15856 6.605088329E-03 1.7256302E+00 1.7322353E+00 3.2980447E+12 0
138 0.15972 6.698147648E-03 1.7255837E+00 1.7322819E+00 3.2980484E+12 0
139 0.16088 6.792899548E-03 1.7252971E+00 1.7320900E+00 3.2980509E+12 0
140 0.16204 6.879837037E-03 1.7259342E+00 1.7328140E+00 3.2980516E+12 0
141 0.16319 6.971735130E-03 1.7262264E+00 1.7331981E+00 3.2980506E+12 0
142 0.16435 7.076681044E-03 1.7262929E+00 1.7333695E+00 3.2980486E+12 0
143 0.16551 7.182752105E-03 1.7263004E+00 1.7334832E+00 3.2980466E+12 0
144 0.16667 7.288885471E-03 1.7263286E+00 1.7336175E+00 3.2980457E+12 0

NF_FWRITE ERROR: nf_put_vara netCDF error code = -40

WRT_HIS ERROR while writing variable 'Abed' into history file.
Time record: 3 netCDF error code -40
WRT_HIS -- wrote history fields into time record = 3 / 3
WRT_AVG -- wrote averaged fields into time record = 2 / 2

MAIN - number of records written into history file(s): 3
number of records written into restart file(s): 0
number of records written into averages file(s): 2


ERROR: Abnormal termination: netCDF OUTPUT

I could also find out the it is related to nf_fread.F but unfortunately I cant interpret it

part of nf_fread.F
Read/Write array from the disk.
!===== ===== ===== ==== === =====
!
#ifndef WRITER
ierr=nf_get_vara_FTYPE (ncid, varid, start, count, buff(1))
nf_fread=ierr
if (ierr .ne. nf_noerr) then
write(*,'(/1x,2A,I5,1x,A,I4/)') 'NF_FREAD ERROR: ',
& 'nf_get_vara netCDF error code =', ierr
& MYID
return
endif
#endif
do k=1,count(3)
do j=jmin,jmax
shift=1-imin+count(1)*(j-jmin+(k-1)*count(2))
do i=imin,imax
#ifdef WRITER
buff(i+shift)=A(i,j,k)
#else
A(i,j,k)=buff(i+shift)
#endif
enddo
enddo
enddo
#ifdef WRITER
ierr=nf_put_vara_FTYPE (ncid, varid, start, count, buff(1))
nf_fwrite=ierr
if (ierr.ne.nf_noerr) then
write(*,'(/1x,2A,I5,1x,A,I4/)') 'NF_FWRITE ERROR: ',
& 'nf_put_vara netCDF error code =', ierr
& MYID
endif
#endif

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

Re: roms.in

#18 Unread post by kate »

According to the manual:
#define NC_EINVALCOORDS (-40) /* Index exceeds dimension bound */
Which BBL did you define?

Post Reply