[MITgcm-support] Problem creating Binary Forcing Files for EXF

Stanislav Martyanov martyanov.sd at gmail.com
Mon May 18 07:16:08 EDT 2020


Hello, Stephen!

When I create my EXF input data, I just write 2D XY fields of meteo forcing
for each required variable sequentially for each time-step. Say, I have an
array of 2m air temperature 't2m' prepared and stored in the matlab's
current workspace and I want to write it into a binary file for use in
MITgcm exf package. If I use daily-mean fields and 1deg horizontal
resolution of the forcing data, I have the array of 360x180x366 elements
for an ordinary year and 360x180x367 for a leap year. The additional record
(366th or 367th) will be used for the internal time-interpolation
implemented in the model when the model's time step in less than 24 hours.
When such array is correctly prepared in matlab, I write it:

fout = fopen('exf_hourly_t2m.bin','wb','ieee-be');
fwrite(fout,t2m,'float32');
fclose(fout);

And so on for each variable..

Also, the corresponding parameters should be correctly set in data.exf and
EXF_OPTIONS.h if you use spatial interpolation.

Regards,
Stanislav Martyanov


пн, 18 мая 2020 г. в 13:44, Stephen Hunter [EAR] <S.Hunter at leeds.ac.uk>:

>
> Firstly my apologies for the long query (my 2 questions are summarised at
> the bottom)
>
> I have set up a CS96 model for a deep-time palaeo experiment. I am using
> 20 years of monthly surface climatology in a cyclical manner to run the
> model for 1500 years. The surface climatology is from a global
> high-resolution atmosphere-only model. I am using Matlab to generate the
> MITgcm boundary conditions (bathymetry) and forcing files.  I believe that
> I have MITgcm correctly set-up as I can run the model from these boundary
> conditions and forcing files for 1500 years without problems. Globally
> integrated temperature on ocean levels comes into equilibrium and I see a
> drift in globally integrated salinity (as I expect as I haven’t implemented
> a river scheme yet).
>
> I generate my bathymetry binary on a CS96 grid using the lat-lon
> specification within the grid definitions. I am satisfied that this works
> as I expect because I can use the reverse of my regridding process to
> unwrap the MITgcm climatological average back to a regular lat-lon grid and
> the imprinted land sea mask comes out as expected.
>
> Whilst the model is happy to run for 1500 years, the processed climatology
> from the final 50 years appears incorrect. Whilst the surface ocean
> temperature appears visually OK (latitudinal distribution of temperatures
> appears fine). It is when I look closer, things appear to be wrong. For
> example when I look at the surface ocean currents I have a lot of diverging
> currents where I would expect zonal equatorial currents. I also don’t have
> flow through ocean gateways and channels. I do get some western boundary
> currents and some upwelling, but these are inconsistent in some regions.
>
> I suspect that this mishmash is because I am creating the Forcing binaries
> incorrectly.  I would therefore like to check if I am creating them
> correctly. Here is a simplified account of what I am doing….
>
> For each climatological field I generate a binary file for each year of
> monthly data. I do this in Matlab by building a vector of the data and then
> saving this as a float64 binary.  Consider a year of climatological data is
> an array of size (360,180,12), in which longitude runs from -179.5 to 179.5
> in 1-degree cells, and latitude runs from 89.5 to -89.5 in 1-degree
> cells. I then create a vector from this array with the following recipe
> (simplified pseudo code):
>
> vec=zeros(360*180*12,1);
> counter=1;
> for month=1:1:12
>   for lat=180:-1:1
>    for lon=1:1:360
>     vec(counter,1)=data(lon,lat,month)
>     counter=counter+1
>   end
> end
> end
>
> I then write vec to a 64 bit binary. With regards to CPP options for EXF
> I am using configuration A1,B3 but currently without runoff. In data.exf I
> define Ustress, Vstress, atemp, aqh, precip, wspeed, swdown and lwdown to
> be read in from yearly binary files with lon0 and lat0 as -179.5 and -89.5.
> My non scalar fields are on slightly different grid but these are specified
> accordingly.
>
> I cannot find a description of the ordering of cell data within binary
> forcing files for the EXF package. I have tried writing array data directly
> to binary file, transposing my input data, changing the ordering that I
> fill vec, but these appear wrong also. I have tried to write my forcing
> data to the CS96 grid (like I do for bathymetry) but I didn’t know how to
> order the data wrt to the time dimension. I would prefer to have EXF read
> and interpolate my lat-lon climatology.
>
>
> *My questions are therefore:*
>
> *1) What is the ordering of the data within binary forcing files that EXF
> reads?*
> *2) Currently I have MITgcm output monthly means of ocean variables but to
> help me understand my problem,  is it possible to have MITgcm write out the
> monthly averages of the Input Forcing Fields? (or at least the surface wind
> vectors)*
>
>
> Kind regards
> Stephen
>
>
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20200518/bcd85603/attachment-0001.html>


More information about the MITgcm-support mailing list