[mpas-developers] Trunk Commit Check: Bug in core_ocean/module_mpas_core.F

Doug Jacobsen dwj07 at fsu.edu
Sun Jan 9 07:29:16 MST 2011


Hi Everyone,

This commit fixes two, or three bugs. But really two of them are so similar
that I just call it two bugs.

First, I added a second if around the one that checks if the current time
step is one to output on, so it only tries to output if
config_output_interval is > 0. Also, I split up the if statement around
config_restart_interval so it only does the mod if config_restart_interval >
0 as well. I guess not all compilers or implementations allow if statements
to short circuit with the first statement, so it's better to separate them
like this. These two modifications simply allow the user to specify
config_restart_interval = 0 and config_output_interval = 0 and have restart
or output files not written during the simulation. I also did this for
config_stats_interval.

Second, I fixed a bug that appeared when running isopycnal levels with a
restart file. Basically, what was happening was the restart file was read in
to time_levs(1). Then since we have isopycnal levels, rho is never updated,
and since it's not read into time_levs(:) time_levs(2:nTimeLevs) is set to
zero. Then in the computation of the Montgomery potential there is a 1/rho
that causes a NaN on the second time step, when time_levs(2) is shifted to
time_levs(1), so all of the current time_levs rhos are zero.

To fix this, I extended the if statement in mpas_init_block around
config_do_restart. Currently this isn't an issue if you are not using a
restart file because module_test_cases.F copies the current time level to
all time levels, so they are all initially the same. So this is now what
happens when you do a restart. The restart file is now read into
time_levs(1), and then copied to time_levs(2:nTimeLevs).

The lines of modification are:
89 - 96
134 - 145
223 - 237

Let me know if there are any questions or comments. I'll probably commit
this on Wednesday if no one has any objections. Thanks

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20110109/54c65491/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module_mpas_core.F
Type: text/x-fortran
Size: 13690 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20110109/54c65491/attachment.bin 


More information about the mpas-developers mailing list