Adding a new ana_XXX.h to ROMS

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
lanerolle
Posts: 157
Joined: Mon Apr 28, 2003 5:12 pm
Location: NOAA

Adding a new ana_XXX.h to ROMS

#1 Unread post by lanerolle »

I am attempting to add a new (analytical) process to ROMS.

(1) I came up with an ana_XXX.h file for it (based on the templates in ROMS/Functionals).

(2) I put this *.h in a new directory called ROMS/My_Functionals.


(3) I pointed to it in the makefile by defining its full path as MY_ANALYTICAL_DIR = ROMS/My_Functionals.

(4) I then created a new CPP option to activate it and thereafter edited ROMS/Functionals/analytical.F and put it in as (say):

#define NEW_CPP
# include <ana_XXX.h>
#endif

(5) I also edited the file : ROMS/Utility/checkdefs.h and put it in there.

(6) I included this new CPP option in the corresponding *.h file in ROMS/Inlcude/

When I compile the ROMS using this new CPP option (which I called NEW_CPP just as reference) the compilation goes smoothly and generates an executable. When I look at Build/analytical.f90, the code from ana_XXX.h is also include in the former. So everything looks good.

However, when I run, ROMS does not even appear to enter this routine and any screen write statements I put in it are not executed (I run the code in serial and no MPI or OpenMP is employed so screen output should not be a problem). So it appears that this routine is simply invisible and the code runs without sourcing it at all.

Could someone please let me know what are the logical steps to adding a new ana_XXX.h to ROMS and also whether there is an error in the procedure I have outlined above?

Thanks very much.

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Adding a new ana_XXX.h to ROMS

#2 Unread post by jcwarner »

it needs to be called from somewhere. Such as set_data or get_data .

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

Re: Adding a new ana_XXX.h to ROMS

#3 Unread post by linzhenhua »

You should change #define NEW_CPP to #ifdef NEW_CPP in my opinion, or this code segment will always be included whether you define this flag or not. But this is not related to the problem you confront with.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Adding a new ana_XXX.h to ROMS

#4 Unread post by kate »

Both of the above are true. Also, if you want your new ana_xxx file to reported in the output, you have to change the ANANAME(x)=__FILE__ to have a unique number. Then, where the reporting happens, you need to loop through a larger set of the ANANAME strings to include yours. Just search on ANANAME and adjust things accordingly.

Post Reply