Hi,
I am just starting with ROMS and I am mostly interested in coupled physical-biogeochemical models. When running ROMS, is it only the main program that cycles through all grid cells and different tiles, when multiprocessing is used? Do the subroutines that calculate biological processes need to "know" the way the grid is divided and "care" about paralelization, or is this handled by the main program that launches several threads and in each of these each subroutine is concerned only with a specific part of the grid?
I am sorry for this confusing questions but I would like to couple some of my biological code with ROMS and I need to understand the implications on multiprocessing.
Pedro
Multiprocessing and coupling
Re: Multiprocessing and coupling
ROMS supports both MPI and OpenMP for multi-processing. The main program loops over tiles only in the OpenMP world. In the MPI world, each process loops only on its own tile (i.e. a loop length of one). The best way to understand what's going on is to look at the code, especially the structure of calling say step3d_t, which in turn calls step3d_t_tile.
There are plenty of examples of ecosystem models in the ROMS/Nonlinear/Biology directory. I would copy one set in there and modify it according to your needs. For a full BGC model, my branch also has the CoSiNE model. Plus, Enrique Curchitser's lab is working to incorporate Cobalt - please contact them if you are interested. They spent some time on having the biology affect the light levels - something not in the standard ROMS.
There are plenty of examples of ecosystem models in the ROMS/Nonlinear/Biology directory. I would copy one set in there and modify it according to your needs. For a full BGC model, my branch also has the CoSiNE model. Plus, Enrique Curchitser's lab is working to incorporate Cobalt - please contact them if you are interested. They spent some time on having the biology affect the light levels - something not in the standard ROMS.
Re: Multiprocessing and coupling
Hi. Just to add to Kate's good advice:
In cases that I'm familiar with, the terms governing biological dynamics involve only local fields (e.g., uptake in a grid cell depends on nutrients and phytoplankton in that grid cell and not in a grid cell from somewhere across the ocean). If this is the case in your model, then you don't have to worry about the tiling and parallelization. Within the biological model subroutine, loops extend horizontally and vertically, but almost all the operations are local. Calculating light levels and sinking are exceptions that require information from above, but that's all right because each column of the model is on the same tile. Horizontal advection and diffusion, which do depend on horizontally separated information are carried out in other subroutines, so you don't have to worry about them.
In cases that I'm familiar with, the terms governing biological dynamics involve only local fields (e.g., uptake in a grid cell depends on nutrients and phytoplankton in that grid cell and not in a grid cell from somewhere across the ocean). If this is the case in your model, then you don't have to worry about the tiling and parallelization. Within the biological model subroutine, loops extend horizontally and vertically, but almost all the operations are local. Calculating light levels and sinking are exceptions that require information from above, but that's all right because each column of the model is on the same tile. Horizontal advection and diffusion, which do depend on horizontally separated information are carried out in other subroutines, so you don't have to worry about them.