Commit 93da36eb authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remapdis: bug fix if distance is zero

parent aa9c16ec
......@@ -12,14 +12,19 @@
* Merge: bug fix for files with constant fields only [report: Christian Rodehacke]
* expr.ex: bug fix for mixed time constant and variable fields
* Ymonstat: bug fix for missing values [report: Ivonne Anders]
* remapdis: bug fix if distance is zero
* remapcon: bug fix in intersection (s1 >= ZERO) [report: Joerg Wegner]
* remapcon: speed up by increasing BABY_STEP from 0.001 to 0.01
* interpolate: bug fix for north/south bounds > 90 or < -90 [report: Stefan Hagemann]
* replace ztype2ltype with zaxis2ltype
* replace ztype2ltype by zaxis2ltype
* ltype2ztype: set default zaxis type to ZAXIS_GENERIC
* selltype, setltype, chltype: extent to all ltypes [request: Patrick Samuelsson]
* Version 1.0.8 released
2007-06-12 Etienne Tourigny <tourigny@sca.uqam.ca>
* Arith: Minor mods for silent output
2007-06-07 Cedrick Ansorge <Cedrick.Ansorge@zmaw.de>
* New operator: smooth9
......
......@@ -4,7 +4,7 @@ CDO NEWS
Version 1.0.8 (15 June 2007):
* New operators:
o Remap model level - remapeta
o Remap vertical hybrid level - remapeta
o 9 point smoothing - smooth9
o Mask region - maskregion
o Show GRIB level types - showltype
......
......@@ -343,7 +343,7 @@ Operator catalog:
Remap remap SCRIP grid remapping
Intgrid interpolate PINGO grid interpolation
Intgrid intgridbil Bilinear grid interpolation
Remapeta remapeta Remap model level
Remapeta remapeta Remap vertical hybrid level
Vertint ml2pl Model to pressure level interpolation
Vertint ml2hl Model to height level interpolation
Inttime inttime Time interpolation
......
No preview for this file type
......@@ -23,6 +23,13 @@
from the World Meteorological Organisation
(\href{http://www.wmo.ch}{WMO})
\label{INTERA}
\bibitem[INTERA]{INTERA} \ \\
\href{http://wekuw.met.fu-berlin.de/~IngoKirchner/nudging/nudging}{INTERA Software Package},
from the
\href{http://www.mpimet.mpg.de}
{Max Planck Institute for Meteorologie}
\label{netCDF}
\bibitem[netCDF]{netCDF} \ \\
\href{http://www.unidata.ucar.edu/packages/netcdf/index.html}{NetCDF Software Package},
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2006 Uwe Schulzweida, schulzweida@dkrz.de
Copyright (C) 2003-2007 Uwe Schulzweida, schulzweida@dkrz.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -90,12 +90,14 @@ void *Arith(void *argument)
if ( vlistNrecs(vlistID1) != 1 && vlistNrecs(vlistID2) == 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoStreamName(1));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoStreamName(1));
}
else if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
{
filltype = FILL_TS;
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
streamIDm = streamID2;
streamIDs = streamID1;
vlistIDm = vlistID2;
......@@ -130,13 +132,15 @@ void *Arith(void *argument)
(vlistNtsteps(vlistID2) == 1 || vlistNtsteps(vlistID2) == 0) )
{
filltype = FILL_REC;
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
}
else if ( (vlistNtsteps(vlistID1) == 1 || vlistNtsteps(vlistID1) == 0) &&
vlistNtsteps(vlistID2) != 1 && vlistNtsteps(vlistID2) != 0 )
{
filltype = FILL_REC;
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
streamIDm = streamID2;
streamIDs = streamID1;
vlistIDm = vlistID2;
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2006 Uwe Schulzweida, schulzweida@dkrz.de
Copyright (C) 2003-2007 Uwe Schulzweida, schulzweida@dkrz.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -115,7 +115,8 @@ void *Comp(void *argument)
varnmiss2[varID] = (int *) malloc(nlev*sizeof(int));
}
cdoPrint("Filling up stream >%s< by copying the first timestep.", cdoStreamName(1));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream >%s< by copying the first timestep.", cdoStreamName(1));
}
tsID = 0;
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2006 Uwe Schulzweida, schulzweida@dkrz.de
Copyright (C) 2003-2007 Uwe Schulzweida, schulzweida@dkrz.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -111,7 +111,8 @@ void *Cond2(void *argument)
varnmiss1[varID] = (int *) malloc(nlev*sizeof(int));
}
cdoPrint("Filling up stream >%s< by copying the first timestep.", cdoStreamName(0));
if ( ! cdoSilentMode )
cdoPrint("Filling up stream >%s< by copying the first timestep.", cdoStreamName(0));
}
tsID = 0;
......
......@@ -97,6 +97,9 @@ void *Intgrid(void *argument)
gridInqType(gridID1) != GRID_GAUSSIAN )
cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
if ( gridIsRotated(gridID1) )
cdoAbort("Rotated grids not supported!");
vlistChangeGridIndex(vlistID2, index, gridID2);
}
......
......@@ -2557,16 +2557,42 @@ static char *IntgridHelp[] = {
static char *RemapetaHelp[] = {
"NAME",
" remapeta - Remap model level",
" remapeta - Remap vertical hybrid level",
"",
"SYNOPSIS",
" remapeta,vct[,oro] ifile ofile",
"",
"DESCRIPTION",
" This operator interpolates between different vertical hybrid levels. ",
" This include the preparation of consistent data for the free atmosphere.",
" The procedure for the vertical interpolation is based on the HIRLAM scheme",
" and was adapted from \{INTERA}.",
" The vertical interpolation is based on the vertical integration of the",
" hydrostatic equation with few adjustments. The basic tasks are the following",
" - first integration of hydrostatic equation",
" - extrapolation of surface pressure",
" - PBL profile interpolation",
" - interpolation in free atmosphere",
" - merging of both profiles",
" - final surface pressure correction",
" ",
" The vertical interpolation corrects the surface pressure. This is simply",
" a cut-off or an addition of air mass. This mass correction should not",
" influence the geostrophic velocity field in the middle troposhere. Therefore",
" the total mass above a given reference level is conserved. As reference level",
" the geopotential height of the 500 hPa level is used. Near the surface the",
" correction can affect the vertical structure of the PBL. Therefore the",
" interpolation is done using the potential temperature. But in the free",
" atmosphere above a certain n (n=0.8 defining the top of the PBL) the",
" interpolation is done linearly. After the interpolation both profiles",
" are merged. With the resulting temperature/pressure correction the hydrostatic",
" equation is integrated again and adjusted to the reference level finding",
" the final surface pressure correction. A more detailed description of",
" the interpolation can be found in \{INTERA}.",
"",
"PARAMETER",
" vct STRING File name of an ASCII dataset with the vertical coordinate table",
" oro STRING File name with the orography of the target dataset",
" oro STRING File name with the orography of the target dataset (optional)",
NULL
};
......
......@@ -2204,7 +2204,7 @@ void grid_search_nbr(REMAPGRID *rg, int *nbr_add, double *nbr_dist, double plat,
n = n+1;
if ( plat >= rg->bin_lats[2*n+0] && plat <= rg->bin_lats[2*n+1] &&
plon >= rg->bin_lons[2*n+0] && plon <= rg->bin_lons[2*n+2] )
plon >= rg->bin_lons[2*n+0] && plon <= rg->bin_lons[2*n+1] )
{
min_add = src_bin_add[2*n+0];
max_add = src_bin_add[2*n+1];
......@@ -2241,6 +2241,9 @@ void grid_search_nbr(REMAPGRID *rg, int *nbr_add, double *nbr_dist, double plat,
distance = acos(sinlat_dst*sinlat[nadd] + coslat_dst*coslat[nadd]*
(coslon_dst*coslon[nadd] + sinlon_dst*sinlon[nadd]));
/* Uwe Schulzweida: if distance is zero, set to small number */
if ( DBL_IS_EQUAL(distance, 0) ) distance = TINY;
/*
store the address and distance if this is one of the
smallest four so far
......@@ -2492,7 +2495,7 @@ void grid_search_nbr1(REMAPGRID *rg, int *nbr_add, double *nbr_dist, double plat
n = n+1;
if ( plat >= rg->bin_lats[2*n+0] && plat <= rg->bin_lats[2*n+1] &&
plon >= rg->bin_lons[2*n+0] && plon <= rg->bin_lons[2*n+2] )
plon >= rg->bin_lons[2*n+0] && plon <= rg->bin_lons[2*n+1] )
{
min_add = src_bin_add[2*n+0];
max_add = src_bin_add[2*n+1];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment