Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Wed Oct 17, 2018 8:30 pm




Post new topic Reply to topic  [ 5 posts ] 

All times are UTC

Author Message
 Post subject: My ROMS
PostPosted: Wed Feb 14, 2018 3:37 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 509
Location: NIWA
Like many ROMS users--I suspect--I have my own lightly hacked version of the ROMS source code and a collection of roms-related scripts. I have just put a selection of these on GitHub.com for the edification and amusement of the ROMS community. There are 3 repositories:

  • roms-trunk-mgh: There are two branches in this repository. The roms-trunk branch is the code from the Rutgers Subversion repository trunk. The master branch is my locally modified copy, into which I regularly merge from roms-trunk. The modifications are minor. I have submitted a few to the Trac system as bug fixes/improvements and there are a few more I may submit. (I've just discovered the delights of using Meld as a Git difftool, which makes it easy to review the differences.) One that I won't be submitting (because it only makes sense to use it for code that's managed by Git) is one that I've just finished: printing Git rather than Subversion revision information to the log file.
  • roms-scripts-mgh: Bash and Python 3 scripts for building the model executable, creating a series of model input files for a multi-segment run, and post-processing model output files. The one I'd specifically like to mention is roms_build, which does the same job as build.bash, but avoids the need to have a separate script for every simulation.
  • roms-test-mgh: This is structured like roms-trunk-mgh, but based on the Subversion repository test directory. The roms-test branch is the Rutgers test tree and the master branch is my modified version. I have been working though a few of the simulations replacing the build.bash script with a "build environment" file, .build_env, required by roms_build.

Regarding the Git revision information, here is an excerpt from some model output:
Code:
...
 Input Script  : ocean_inlet_test.in

 Git Root URL  : git@github.com:hadfieldnz/roms-trunk-mgh.git
 Git Revision  : branch master commit 51965b32fdaf4014a3d69b96f94c27efad45aabb

 Local Root    : /home/hadfield/ROMS/roms-trunk-mgh
 Header Dir    : /home/hadfield/ROMS/roms-test-mgh/inlet_test
 Header file   : inlet_test.h
 Analytical Dir: /home/hadfield/ROMS/roms-test-mgh/inlet_test
...

One cool thing about this is that Git hashes are globally unique, so the commit identifier, 51965b32..., uniquely identifies the codebase for that model run. And this particular commit is on GitHub.com in a public repository, so anyone can find it by entering the hash code, or just the leading digits, into the GitHub.com search box. It's a bit like a DOI system for code revisions.

Actually the above will hold true only if the working copy was clean when the model was built, i.e. without any untracked or uncommitted changes. Generally you should only build from a clean repository, but you might do otherwise by mistake, or when debugging. So I'm going to add a field based on git status output to warn about dirty working copies.

The roms_build script, as I said, is a single replacement for the simulation-specific build.bash scripts, but it requires a bit of guidance to carry out this role:
  • Platform-specific environment variables (eg. FORT, USE_NETCDF4) should be set in the shell before invoking roms_build. I do this with Bash functions defined in .bashrc--see the attached file for examples.
  • Simulation-specific environment variables are specified by a "build environment" file (./build_env by default)--see this example.
  • The roms_build script accepts options to control the compilation mode: -o for OpenMP, -m for MPI, -g to turn on bounds-checking, traceback, etc.

The license is MIT so you can do what you like with this stuff. I'd appreciate suggestions for improvements. Documentation is a bit thin, I'm afraid.


Attachments:
File comment: Bash functions to set ROMS variables on different platforms
bash_functions.txt [2 KiB]
Downloaded 24 times
Top
 Profile  
Reply with quote  
 Post subject: Re: My ROMS
PostPosted: Thu Feb 22, 2018 1:22 am 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3515
Location: IMS/UAF, USA
Thanks! Doing a diff between your branches, I don't think this is correct:
Code:
+#  if defined ATM_PRESS & defined PRESS_COMPENSATE
+      real(r8) :: OneAtm, fac
+#  endif
The rules according to this page state that the "and" should be "&&".

Oh, man, I always have untracked cruft in my directories.


Top
 Profile  
Reply with quote  
 Post subject: Re: My ROMS
PostPosted: Thu Feb 22, 2018 1:27 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 509
Location: NIWA
Thanks. PRESS_COMPENSATE is something I added to ATM_PRESS. I think it lets you use lateral boundary zeta data from a model without ATM_PRESS (the inverse barometer effect) for a model that does have it. I haven't used ATM_PRESS for a while, but if you're interested in storm surge it's a must-have . I should submit the PRESS_COMPENSATE stuff to Hernan.


Top
 Profile  
Reply with quote  
 Post subject: Re: My ROMS
PostPosted: Thu Feb 22, 2018 4:39 am 
Offline
User avatar

Joined: Mon Apr 28, 2003 5:44 pm
Posts: 460
Location: Rutgers University
We'd be interested to know more about your PRESS_COMPENSATE.

To use Mercator-Ocean sea level as open boundary conditions to our model we make our own ad hoc adjustment to the sea level to impose an inverse barometer response. Our regional model has the ATM_PRESS effect driving local "storm surge" - actually any dynamic atmosphere forced response which may include Coastal Trapped Waves.

_________________
John Wilkin: IMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu


Top
 Profile  
Reply with quote  
 Post subject: Re: My ROMS
PostPosted: Thu Feb 22, 2018 4:45 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 509
Location: NIWA
wilkin wrote:
We'd be interested to know more about your PRESS_COMPENSATE.


See

https://github.com/hadfieldnz/roms-trun ... u2dbc_im.F
https://github.com/hadfieldnz/roms-trun ... v2dbc_im.F

but replace "&" with "&&".


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group