Search found 872 matches

by wilkin
Mon Mar 11, 2024 6:03 pm
Forum: ROMS Discussion
Topic: ROMS Radiation Boundary condition (RadNud)
Replies: 11
Views: 728

Re: ROMS Radiation Boundary condition (RadNud)

Clamping and nudging won't help you if you have an advection dominated outflow because the exterior conditions know nothing of the interior solution that is propagating out along characteristics of the current. They will act as a wall. You might be better off simply using gradient conditions, which ...
by wilkin
Sun Mar 10, 2024 5:57 pm
Forum: ROMS Discussion
Topic: ROMS Radiation Boundary condition (RadNud)
Replies: 11
Views: 728

Re: ROMS Radiation Boundary condition (RadNud)

A radiation condition for 3-D variables is potentially sensible if you have 3-D wave motions emanating from the model interior, such as internal gravity waves, that might reflect at the boundary. This was the general idea behind the original Orlanski (1976) paper that inspired this approach. https:/...
by wilkin
Fri Mar 08, 2024 11:48 am
Forum: ROMS Discussion
Topic: River inflow direction
Replies: 3
Views: 345

Re: River inflow direction

No, that is incorrect. For flow through the v face river_direction = 1 but if flow is in the negative y direction then river_transport is negative.
by wilkin
Thu Mar 07, 2024 3:02 pm
Forum: ROMS Problems
Topic: Disabling Wind Force in Model's Forcing File
Replies: 2
Views: 260

Re: Disabling Wind Force in Model's Forcing File

If you are using analytical wind stresses, like in the UPWELLING test case, those are set in Functionals/ana_smflux.F (for surface momentum flux). Open Functionals/ana_smflux.F and search for UPWELLING. You will see that sustr = 0 and svstr ramps up over 2 days as a SINE function. You can modify thi...
by wilkin
Thu Mar 07, 2024 2:56 pm
Forum: ROMS Discussion
Topic: River inflow direction
Replies: 3
Views: 345

Re: River inflow direction

The river_direction variable specifies whether flow is crossing a u-face (river_direction = 0), a v-face (river_direction = 1) or enters as a flux divergence in the center of the cell at a rho-point (river_direction = 2). That is spelled out here: https://www.myroms.org/wiki/River_Runoff#river_direc...
by wilkin
Mon Mar 04, 2024 12:25 pm
Forum: ROMS Discussion
Topic: wind -current- Zeta, Inaccurate simulation results
Replies: 8
Views: 380

Re: wind -current- Zeta, Inaccurate simulation results

You have CPP flags in there I don't recognize from myroms.org .... OBC_NUDGING, CORE_FORCING, ALBEDO_CLOUD ... etc.

If this is COAWST or CROCO I suggest you post your query on those forums.
by wilkin
Sun Mar 03, 2024 7:38 pm
Forum: ROMS Discussion
Topic: wind -current- Zeta, Inaccurate simulation results
Replies: 8
Views: 380

Re: wind -current- Zeta, Inaccurate simulation results

You've got a bit of a mess of CPP directives there. You have BODYFORCE to add the wind stress directly into the surface layers, but you also have GLS_MIXING and BULK_FLUXES to add the stress at a surface bojundary condition to vertical mixing. Without digging into the code I don't know which you wil...
by wilkin
Tue Feb 27, 2024 3:13 pm
Forum: ROMS Discussion
Topic: Issue with Output File Generation in ROMS
Replies: 3
Views: 675

Re: Issue with Output File Generation in ROMS

you need to set NDEFHIS and NDEFAVG not equal to zero. roms*.in file has an extensive description about these switches That is incorrect. NDEFHIS = 0 is valid. It means create only one history file and write all history output to it. The GLOSSARY comments at the end of every example roms*.in states...
by wilkin
Mon Feb 12, 2024 7:50 pm
Forum: ROMS Discussion
Topic: angle, wind, ocean current
Replies: 3
Views: 912

Re: angle, wind, ocean current

1. When I prepare the wind forcing, should I rotate the wind direction from geometrical eastward/northward to grid xi/eta in my forcing .nc file ? If you are providing Uwind,Vwind in a netcdf file and having ROMS interpolate from the Uwind,Vwind lon,lat coordinates then ROMS will apply the angle ro...
by wilkin
Sun Feb 04, 2024 1:13 pm
Forum: ROMS Problems
Topic: Problem with tidal forcing
Replies: 2
Views: 802

Re: Problem with tidal forcing

It did read them. It's just telling you that somewhere in the file you have NaN values. They aren't on the boundary though otherwise ROMS would not have run.
by wilkin
Fri Feb 02, 2024 9:46 pm
Forum: ROMS Problems
Topic: Error making initial conditions with d_initial.m
Replies: 1
Views: 787

Re: Error making initial conditions with d_initial.m

There is a diagram of the ROMS computational grid here: https://www.myroms.org/wiki/Numerical_Solution_Technique The rho cells number from 0 to L (in green), so there are L+1 values. This is the netcdf file dimension xi_rho. In roms.in you indicate parameter Lm, which stands for L minus 1. So, xi_rh...
by wilkin
Tue Jan 30, 2024 2:56 pm
Forum: ROMS Discussion
Topic: River Input
Replies: 13
Views: 22436

Re: River Input

Adding solar radiation will heat the ocean. An ice covered lake is insulated from solar heating.
by wilkin
Sat Jan 20, 2024 7:14 pm
Forum: ROMS Discussion
Topic: River Input
Replies: 13
Views: 22436

Re: River Input

You say you want to keep the ocean surface temperature at 0 degrees ... so it freezes?

Please post a more detailed question and do so in a new thread because this no longer has anything to do with River Inputs.
by wilkin
Sat Jan 20, 2024 7:11 pm
Forum: ROMS Discussion
Topic: Issues Encountered in Creating ROMS Model Grid by Matlab: Seeking Assistance
Replies: 2
Views: 1103

Re: Issues Encountered in Creating ROMS Model Grid by Matlab: Seeking Assistance

c_contact.m is for creating the contact file for two nested grids once the two grid files are already made, so I don't follow why you would be running that routine when you say you are trying to create a grid anew.
by wilkin
Thu Jan 18, 2024 12:43 am
Forum: ROMS Discussion
Topic: Virtual dye sources problem
Replies: 2
Views: 1232

Re: Virtual dye sources problem

You want the LwSrc option. This introduces tracer mass without momentum by augmenting the tracer flux divergence at the cell center. It does not impact u,v. For both LuvSrc and LwSrc sources the rate at which tracer is added (in kg/s) is the volume flux (river_transport, m^3/s) multiplied by the con...
by wilkin
Fri Dec 15, 2023 9:05 am
Forum: ROMS Discussion
Topic: Abnormal termination: NetCDF INPUT
Replies: 13
Views: 22320

Re: Abnormal termination: NetCDF INPUT

Your log shows ,,,
Maximum barotropic Courant Number = 9.00832155E+00
which seems much too large, but I can't where that comes from on the basis of initial conditions.
by wilkin
Fri Dec 15, 2023 8:53 am
Forum: ROMS Discussion
Topic: River Input
Replies: 13
Views: 22436

Re: River Input

You might need ...

** ANA_SRFLUX if analytical surface shortwave radiation flux **
by wilkin
Sat Dec 02, 2023 9:55 pm
Forum: ROMS Discussion
Topic: Problem using wikin's matlab code
Replies: 6
Views: 15029

Re: Problem using wikin's matlab code

% bbox - A 4-element vector in the format of Matlab axis defining the % lon/lat bounding box region to subset with the OPeNDAP query % e.g. bbox = [-110 -30 0 55] or [250 330 0 55] for West Atlantic. % NOTE: The longitude coordinate in ERA5 breaks at the prime meridian. % This function detects whet...
by wilkin
Wed Nov 22, 2023 1:43 pm
Forum: ROMS Discussion
Topic: AMSR2 collated or uncollated?
Replies: 6
Views: 14510

Re: AMSR2 collated or uncollated?

When I read these papers some time ago I concluded the quantity most representative of ROMS surface later (k = N) temperature would be to compute sea_surface_temperature minus sses_bias . That's what we do in operational Doppio.
by wilkin
Thu Nov 16, 2023 3:17 pm
Forum: ROMS Discussion
Topic: AMSR2 collated or uncollated?
Replies: 6
Views: 14510

Re: AMSR2 collated or uncollated?

The AMSR file format includes a sses_bias correction term that a user can apply to obtain the best estimate of foundation temperature. See Petrenko et al. https://doi.org/10.1175/JTECH-D-15-0166.1
by wilkin
Thu Nov 16, 2023 1:57 pm
Forum: ROMS Discussion
Topic: Problem using wikin's matlab code
Replies: 6
Views: 15029

Re: Problem using wikin's matlab code

Correct. I am not updating the svn version. In the contents.m ... % This collection of tools was originally created March 2008 (some are much % older) for release to the ROMS User community. Prior to December 2020 % the code set was managed by svn and accessible with login credentials for % the myro...
by wilkin
Wed Nov 15, 2023 4:23 pm
Forum: ROMS Discussion
Topic: AMSR2 collated or uncollated?
Replies: 6
Views: 14510

Re: AMSR2 collated or uncollated?

In the real-time Doppio analysis system we run for MARACOOS/IOOS, we currently access AMSR2 L2 from dataset ID AMSR2-REMSS-L2P-v8.2 at PO.DAAC.

I'd have to check, but I believe the granules that intersect with the model domain bounding box are identified using the PO.DAAC subsetter.
by wilkin
Tue Nov 14, 2023 3:56 pm
Forum: ROMS Discussion
Topic: Problem using wikin's matlab code
Replies: 6
Views: 15029

Re: Problem using wikin's matlab code

Yes, there were some changes at NCAR. I updated my code some weeks ago and it seems to be working robustly. I just uploaded the changes to my GitHub https://github.com/johnwilkin/roms_wilkin so please refresh and see if that solves the problem.
by wilkin
Thu Nov 09, 2023 1:52 pm
Forum: ROMS Discussion
Topic: River Input
Replies: 13
Views: 22436

Re: River Input

This is explained in WikiROMS: For uv source you must be mindful of the placement of land and water to the "left" or "right" of the cell interface: https://www.myroms.org/wiki/River_Runoff#river_Xposition_and_river_Eposition You need to change the sign of the river entering the o...
by wilkin
Wed Nov 08, 2023 2:40 pm
Forum: ROMS Discussion
Topic: Coastal flood risk assessment with ROMS?
Replies: 4
Views: 13005

Re: Coastal flood risk assessment with ROMS?

You can #undef SOLVE3D and see what happens
https://www.myroms.org/wiki/SOLVE3D
by wilkin
Fri Nov 03, 2023 2:07 pm
Forum: ROMS Usage
Topic: "thin dams" in ROMS
Replies: 4
Views: 18210

Re: "thin dams" in ROMS

(There was another post about this a couple of years ago ... https://www.myroms.org/forum/viewtopic.php?p=23078&hilit=thin#p23078) Exercise some caution in simply setting mask_u(i)=0 to impose a barrier because the calculation at u(i+1) may use values at u(i-1) in addition to u(i) to complete th...
by wilkin
Sun Oct 22, 2023 7:48 pm
Forum: ROMS Discussion
Topic: Spatially varied bottom roughness
Replies: 2
Views: 9064

Re: Spatially varied bottom roughness

Do you have ...

Code: Select all

  #define UV_LOGDRAG
by wilkin
Thu Oct 19, 2023 2:56 pm
Forum: ROMS Discussion
Topic: Issue with sacling of Nested grid applications
Replies: 1
Views: 4897

Re: Issue with sacling of Nested grid applications

This isn't a nesting issue, it's simply that you are asking for tile partitions that are too small. See this link in WikiROMS https://www.myroms.org/wiki/File:communications.png to visualize the tiles and their associated halo regions that communicate the data from adjacent tiles to complete the num...
by wilkin
Wed Oct 11, 2023 1:33 pm
Forum: Ocean News
Topic: John S. Allen (1937-2023)
Replies: 5
Views: 13827

John S. Allen (1937-2023)

The coastal ocean modeling and dynamics community has lost an influential and insightful colleague and mentor. John S. Allen authored over 100 papers https://oregonstate.box.com/s/ykejvhu8t3y935o2kvq4v6dhri98xtda on coastal ocean and shelf sea currents, instabilities, coastal trapped waves, upwellin...
by wilkin
Thu Oct 05, 2023 2:00 pm
Forum: ROMS Discussion
Topic: Problem with BLOWUP REASON: MaxSpeed = 2.1E+01
Replies: 2
Views: 5130

Re: Problem with BLOWUP REASON: MaxSpeed = 2.1E+01

Your open boundary conditions don't make sense. You have periodic conditions for u,v but a mix of closed and Flather conditions for ubar, vbar. If u,v is periodic then ubar,vbar must be also. Without knowing more about your grid it's hard to say what to do, but since you have MASKING defined I presu...
by wilkin
Tue Sep 26, 2023 9:23 am
Forum: ROMS Problems
Topic: Help on ROMS Blowing before even running first time step
Replies: 4
Views: 5093

Re: Help on ROMS Blowing before even running first time step

That looks like an issue with your libraries or compiler. If it were just ROMS the blow-up message would give more guidance as to where in the code the issue arose. This is an outright crash. Make sure you are linking to MPI libraries built with the same compiler you use for ROMS. That said, the NaN...
by wilkin
Tue Sep 26, 2023 9:01 am
Forum: ROMS Documentation
Topic: update of "Waves Effect on Currents" ?
Replies: 2
Views: 4211

Re: update of "Waves Effect on Currents" ?

The trac ticket you note #943 explains .... The ROMS source code was consolidated due to changes for new developments: ... including ... Porting the Waves Effect on Currents (WEC) based on the Vortex Force formulation of Uchiyama et al. (2010) and Kumar et al. (2012) based on COAWST implementation. ...
by wilkin
Fri Sep 22, 2023 4:49 pm
Forum: ROMS Discussion
Topic: tracer with a settling velocity
Replies: 3
Views: 4838

Re: tracer with a settling velocity

There is no specific example in the myroms repository. When you think of how many features ROMS has it's overwhelming to construct examples for everything. FLOAT_OYSTER is pretty straightforward - I'm sure you can figure it out. But please feel free to contribute a test case - perhaps an option on a...
by wilkin
Thu Sep 21, 2023 8:16 am
Forum: ROMS Discussion
Topic: tracer with a settling velocity
Replies: 3
Views: 4838

Re: tracer with a settling velocity

Do you want to do this with Lagrangian particles, or Eulerian tracers? With tracers: You can do this with the sediment model. Configure it with just a single sediment class and set the sinking velocity you want. Turn off all the options for resuspension etc. (unless you ultimately those). You can te...
by wilkin
Mon Sep 18, 2023 7:45 pm
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

Please try running this ... modified ... code again. The NCAR helpdesk claim the issue is resolved.
by wilkin
Fri Sep 08, 2023 9:04 am
Forum: ROMS Installation
Topic: Error while running the model by: ./romsG < roms_upwelling.in
Replies: 2
Views: 3189

Re: Error while running the model by: ./romsG < roms_upwelling.in

This error message ... ERROR: Cannot open file '/home/roms_project/sobhan/varinfo.yaml': No such file or directory indicates that file varinfo.yaml is not present in that location, or its permissions make it unreadable. Most users keep a copy of varinfo.yaml in the directory where they run ROMS (sam...
by wilkin
Tue Aug 29, 2023 7:36 am
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

If you got to that place in the code ... Error in roms_get_era5_NCARds633_bulkflux_update (line 478) itime = double(ncread(url,'forecast_initial_time'))/24 + epoch; ... then it must have read the first set of data files, right? So the urlbase is not wrong. The File Not Found error in this case possi...
by wilkin
Fri Aug 25, 2023 8:48 am
Forum: ROMS Problems
Topic: TRYING RUN A NEW CASE
Replies: 4
Views: 5123

Re: TRYING RUN A NEW CASE

The code at line 149 in get_data.f 90 is & BOUNDARY(ng) % zetaG_west) Is a problem with the boundary conditions? It does seem that's a likely source of the problem. I can't help here. Your boundary file is in a very different format to what I'm used to, with 1-dimensional vectors for the coordi...
by wilkin
Thu Aug 24, 2023 8:33 am
Forum: ROMS Problems
Topic: TRYING RUN A NEW CASE
Replies: 4
Views: 5123

Re: TRYING RUN A NEW CASE

#6 0x564becef30db in get_data_
at /home/felipejbarragan11/roms_project/test/MyTest/ROMSSantander3D/Build_romsG/get_data.f90:149
What is the code at line 149 in get_data.f90?
by wilkin
Wed Aug 23, 2023 12:55 pm
Forum: ROMS Problems
Topic: INQUIRY_NF90 - unable to find requested variable: swflux
Replies: 4
Views: 5022

Re: INQUIRY_NF90 - unable to find requested variable: swflux

Read the Backtrace for this error. This shows the ultimate failure is associated with trying to read from a netcdf file. But which file? The particular netcdf read was initiated at Backtrace for this error: ... #3 0x561b93338719 in __mod_netcdf_MOD_netcdf_get_fvar_1d at /home/felipejbarragan11/roms_...
by wilkin
Wed Aug 23, 2023 8:28 am
Forum: ROMS Problems
Topic: INQUIRY_NF90 - unable to find requested variable: swflux
Replies: 4
Views: 5022

Re: INQUIRY_NF90 - unable to find requested variable: swflux

It looks like you want to prescribe temperature and salinity surface boundary conditions with analytical functionals (because you have #define ANA_STFLUX). In that case you also need #define ANA_SSFLUX, otherwise the default action is to look for the data amongst the forcing netcdf file list.
by wilkin
Mon Aug 21, 2023 9:00 am
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

It appears NCAR changed the hostname for the THREDDS server. It is now https://thredds.rda.ucar.edu not just https://rda.ucar.edu. If you update the line in the code that sets urlbase to read ... urlbase = 'thredds.rda.ucar.edu/thredds/dodsC/files/g/ds633.0'; ... it should work. It also appears that...
by wilkin
Wed Aug 09, 2023 9:14 am
Forum: ROMS Documentation
Topic: Math rendering in wikiRoms
Replies: 5
Views: 20589

Re: Math rendering in wikiRoms

Thank you for alerting us to this. Something has broken very recently following recent updates. We are looking into it.
by wilkin
Mon Jul 31, 2023 9:11 am
Forum: ROMS Discussion
Topic: Lambert grid
Replies: 2
Views: 3638

Re: Lambert grid

I showed a way to do this with MATLAB in this post:
viewtopic.php?p=23769#p23769
by wilkin
Fri Jul 21, 2023 12:09 pm
Forum: ROMS Problems
Topic: Conflict for units of shflux
Replies: 5
Views: 8104

Re: Conflict for units of shflux

Well, yes, air-sea flux options and inputs is just another one of the many things we need to add to WikiROMS. Perhaps in my retirement ... ! Scanning those entries in varinfo.yaml I do spot an error in the #Input tag for dQdSST: - variable: dQdSST # Input standard_name: derivative_of_surface_downwar...
by wilkin
Thu Jul 20, 2023 9:30 am
Forum: ROMS Problems
Topic: Conflict for units of shflux
Replies: 5
Views: 8104

Re: Conflict for units of shflux

The comments in varinfo.yaml tell you the units ROMS expects in a netCDF file, # Input: [Watt/m2] - variable: shflux # Input/Output standard_name: surface_downward_heat_flux_in_sea_water long_name: surface net heat flux units: watt meter-2 # Input: [Watt/m2] field: surface heat flux # [Celsius m/s] ...
by wilkin
Sat Jul 15, 2023 9:26 am
Forum: ROMS Bugs
Topic: Nsrc init
Replies: 2
Views: 5105

Re: Nsrc init

I don't follow the question. If ANA_PSOURCE is not defined but logical flags in roms.in indicate sources are to be used, then the netcdf file is interrogated. If ANA_PSOURCE is defined, an arbitrary allocation of 200 is accommodated (there should probably be a warning in ana_psourceF about this).
by wilkin
Thu Jul 13, 2023 8:18 am
Forum: ROMS Discussion
Topic: Problems with river point source configuration
Replies: 2
Views: 3400

Re: Problems with river point source configuration

Looks like you missed this part of the guidance at https://www.myroms.org/wiki/River_Runoff ... If passive tracers are being used, by having set #define T_PASSIVE and the associated options in roms.in, then for those tracers ... In your tracer_1r.h file you need ... #define T_PASSIVE Also, I'm not s...
by wilkin
Fri Jun 09, 2023 12:20 pm
Forum: ROMS Discussion
Topic: Changes in the Input File Regarding Point sources for River Forcing
Replies: 4
Views: 4795

Re: Changes in the Input File Regarding Point sources for River Forcing

Look at the figure here: https://www.myroms.org/wiki/River_Runoff#river_Xposition_and_river_Eposition It is for you, as user, to decide whether your source points falls on a coastline with land on the left or right. If it is Case A (in the figure), then river_direction = 0, river_Xposition = i and r...
by wilkin
Thu Jun 08, 2023 10:06 am
Forum: ROMS Discussion
Topic: Changes in the Input File Regarding Point sources for River Forcing
Replies: 4
Views: 4795

Re: Changes in the Input File Regarding Point sources for River Forcing

You may be off by one in your river_Xposition etc if you have not adjusted for FORTRAN indexing as opposed to Matlab. This is explained in WikiROMS https://www.myroms.org/wiki/River_Runoff#river_Xposition_and_river_Eposition. roms_plot_river_source_locations.m from my ROMS tools at https://github.co...
by wilkin
Fri May 26, 2023 3:03 pm
Forum: ROMS Discussion
Topic: Boundary settings are not working for ROMS
Replies: 4
Views: 6661

Re: Boundary settings are not working for ROMS

(3) and OBCFAC == 0.0d0 Tnudge=0. I think this means that I didn't use the nudging. If you set the nudging time scale to zero, then yes, the "Nud" part of "RadNud" does nothing. The temp and salt data in your BRYNAME list is ignored. Moreover, even if you had a finite Tnudg your...
by wilkin
Thu May 25, 2023 2:40 pm
Forum: ROMS Discussion
Topic: River Input
Replies: 13
Views: 22436

Re: River Input

I'm struggling to envision what geophysical problem it is you are trying to model, but if you want to add mass (volume) at some rate (cubic meters per second) distributed all across the surface of your lake, then you have to create all the point sources. It sounds like this is an idealized problem, ...
by wilkin
Thu May 25, 2023 2:30 pm
Forum: ROMS Discussion
Topic: create river forcing for 2D model
Replies: 2
Views: 3217

Re: create river forcing for 2D model

This is not a use case that anyone has run, to my knowledge anyway. In principle it should work, because the volume flux is introduced via Nonlinear/step2d_LF_AM3.h (search for LwSrc to see where it is done). There are no loops over k, of course, and so the additional information like river_Vshape s...
by wilkin
Wed May 10, 2023 5:35 pm
Forum: ROMS Discussion
Topic: best 3D visualization tool for ROMS
Replies: 2
Views: 3437

Re: best 3D visualization tool for ROMS

I have written code (roms_isosurface.m) to use Matlab's isosurface function to create 3D visualizations. This is part of my roms_wilkin toolbox at https://github.com/johnwilkin/roms_wilkin Some examples are shown below generated by roms_isosurface_demo.m in the GitHub repo.The demo calls an OPeNDAP ...
by wilkin
Sun May 07, 2023 11:58 pm
Forum: ROMS Discussion
Topic: cluster distribution parameter in floats.in
Replies: 1
Views: 3174

Re: cluster distribution parameter in floats.in

There is some additional, admittedly very succinct, documentation at https://www.myroms.org/wiki/floats.in As an example, the code below will initialize 15 floats at i = 3 (Fx0 =3), j = 2 (Fy0 = 2) and k = 1:2:31 (Fz0 = 1, Fdz = 2): ! C Initial horizontal coordinate type (0: grid units, 1: spherical...
by wilkin
Sat May 06, 2023 12:32 am
Forum: ROMS Discussion
Topic: Interpolation of bed stress for step_floats
Replies: 8
Views: 11080

Re: Interpolation of bed stress for step_floats

A paper describing larval transport results using ROMSpath in a nested grid configuration is here: Garwood, J.C., Fuchs, H.L., Gerbi, G.P., Hunter, E.J., Chant, R.J. and Wilkin, J.L., 2022. Estuarine retention of larvae: Contrasting effects of behavioral responses to turbulence and waves. Limnology ...
by wilkin
Fri May 05, 2023 2:43 pm
Forum: ROMS Discussion
Topic: Interpolation of bed stress for step_floats
Replies: 8
Views: 11080

Re: Interpolation of bed stress for step_floats

Another approach you might consider is offline particle tracking using ROMSPath https://gmd.copernicus.org/articles/15/4297/2022/ ROMSpath uses almost exactly the same floats algorithm internal to ROMS. Importantly, the velocity is expressed in ROMS native xi,eta,s coordinates using u,v,omega, so it...
by wilkin
Tue Apr 18, 2023 5:30 pm
Forum: ROMS Ecosystem
Topic: Biological Tracer from River
Replies: 6
Views: 9509

Re: Biological Tracer from River

In my experience LtracerSrc = F is quite stable when used with Dsrc = 2, i.e. the updated LwSrc cell-centered divergence method for sources.
by wilkin
Tue Apr 18, 2023 3:17 pm
Forum: ROMS Problems
Topic: Problems encountered while installing ROMS
Replies: 1
Views: 3494

Re: Problems encountered while installing ROMS

romsS is a S for "serial" meaning you intend to run on a single processor. romsM is a M for "multiple" or "MPI" meaning you will run on multiple cores by setting nNtileI and NtileJ in roms.in greater than 1. Their product is the number of concurrent (parallel) cores to ...
by wilkin
Tue Apr 18, 2023 3:13 pm
Forum: ROMS Ecosystem
Topic: Biological Tracer from River
Replies: 6
Views: 9509

Re: Biological Tracer from River

If you want to set the concentration of biology tracers in the rivers, i.e. use LtracerSrc = T for some variables, then those concentrations are determined by: Default is to read the file specified by SSFNAME in roms .in ! Input Sources/Sinks forcing (like river runoff) file name. SSFNAME == roms_ri...
by wilkin
Mon Apr 17, 2023 4:49 pm
Forum: ROMS Problems
Topic: AVERAGES_DETIDES result problem
Replies: 10
Views: 12395

Re: AVERAGES_DETIDES result problem

ROMS should create the file defined by HARNAME. When we first introduced this option, ROMS would add to the forcing harmonics file but that was not an option once nesting was introduced. See ticket https://www.myroms.org/projects/src/ticket/736 To get to that line in the def_tides.F code where you h...
by wilkin
Mon Apr 10, 2023 2:46 pm
Forum: Ocean News
Topic: Dale B. Haidvogel (1949-2023)
Replies: 18
Views: 35432

Re: Dale B. Haidvogel (1949-2023)

Posted on behalf of Glenn Flierl, MIT Dale and I talked during a time when we were both visiting NCAR; it was great seeing someone bringing more advanced numerical methods to ocean models, albeit idealized, that began to represent the eddies. This expertise in both the physics and the numerics carri...
by wilkin
Tue Apr 04, 2023 2:13 pm
Forum: Ocean News
Topic: Dale B. Haidvogel (1949-2023)
Replies: 18
Views: 35432

Re: Dale B. Haidvogel (1949-2023)

The Boulder "Daily Camera" newspaper published this obituary online today ...
https://www.legacy.com/us/obituaries/da ... d=51548008
by wilkin
Wed Mar 29, 2023 2:26 pm
Forum: User Applications
Topic: Vertical segmentation issue
Replies: 3
Views: 9645

Re: Vertical segmentation issue

You have ... SOLVE3D Solving 3D Primitive Equations so you need enough vertical layers for ROMS to be able to compute vertical gradients for such things as vertical mixing and hence to impose surface and bottom stresses, etc., If you want a strictly 2-D solution where you are solving the shallow wat...
by wilkin
Mon Mar 27, 2023 11:59 am
Forum: ROMS Discussion
Topic: solar radaiation
Replies: 1
Views: 3302

Re: solar radaiation

This code already exists ... #define SOLAR_SOURCE. The work is done in Nonlinear/lmd_swfrac.F using two length scales according to the method of Paulson and Simpson (1977) https://doi.org/10.1175/1520-0485(1977)007%3C0952:IMITUO%3E2.0.CO;2 The user chooses the length scales with the water type WTYPE...
by wilkin
Mon Mar 27, 2023 11:42 am
Forum: ROMS Discussion
Topic: Bias is growing with more spin up years
Replies: 4
Views: 4838

Re: Bias is growing with more spin up years

My suggestion was to #define LONGWAVE_OUT and #undef LONGWAVE. Don't set both - that makes no sense. Look in bulk_fluxes.F to see what these options do. LONGWAVE_OUT will cause ROMS to read lwrad_down (or whatever you renamed it to be in varinfo.dat) but compute outward longwave from model SST. Howe...
by wilkin
Sun Mar 26, 2023 6:54 pm
Forum: ROMS Discussion
Topic: Bias is growing with more spin up years
Replies: 4
Views: 4838

Re: Bias is growing with more spin up years

I see you are using net longwave radiation forcing. Does IMDAA have a separate analysis for downward longwave only (i.e. what ROMS expects as lwrad_down)? If it does, you might find #define LONGWAVE_OUT helps because your growing SST might be reined in by increasing upward outgoing longwave emission...
by wilkin
Fri Mar 24, 2023 11:23 am
Forum: Ocean News
Topic: Dale B. Haidvogel (1949-2023)
Replies: 18
Views: 35432

Re: Dale B. Haidvogel (1949-2023)

On behalf of Ichiro Fukumori ... I first met Dale in the early ‘90s. Friendly and kind, and generous with his time, Dale introduced me to ocean modeling for exploring ways to conduct ocean data assimilation. The model was SPEM, which I found to be elegantly written in a manner one could readily foll...
by wilkin
Sat Mar 18, 2023 7:17 am
Forum: Ocean News
Topic: Dale B. Haidvogel (1949-2023)
Replies: 18
Views: 35432

Dale B. Haidvogel (1949-2023)

The oceanography community has lost a respected pioneer of regional and coastal ocean modeling. Dale Haidvogel passed away unexpectedly on March 14 at his home in Buffalo, NY. Though recently retired from Rutgers University, Dale was still active as an emeritus instructor in graduate GFD courses. A ...
by wilkin
Fri Mar 17, 2023 11:31 pm
Forum: ROMS Discussion
Topic: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)
Replies: 5
Views: 6766

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

Is that the salt initial condition you want? I doubt it. I think you need to sort out the basic solution before you worry about dyes.

And why all the little lakes in the land?
by wilkin
Wed Mar 15, 2023 9:27 am
Forum: ROMS Discussion
Topic: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)
Replies: 5
Views: 6766

Re: Problem of adding passive tracer(dye concentrantion is 0 everywhere after calculation)

You could simplify your test case by choosing Rad instead of RadNud for the dye open boundary condition ... then ROMS should not need use (or even read) the boundary dye values. You have OBCFAC = 0.0, which I think disables the nudging on inflow. Maybe start with OBCFAC = 1.0 so you have boundary nu...
by wilkin
Sat Mar 11, 2023 9:09 am
Forum: ROMS Bugs
Topic: History file archiving intervals: bug in output.F?
Replies: 12
Views: 34108

Re: History file archiving intervals: bug in output.F?

It is hard to tell from those diffs, but I suspect you might have confused ROMS in the restart process. It looks like you are asking ROMS to write 10 records to a history before refreshing a new file, but you are restarting only part way through that sequence. ROMS might be looking for file 0002 to ...
by wilkin
Mon Mar 06, 2023 2:03 am
Forum: ROMS Discussion
Topic: ROMS crashing when using LwSrc
Replies: 18
Views: 31061

Re: ROMS crashing when using LwSrc

Parker and Aurora, I don't think this is your issue, but could you just check whether the point source giving you trouble happens to fall on a parallel tile boundary? If so, or even if not, can you test whether the blow-up you get also occurs at the same time in the run for a different choice of Nti...
by wilkin
Sat Mar 04, 2023 10:21 pm
Forum: ROMS Discussion
Topic: ROMS crashing when using LwSrc
Replies: 18
Views: 31061

Re: ROMS crashing when using LwSrc

If there was a bug here, and I haven't yet tunneled into the code to double check, it would affect whether the source was identified in the active i,j tile, or not, for all time. I don't see how it could be the direct cause of an instability that appears well into a run.
by wilkin
Sun Feb 19, 2023 2:34 pm
Forum: ROMS Discussion
Topic: Model could not recognize variables
Replies: 8
Views: 8064

Re: Model could not recognize variables

I think you are confusing dimensions and coordinate variables. It does not matter whether a variable is dimensioned salt_time or mud_time. That conveys no information to ROMS about the time coordinate . Which time coordinate to use to interpret the index into the time dimension can be specified eith...
by wilkin
Wed Feb 08, 2023 4:23 pm
Forum: ROMS Discussion
Topic: problem in using Hvom and Huon
Replies: 8
Views: 10392

Re: problem in using Hvom and Huon

Yes, as I noted previously Since the dz is already in there, the vertical integral of the tracer flux, weighted by cell width, is simply the summation from k=1,N. To also integrate over "x", just take the sum over "i" because the dx is already in there. so you should sum over lay...
by wilkin
Fri Feb 03, 2023 4:50 pm
Forum: ROMS Discussion
Topic: Question calculating transport of passive tracer
Replies: 3
Views: 4062

Re: Question calculating transport of passive tracer

What you say is, in principle, correct. Generally speaking, in method B you need to subtract the mass of tracer at the start, but that is zero for this specific set up, right? How are you calculating dz in the volume integral? It is easy to get that wrong if you are coding from scratch. Replying to ...
by wilkin
Thu Feb 02, 2023 9:07 pm
Forum: Job Opportunities
Topic: Post-doc: Rutgers Ocean Modeling Group / ECCOFS team
Replies: 0
Views: 4507

Post-doc: Rutgers Ocean Modeling Group / ECCOFS team

We are advertising for a Postdoctoral Associate in Physical Oceanography & Ocean Modeling The project is to work on elements of the design, development and evaluation of a prototype East Coast Community Ocean Forecast System (ECCOFS) that implements data-assimilation of real-time observations in...
by wilkin
Thu Feb 02, 2023 5:55 pm
Forum: ROMS Discussion
Topic: problem in using Hvom and Huon
Replies: 8
Views: 10392

Re: problem in using Hvom and Huon

You want ... v.dx.dz v.T.dx.dz The diagnostics outputs Hvom tracer are exactly these terms. In "Hvom" the "H" does not refer to water depth, h, but to the "Hz" variable that is ROMS time-varying layer thickness, i.e., dz. (The sum k=1 to N of Hz equals h+zeta.) The &quo...
by wilkin
Tue Jan 31, 2023 12:06 pm
Forum: ROMS Discussion
Topic: ROMS crashing when using LwSrc
Replies: 18
Views: 31061

Re: ROMS crashing when using LwSrc

My own guess is that there is some bug in the zeta calculation in the presence of a vertical source that leads to an instability. I can't see how a baroclinic error would show up as a huge SSH jump. Hi Parker, Once you get an instability in the velocity the extreme values drive extreme convergence ...
by wilkin
Sun Jan 29, 2023 10:04 pm
Forum: ROMS Discussion
Topic: ROMS crashing when using LwSrc
Replies: 18
Views: 31061

Re: ROMS crashing when using LwSrc

I think the sudden jump in sea level and surface velocities are symptoms of the instability, and not its origin. Looking at the density profile and AKt vertical mixing eddy diffusivity immediately before and after the vertical homogenization of the water column can you convince yourself this is mixi...
by wilkin
Mon Jan 16, 2023 7:40 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

I see your point. The individual files, e.g., https://rda.ucar.edu/thredds/dodsC/files/g/ds083.3/2021/202101/gdas1.fnl0p25.2021010100.f09.grib2.html (one every 3 hours) have variable Downward_Short-Wave_Radiation_Flux_surface_3_Hour_Average Perhaps that is what should have been aggregated in THREDDS...
by wilkin
Mon Jan 16, 2023 4:12 pm
Forum: ROMS Discussion
Topic: ROMS crashing when using LwSrc
Replies: 18
Views: 31061

Re: ROMS crashing when using LwSrc

Brainstorming here ... If your Vshape causes the source to flow entirely into the bottom cell, then a transport Q is going to drive vertical flow up out of that cell at velocity w = Q/(dx*dy). If the thickness of that cell, dz, is small, such that w*dt/dz > 1, then you might have a CFL instability o...
by wilkin
Mon Jan 16, 2023 3:57 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

I think we might be speaking at cross purposes here. You are plotting values extracted from individual files, which have 3- and 6-hour average values in each cycle. I was plotting "3-hour" data from the THREDDS FMRC aggregations. I may be wrong, but I assumed whoever configured the FMRC co...
by wilkin
Fri Jan 13, 2023 8:57 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

Looks to me like your magenta dots are simply half way between the orange dots, and if you plot them together you get a nice diurnal cycle resolved at 3-hour intervals? I think the files you are reading have correctly parsed data from the 3 and 6 hour fields in each cycle. No further tinkering requi...
by wilkin
Thu Jan 12, 2023 8:07 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

As I understand it, the reftime tells when that forecast cycle started. There is a new forecast every 6 hours, and data from that cycle is saved at 3-hour intervals. Hence, reftime repeats in pairs 0, 0, 6, 6, whereas the time coordinate advances by 3 hours for each record. This is a Forecast Model ...
by wilkin
Thu Jan 12, 2023 3:21 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

I have added codes roms_{get,write}_gfs_NCARds083_bulkflux.m for accessing the NCAR archive of GFS data to my tools https://github.com/johnwilkin/roms_wilkin. They run similarly to the ERA5 downloads, though there is presently an issue with updating the GFS THREDDS aggregation that the NCAR Helpdesk...
by wilkin
Tue Jan 10, 2023 3:23 pm
Forum: ROMS Discussion
Topic: variable frequency in atmospheric forcing fields
Replies: 15
Views: 19281

Re: variable frequency in atmospheric forcing fields

The MATLAB codes I wrote (roms_get_era5_NCARds633_bulkflux.m and roms_write_era5_NCARds633_frcfile.m) at https://github.com/johnwilkin/roms_wilkin extract hourly data for all fields from the ERA5 dataset in the Research Data Archive at NCAR (rda.ucar.edu).
by wilkin
Mon Jan 09, 2023 6:00 pm
Forum: ROMS Discussion
Topic: ROMS tidal forcing file
Replies: 1
Views: 3052

Re: ROMS tidal forcing file

The error says "Permission denied" which suggests you are trying to write to a non-existent directory or you lack the permissions to create files there. Matlab has great debugging tools. Try: >> dbstop in write_roms_otps_ncfile_v2 and when Matlab pauses there, check what directory you are ...
by wilkin
Thu Jan 05, 2023 8:43 pm
Forum: ROMS Discussion
Topic: Land boundary for ROMS online floats
Replies: 2
Views: 2953

Re: Land boundary for ROMS online floats

The 4th order predictor corrector scheme for ROMS online floats interpolates the gridded velocity field to each float's position within a cell and integrates over the model time step DT in such a way that as a float approaches a land boundary the velocity normal to the boundary tends zero (by virtue...
by wilkin
Wed Jan 04, 2023 1:08 pm
Forum: ROMS Discussion
Topic: Water Level for One-Way Nesting is Wrong but Two-Way Nesting Works
Replies: 7
Views: 8893

Re: Water Level for One-Way Nesting is Wrong but Two-Way Nesting Works

Is the bathymetry continuous at the nest perimeter? If not, it's not possible to match velocity ubar,vbar with transport ubar*h,vbar*h and volume will not be conserved. Two-way nesting compensates for this by establishing a pressure gradient that will drive flow into the nest to rebalance the sea le...
by wilkin
Tue Jan 03, 2023 1:13 am
Forum: Job Opportunities
Topic: PhD assistantship in global internal wave modeling.
Replies: 0
Views: 4378

PhD assistantship in global internal wave modeling.

Graduate Assistantship in a NOPP Internal Wave Project (Physical Oceanography) The Division of Marine Science of the University of Southern Mississippi (USM) invites applicants for an M.S. or Ph.D. study in Physical Oceanography starting in summer/fall 2023. We seek a skilled and motivated individu...
by wilkin
Wed Dec 28, 2022 6:15 pm
Forum: ROMS Bugs
Topic: Whether different intel environments will affect the operation of ROMS
Replies: 1
Views: 3401

Re: Whether different intel environments will affect the operation of ROMS

