NPZD model makes hydrodynamic model unstable?

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

NPZD model makes hydrodynamic model unstable?

#1 Post by drivas » Fri Jun 12, 2015 2:17 am

Hi modelers,

I’m trying to run the NPZD_POWELL model in a workstation with CentOS and gfortran compiler. My domain is not very big: 160x155x22. When I run just the hydrodynamic model it runs very well, but when I include the NPZD it presents a segmentation fault. I’ve tried different options for the NtileI and NtileJ, trying to define them according to my number of parallel threads (16). The initial conditions of the biological model look OK (values >=0). The default stack size is 10240 kB, but I can easily change it to “unlimited”. However, if I change it the model runs but also develops some disturbances (apparently at the free surface) which grow and the model blows up. After this, if I deactivate the NPZD option, the model runs but it’s still unstable. Apparently, the model can be stable again only if I decrease the stack size. Does anybody know what’s going on?
By the way, memory shouldn’t be a problem, since I recently ran a significantly bigger model (including the NPZD_POWELL model) with no problem and no need to modify the stack size.
I’d appreciate any comment about this issue.
Best regards,

drivas

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

Re: NPZD model makes hydrodynamic model unstable?

#2 Post by kate » Fri Jun 12, 2015 11:20 am

Have you tried compiling with array bounds checking? It might be useful here.

drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

Re: NPZD model makes hydrodynamic model unstable?

#3 Post by drivas » Mon Jun 15, 2015 6:42 pm

Thank very much for your kind reply, Kate.
I'm trying to run the Debug option (with no NPZD model yet) but I get the following error message:

At the line 1114 of file read_phypar.f90
Fortran runtime error: Array reference out of bounds for array 'hout', lower bound of dimension 1 exceeded (0<1)

Any thought?

drivas

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

Re: NPZD model makes hydrodynamic model unstable?

#4 Post by kate » Tue Jun 16, 2015 3:22 pm

At the line 1114 of file read_phypar.f90
It's time to read the source. Look at that file within the $SCRATCHDIR directory to find out which of the Hout values is being trouble.

drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

Re: NPZD model makes hydrodynamic model unstable?

#5 Post by drivas » Wed Jun 17, 2015 11:11 pm

Well, the model finally works. Apparently I had two problems: first, I was using a old version of the *.in file (not sure what the problem was); and second, there was some problem with a recent modification of the step3d_t to prevent negative values in the NPZD outputs. I just deactivated this modification and now the model works. I still need to prevent the negative values, I haven't been able to prevent them in any of my simulations.
Thanks for you help, Kate!

drivas

arnaudlaurent
Posts: 4
Joined: Thu Jun 19, 2008 3:24 am
Location: Oceanography Department, Dalhousie University

Re: NPZD model makes hydrodynamic model unstable?

#6 Post by arnaudlaurent » Thu Jun 18, 2015 1:21 pm

Hi Drivas,

Have you tried the MPDATA advection scheme? It helps to prevent negative data in the biological variables, see this post

Cheers,

Arnaud

drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

Re: NPZD model makes hydrodynamic model unstable?

#7 Post by drivas » Thu Jun 18, 2015 4:32 pm

Yeah, I think that can be used when running the model with MPI, I use OpenMP. Is that correct?
Thanks,
DAVID

arnaudlaurent
Posts: 4
Joined: Thu Jun 19, 2008 3:24 am
Location: Oceanography Department, Dalhousie University

Re: NPZD model makes hydrodynamic model unstable?

#8 Post by arnaudlaurent » Thu Jun 18, 2015 6:37 pm

I did use MPDATA with OpenMP a few years back and it worked well. Give it a try to see if it solves your problem with negative values.

drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

Re: NPZD model makes hydrodynamic model unstable?

#9 Post by drivas » Thu Jun 18, 2015 7:16 pm

Thanks a lot for your suggestion. I tried to use it but I get an error message saying that the TS_MPDATA can't be used width Open MP. When you used it, what did you modify?

drivas

arnaudlaurent
Posts: 4
Joined: Thu Jun 19, 2008 3:24 am
Location: Oceanography Department, Dalhousie University

Re: NPZD model makes hydrodynamic model unstable?

#10 Post by arnaudlaurent » Thu Jun 18, 2015 7:32 pm

Ah true, sorry I forgot that OpenMP and MPDATA are not compatible anymore. I used it several years ago with an older version of ROMS.

drivas
Posts: 28
Joined: Tue Aug 28, 2007 8:31 pm
Location: CICESE

Re: NPZD model makes hydrodynamic model unstable?

#11 Post by drivas » Thu Jun 18, 2015 7:37 pm

Ok, thanks anyway. I'll look for another option. I recently tried the different option for the advection but I got numerous negative values always. Zooplankton is the component that is especially problematic.

Post Reply