Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing OPTIONS.nam; Which binary should I use and can I build without netCDF or GRIB-API? #3

Closed
alapha23 opened this issue Jun 20, 2018 · 3 comments

Comments

@alapha23
Copy link

alapha23 commented Jun 20, 2018

Hi! Thank you for this cmake version of open-SURFEX.

I built using the following commands

 mkdir build && cd build
 cmake .. -DCMAKE_INSTALL_PREFIX=../_install
 cmake --build .
 cmake --build . --target install

While I found a couple of binaries in _install, SODA, SXPOST, VARASSIM, PGD, OI_MAIN, OFFLINE, NCPOST. They all report error opening OPTIONS.nam to me.

In LISTING_SODA0.txt, I also have

 ERROR WHILE OPENING OPTIONS.nam                  THIS FILE IS MISSING IN THE RUN DIRECTORY

What is OPTIONS.nam? Which binary should I use to start? Is my way of building correct? I have not install netCDF nor GRIB-API.

Thank you in advance!

@alapha23 alapha23 changed the title Missing OPTIONS.nam: Which binary should I use and can I build without netCDF or GRIB-API? Missing OPTIONS.nam; Which binary should I use and can I build without netCDF or GRIB-API? Jun 20, 2018
@joewkr
Copy link
Owner

joewkr commented Jun 20, 2018

Hi! Yes, you have built open-SURFEX in the correct way and, if you don't provide any additional options for cmake, GRIB-API and NetCDF libraries shipped with SURFEX will be used.

There are quite a number of different binaries in the installation directory, but if you're interested in running some basic SURFEX experiments, you would use mainly:

  • PGD -- to prepare physiography data
  • PREP -- to prepare initial state of an experiment
  • OFFLINE -- to run an experiment

To run SURFEX, one would need to prepare some forcing data (air temperature and specific humidity, surface pressure, direct and diffuse downward short-wave radiation, downward long-wave radiation, rainfall and snowfall amount, wind speed and direction, CO2 concentration) for the area of interest, and configure experiment through OPTIONS.nam namelist file. Quite some work, I'd say. But there is a number of test experiments provided with open-SURFEX that are relatively easy to run and could be used to get an idea on how a SURFEX experiment should be set up.

The problem is, that these experiments are not ready to run, and to configure them you should do the following (please note that each step starts from the open-SURFEX root directory):

  1. First of all, you need to build the forcing generation tool that is not built by default:
 mkdir build && cd build
 cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DUSER_SOURCES_DIR=../src/FORC
 cmake --build .
 cmake --build . --target install

you could re-use your old build to not re-compile the whole thing:

 cd build
 cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DUSER_SOURCES_DIR=../src/FORC
 cmake --build . --target pre_input_experiment
 cmake --build . --target install
  1. Next step is to prepare ECOCLIMAP cover parameters data files:
cd  MY_RUN/ECOCLIMAP
gfortran -fdefault-real-8 -fdefault-double-8 -g -fno-second-underscore -fpic  -ffpe-trap=overflow,zero,invalid -fbacktrace -fconvert=swap convert_ecoclimap_param.f90
./a.out
  1. And now, you can set up the experiment itself (I just took the Alp_for_0203 experiment as an example, you could try a different test experiment):
# To set up the experiment directory and copy required data files:
#
# Please note that your experiment should be located in MY_RUN
# directory because PRE_INPUT_EXPERIMENT uses relative paths
# to find its input data.
#
cd MY_RUN
cp -rv NAMELIST/Alp_for_0203 .
cd Alp_for_0203
cp -v ../ECOCLIMAP/*.dat .

# To prepare forcing data in format that SURFEX could understand
<path to SURFEX binaries>/PRE_INPUT_EXPERIMENT

You could check the OPTIONS.nam file in the experiment directory to see which SURFEX options will be used.

  1. Finally, you can run the experiment:
cd MY_RUN/Alp_for_0203
<path to SURFEX binaries>/PGD
<path to SURFEX binaries>/PREP
<path to SURFEX binaries>/OFFLINE

You will get a lot of different ASCII files that contain time series of SURFEX output variables. More information about different SURFEX options you could get from the Météo-France SURFEX documentation.

@alapha23
Copy link
Author

Hi Joewkr!
Thank you so much for those helpful instructions!
It is utterly comprehensive and greatly inspiring!

If there is still something I would like to note, it could be that To set up the experiment directory and copy required data files:, the data files seem not only to be *.dat, but also *.bin, which seems to be required when I run <path to SURFEX binaries>/PRE_INPUT_EXPERIMENT

Anyway, problems solved and my SURFEX is running fairly decent on my machine now thanks to your help.
I would definitely read through the document from the link, in order that I could do further contributions to this software.

@joewkr
Copy link
Owner

joewkr commented Jun 20, 2018

Oops, my bad... of course *.bin files should be used, because SURFEX can not read ASCII *.dat parameter files, so they were converted to binary format during the Step 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants