Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

How do you run the model from a different location.

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
I have gone through the 2019 Tutorial, all done in the root MPAS Model folder. Considering that I plan to run several case study with different time period (for example June 1990 and June 2018), using CFS (pre 2011) and CFSV2 (post 2010). I would like to have different folder for each case. I plan to have something similar to below


I did try running init_atmosphere_model inside a subfolder. The subfolder contains all the mesh files, the intermediate files, the namelist and streams files. init_atmosphere_model has no problem running through `mpirun -n 4 ../init_atmosphere_model`. The static, surface update, and boundary layer condition files were created properly and successfully.

When I tried running atmosphere_model inside the same subfolder through `mpirun -n 4 ../atmosphere_model`, it runs to critical error, that OZONE_PLEV.TBL couldn't be read. I linked the file into the subfolder. I ran atmosphere_model again, and this time it asks for another *.TBL file. I linked all the *.TBL files this time. Ran it again, and this time,
ERROR: module_ra_rrtmg_sw: error reading RRTMG_SW_DATA on unit   10
CRITICAL ERROR: MPAS core_physics abort
At this point, I stopped using subfolder for the tutorial and ran everything on the model folder.

What is possible from what I have seen is to edit the streams file to add folder names, so that the input and output file can be written and read from a different location. The mesh supporting files for parallel run however has to be in the model folder, or linked to the model folder.

Is there a way or a guide on how to run MPAS-Atmosphere on a different location? It seems the executable atmosphere_model is set to be looking for the files relative to where it was called, and not looking for the files on an absolute location or where the executable was build.
Hi Zemega, good question. You're right that the atmosphere_model executable looks for additional files from the location of where its called. The atmosphere_model is different from the init_atmosphere_model in that in needs physics lookup tables to run. Thus, we can't call from another directory. We also don't generally call the init_atmosphere_model from other directories, but we do this just to be consistent. As you notice it works fine.

To be able to run the model as you are describing, we most often symbolic link the executables, copy namelists, streams and stream_list files and link the atmosphere_cores lookup tables. On the MPAS-Tutorial page, if you checkout section 2.3 Model Integration (below the slides) you'll find instructions that show you how to link the atmosphere core and its needed physics files. I've copied the instruction here:

Working from our 240km_uniform directory, we'll begin by creating a symbolic link to the atmosphere_model executable that we compiled in ${HOME}/MPAS-Model. We'll also make copies of the namelist.atmosphere and streams.atmosphere files as well. Recall from when we compiled the model that there are stream_list.atmosphere.* files that accompany the streams.atmosphere file; we'll copy these as well.

$ ln -s ${HOME}/MPAS-Model/atmosphere_model .
$ cp ${HOME}/MPAS-Model/namelist.atmosphere .
$ cp ${HOME}/MPAS-Model/streams.atmosphere .
$ cp ${HOME}/MPAS-Model/stream_list.atmosphere.* .

You'll also recall that there were many look-up tables and other data files that are needed by various physics parameterizations in the model. Before we can run MPAS-Atmosphere, we'll need to create symbolic links to these files as well in our working directory:

$ ln -s ${HOME}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*

Lastly, for the next release we are planning to release a shell script that will automatically set up the init_atmosphere and atmosphere cores in a desired directory, so be on the lookout for that.
mcurry said:
Lastly, for the next release we are planning to release a shell script that will automatically set up the init_atmosphere and atmosphere cores in a desired directory, so be on the lookout for that.

mcurry, yes, using those steps, I'm able to run MPAS from different folder.
Didn't realise the actual tutorial is below the slides. Going through everything again now.