Custom Query (964 matches)
Results (643 - 645 of 964)
Ticket | Owner | Reporter | Resolution | Summary |
---|---|---|---|---|
#603 | Done | Update Matlab scripts tp process 4D-Var observations | ||
Description |
Several Matlab scripts used to process 4D-Var observations were updated. The observations URL are now passed as an argument to the processing functions, so the extraction scripts are more generic. Since mostly of the 4D-Var observations are on OpenDAP servers, the scripts now support the native NetCDF interface for Matlab version 2012a or higher and SNCTOOLS with Java support for older Matlab versions. Users can download SNCTOOLS from SourceForge. If doing so, notice that the startup.m script has now: my_home = getenv('HOME'); ... % Load NetCDF Toolbox for OpenDAP support for versions 2008b or higher. % However, this is not needed if version 2012a or higher since Matlab % native NetCDF interface supports OpenDAP. Users need to change the % paths for SNCTOOLS and JAVA. v = version('-release'); vyear = str2num(v(1:4)); load_toolbox = vyear >= 2008; if ((vyear == 2008 && v(5:5) == 'a') || vyear >= 2012), load_toolbox = false; end if (load_toolbox), addpath (strcat(my_home, '/ocean/matlab/snctools'), '-end'); javaaddpath (strcat(my_home, '/ocean/matlab/classes/toolsUI-4.1.jar'), '-end'); javaaddpath (strcat(my_home, '/ocean/matlab/classes/netcdfAll-4.2.jar'), '-end'); javaaddpath (strcat(my_home, '/ocean/matlab/snctools/classes'), '-end'); setpref('SNCTOOLS','USE_JAVA', true); end |
|||
#604 | Fixed | IMPORTANT: Corrected bug in interp_boundary.m | ||
Description |
Corrected a bug in Matlab script interp_boundary.m. In line 201 we need to have: if (~isempty(ind)), if (RemoveNaN), B.(field)(ind) = FN(I.XR.(edge)(ind), I.YR.(edge)(ind)); % <=== Rmin = min(Rmin, min(B.(field)(ind))); Rmax = max(Rmax, max(B.(field)(ind))); ind = find(isnan(B.(field))); if (~isempty(ind)), Ncount = length(ind); end else Ncount = length(ind); end end instead of B.(field)(ind) = FN(I.XR.(edge)(ind), I.YR.(field)(ind)); We need to have edge instead of field in I.YR.(?) structure. This bug is only relevant when removing interpolated variable NaNs values with a nearest neighbor interpolant. This is the second interpolation to remove outliers. This is an important correction and users need to update this file if using this function to prepare boundary conditions. |
|||
#605 | Fixed | Corrected FLOATS restart | ||
Description |
Corrected a problem in def_floats.F when setting the DRIFTER(ng)%bounded switch during restart. If the floats have not been released yet at restart time, the values of Xgrid, Ygrid, and Zgrid will be _FillValue (i.e. 1.0E+37) in the FLOATS NetCDF file. The calls to netcdf_get_fvar in def_floats.F will replace such values with zeros. Therefore, we need to read Zgrid first so the DRIFTER(ng)%bounded switch is FALSE in such cases to trigger the release. This switch will be set corrected if Xgrid and Ygrid are read last. The zero values in Xgrid and/or Ygrid due to unreleased floats will set DRIFTER(ng)%bounded=FALSE because of the lower bound is 0.5 in fractional coordinates. So the order of operations in def_floats.F is very important during restart. The correct code is then: # ifdef SOLVE3D CALL netcdf_get_fvar (ng, iNLM, ncname, 'Zgrid', & & Tinp, & & ncid = FLT(ng)%ncid, & & start = (/1,FLT(ng)%Rindex/), & & total = (/Nfloats(ng),1/)) IF (exit_flag.ne.NoError) RETURN DO l=1,Nfloats(ng) IF ((Tinp(l).gt.REAL(N(ng),r8)).or. & & (Tinp(l).lt.0.0_r8)) THEN DRIFTER(ng)%bounded(l)=.FALSE. ELSE DRIFTER(ng)%bounded(l)=.TRUE. DO i=0,NFT DRIFTER(ng)%track(izgrd,i,l)=Tinp(l) DRIFTER(ng)%track(izrhs,i,l)=0.0_r8 END DO END IF END DO ! # endif CALL netcdf_get_fvar (ng, iNLM, ncname, 'Xgrid', & & Tinp, & & ncid = FLT(ng)%ncid, & & start = (/1,FLT(ng)%Rindex/), & & total = (/Nfloats(ng),1/)) IF (exit_flag.ne.NoError) RETURN DO l=1,Nfloats(ng) IF ((Tinp(l).gt.REAL(Lm(ng)+1,r8)-0.5_r8).or. & & (Tinp(l).lt.0.5_r8)) THEN DRIFTER(ng)%bounded(l)=.FALSE. ELSE DRIFTER(ng)%bounded(l)=.TRUE. DO i=0,NFT DRIFTER(ng)%track(ixgrd,i,l)=Tinp(l) DRIFTER(ng)%track(ixrhs,i,l)=0.0_r8 END DO END IF END DO ! CALL netcdf_get_fvar (ng, iNLM, ncname, 'Ygrid', & & Tinp, & & ncid = FLT(ng)%ncid, & & start = (/1,FLT(ng)%Rindex/), & & total = (/Nfloats(ng),1/)) IF (exit_flag.ne.NoError) RETURN DO l=1,Nfloats(ng) IF ((Tinp(l).gt.REAL(Mm(ng)+1,r8)-0.5_r8).or. & & (Tinp(l).lt.0.5_r8)) THEN DRIFTER(ng)%bounded(l)=.FALSE. ELSE DRIFTER(ng)%bounded(l)=.TRUE. DO i=0,NFT DRIFTER(ng)%track(iygrd,i,l)=Tinp(l) DRIFTER(ng)%track(iyrhs,i,l)=0.0_r8 END DO END IF END DO Many thanks to Diego Narvaez for bringing this issue to my attention. This issue was also discussed in forum sometime ago but I was not able to reproduce it. We didn't have enough information. I also correct a bug in packing.F when computing the norm in parallel. Many thanks to Andy for reporting this problem. |