I think you need to take some time to carefully quality control your initial conditions. Quickly looking at one of your log files 2018/3600/..out2 I see initial condition values of: - potential temperature (Min = -7.18577153E+00 Max = 3.30190636E+01) - salinity (Min = -4.23978987E+00 Max = 4.5697575...
by wilkin
Fri Dec 09, 2022 1:47 pm
Forum: ROMS Source
Topic: Abnormal shflux when QCORRECTION is defined in ROMS 1147
Replies: 7
Views: 8977

Re: Abnormal shflux when QCORRECTION is defined in ROMS 1147

(Min = -1.09291988E-05 Max = -4.45711885E-06) regrid = F Those seem like very small numbers for dQdT. varinfo.yaml indicates that the assumed units are watt meter-2 Celsius-1 ROMS works in kinematic units so this factor is divided by rho0*Cp to convert it to m/s. Then in set_vbc.F the Qcorrection i...
by wilkin
Thu Dec 08, 2022 6:42 pm
Forum: ROMS Source
Topic: Abnormal shflux when QCORRECTION is defined in ROMS 1147
Replies: 7
Views: 8977

Re: Abnormal shflux when QCORRECTION is defined in ROMS 1147

Are you using #define ANA_DQDSST to set dqdt with the analytical functional file? If so, check analytical.f90 in the Build directory to see what code is actually there. Maybe dqdt is set to zero. If you are reading it from netcdf, the logfile should report the vales read. Check for that. To revert t...
by wilkin
Tue Dec 06, 2022 2:52 pm
Forum: ROMS Problems
Topic: error while inquiring ID for variable: sms_time - ROMS Bullk forcing files
Replies: 1
Views: 3273

Re: error while inquiring ID for variable: sms_time - ROMS Bullk forcing files

If you are using the myroms.org code then the file varinfo.yaml sets the default names for time coordinate, sms_time, which is not in the file you made with croco tools. The myroms code also allows over-riding the default name with a "time" attribute for each variable, but you don't have t...
by wilkin
Thu Dec 01, 2022 12:30 pm
Forum: ROMS Tools and Techniques
Topic: roms_matlab plotting and analysis routines
Replies: 105
Views: 1246213

Re: roms_matlab plotting and analysis routines

The Mathworks have several online tutorials for getting started with using Matlab
https://www.mathworks.com/learn/tutoria ... nramp.html
by wilkin
Wed Nov 30, 2022 3:25 pm
Forum: ROMS Discussion
Topic: Question about Flather 2d boundary condition for ubar
Replies: 10
Views: 13865

Re: Question about Flather 2d boundary condition for ubar

Stefan, I see what you are saying. The reduced physics option to estimate ubar(Istr) (the physical boundary u-point) for use in Flather (when ubar_west is not provided) is solving d(ubar)/dt = -g*d(zeta)/dx and there appears to be a factor of 1/2 multiplying the pressure gradient RHS term. This is u...
by wilkin
Tue Nov 29, 2022 12:03 pm
Forum: ROMS Sediment
Topic: WRT_AVG ERROR while writing variable 'bed_frac_sand' into history file.
Replies: 7
Views: 13812

Re: WRT_AVG ERROR while writing variable 'bed_frac_sand' into history file.

Those CPP options don't look like myroms.org or COAWST. Are you running ROMS Agrif or CROCO? You might get more help from that user community.
by wilkin
Sun Nov 27, 2022 6:11 pm
Forum: ROMS Discussion
Topic: Question about Flather 2d boundary condition for ubar
Replies: 10
Views: 13865

Re: Question about Flather 2d boundary condition for ubar

I believe the 1/2 is there because, while the staggered grid formally places zeta_west 1/2 cell to the "left" of the u-face point (this is the code block where UV_TIDES is undefined so we are substituting a dynamical approximation for it), when zeta_west and ubar_west are created by users ...
by wilkin
Mon Nov 21, 2022 5:33 pm
Forum: ROMS Discussion
Topic: Canyon test case: unable to open restart NetCDF file
Replies: 6
Views: 6993

Re: Canyon test case: unable to open restart NetCDF file

That does look like a bug.

There aren't a lot of of users running 2D ROMS, so it's possible some bug crept in with file handling.
by wilkin
Thu Nov 10, 2022 11:35 am
Forum: ROMS Problems
Topic: ROMS Blows up on after first time step
Replies: 5
Views: 6686

Re: ROMS Blows up on after first time step

From those plots it does appear that the English Channel is where blow-up is likely to occur, but the error flags grid point (i,j,k) = (0,0,0), not a local blow-up point. Your initial and boundary values appear to be benign, so it is odd that the blow-up occurs on the very first step and is everywhe...
by wilkin
Tue Nov 08, 2022 7:12 pm
Forum: ROMS Problems
Topic: tides_date.f90 variable definition
Replies: 14
Views: 21339

Re: tides_date.f90 variable definition

All that said, I'm re-running the model now as it was to replicate the error and it's not crashing, which is in some ways scarier than the error I was getting previously. The fact that your earlier run terminated with no error report from ROMS does suggest it was a crash of one of the processors. Y...
by wilkin
Tue Nov 08, 2022 2:40 pm
Forum: ROMS Problems
Topic: tides_date.f90 variable definition
Replies: 14
Views: 21339

Re: tides_date.f90 variable definition

One perplexing thing is the way in which your job exited. There are quite extensive error trapping routines in ROMS so that you get some information on where the code failed before it exits. Yours just stopped, judging by the log you posted. It did not indicate a BLOW UP, or give a line number for t...
by wilkin
Sun Nov 06, 2022 1:14 pm
Forum: ROMS Problems
Topic: tides_date.f90 variable definition
Replies: 14
Views: 21339

Re: tides_date.f90 variable definition

Does the log really end abruptly like that, with no error reporting from ROMS?
by wilkin
Thu Nov 03, 2022 3:29 pm
Forum: ROMS Tools and Techniques
Topic: some possible errors using matlab tool
Replies: 6
Views: 10169

Re: some possible errors using matlab tool

You are correct. Something has changed with Matlab netcdf handling. I'm using R2022b (the latest) and get the same error. Your fix to add netcdf.reDef at line 100 works % svn diff nc_drename.m Index: nc_drename.m =================================================================== --- nc_drename.m (r...
by wilkin
Tue Nov 01, 2022 12:54 pm
Forum: ROMS Discussion
Topic: Canyon test case: unable to open restart NetCDF file
Replies: 6
Views: 6993

Re: Canyon test case: unable to open restart NetCDF file

That looks like a write permissions error. ROMS is not reading the restart file ... because you have ANA_INITIAL and it creates the initial conditions internally. The log shows the error occurs in DEF_RST_NF90, i.e., when ROMS is trying to define/create the restart file. You may not have permissions...
by wilkin
Mon Oct 31, 2022 1:11 pm
Forum: ROMS Tools and Techniques
Topic: some possible errors using matlab tool
Replies: 6
Views: 10169

Re: Unrecognized field name "f" using coarse2fine

Yes, that's a bug I just discovered myself. There are some other similar bugs but not for "spherical" grids using lon/lat coordinates.
by wilkin
Wed Oct 19, 2022 2:52 pm
Forum: ROMS Discussion
Topic: the Longwave radiation of Bulkflux
Replies: 1
Views: 2540

Re: the Longwave radiation of Bulkflux

The ROMS sign convention is that positive heat flux warms the ocean. This is so for swrad, lwrad and lwrad_down. In your region you would typically have 400 W/m^2 of downwelling longwave radiation https://link.springer.com/article/10.1007/s42452-019-1172-2/figures/4 so the fact you have negative val...
by wilkin
Sun Oct 16, 2022 12:12 pm
Forum: ROMS Problems
Topic: How to turn off horizontal advection term just for phytoplankton
Replies: 4
Views: 6858

Re: How to turn off horizontal advection term just for phytoplankton

If you really want to do this, the logic would be to perform the advection time step update for all tracers except 6 with ... IF (itrc.ne.6) THEN t(i,j,k,3,itrc)=Hz(i,j,k)*(cff1*t(i,j,k,nstp,itrc)+ & & cff2*t(i,j,k,nnew,itrc))- & & cff*pm(i,j)*pn(i,j)* & .... When the code gets t...
by wilkin
Fri Oct 14, 2022 12:15 pm
Forum: ROMS Ecosystem
Topic: adding a new variable to hypoxia_srm
Replies: 4
Views: 7924

Re: adding a new variable to hypoxia_srm

Found Error: 02 Line: 1006 Source: ROMS/Nonlinear/get_data.F
Look at line 1006 in your get_data and see what variable it is trying to read.

In mine (not COAWST) it's reading boundary conditions so yours must be quite different. Presumably, it's related to your modified setup.
by wilkin
Thu Oct 13, 2022 12:38 pm
Forum: ROMS Ecosystem
Topic: adding a new variable to hypoxia_srm
Replies: 4
Views: 7924

Re: adding a new variable to hypoxia_srm

Often, compiling with debug option leads to more informative error messages. Try that first.
by wilkin
Wed Oct 12, 2022 3:25 pm
Forum: ROMS Problems
Topic: 4 Sides Boundary makes ROMs running errors
Replies: 2
Views: 5453

Re: 4 Sides Boundary makes ROMs running errors

You definitely want to remove the perimeter wall. Then you need some sensible open boundary conditions. Presently you have east-east periodic, which would only be admissible in this situation if you contrived to match the land/sea mask at the left and right boundaries, or ensured both were entirely ...
by wilkin
Mon Oct 10, 2022 3:15 pm
Forum: ROMS Discussion
Topic: ROMS runtime setting problem
Replies: 7
Views: 6349

Re: ROMS runtime setting problem

You haven't #define MASKING
by wilkin
Mon Oct 10, 2022 2:09 pm
Forum: ROMS Discussion
Topic: ROMS runtime setting problem
Replies: 7
Views: 6349

Re: ROMS runtime setting problem

Thank you for your reply. Is it possible if I replace nan with 0 in the file? And will roms do the screening operation based on mask? Yes, zero values (any finite value) in the land should solve your initialization problem. Then the masks will be applied - zero times anything finite is zero. ROMS r...
by wilkin
Sun Oct 09, 2022 1:42 pm
Forum: ROMS Discussion
Topic: ROMS runtime setting problem
Replies: 7
Views: 6349

Re: ROMS runtime setting problem

You can't have NaNa in any input fields, not even in the area masked as land. ROMS computes on all points and then applies the 0/1 land mask afterward. Zero times NaN is NaN, so they won't go away. Your log reports that both forcing and boundary data were read for initial time 2019-08-01 00:00:00.00...
by wilkin
Tue Oct 04, 2022 4:49 pm
Forum: ROMS Problems
Topic: NaN occur in fisrt step
Replies: 7
Views: 6293

Re: NaN occur in fisrt step

Your air pressure data are in Pascals ranging from 98,040 to 102,590. By default, ROMS expects Pair in millibars unless you have modified varinfo.dat to do the conversion via a scale factor of 0.01. It is likely you have crazy air pressures in your run. Quickly plotting your Pair data I find that ev...
by wilkin
Mon Oct 03, 2022 3:53 pm
Forum: ROMS Problems
Topic: ERROR: Abnormal termination: NetCDF OUTPUT
Replies: 6
Views: 8234

Re: ERROR: Abnormal termination: NetCDF OUTPUT

Read the documentation.

The | joins files with the same variables that are broken into time segments.

You want \ which goes to the next file - here you have different variables in each file in a list. You have 7 files.
by wilkin
Mon Oct 03, 2022 1:37 pm
Forum: ROMS Problems
Topic: ERROR: Abnormal termination: NetCDF OUTPUT
Replies: 6
Views: 8234

Re: ERROR: Abnormal termination: NetCDF OUTPUT

The "|" character is used to effectively concatenate files with sequential time records, e.g. one year at a time. When this is used it counts as only one file. You should use the "\" character to end one file and go to the next, with a different variable, in a list. What you have...
by wilkin
Thu Sep 22, 2022 2:30 pm
Forum: ROMS Discussion
Topic: Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)
Replies: 6
Views: 6543

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

Your file output.txt indicates that the ERA5 forcing data were read successfully. The next thing ROMS is doing when the error occurs is reading the open boundary conditions file, and the first variable it reads is zeta, so that's why you are getting an error about zeta_time. The log says your Input ...
by wilkin
Thu Sep 22, 2022 1:53 pm
Forum: ROMS Discussion
Topic: Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)
Replies: 6
Views: 6543

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

The netcdf files created by roms_write_era5_NCARds633_frcfile.m have a time coordinate variable called "time" (not zeta_time) and the "time" attribute of all variables will point ROMS to read "time" in preference the default in varinfo.dat. But, I can't imagine what met...
by wilkin
Wed Sep 21, 2022 4:00 pm
Forum: ROMS Tools and Techniques
Topic: no bitcount using roms_write_era5_NCARds633_frcfile.m
Replies: 12
Views: 16215

Re: no bitcount using roms_write_era5_NCARds633_frcfile.m

I have updated the svn repository, but at some time in the medium term future we will shut that down and keep everything just in GitHub.
by wilkin
Wed Sep 21, 2022 2:59 pm
Forum: ROMS Tools and Techniques
Topic: no bitcount using roms_write_era5_NCARds633_frcfile.m
Replies: 12
Views: 16215

Re: no bitcount using roms_write_era5_NCARds633_frcfile.m

You are correct that the svn version is out of date. I'll try to get that updated soon, but the latest version will always be at GitHub for the foreseeable future.
by wilkin
Wed Sep 21, 2022 2:21 pm
Forum: ROMS Tools and Techniques
Topic: no bitcount using roms_write_era5_NCARds633_frcfile.m
Replies: 12
Views: 16215

Re: no bitcount using roms_write_era5_NCARds633_frcfile.m

Do you have a current version of this function from https://github.com/johnwilkin/roms_wilkin ? I updated it 4 months ago in response to a similar post from another user, and I just tested that ... >> E = roms_get_era5_NCARds633_bulkflux(2020,1,[99 140 0 26]) works just fine with the present version.
by wilkin
Mon Sep 19, 2022 11:24 am
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

Is the error repeatable?

It looks like a failure on the server side which might be a temporary problem at NCAR.
by wilkin
Wed Sep 07, 2022 11:21 am
Forum: ROMS Discussion
Topic: pan-Arctic grid
Replies: 4
Views: 6710

Re: pan-Arctic grid

I've been making simple rectangular equi-spaced grids in Matlab using an arbitrary Lambert projection which you can center on any point and rotate. There is a post here: https://www.myroms.org/forum/viewtopic.php?p=23769#p23769. I have not tried, but I don't see any reason it would fail spanning the...
by wilkin
Fri Aug 19, 2022 2:29 pm
Forum: ROMS Tools and Techniques
Topic: roms_matlab plotting and analysis routines
Replies: 105
Views: 1246213

Re: roms_matlab plotting and analysis routines

I thought I had expunged all the old calls to SNC tools functions, but missed this one.

The first line just needs to be:

Code: Select all

cpp = ncreadatt(file,'/','CPP_options');
I've updated the repo on GitHub.
by wilkin
Wed Aug 17, 2022 2:43 pm
Forum: Job Opportunities
Topic: Post-doc in Southern Ocean climate dynamics - Princeton and Arizona
Replies: 0
Views: 3183

Post-doc in Southern Ocean climate dynamics - Princeton and Arizona

The University of Arizona, Princeton University, and NOAA’s Geophysical Fluid Dynamics Laboratory (GFDL) are seeking applicants for a position to analyze simulations of the Southern Ocean from GFDL’s CMIP6-generation ocean-only and coupled climate models using observational constraints. The position...
by wilkin
Wed Aug 10, 2022 3:58 pm
Forum: ROMS Discussion
Topic: Particle floats in ROMS?
Replies: 4
Views: 6828

Re: Particle floats in ROMS?

Where did you get your source code? My up-to-date checkout from myroms.org has flt_test.h at revision 1099, and the #define FLOATS is definitely there. /* ** svn $Id: flt_test.h 1099 2022-01-06 21:01:01Z arango $ ******************************************************************************* ** Copy...
by wilkin
Wed Aug 10, 2022 11:28 am
Forum: ROMS Discussion
Topic: Particle floats in ROMS?
Replies: 4
Views: 6828

