Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error writing .nc file #333

Open
gclessa opened this issue Nov 8, 2024 · 13 comments
Open

Error writing .nc file #333

gclessa opened this issue Nov 8, 2024 · 13 comments

Comments

@gclessa
Copy link

gclessa commented Nov 8, 2024

Dear John

Sorry to bother with a possibly basic mistake.
I am running a complete month of simulation (2 nested grids, 90s step time, hourly recording interval) smoothly.
But the model saves (as .nc) only about 50% of the output files.
If I run with a recording interval of 3 hours, all files are saved.
So I am exceeding a limit of number of files that can be handled.
Any suggestion
Many thanks

The error line says:
At line 1722 of file agioncmd.f90 (unit = 6, file = '')
Fortran runtime error: Too many open files

@jcwarner-usgs
Copy link
Collaborator

is this for roms or swan?

@gclessa
Copy link
Author

gclessa commented Nov 8, 2024 via email

@jcwarner-usgs
Copy link
Collaborator

are you writing out 2d spec points ?
let me see you swan.in.
I have a flag
#define SWAN_SINGLESPEC
that will only create 1 fie for each spec point.

@gclessa
Copy link
Author

gclessa commented Nov 11, 2024 via email

@jcwarner-usgs
Copy link
Collaborator

i did not get the swan.in file.

@gclessa
Copy link
Author

gclessa commented Nov 11, 2024 via email

@gclessa
Copy link
Author

gclessa commented Nov 11, 2024 via email

@gclessa
Copy link
Author

gclessa commented Nov 11, 2024

The extension .in ca not be attached.
Sending as .txt files
swan_child.txt
swan_parent.txt

@jcwarner-usgs
Copy link
Collaborator

ok i think i know what is happening.
You can not write out netcdf files for both the parent and child at the same time.
This is a problem with coawst that i did not figure out yet.

So you have
BLOCK 'COMPGRID' NOHEADER 'Child_hsig.nc' LAY 4 HSIGN 1. OUTPUT 20210601.000000 1 HR
BLOCK 'COMPGRID' NOHEADER 'Child_wdir.nc' LAY 4 DIR 1. OUTPUT 20210601.000000 1 HR
BLOCK 'COMPGRID' NOHEADER 'Child_peakwave.nc' LAY 4 RTP 1. OUTPUT 20210601.000000 1 HR
I assume that works.

For the parent, you have this commented out:
$BLOCK 'COMPGRID' NOHEADER 'saida_wdir.nc' LAY 4 DIR 1. OUTPUT 20210601.080000 3 HR
$BLOCK 'COMPGRID' NOHEADER 'saida_peakwave.nc' LAY 4 RTP 1. OUTPUT 20210601.080000 3 HR
$BLOCK 'COMPGRID' NOHEADER 'saida_hsig.nc' LAY 4 HSIGN 1. OUTPUT 20210601.000000 1 HR
$BLOCK 'COMPGRID' NOHEADER 'saida_wlevel.nc' LAY 4 WATLEV 1. OUTPUT 20210601.080000 3 HR
There is actually no need to write any of this out, because you can have these fields written out by ROMS in the his file.

@ianvinicio
Copy link

Hi John,

Unfortunately, the problem has not been resolved.
I took the outputs from the parent grid and set it to simulate the 30 days, but the error in writing the output .nc files persists after the entire simulation.

After completing the simulation, only 14 days of data are recorded in the netCDF file.

We are running only SWAN, with 24 np.

Attached, you will find an image showing the error, and a screenshot of the hs output.

hs_child
swan_error

@jcwarner-usgs
Copy link
Collaborator

if you do an ls how many files are in that folder?
are you writing nc files for just one of the grids?
if you write out to .mat files does it work?

@ianvinicio
Copy link

The .nc files are being saved in the main folder (COAWST execution folder). There should be at least 170 files.
I am writing .nc files only for the child grid.
I can generate .mat output files, but they are always corrupted.

Captura de Tela (11)

@jcwarner-usgs
Copy link
Collaborator

what do you get with
ulimit -a

when u say the mat files are corrupt, you need to wait til the end and then swan puts them all together into 1 file.
is this gfortran?
try to compile with one or both of these flags. i forget which one is needed.
FFLAGS += -assume byterecl
FFLAGS += -frecord-marker=4 -fconvert=big-endian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants