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.
Adding a new ana_XXX.h to ROMS
Re: Adding a new ana_XXX.h to ROMS
it needs to be called from somewhere. Such as set_data or get_data .
-
- 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
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.
Re: Adding a new ana_XXX.h to ROMS
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.