Hello, I'm sorry if this has been answered before or if it's very easy or elemental but I want to create a nc file of initial conditions for the ININAME and I don't know how to do it. I'm trying to use the matlab scripts provided, concretely the C_initial.m script for matlab.
I don't understand what to type with the array input S. For example, I type C_initial('example') and I get the mistake:
??? Error using ==> c_initial at 42
C_INITIAL - Cannot find dimension parameter: ncname, in structure array S
Do you have an example of how to define initial conditions using C_initial?
Initial conditions with C_initial.m
Re: Initial conditions with C_initial.m
Hi,
At this function you're gonna have to use both d_initial.m and c_intial.m functions to create the Initial file.
See the following code:
In matlab, in order to create a structure S you just have to type:
S.ncname='my_initial.nc'; (string)
S.spherical= 1 or 0 (it depends on your grid).
S.Vtransform, Lm, Mm, N, NT are just scalar. Fill this with your data.
After that I remember you'll have to use the d_initial.m function in order to interpolate your data to you grid. I think this function calls c_initial.m, fills the S structure and then interpolates yur data. At the end it creates the netcdf file.
I've used it before a few times. If you need any extra help you contact me at ramos.oceano@gmail.com
Good luck!
Arthur Ramos
At this function you're gonna have to use both d_initial.m and c_intial.m functions to create the Initial file.
See the following code:
Code: Select all
% S.ncname NetCDF file name
% S.spherical Spherical grid switch
% S.Vtransform Vertical transformation equation
% S.Lm Number of interior RHO-points in X
% S.Mm Number of interior RHO-points in Y
% S.N Number of vertical levels
% S.NT Number of active and passive tracers
S.ncname='my_initial.nc'; (string)
S.spherical= 1 or 0 (it depends on your grid).
S.Vtransform, Lm, Mm, N, NT are just scalar. Fill this with your data.
After that I remember you'll have to use the d_initial.m function in order to interpolate your data to you grid. I think this function calls c_initial.m, fills the S structure and then interpolates yur data. At the end it creates the netcdf file.
I've used it before a few times. If you need any extra help you contact me at ramos.oceano@gmail.com
Good luck!
Arthur Ramos
Re: Initial conditions with C_initial.m
Thank you Arthur for your answer.
I see it's better to use and modify the d_initial.m.
I've been reading the code, but I don't see what is the OAname?
Another question is it seems all the initial conditions (zeta, ubar, vbar, u and v) are set to zero and the tracers (temp and salt) are interpolated. Why is so?
I see it's better to use and modify the d_initial.m.
I've been reading the code, but I don't see what is the OAname?
Another question is it seems all the initial conditions (zeta, ubar, vbar, u and v) are set to zero and the tracers (temp and salt) are interpolated. Why is so?
Re: Initial conditions with C_initial.m
Hi,
The way I see it, the 'OAname' reffers to your data. You can have monthly or annual climatology to use as the initial condition for your experiment and this package helps you to work with the data. I haven't used it yet, but I'm pretty sure there are lots of posts here in the forum about this tool. Please see the following page: http://www.myroms.org/index.php?page=oa
You can manage to work with several data sources, dependig on your experiments. You can use Global HYCOM, Levitus climatology for salt and temperature and so many others.
Arthur
The way I see it, the 'OAname' reffers to your data. You can have monthly or annual climatology to use as the initial condition for your experiment and this package helps you to work with the data. I haven't used it yet, but I'm pretty sure there are lots of posts here in the forum about this tool. Please see the following page: http://www.myroms.org/index.php?page=oa
You can manage to work with several data sources, dependig on your experiments. You can use Global HYCOM, Levitus climatology for salt and temperature and so many others.
I can't tell you for sure why are they set to zero and just the tracers are interpolated. I've used part of this function to interpolate temp and salt and then used netcdf tools for Matlab to add zeta, u, v, ubar and vbar to my initial file. I've used the CDL script as a model for my initial.nc file.Another question is it seems all the initial conditions (zeta, ubar, vbar, u and v) are set to zero and the tracers (temp and salt) are interpolated. Why is so?
Arthur