Re: Particle floats in ROMS?

#define FLOATS

then ROMS reads the "floats.in" file name set by option FPOSNAME in roms.in. There is an example floats.in file in External that is documented further on WikiROMS here
https://www.myroms.org/wiki/floats.in
by wilkin
Tue Aug 09, 2022 10:52 am
Forum: ROMS Discussion
Topic: the middle layer velocity blows up
Replies: 1
Views: 2449

Re: the middle layer velocity blows up

You chose 4-th order centered advection for tracers. Is that what you used previously with the stable model?

Your barotropic Courant number is 0.6 which is getting a bit large, though still stable. You might need to increase NDTFAST.
by wilkin
Mon Aug 01, 2022 2:32 pm
Forum: ROMS Tools and Techniques
Topic: How to extract all sea surface height data along the lon, lat path
Replies: 3
Views: 4092

Re: How to extract all sea surface height data along the lon, lat path

Just code it yourself using the scatteredInterpolant class: % some ROMS output f = 'http://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/2017_da/his/History_Best'; % get some zeta output t0 = 1000; tcount = 100; zeta = ncread(f,'zeta',[1 1 t0],[Inf Inf tcount]); % get the lon/lat coordinates lon ...
by wilkin
Mon Aug 01, 2022 11:17 am
Forum: ROMS Usage
Topic: An error occurred when running ROMS in COAWST
Replies: 10
Views: 12731

Re: An error occurred when running ROMS in COAWST

I notice you have salinities in the initial conditions (and boundary conditions) of minus 11 NLM: GET_STATE - Reading state initial conditions, 2005-08-27 00:00:00.00 (Grid 01, t = 53609.0000, File: Katrina_ini.nc, Rec=0001, Index=1) ... - salinity (Min = -1.15371107E+01 Max = 3.68318607E+01) That i...
by wilkin
Sat Jul 30, 2022 7:44 pm
Forum: ROMS Discussion
Topic: Meet a problem while using contact.m
Replies: 1
Views: 2452

Re: Meet a problem while using contact.m

I get that error recomputing the contacts points file for my DOPPIO and PIONEER application. I had previously computed the file some time ago with an earlier version of contact.m.

So, yes, it looks like a bug has crept in.
by wilkin
Wed Jul 06, 2022 2:22 pm
Forum: ROMS Tools and Techniques
Topic: obc_roms2roms.m
Replies: 1
Views: 4254

Re: obc_roms2roms.m

I don't get that error. At that place in the code u_west and v_west are the same dimension because they have been interpolated to the receiver rho points (for rotation). On exit from obc_roms2roms they have been placed on their respective grids so have different dimensions. But, my code has a few ha...
by wilkin
Tue Jul 05, 2022 2:17 pm
Forum: ROMS Discussion
Topic: How to improve modelled salinity and salinity initial condition
Replies: 14
Views: 15390

Re: How to improve modelled salinity and salinity initial condition

As you have discovered, when whole chunks of code are not active (such as 4dvar in your example) the relevant subroutines simply have MODULE ... END MODULE and no executable code. We do this because otherwise the BUILD script would have to have logic that modified the list of routines to be compiled...
by wilkin
Mon Jul 04, 2022 12:23 pm
Forum: ROMS Discussion
Topic: How to improve modelled salinity and salinity initial condition
Replies: 14
Views: 15390

Re: How to improve modelled salinity and salinity initial condition

The question here is why ROMS is looking for 'swflux' at all when you have ANA_STFLUX, which should set the surface salinity/freshwater flux in ana_flux.h. You might have some conflicting or contradicting CPP defs. Rather than look at the .F code as you were, go into the build directory and look at ...
by wilkin
Fri Jul 01, 2022 4:57 pm
Forum: ROMS Discussion
Topic: I want to use HYCOM GLB v0.08 as the initial / boundary data of ROMS.
Replies: 17
Views: 24159

Re: I want to use HYCOM GLB v0.08 as the initial / boundary data of ROMS.

You would do better to use seapy https://github.com/powellb/seapy From the README: Find out how to download global HYCOM data that will span my grid from 1/1/2015 through 5/1/2015: >> seapy.model.hycom.load_history("hycom_file.nc", start_time=datetime(2015,1,1), end_time=datetime(2015,5,1)...
by wilkin
Tue Jun 28, 2022 11:26 am
Forum: ROMS Discussion
Topic: I want to use HYCOM GLB v0.08 as the initial / boundary data of ROMS.
Replies: 17
Views: 24159

Re: I want to use HYCOM GLB v0.08 as the initial / boundary data of ROMS.

The Matlab tools at https://github.com/NakamuraTakashi/matlab appear to be a clone (that is not up to date) of the myroms.org repo documented here https://www.myroms.org/wiki/Matlab_Scripts.
by wilkin
Wed Jun 22, 2022 3:01 pm
Forum: ROMS Discussion
Topic: too high bottom temperature result in estuary
Replies: 6
Views: 9694

Re: too high bottom temperature result in estuary

If you now have too-warm conditions at the surface where water is clearer (because heating is too surface intensified with wtype=5), then you can try a regionally varying water type. See https://www.myroms.org/projects/src/ticket/609. This must be static - not time varying. Other users have had some...
by wilkin
Thu Jun 16, 2022 2:44 pm
Forum: ROMS Installation
Topic: understanding of solar_source, diurnal_srflx,atm_press etc.
Replies: 2
Views: 5181

Re: understanding of solar_source, diurnal_srflx,atm_press etc.

#define BULK_FLUXES uses the COARE3.0 algorithm of Fairall et al. (references are in the code bulk_flux.F) to compute air-sea heat and momentum flux (stress) on the basis of input marine atmospheric boundary layer conditions (air temp, wind etc.) #define LONGWAVE_OUT computes the outgoing longwave r...
by wilkin
Wed Jun 15, 2022 12:36 am
Forum: ROMS Discussion
Topic: How to improve modelled salinity and salinity initial condition
Replies: 14
Views: 15390

Re: How to improve modelled salinity and salinity initial condition

Gaoyang, First, let me say thank you for such an informative and interesting post. You show detailed plots of model and data, succinctly describe your model set-up, and ask directed questions so that we might offer an informed response. Other ROMS Forum readers take note! That said, I have few concr...
by wilkin
Mon Jun 13, 2022 10:34 pm
Forum: ROMS Discussion
Topic: Matlab code(wikin code) for forcing
Replies: 7
Views: 8070

Re: Matlab code(wikin code) for forcing

Or use NCO tools ncrcat to merge the monthly files into fewer files. Also, perhaps it's not obvious in the script documentation but my intention with % Output file name prefix. If not set, name is MY_APPLICATION if ~exist('ROMS_APP','var') ROMS_APP = 'MY_APPLICATION'; end is that the user chooses a ...
by wilkin
Mon Jun 13, 2022 3:58 pm
Forum: ROMS Discussion
Topic: too high bottom temperature result in estuary
Replies: 6
Views: 9694

Re: too high bottom temperature result in estuary

Tmax is time. The max value 26.6 is OK. Consider your jerlov water type WTYPE. If it's 1 (clear ocean water) then in a shallow estuary a lot of sunlight reaches the seafloor and is trapped there because the bottom is effectively insulated. Use type 3 or 4 and absorption is more rapid keeping heating...
by wilkin
Thu Jun 09, 2022 11:50 am
Forum: ROMS Discussion
Topic: Matlab code(wikin code) for forcing
Replies: 7
Views: 8070

Re: Matlab code(wikin code) for forcing

Yes, you have to request a bounding box that is larger than your domain by at least the 0.25 deg resolution of ERA5. Make it 1 or 2 deg more ... there is no reason not to.
by wilkin
Wed Jun 08, 2022 2:58 pm
Forum: ROMS Problems
Topic: GET_2DFLD_NF90 - error while reading variable: Uwind at TIME index = 56
Replies: 4
Views: 4767

Re: GET_2DFLD_NF90 - error while reading variable: Uwind at TIME index = 56

Also check your rivers options. The log says ... Rivers_NorthSea8_smooth013_Dai2014_AnnualCycle_1993-2019.nc LuvSrc = F u-face = 63 LuvSrc = F v-face = 0 LwSrc = F w-face = 0 You have FALSE for all, which I expect renders the rivers inactive. There were recent enhancements to the LuvSrc/LwSrc option...
by wilkin
Wed Jun 08, 2022 2:47 pm
Forum: ROMS Problems
Topic: GET_2DFLD_NF90 - error while reading variable: Uwind at TIME index = 56
Replies: 4
Views: 4767

Re: GET_2DFLD_NF90 - error while reading variable: Uwind at TIME index = 56

The error says ROMS is failing while attempting to regrid the Uwind data to the model grid: Statement of problem in log: REGRID - input gridded data does not contain model grid: Gridded: LonMin = -24.0000 LonMax = 14.0000 LatMin = 32.0000 LatMax = 66.0000 Model: LonMin = 0.0000 LonMax = 0.0000 LatMi...
by wilkin
Wed Jun 08, 2022 2:28 pm
Forum: ROMS Discussion
Topic: Matlab code(wikin code) for forcing
Replies: 7
Views: 8070

Re: Matlab code(wikin code) for forcing

That was an easy to solve bug. It's fixed now and updated in GitHub.
by wilkin
Sat Jun 04, 2022 12:06 pm
Forum: ROMS Problems
Topic: Averaging in time or space (best practices)
Replies: 1
Views: 2943

Re: Averaging in time or space (best practices)

In the water depths you are looking at > 250 m the vast majority of in situ ocean observations would not be referenced to a fixed vertical datum but instead as a depth below the sea surface with no regard for the changing sea surface height because depth was obtained from a pressure sensor. Most oce...
by wilkin
Fri Jun 03, 2022 2:47 pm
Forum: Job Opportunities
Topic: Coastal Modeler, NOAA NOS, Silver Spring MD
Replies: 0
Views: 3489

Coastal Modeler, NOAA NOS, Silver Spring MD

There is an opening for a Coastal Modeler to support National Oceanic and Atmospheric Administration (NOAA), Center for Operational Oceanographic Products and Services (CO-OPS) in Silver Spring, MD. Key Responsibilities: Assist CO-OPS with the transition and implementation of new hydrodynamic coasta...
by wilkin
Thu Jun 02, 2022 2:14 pm
Forum: ROMS Usage
Topic: facing Error:ROMS/TOMS - Blows up ......... exit_flag: 1
Replies: 13
Views: 14161

Re: facing Error:ROMS/TOMS - Blows up ......... exit_flag: 1

You still have negative DZmin, so you have negative bottom depth h somewhere - probably in the land but that can still cause problems. Make h > 0 in the land. You also have: GET_NGFLD - river runoff mass transport vertical profile (Grid = 01, Min = 0.00000000E+00 Max = 2.00000000E-01) ... GET_NGFLD ...
by wilkin
Wed Jun 01, 2022 1:22 pm
Forum: ROMS Discussion
Topic: How to calculate turbulent shear rate / energy dissipation
Replies: 3
Views: 4181

Re: How to calculate turbulent shear rate / energy dissipation

