[MITgcm-devel] exf_interp and grib data
Martin Losch
Martin.Losch at awi.de
Thu Mar 12 10:26:44 EDT 2015
Hi Jean-Michel,
I tried to add code for the case of y_in(0)>y_in(nyIn+1) (or lat_inc<0), but wasn’t successful.
I guess I need to understand this code first, but before I seriously try, do you think it’s worth it?
Is this the only place where this assumption is made? Or maybe there’s something exf_interpolate.F as well?
Martin
> On 12 Mar 2015, at 14:15, Jean-Michel Campin <jmc at ocean.mit.edu> wrote:
>
> Hi Martin,
>
> I did not check carefully, but I vagely remember that exf-interp assumes
> lat_inc > 0 (& lon_inc > 0). For instance, exf_interp.F, lines 350-357:
> IF ( w_ind(i,j).GT.s_ind(i,j)+1 ) THEN
> k = NINT( (s_ind(i,j)+w_ind(i,j))*0.5 )
> IF ( yG(i,j,bi,bj) .LT. y_in(k) ) THEN
> w_ind(i,j) = k
> ELSE
> s_ind(i,j) = k
> ENDIF
> ENDIF
> In theory, should be possible to (re-)write the code for the case
> of negative increment but, except if I am wrong, this is not presently the case.
>
> Cheers,
> Jean-Michel
>
> On Thu, Mar 12, 2015 at 11:18:41AM +0100, Martin Losch wrote:
>> Hi there
>>
>> I am trying to convert (on the fly) atmospheric data in grib format into ieee-be so that I can use exf (exf_interp) to read it.
>> The grb data seems to put the index (i,j) = (1,1) at the top left (NW) corner, whereas we expect (i,j)=(1,1) to be at the bottom right (SW) corner of the gridded data field. For technical reasons, it would be simpler to not have to flip the forcing fields (I would like to use wgrib <http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html>, which can produce ieee-be fields from grib data, but doesn’t seem to be able to do the N to S-flip), so that my data.exf entry would look like this:
>>
>> ${var}_lat0 = 78,
>> ${var}_lat_inc = 39*-4.,
>>
>> instead of
>> ${var}_lat0 = -78,
>> ${var}_lat_inc = 39*4.,
>>
>> Appart from the fact, that the routine exf_interp checks if the forcing grid “encompasses” the model grid (which it does technically), and this fails (because the check also expects lat0 to be the southern-most latitude), can exf_interp handle this situation properly? (a simple test with global_with_exf suggests, that it does not, but why?)
>>
>> Martin
>>
>>
>>
>> _______________________________________________
>> MITgcm-devel mailing list
>> MITgcm-devel at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-devel
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list