Phil, The GLS k-kl closure is effectively Mellor-Yamada 2.5. Here is my Python code for calculating dissipation and turbulence length scale from the output, reading the GLS p,m,n parameters from the netcdf file (so this is generic for any chosen closure). ds is a DataArray opened with xarray (I was ...
by wilkin
Tue May 31, 2022 4:27 pm
Forum: ROMS Usage
Topic: facing Error:ROMS/TOMS - Blows up ......... exit_flag: 1
Replies: 13
Views: 14161

Re: facing Error:ROMS/TOMS - Blows up ......... exit_flag: 1

Looks like your initial conditions have a NaN in them. STEP Day HH:MM:SS KINETIC_ENRG POTEN_ENRG TOTAL_ENRG NET_VOLUME C => (i,j,k) Cu Cv Cw Max Speed 0 9135 12:00:00 NaN NaN NaN 0.000000E+00 You have negative DZ in the land Minimum Z-grid spacing, DZmin = -1.31577343E+04 m Water points = 6.68401986...
by wilkin
Thu May 26, 2022 3:56 pm
Forum: ROMS Results
Topic: Specific humidity performs worse than the relative
Replies: 3
Views: 4702

Re: Specific humidity performs worse than the relative

Notice that ROMS bulk_flux.F has this code.... ! ! Compute specific humidity, Q (kg/kg). ! IF (RH.lt.2.0_r8) THEN !RH fraction cff=cff*RH !Vapor pres (mb) Q(i)=0.62197_r8*(cff/(PairM-0.378_r8*cff)) !Spec hum (kg/kg) ELSE !RH input was actually specific humidity in g/kg Q(i)=RH/1000.0_r8 !Spec Hum (k...
by wilkin
Thu May 26, 2022 2:14 pm
Forum: ROMS Results
Topic: Specific humidity performs worse than the relative
Replies: 3
Views: 4702

Re: Specific humidity performs worse than the relative

When I make forcing files for ROMS from ERA5 (in my roms_wilkin tools function roms_write_era5_NCARds633_frcfile.m) I compute relative humidity from 2-m air temperature and specific humidity. % Compute relative humidity using Clausius-Clapeyron equation tsur = t2; % 2m temperature from ERA5 tdew = d...
by wilkin
Fri May 20, 2022 11:37 am
Forum: ROMS Discussion
Topic: Blow up in Second step
Replies: 12
Views: 7743

Re: Blow up in Second step

196 2020-05-01 00:32:40.00 3.869347E-01 1.555930E+04 1.555969E+04 8.325429E+15 (225,061,23) 3.047532E-04 2.696655E-04 5.290505E-01 1.944507E+01 197 2020-05-01 00:32:50.00 3.923971E-01 1.555928E+04 1.555967E+04 8.325429E+15 (225,061,23) 3.276896E-04 2.693862E-04 5.415630E-01 1.996086E+01 198 2020-05...
by wilkin
Tue May 17, 2022 1:43 pm
Forum: ROMS Discussion
Topic: Average file problem
Replies: 1
Views: 2861

Re: Average file problem

Your average is from 1 January to 30 January, so the date written to the output file to be associated with the average is the average time, 15 January. Makes sense. If you look at the log closely you will see that WRT_AVG executes on January 30, as it must because not until then can it have accumula...
by wilkin
Fri May 13, 2022 7:52 pm
Forum: ROMS Discussion
Topic: Blow up in Second step
Replies: 12
Views: 7743

Re: Blow up in Second step

Now you have deactivated all horizontal mixing. You have neither #define TS_DIF2 not #define TS_DIF4, which is why no horizontal mixing coefficient values nl_tnu2 are reported to the log. #define MIX_GEO_TS You do have some horizontal viscosity (#define MIX_GEO_UV) but the viscosity coefficient is z...
by wilkin
Fri May 13, 2022 1:56 pm
Forum: ROMS Discussion
Topic: Blow up in Second step
Replies: 12
Views: 7743

Re: Blow up in Second step

I see a number of things in your logfiles that are a bit unconventional and you might consider adjusting. Both runs have both these defined: UV_VIS2 Harmonic mixing of momentum UV_VIS4 Biharmonic mixing of momentum I recommend you start with only #undef UV_VIS4 until to show you need it. Especially ...
by wilkin
Mon May 09, 2022 9:22 pm
Forum: ROMS Tools and Techniques
Topic: roms_matlab plotting and analysis routines
Replies: 105
Views: 1246213

Re: roms_matlab plotting and analysis routines

Looks to me like you have the wrong ncread . You are not getting the ncread that is the native Matlab netcdf interface. In Matlab try ... >> which ncread -all You should see something like ... >> which ncread -all /Applications/MATLAB_R2020b.app/toolbox/matlab/imagesci/ncread.m >> If you see some ot...
by wilkin
Sun May 08, 2022 12:49 pm
Forum: ROMS Tools and Techniques
Topic: roms_matlab plotting and analysis routines
Replies: 105
Views: 1246213

Re: roms_matlab plotting and analysis routines

That nothing has changed at http://romsmatlab.tiddlyspot.com/ since 2010 is your clue that maybe that's not up to date. I'm struggling to remember how to update that web site with new info, but here it is... My codes, much updated since 2010, are now on GitHub at https://github.com/johnwilkin/roms_w...
by wilkin
Sat May 07, 2022 7:42 pm
Forum: ROMS Ice
Topic: Build Lambert Grid
Replies: 4
Views: 5377

Re: Build Lambert Grid

I misspoke in my message. I previously used the contributed m_map mapping toolbox to do this, but the code I posted uses Matlab's own Mapping toolbox ... the mstruct = defaultm('lambertstd'); etc steps. It's just very simple code to make a simple grid. In this example we created the bathymetry and l...
by wilkin
Fri May 06, 2022 9:46 pm
Forum: ROMS Ice
Topic: Build Lambert Grid
Replies: 4
Views: 5377

Re: Build Lambert Grid

I have been making simple rectangular Lambert grids, optionally rotated, using simple Matlab code and the m_map toolbox and some utilities from the myroms Matlab toolset to compute the grid metrics. mstruct = defaultm('lambertstd'); mstruct.mapparallels = 71.42; mstruct.origin = [71.42 -52.6]; mstru...
by wilkin
Thu May 05, 2022 2:15 pm
Forum: ROMS Discussion
Topic: River runoff problem
Replies: 9
Views: 13504

Re: River runoff problem

Here s_rho is just an index for the vertical dimension. You say you have 40 vertical layers, i.e. you have N = 40 in ROMS. If you are working in Python then the index is from 0 to 39, if you are in Matlab the index is from 1 to 40. That plot is an oddly varying profile for river_Vshape. You do under...
by wilkin
Thu May 05, 2022 1:56 pm
Forum: ROMS Discussion
Topic: River runoff problem
Replies: 9
Views: 13504

Re: River runoff problem

river_Vshape has the properties ... double river_Vshape(s_rho, river) ; river_Vshape:long_name = "river runoff mass transport vertical profile" ; river_Vshape:requires = "must sum to 1 over the s_rho coordinate" ; so in your case dimension s_rho = 40. But whether you count from 0...
by wilkin
Thu Apr 28, 2022 11:03 am
Forum: ROMS Discussion
Topic: River runoff problem
Replies: 9
Views: 13504

Re: River runoff problem

The function roms_plot_river_source_locations.m in my roms_wilkin tools https://github.com/johnwilkin/roms_wilkin will plot the sources in Matlab with symbols to indicate the flow direction.
by wilkin
Thu Apr 14, 2022 4:56 pm
Forum: ROMS Discussion
Topic: "gls" in the output file, and calculation of TKE dissipation
Replies: 7
Views: 5915

Re: "gls" in the output file, and calculation of TKE dissipation

Variable "gls" takes on different meanings, and units, depending on whether the parameters set in roms.in are for k-kl, k-epsilon, k-omega or "GLS". Since roms.in is processed at run time, not compile time, the logic becomes rather tortured for setting the output netcdf long_name...
by wilkin
Thu Apr 14, 2022 4:41 pm
Forum: Job Opportunities
Topic: Physical Scientist Ocean Modeling @ NOAA College Park, MD
Replies: 0
Views: 3239

Physical Scientist Ocean Modeling @ NOAA College Park, MD

https://www.usajobs.gov/job/648447500 Duties: The working title for this position is Physical Scientist (Development). As a Physical Scientist (Development), you will perform the following duties: Independently conduct numerical model and data assimilation development for prediction techniques (such...
by wilkin
Tue Mar 08, 2022 12:31 pm
Forum: ROMS Discussion
Topic: SIGSEGV, segmentation fault occurred (with Empty log file)
Replies: 6
Views: 8214

Re: SIGSEGV, segmentation fault occurred (with Empty log file)

Your shallow2d.h file has almost nothing in it. I'm not sure what you're going to get for default options on so many aspects of the code. Your roms_shallow.in is based of the upwelling example. Did you manage to run the upwelling test case successfully? If so, build from that by changing the options...
by wilkin
Sun Mar 06, 2022 1:34 pm
Forum: ROMS Discussion
Topic: forrtl: severe (174): SIGSEGV, segmentation fault occurred
Replies: 9
Views: 11257

Re: forrtl: severe (174): SIGSEGV, segmentation fault occurred

... I annotated these two lines because there is no frc file when using ROMS You don't have any ANA_* functionals defined for forcing (wind stress, heat flux etc.), so ROMS is trying to read those from a forcing netcdf file. Even if you want zero forcing, you need to set how that is implemented. Th...
by wilkin
Sat Mar 05, 2022 1:07 pm
Forum: ROMS Discussion
Topic: forrtl: severe (174): SIGSEGV, segmentation fault occurred
Replies: 9
Views: 11257

Re: forrtl: severe (174): SIGSEGV, segmentation fault occurred

The error occurs in get_data, so there is something wrong with one of your netcdf forcing files.
oceanG 00000000014F36CD get_data_ 101 get_data.f90
Look in get_data.f90 at what ROMS is reading at when the error occurs, and fix that file.
by wilkin
Fri Mar 04, 2022 3:47 pm
Forum: ROMS Discussion
Topic: ERA5_wind_problem
Replies: 9
Views: 8642

Re: ERA5_wind_problem

The boundary condition options are described here: https://www.myroms.org/wiki/Boundary_Conditions Only the Clamped and Flather conditions use boundary zeta. Only the Flather condition uses boundary ubar/vbar. If you choose to continue this discussion, please start another thread. This topic has not...
by wilkin
Sun Feb 27, 2022 2:16 pm
Forum: ROMS Discussion
Topic: shallow water blow up due to large wind speed or too much cooling?
Replies: 3
Views: 4101

Re: shallow water blow up due to large wind speed or too much cooling?

Upon blow-up a third record should have been written to the Restart file. So you should examine that closely. The log is telling you the i,j,k point where maximum speed is occurring so look in that general area. ( 307,125,03 ) 6.701547E-03 8.329611E-03 2.118809E+00 1.411828E+00 133918 2003-01-24 05:...
by wilkin
Tue Feb 15, 2022 9:07 pm
Forum: ROMS Discussion
Topic: Bizarre blow-up issue, seemingly due to tracers
Replies: 6
Views: 5612

Re: Bizarre blow-up issue, seemingly due to tracers

I recommend that at all points in permanent land mask the depth be given a modest positive value so that they play nicely with adjacent wet point at the coast. Within ROMS internal calculations you don't ever want NaNs anywhere. Is it possible that after some time wetting/drying dipped into a region...
by wilkin
Tue Feb 15, 2022 4:31 pm
Forum: ROMS Discussion
Topic: Bizarre blow-up issue, seemingly due to tracers
Replies: 6
Views: 5612

Re: Bizarre blow-up issue, seemingly due to tracers

You should look for NaNs irrespective of the masks because ROMS computes on all points, and then applies the mask. A NaN could have arisen in the land prior to masking. You don't have any explicit horizontal viscosity activated (UV_VIS2 is undefined) yet you have VISC_3DCOEFF, so I suspect those vis...
by wilkin
Sat Feb 12, 2022 8:33 pm
Forum: ROMS Discussion
Topic: ERA5_wind_problem
Replies: 9
Views: 8642

Re: ERA5_wind_problem

You have Rad + Nud boundary conditions for u,v but your logfile indicates the nuding time scale is zero. So you have only radiation, but that's probably OK. Boundary velocities will be controlled more by 2D Flather. I would just use Rad for u,v anyway. But if boundaries are open for u,v I don't thin...
by wilkin
Mon Feb 07, 2022 6:25 pm
Forum: ROMS Discussion
Topic: ERA5_wind_problem
Replies: 9
Views: 8642

Re: ERA5_wind_problem

User Bilge Tutak may be correct. Your temp and salt open boundary data are both zero for all times, which is something you need to fix. GET_NGFLD_NF90 - temperature eastern boundary condition, 2013-01-01 00:18:00.00 (Grid= 01, Rec=4, Index=1, File: persian_bry.nc) (Tmin= 0.0000 Tmax= 36.5958) t = 0....
by wilkin
Tue Jan 18, 2022 8:59 pm
Forum: ROMS Discussion
Topic: Error in c_initial matlab script
Replies: 7
Views: 7737

Re: Error in c_initial matlab script

It's explained in mexnc.m. function [varargout] = mexnc ( varargin ) % MEXNC is a gateway to the netCDF interface. To use this function, you % should be familiar with the information about netCDF contained in the % "User's Guide for netCDF". This documentation may be obtained from % Unidat...
by wilkin
Tue Jan 18, 2022 4:10 pm
Forum: ROMS Ecosystem
Topic: Light attenuation in Fasham
Replies: 4
Views: 8438

Re: Light attenuation in Fasham

You are correct. The units of AttChl are m^2 / mg_Chl. This is because they are inverse meters per chlorophyll concentration. At line 711 in fennel.h where AttChl is multiplied by the chlorophyll concentration (mg_Chl / m^3) it has to give units of inverse length ... to match units of AttSW ... and ...
by wilkin
Tue Jan 18, 2022 3:59 pm
Forum: ROMS Discussion
Topic: Error in c_initial matlab script
Replies: 7
Views: 7737

Re: Error in c_initial matlab script

I just tried that exact code you posted and it works fine for me ... >> INIname = 'shallow2d-init-v2.nc'; OA_INTERPOLATE = 1; S.ncname = INIname; S.spherical = 0; S.Lm = 128; S.Mm = 128; S.N = 20; S.NT = 2; S.Vtransform = 2; S.Vstretching = 2; S.theta_s = 7.0; S.theta_b = 0.1; S.Tcline = 200.0; S.hc...
by wilkin
Wed Jan 05, 2022 9:18 pm
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

I have updated my routines roms_get_era5_NCARds633_bulkflux.m and roms_write_era5_NCARds633_frcfile.m at https://github.com/johnwilkin/roms_wilkin Relative humidity is now computed using the formula documented by WMO-No.8 report (2018). In my test comparison the values differed at most by a factor o...
by wilkin
Wed Jan 05, 2022 8:01 pm
Forum: ROMS Tools and Techniques
Topic: Extraction of ERA 5 data for custom grid
Replies: 34
Views: 65157

Re: Extraction of ERA 5 data for custom grid

I would look at the documentation at NCAR for this specific version of the dataset, not other versions hosted by Copernicus. NCAR provide some variables as mean fluxes per unit time and some as instantaneous time analysis. The structure E in my code shows which variables are loaded from the meanflux...
by wilkin
Wed Jan 05, 2022 3:40 pm
Forum: ROMS Problems
Topic: Question about tracer routine
Replies: 4
Views: 5208

Re: Question about tracer routine

It is my understanding that the conversion of t(nnew) back to tracer units,before switching nnew and nstp, occurs in step3d_t.F, but as John Warner points out this depends on the advection scheme (MPDATA is different) and the status of SPLINES _VDIFF. See line 1190 in step3d_t.F: # ifdef SPLINES_VDI...
by wilkin
Fri Dec 31, 2021 4:01 pm
Forum: ROMS Discussion
Topic: Adding a river runoff in simulation
Replies: 2
Views: 4086

Re: Adding a river runoff in simulation

Is it possible you have placed your source in the land? In the wiki notes ... When using option LuvSrc = T, river_Xposition and river_Eposition refer to the i,j index of the u-face or v-face the flow crosses - NOT the i,j index of the rho cell it flows into. The i,j values must follow ROMS Fortran n...
by wilkin
Mon Dec 20, 2021 5:51 pm
Forum: ROMS Discussion
Topic: Variables for Masked Grid Cells
Replies: 5
Views: 5407

Re: Variables for Masked Grid Cells

Here for example is what NOAA NOS did to pad out cells in the land for their Chesapeake Bay CBOFS grid, which was computed with Delft tools. This shows "dy" grid spacing (1/pn) plotted in the grid i,j coordinates, because the filled bogus lon/lats in the land mess up my plotting routines (...
by wilkin
Mon Dec 20, 2021 5:04 pm
Forum: ROMS Discussion
Topic: Variables for Masked Grid Cells
Replies: 5
Views: 5407

Re: Variables for Masked Grid Cells

The min/max grid spacings reported in the log ... e.g. Metrics information for Grid 01: =============================== Minimum X-grid spacing, DXmin = 2.14507269E-01 km Water points = 2.30213420E-01 km Maximum X-grid spacing, DXmax = 2.20401588E+00 km Water points = 1.53947491E+00 km are calculated...
by wilkin
Mon Dec 20, 2021 12:39 pm
Forum: ROMS Discussion
Topic: Variables for Masked Grid Cells
Replies: 5
Views: 5407

Re: Variables for Masked Grid Cells

Yes, that's a problem. ROMS computes on all cells and then applies the masks. So, NaN values just inside the coastline can propagate into the interior. Zero values of, say, depth (but also other grid metrics) can cause divide-by-zero. Just fill the land with modest finite values and the masks should...
by wilkin
Sat Dec 18, 2021 1:36 pm
Forum: ROMS Discussion
Topic: Introducing Eulerian tracer during a simulation - flushing time
Replies: 18
Views: 28906

Re: Introducing Eulerian tracer during a simulation - flushing time

Tracer_NudgCoef is an inverse time scale. So it will interact with DT and your concentration of 100 to approach 100 in discrete steps. The ideal solution will approach 100 as a negative exponential. You can probably quickly calculate numerically what those discrete steps would be under the assumptio...
by wilkin
Sat Dec 11, 2021 9:39 pm
Forum: ROMS Discussion
Topic: blow up when nudging SST and SSS
Replies: 10
Views: 11056

Re: blow up when nudging SST and SSS

These error messages are quite helpful if you read them closely: Screen Shot 2021-12-11 at 4.32.34 PM.png If you inspect line 512 of set_data.F (last line of the code chunk below) you'll see it is the error condition triggered by a call to set_2dfld_tile to get surface salinity, which is code outsid...
by wilkin
Fri Dec 10, 2021 5:37 pm
Forum: ROMS Discussion
Topic: blow up when nudging SST and SSS
Replies: 10
Views: 11056

Re: blow up when nudging SST and SSS

The error says Tmin and Tmax are both zero. So, you have not associated the correct time coordinate variable with the SSS variable in the netcdf file. This is done by the "time" attribute for variable SSS, or if that is absent, it uses the entry for SSS in varinfo.dat.
by wilkin
Fri Dec 10, 2021 12:37 pm
Forum: ROMS Discussion
Topic: blow up when nudging SST and SSS
Replies: 10
Views: 11056

Re: blow up when nudging SST and SSS

Looks like your initial time is -389 days, which is not between 0 and 360.

It would probably make your time arithmetic easier to use DSTART = 0, and make the times in the forcing file [0, 180]. Make sure you spelled cycle_length correctly.
by wilkin
Thu Dec 02, 2021 5:20 pm
Forum: ROMS Installation
Topic: How to organize custom bio code
Replies: 3
Views: 6311

Re: How to organize custom bio code

The trick here is the angle bracket syntax for the #include in biology.F: # if defined BIO_FENNEL # include <fennel.h> # elif defined ECOSIM # include <ecosim.h> # elif defined HYPOXIA_SRM # include <hypoxia_srm.h> which you also see in analytical.F: analytical.F: #include "cppdefs.h" .. #...
by wilkin
Tue Nov 30, 2021 12:43 pm
Forum: ROMS Problems
Topic: Query regarding atmospheric CO2 value in ROMS Fennel coupled model.
Replies: 1
Views: 2743

Re: Query regarding atmospheric CO2 value in ROMS Fennel coupled model.

The code uses a constant CO2 concentration, and the default value may be out of date for the contemporary atmosphere. If you look in the code where that value is used, you'll see it's not difficult to introduce your own simple time series such as a uniformly increasing concentration, or even modulat...
by wilkin
Tue Nov 30, 2021 12:24 am
Forum: ROMS Discussion
Topic: Problems with restarting the model
Replies: 11
Views: 16810

Re: Problems with restarting the model

Kia ora Gaoyang, You can use the 'trac' source code browser https://www.myroms.org/projects/src/browser to explicitly compare two svn release numbers to see what might differ. But, if you don't have the three time level fields in your output that suggests it was not a perfect restart configuration. ...
by wilkin
Mon Nov 29, 2021 7:35 pm
Forum: ROMS Discussion
Topic: How can I understand ROMS vertical salt fluxes?
Replies: 2
Views: 2913

Re: How can I understand ROMS vertical salt fluxes?

The ROMS state variable is salinity, not freshwater, and we do not treat precipitation as if it actually adds freshwater volume to the top cell, thereby decreasing the average salinity of the cell by dilution (the mass of salt is conserved in reality). Instead, we fudge it by imposing a salt flux th...
by wilkin
Wed Nov 24, 2021 4:02 pm
Forum: ROMS Discussion
Topic: High Temperature in Summer
Replies: 4
Views: 5785

Re: High Temperature in Summer

Telling us only your CPP definitions is not much information to go on. There are a lot more details in the log file. But what I notice is you have: #define TS_MPDATA #define TS_DIF2 #define MIX_S_TS MPDATA is already quite diffusive, so adding explicit horizontal mixing (especially if your coefficie...
by wilkin
Tue Nov 23, 2021 3:42 pm
Forum: ROMS Discussion
Topic: usage of both LuvSrc and LwSrc
Replies: 4
Views: 8209

Re: usage of both LuvSrc and LwSrc

In principle, yes, 'uv' and 'w' sources can co-exist, and the Dsrc flag is not used in 'w' sources so it is available to indicate the distinction. The existing LuvSrc and LwSrc logical flags in roms.in would have to take on the meanings ... if(ANY(LuvSrc)) and if(ANY(LwSrc)) ... to force scanning th...
by wilkin
Sat Nov 06, 2021 1:14 am
Forum: ROMS Tools and Techniques
Topic: TPXO to ROMS EXPRESS (tide extraction software)
Replies: 110
Views: 2421950

Re: TPXO to ROMS EXPRESS (tide extraction software)

My suggestion was simply to compare the input tides file harmonics, but your analysis of a short ROMS model run suffices for the same purpose. Each harmonic shows a spatially uniform phase offset. To me, this implicates the processing of the time base date. I think you need to look very closely as t...
by wilkin
Thu Nov 04, 2021 2:14 pm
Forum: ROMS Tools and Techniques
Topic: TPXO to ROMS EXPRESS (tide extraction software)
Replies: 110
Views: 2421950

Re: TPXO to ROMS EXPRESS (tide extraction software)

Since the domain-wide mean phase isn't very illuminating, I encourage you to plot a map of the phases, and differences, to check that the offset is more or less constant everyone. That would be a clear indication of a time base problem. Likewise, mapping the amplitudes should show very little spatia...
by wilkin
Tue Nov 02, 2021 6:33 pm
Forum: ROMS Tools and Techniques
Topic: TPXO to ROMS EXPRESS (tide extraction software)
Replies: 110
Views: 2421950

Re: TPXO to ROMS EXPRESS (tide extraction software)

Just to be sure I understand what you are showing ... The blue line is your data. The orange line is ROMS, and you have two cases where the tide harmonic boundary forcing is computed for TPXO7 and TPXO9 with the same Matlab code. Is this right? Do the two orange lines overlay with a simple phase shi...
by wilkin
Tue Nov 02, 2021 5:26 pm
Forum: ROMS Bugs
Topic: tiling and divide by zero error
Replies: 10
Views: 17328

Re: tiling and divide by zero error

Parker, You can use svn to methodically bring your code up to date. (1) Check out a clean version of release 823. (2) copy over your NPZD mods to that repo (check with svn diff how it differs from 823). (3) Proceed in modest steps to update the whole repo to increasing version numbers ... svn update...
by wilkin
Tue Nov 02, 2021 4:52 pm
Forum: ROMS Bugs
Topic: tiling and divide by zero error
Replies: 10
Views: 17328

Re: tiling and divide by zero error

Hernan can correct me if I'm wrong, but ideally it is Lm and Mm that have many small prime factors so that you can have equal size tiles on many cores.
So, if you rho variables are 1302 x 663 (Lp by Mp) you are looking at prime factors of 1300 by 661. Unfortunately, 661 is prime.
by wilkin
Mon Nov 01, 2021 7:34 pm
Forum: ROMS Discussion
Topic: Problems with restarting the model
Replies: 11
Views: 16810

Re: Problems with restarting the model

A few things ... You have #define TS_FIXED so your tracer fields temp and salt are not going to evolve in time. I can see this might be a valid approach for your initial testing, especially if you have set them to constants so you are effectively solving a homogenous ocean problem with z-dependence ...
by wilkin
Thu Oct 28, 2021 1:53 pm
Forum: ROMS Tools and Techniques
Topic: TPXO to ROMS EXPRESS (tide extraction software)
Replies: 110
Views: 2421950

Re: TPXO to ROMS EXPRESS (tide extraction software)

The safest approach to start, to avoid any confusion with these time coordinates, would be to use a TIME_REF that matches t0 in the TPXO function, and then TIDE_START and DSTART both = 0. Any phase mismatch then would point to something other than these switches.
by wilkin
Sat Oct 09, 2021 12:42 pm
Forum: ROMS Discussion
Topic: relative/potential vorticity outputs
Replies: 7
Views: 11505

Re: relative/potential vorticity outputs

For vorticity at an individual timestamp you can calculate this from output of other variables in the History file.

In Averages and Diagnostics we save things that cannot be saved (accurately) otherwise unless computed online at runtime.
by wilkin
Tue Sep 14, 2021 2:56 pm
Forum: ROMS Discussion
Topic: Elevation decreased at all of grids except outermost grid at the boundary
Replies: 2
Views: 3695

Re: Elevation decreased at all of grids except outermost grid at the boundary

Do the bathymetries of the parent and child grids match for several grid cells near to the edge of the child grid? This is recommended so that the volumes of the grids match in the transition region. Have you compared one-way and two-way nesting to see if the issue occurs in both? Note that the nest...
by wilkin
Fri Sep 03, 2021 1:33 pm
Forum: ROMS Problems
Topic: READ_INP ERROR: A total of 1 configuration errors discovered.
Replies: 3
Views: 4344

Re: READ_INP ERROR: A total of 1 configuration errors discovered.

Vertical S-coordinate System: level S-coord Cs-curve at_hmin over_slope at_hmax 30 0.0000000 0.0000000 0.000 0.000 0.000 29 -0.0333333 -0.0001156 Infinity************ -Infinity 28 -0.0666667 -0.0004685 Infinity************ -Infinity 27 -0.1000000 -0.0010779 Infinity************ -Infinity 26 -0.1333...
by wilkin
Fri Sep 03, 2021 11:51 am
Forum: ROMS Discussion
Topic: Incorporating phytoplankton floating (Fennel model)
Replies: 6
Views: 7307

Re: Incorporating phytoplankton floating (Fennel model)

This is way more difficult than you'd think, but we've already done it. See the RED_TIDE ecosystem model code:
https://www.myroms.org/projects/src/ticket/694
It has upward "swimming" tracers.
by wilkin
Wed Sep 01, 2021 2:13 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

David is correct. Setting

Code: Select all

>> axis equal
does not solve the problem. Try it and you'll see.
by wilkin
Wed Sep 01, 2021 2:12 pm
Forum: ROMS Problems
Topic: READ_INP ERROR: A total of 1 configuration errors discovered.
Replies: 3
Views: 4344

Re: READ_INP ERROR: A total of 1 configuration errors discovered.

We would need to see you logfile to debug this.

But, since you are running CROCO and not ROMS from myroms.org, you might want to consult your CROCO colleagues directly.
by wilkin
Wed Sep 01, 2021 2:10 pm
Forum: ROMS Discussion
Topic: Hello
Replies: 4
Views: 4538

Re: Hello

You are using PARALLEL_IO which is a very new option recently added to ROMS. If this is not essential to achieving the performance you need, disable that option. I also notice that ROMS is unable to format DSTART and TIDE_START in the log file: *********** dstart Time-stamp assigned to model initial...
by wilkin
Wed Sep 01, 2021 2:06 pm
Forum: ROMS Discussion
Topic: ROMS/TOMS - Output error ............ exit_flag: 3
Replies: 3
Views: 5476

Re: ROMS/TOMS - Output error ............ exit_flag: 3

I see you are using #define PARALLEL_IO

That is almost certainly the issue. Try running without that and see if the error occurs.
by wilkin
Sat Aug 28, 2021 8:53 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

Mike is on to the problem. It's a failing of Matlab quiver with no easy workaround. If the plot space has a highly elongated aspect ratio the quiver vector components are distorted. This is why one can't simply put vectors of horizontal and vertical velocity on a vertical slice plot. I have a rather...
by wilkin
Fri Aug 27, 2021 9:08 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

Well, this is a mystery. I recomputed your angle and metrics from the grid lon/lat using roms_metrics.m (part of the Matlab tools at myroms.org). The values are not appreciably different. So, I made a sanity check plot using mature code that that I have used for years. I plotted two sets of vectors ...
by wilkin
Fri Aug 27, 2021 6:23 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

Yes, I would suspect your grid angle.

How did you generate the grid? Was it an angle preserving map projection?

Try plotting some velocity vectors with my roms_quivergrd and look closely if they are parallel to the coast. They absolutely should be.
by wilkin
Thu Aug 26, 2021 7:18 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

I added a function roms_surface_geostrophic_velocity.m to my ROMS tools at https://github.com/johnwilkin/roms_wilkin. It returns surface geostrophic velocity in east-north coordinates on the lon_rho grid ready for plotting by quiver. It gives vectors that align with zeta contours in my test plots. T...
by wilkin
Wed Aug 25, 2021 5:01 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

I think your average to u-points of 1/pm is not the same as 1/(average of pm). ROMS uses (look in metrics.F) !----------------------------------------------------------------------- ! Compute m/n, 1/m, and 1/n at horizontal U-points. !-----------------------------------------------------------------...
by wilkin
Wed Aug 25, 2021 2:30 pm
Forum: ROMS Tools and Techniques
Topic: Surface geostrophic velocity issue
Replies: 27
Views: 50315

Re: Surface geostrophic velocity issue

pm, pn have units inverse distance, so d(zeta)/d(xi) is diff(zeta) TIMES pm. But pm,pn are defined at cell center rho points, same as zeta. What ROMS does is average pm to the cell face u-point, say pm_u, and calculate diff(zeta)*pm_u. Then you have the zeta slope at u-points, and you need to averag...
by wilkin
Tue Aug 03, 2021 2:41 pm
Forum: ROMS Information
Topic: conversion of sigma levels in to depth
Replies: 4
Views: 8339

Re: conversion of sigma levels in to depth

The vertical coordinate is documented here in WikiROMS https://www.myroms.org/wiki/Vertical_S-coordinate. In the depths.m function you quote fname is any ROMS output file - history, averages, restart etc. Strictly speaking, the vertical coordinate changes in time with sea level zeta . The input tind...
by wilkin
Tue Aug 03, 2021 2:34 pm
Forum: ROMS Discussion
Topic: How to create the bathymetry data for nesting ROMS grids
Replies: 2
Views: 3240

Re: How to create the bathymetry data for nesting ROMS grids

x,y,x are longitude, latitude and depth.
by wilkin
Fri Jul 30, 2021 11:50 am
Forum: ROMS Discussion
Topic: Introducing Eulerian tracer during a simulation - flushing time
Replies: 18
Views: 28906

Re: Introducing Eulerian tracer during a simulation - flushing time

Look carefully at the logfile output from both runs. ROMS is very complete in documenting what it did, and you may stop some differences in configuration. Consider especially the settings for advection scheme because this can be a source of tracer over/under-shoot.
by wilkin
Fri Jul 30, 2021 11:45 am
Forum: ROMS Adjoint
Topic: INP_PAR, PHYPAR: Problems finding input file.
Replies: 7
Views: 14110

Re: INP_PAR, PHYPAR: Problems finding input file.

it is not clear to me how to "make sure my roms.in is up to date". My grid-file is included like this: Start from one of the example roms.in files in a recent version of the code, and work your way through adding the options you want. This is a safe way to make sure the file is complete, ...
by wilkin
Thu Jul 29, 2021 7:00 pm
Forum: ROMS Discussion
Topic: ROMS grid for conservative remapping
Replies: 12
Views: 22062

Re: ROMS grid for conservative remapping

Good point, Kate.

The mapping toolbox does include the stereographic projection (there are 72 projections in total) but I have no idea how to drive it, and will resist the temptation to delve into some recreational Matlab today to try and figure it out.
by wilkin
Thu Jul 29, 2021 6:11 pm
Forum: ROMS Discussion
Topic: ROMS grid for conservative remapping
Replies: 12
Views: 22062

Re: ROMS grid for conservative remapping

I've attached here another approach to making a simple grid using the Matlab mapping toolbox to set a Lambert conformal projection, and create a rectangular grid in Lambert space (optionally rotated w.r.t. east-north) that is then projected back to geographic coordinates. It takes a bit of trial and...
by wilkin
Thu Jul 29, 2021 3:16 pm
Forum: ROMS Discussion
Topic: Introducing Eulerian tracer during a simulation - flushing time
Replies: 18
Views: 28906

Re: Introducing Eulerian tracer during a simulation - flushing time

You might be able to do this with a hack to step3d_t.F using the tracer climatology nudging. See the code chuck near line 1559: ! ! Nudge towards tracer climatology. ! IF (LtracerCLM(itrc,ng).and.LnudgeTCLM(itrc,ng)) THEN DO k=1,N(ng) DO j=JstrR,JendR DO i=IstrR,IendR t(i,j,k,nnew,itrc)=t(i,j,k,nnew...
by wilkin
Thu Jul 29, 2021 11:55 am
Forum: ROMS Discussion
Topic: Problems reading the grid netCDF file
Replies: 1
Views: 2560

Re: Problems reading the grid netCDF file

Are you sure your roms.in is up to date with your code? When updates are made to the code sometimes they require new entries in roms.in (and varinfo.dat), and if you don't also update those input files it can trigger errors (because ROMS is expecting to read some settings from roms.in). Recent chang...
by wilkin
Thu Jul 29, 2021 11:48 am
Forum: ROMS Discussion
Topic: Introducing Eulerian tracer during a simulation - flushing time
Replies: 18
Views: 28906

Re: Introducing Eulerian tracer during a simulation - flushing time

No, that won't work because the point sources will also introduce mass (you have to specify discharge in m3/s) and radically change the circulation. I think your only choice is to stop and restart, or make some radical hack to reset dye_01 concentration at a chosen time (and I'm not sure how to do t...
by wilkin
Wed Jul 28, 2021 11:40 am
Forum: ROMS Discussion
Topic: Introducing Eulerian tracer during a simulation - flushing time
Replies: 18
Views: 28906

Re: Introducing Eulerian tracer during a simulation - flushing time

I can't think of any way to initialize passive tracers other than via the initial conditions file ... so here a restart.

But you can have floats initialize with a time delay, and you could estimate flushing time from a large float ensemble.
by wilkin
Tue Jul 27, 2021 3:42 pm
Forum: ROMS Discussion
Topic: ROMS grid for conservative remapping
Replies: 12
Views: 22062

Re: ROMS grid for conservative remapping

I struck the same problem working from the Met Norway grids and wrote simple code to add the lon_psi etc. kiwi:sandbox wilkin$ more roms_add_psi_latlon.m function g = roms_add_psi_latlon(ncfile,~) % grd = roms_add_psi_latlon(grd_file,[writeit]) % or roms_add_psi_latlon(grd_structure,[writeit]) % % I...
by wilkin
Tue Jul 27, 2021 3:34 pm
Forum: ROMS Discussion
Topic: Error in extract_bath.m program
Replies: 2
Views: 3388

Re: Error in extract_bath.m program

Blat=25.0; % Bottom corner latitude
Tlat=5.0; % Top corner latitude
Could it be that Blat > Tlat ?
by wilkin
Thu Jul 22, 2021 12:39 am
Forum: ROMS Discussion
Topic: DIURNAL_SRFLUX and cloud fraction
Replies: 3
Views: 5841

Re: DIURNAL_SRFLUX and cloud fraction

Kate's advice is right on. Look at the code. A quick search of where the option is active is accomplished with ... grep -r DIURNAL_SRFLUX . The only relevant entry is ... ./Functionals/ana_srflux.h My reading of the code in there is that daily average SWRAD is converted to a diurnal cycle of swrad, ...
by wilkin
Sat Jul 17, 2021 10:42 am
Forum: ROMS Problems
Topic: Boundary forcing error (t3dbc_im)
Replies: 8
Views: 14220

Re: Boundary forcing error (t3dbc_im)

Your log file indicates Tracer Affection Schemes are undefined. You might want to fix that first. You have a very large value for OBCFAC > 500. That's an unconventional choice that will lead to very different OBC behavior when the radiation switches sign. I suggest a smaller nudging time scale so th...
by wilkin
Fri Jun 25, 2021 11:10 am
Forum: ROMS Discussion
Topic: Issue of exceptionally low velocity
Replies: 8
Views: 15403

Re: Issue of exceptionally low velocity

Your log file shows all open boundaries are "Closed". You need Chapman and Flather conditions for the tides to be active. Set the appropriate LBC options in roms.in
by wilkin
Tue Jun 22, 2021 2:52 pm
Forum: ROMS Discussion
Topic: Issue of exceptionally low velocity
Replies: 8
Views: 15403

Re: Issue of exceptionally low velocity

The output of stresses does not require ANA_SMFLUX. ROMS can determine stresses analytically, from the bulk flux formulae, or from model coupling. Whatever it does, output is controlled by the relevant Hout option in roms.in. The log file tells you what ROMS actually did. So read that closely. Look ...
by wilkin
Tue Jun 22, 2021 11:16 am
Forum: ROMS Discussion
Topic: Issue of exceptionally low velocity
Replies: 8
Views: 15403

Re: Issue of exceptionally low velocity

You have defined ANA_SMFLUX but also BULK_FLUXES. So I'm not sure what you actually got. Think more carefully about your setup.
by wilkin
Fri Jun 18, 2021 3:48 pm
Forum: ROMS Discussion
Topic: problems to use d_ecmwf2roms
Replies: 2
Views: 3852

Re: problems to use d_ecmwf2roms

Your forcing files do not have to span precisely the interval of your simulation. Download extra files for the months before and after the run interval and concatenate them together (or use the | syntax in the FRCNAME list). From the time of the initial conditions in your ININAME file, ROMS will fig...
by wilkin
Sat Jun 12, 2021 1:00 pm
Forum: ROMS Discussion
Topic: Error in ending value for forcing
Replies: 5
Views: 5800

Re: Error in ending value for forcing

Does this error occur at the vert start, or after the model has run for a while?

Are you using the cycle_length attribute with the time coordinate?
by wilkin
Thu Jun 03, 2021 6:25 pm
Forum: ROMS Ecosystem
Topic: NPZD nesting
Replies: 5
Views: 7877

Re: NPZD nesting

Hernan, The user has this in npzd_Powell.in ... BioIni(iNO3_) == 17.0d0 17.0d0 ! nitrate BioIni(iPhyt) == 1.0d0 1.0d0 ! phytoplankton BioIni(iZoop) == 1.0d0 1.0d0 ! zooplankton BioIni(iSDet) == 1.0d0 1.0d0 ! detritus but gets this in stdout ... NPZD Model Parameters, Grid: 02 =======================...
by wilkin
Thu Jun 03, 2021 2:53 pm
Forum: ROMS Ecosystem
Topic: NPZD nesting
Replies: 5
Views: 7877

Re: NPZD nesting

Looks to me like this piece of npzd_Powell_inp.h ... #ifdef ANA_BIOLOGY CASE ('BioIni(iNO3_)') Npts=load_r(Nval, Rval, Ngrids, BioIni(iNO3_,1)) CASE ('BioIni(iPhyt)') Npts=load_r(Nval, Rval, Ngrids, BioIni(iPhyt,1)) CASE ('BioIni(iZoop)') Npts=load_r(Nval, Rval, Ngrids, BioIni(iZoop,1)) CASE ('BioIn...
by wilkin
Tue Jun 01, 2021 7:48 pm
Forum: ROMS Discussion
Topic: Problem faced during online nesting for ROMS using self created grid
Replies: 12
Views: 15893

Re: Problem faced during online nesting for ROMS using self created grid

Are you reading the instructions - "GLOSSARY" - at the end of the roms.in template? You see there that the tides go in one file - and apply only to the parent grid: ! TIDENAME Tidal constituents period, phase, elevation, and current data. ! This data is needed when SSH_TIDES, UV_TIDES, or ...
by wilkin
Tue Jun 01, 2021 6:30 pm
Forum: ROMS Discussion
Topic: Problem faced during online nesting for ROMS using self created grid
Replies: 12
Views: 15893

Re: Problem faced during online nesting for ROMS using self created grid

You can't have a tidal boundary condition file for the nested grid. It gets its boundary conditions from the parent.
by wilkin
Tue Jun 01, 2021 2:58 pm
Forum: ROMS Discussion
Topic: Problem faced during online nesting for ROMS using self created grid
Replies: 12
Views: 15893

Re: Problem faced during online nesting for ROMS using self created grid

You log file is reporting exactly the same inputs for the parent and child grids: Resolution, Grid 01: 298x148x15, Parallel Threads: 1, Tiling: 1x1 Physical Parameters, Grid: 01 ============================= 60000 ntimes Number of timesteps for 3-D equations. 10.000 dt Timestep size (s) for 3-D equa...
by wilkin
Thu May 27, 2021 11:28 am
Forum: ROMS Discussion
Topic: WET_DRY compilation problem
Replies: 10
Views: 21764

Re: WET_DRY compilation problem

Is your code up to date? I'm not seeing that syntax error in my code.
by wilkin
Thu May 27, 2021 11:20 am
Forum: ROMS Discussion
Topic: How repeat one year forcig for some years?
Replies: 1
Views: 3226

Re: How repeat one year forcig for some years?

Add a cycle_length attribute to the time coordinate variable in your forcing file. See the example in frc_fluxclm.cdl.
by wilkin
Thu May 27, 2021 11:17 am
Forum: ROMS Discussion
Topic: Boundary Condition Choice
Replies: 4
Views: 6490

Re: Boundary Condition Choice

If you put a one-cell wide strip of masked land down most of your west boundary, the open boundary condition can apply just to the "estuary".
by wilkin
Wed May 26, 2021 2:43 pm
Forum: ROMS Results
Topic: Wrong surface wind results when run ROMS
Replies: 3
Views: 3955

Re: Wrong surface wind results when run ROMS

You have a problem with the longwave radiation forcing data: GET_2DFLD - downwelling longwave radiation flux, 2008-01-01 00:00:00.00 (Grid=01, Rec=0000001, Index=1, File: east_vietnam_blk_1.nc) (Tmin= 0.0000 Tmax= 62.0000) t = 0.0000 (Min = 1.00000000E+37 Max = -1.00000000E+37) regrid = F
by wilkin
Thu May 20, 2021 11:32 am
Forum: ROMS Discussion
Topic: Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)
Replies: 6
Views: 6543

Re: D_ECMWF2ROMS Matlab scripts (ECMWF hourly data accumulation)

I wrote that code long ago and have not updated from ERA-Interim to ERA5. You will have to figure out the accumulation logic yourself, if indeed that is still how the data are presented (it may not be, check the units). I now access ERA5 from the NCAR Research Data Archive using roms_write_era5_NCAR...
by wilkin
Mon May 17, 2021 3:13 pm
Forum: ROMS Discussion
Topic: MaxDensity blowup
Replies: 2
Views: 3636

Re: MaxDensity blowup

Both your log files show high vertical velocity values in the vicinity of point (060,092,30) ... roms.log: 23871 2012-11-25 03:05:00.00 5.381065E-03 1.213158E+04 1.213159E+04 1.738389E+14 (060,092,30) 5.036566E-02 3.810904E-02 7.289321E+01 3.587618E+00 23872 2012-11-25 03:06:40.00 5.381077E-03 1.213...
by wilkin
Tue May 11, 2021 3:57 pm
Forum: ROMS Usage
Topic: Having trouble getting lagrangian float working...
Replies: 8
Views: 7551

Re: Having trouble getting lagrangian float working...

It's a bit of a wild guess, but possibly having Fcount > 0 but all of Fdt=Fdx=Fdy=Fdz=0 is messing things up. It looks like you are trying to release all 240 floats at the same location and time. They will all go the same place unless you also #define VWALK_FORWARD. Perhaps try spreading them out us...
by wilkin
Wed May 05, 2021 7:53 pm
Forum: ROMS Discussion
Topic: How to split the advection and diffusion term
Replies: 4
Views: 7908

Re: How to split the advection and diffusion term

You need to be a bit thoughtful here about what will happen if you disable all vertical mixing. If you have no vertical viscosity, then if you also want surface stress or bottom drag then the way in which those mix into the interior is going to be significantly modified. Surface and bottom stresses ...